-5
What is the most efficient way to make literals of string do not appear in compiled code? I want to prevent reverse engineering. To do this, I tried the following code. However, I am concerned about the performance:
#include <stdio.h>
static const volatile char a = 'a', s = ' ';
int main(int argc, char *argv[]) {
puts((const char[]){a-32, a+17, a+1, a+8, a+19, a+17, a, a+17, a+24, s, a+18, a+19, a+17, a+8, a+13, a+6, s, a+19, a+7, a, a+19, s, a+18, a+7, a+14, a+20, a+11, a+3, s, a+13, a+14, a+19, s, a+18, a+7, a+14, a+22, s, a+8, a+13, s, a+2, a+14, a+12, a+15, a+8, a+11, a+4, a+3, s, a+2, a+14, a+3, a+4, 0});
return 0;
}
This should print a sequence, and this sequence is never found in the compiled executable. Is there another way to prevent reverse engineering by these means? I’m expecting some kind of code.
I have often commented this here on the site (I’ll see if I find the reference), but the basic rule is: practically always the concern with reverse engineering is inversely proportional to the quality of the product questioned, so it is "protected by nature itself". It pays to save energy for the development of the product itself. When this becomes a real problem, the very technological maturity of the person will have already filtered the essential problems, there you can look for some more specific technologies that would not even fit on the site. The essential thing is what has already been answered here.
– Bacco
You could "specialize" the question according to the selected concern. For example, "how do I protect the DB password in the executable?" - It does not protect, the error is by in the executable. Usually nothing justifies it. " How do I change my credits in the software?" - ai do not need to hide the string, just check if there has been a change in the code (can still be cracked, but already complicates). The question of how it is and what we call XY problem
– Bacco
Depending on the nature and use of this string, you could perhaps search for it on a server of your property, using login and password entered by the user. Because hardcodar the credentials would give in the same problem. If this is not a viable solution, maybe a string that represents such importance in its executable is not the ideal solution.
– nmindz