r/C_Programming • u/Motor_Bluebird1908 • Sep 02 '26
Protecting source code from reverse engineering
Hi everyone,
I am looking to provide a compiled version of our physics solver to our customers. I understand there are many obfuscation techniques to protect source code but I am wondering if there are some smarter ways?
We already cloud computing, the issue is we have customers that are in locations without internet/need realtime solving.
0
Upvotes
View all comments
1
u/limitless_grow Sep 17 '26
In the end you can't only make it more expensive to understand what the binary does.
Once you are stripping the debug information than most of the code is gone, but the binary still does, what the code says and still contains all constants and all of that can be figured out. However you can make right that a little bit harder.
You could replace all string functions und common standard library functions using your own wrappers, prepend allocated memory with additional junk, remove 3rd party libraries because the interfaces may tell what your code does, remove logging and error messages from release versions, call invalid functions if there are huge time delays during the initialization because your program is debugged aso.
A total protection is impossible because your program has always to do what it should do but you can make the reverse engineering several times harder and much more expensive than rewriting your software. That way it becomes unattractive for others. However, if the calculations of the program itself are a total secret than you should execute those remote in a protected system that nobody else but you has physical access to.