Search code examples
cembeddedstructure.a

Library file (.a) where the contents of the structure changes


I am creating an algorithm in C that is confidential and cannot be shared with external customers. So, I decided to go with creating a library (.a) file which compiles my algorithm and lets others use it without modifying it. It basically alters the data of a variable within a structure. Now, the structure as such is visible externally (The structure is defined in a separate header file which is included in my .c file) and is generated based on user's configuration. But the said variable is always present within the structure - only remaining data is changed based on user's configuration.

The problem is that if the structure is not exactly the one I used to create the library file, the code fails. So is there a way to create a library file to modify the data inside a structure, if the structure itself is not available in the beginning?

Any help is greatly appreciated...


Solution

  • If you are interested only in one data member of a structure,Then get the address of that variable in your confidential application and modify it's value.