hello everyone. im quite new to this.. and to "embedded" in general.. so please help.
i got to do an integration between a costumer code and our algorithem code. im working on a ST board. i have included our librery to their project, and it works well. i need to send them the code. but , i can see that in the .lib file which i included (the only one they will get) you can see our code .. and for reverse engineering reasons...that sould not be there!
i know there must be a way to hide all the symbols and source code from the .lib file.
i tried using the options for target->linker-> misc control .. trying different flags.. but none seems to work, also tried reading about "scatter files" and "HIDE *" command from Keil's user manuel.
so how its done?
thank's
What can you see in the .lib file that concerns you?
Public symbols would have to be present, otherwise the linker won't be able to know what functions you've included. I can't imagine that your source code is in the .lib file. Reverse engineering of a .lib file like this will always reveal something to a determined reverse engineer and there's not much (if anything) you can do about it. If your code is so valuable, then maybe you should look at some other form of distribution.
Back when I last had cause to do this, I wrote an app to sanitize ELF objects and libraries, so the only thing in plain text was the function names the customer could bind too, and the library functions it imported. General rule of thumb is to understand the object formats at least as well as the people you expect to analyze them.
Unchecking "Debug Information" when creating the objects will kill some of the noise.
Would tend to agree with Kevin, heck I can read code out of a disassembler without any symbols, and debug code out of ROM directly. FromELF supplied with the tool chain does a reasonable job. Even if you strip a lot of user readable data from an object file there is still a lot of metadata that the linker uses.
thanks so much on the fast replies. after a day of searching about this subject, i had a feeling the this might not be as bad as my project maneger makes it. will try to convice him.
How does it work on other platforms? i believe that in IAR there is a "strip" flag, is it equivelent to unchecking "debug information" on the Keil output tab?