On 25/10/2019 15:31, Frederick Gotham wrote:
> On Friday, October 25, 2019 at 12:21:25 PM UTC+1, Ian Collins wrote:
>
>> So don't do that. There's seldom a need to commit generated files
>> to SCM.
>
>
> I am deliberately obfuscating my code. I'm working on a security
> product, and so after I produce my binary executables and libraries,
> I run them through a decompiler and try to see how difficult it would
> be to reverse-engineer.
>
My initial thoughts are that obfuscating your code is a bad idea, a
misunderstanding of what is important for security, and even if it was a
good idea, then it does not sound like a good way to achieve this. My
initial thoughts may be wrong, as I don't know anything more than the
short paragraph above, but "security by obscurity" is rarely a good idea.
> My program would be too easy to reverse-engineer if I linked the
> library dynamically, so I'm linking it statically and obfuscating it
> as best I can.
>
My recommendation would be to avoid the library altogether - certainly
do not consider it a separate item to be produced and checked into an
SCM (the clue is in the name - "Source Control Manager").
Rather, you should consider using link-time optimisation. With
link-time optimisation, high compiler optimisation levels, no debugging
information, careful control of elf symbol visibility, and stripped
executables, your generated code will be incomprehensible. I doubt if
any other kind of obfuscation would make a measurable difference - and
yet you still have clear and maintainable source code. (You might also
want to disable RTTI.)