if I accidentally forget to switch to release configuration before releasing my program, does it matter in terms of it being easier to decompile or reverse engineer my code?
For example if I accidentally use the following debug compiler options:
1. Compiling:
- StackFrames = True
2. Debugging
- Debug information = Debug information
- Local Symbols = True
- Symbol Reference info = Reference Info
3. Linking
- Map File = Detailed
I have read help and from what I can tell it doesn't make much difference unless the map file is also somehow released with the binary file, so I wonder how much a difference it makes if someone has the map file?
Software applications comprise source code files that are compiled to convert them into binary executable code. If this binary executable code is converted back into source code files using a decompiler then this will be termed as reverse engineering of source code.
Debugging. Reverse engineering can either be performed statically or dynamically. Static reverse engineering involves looking at the assembly code of an application and attempting to understand its function without running it. Dynamic analysis, on the other hand, runs the application code and observes its results.
Conclusion: There are various Reverse Engineering tools, like debuggers, Valgrind, PEID, JAVAsnoop, Ollydbg and othes, that can help reverse engineer programs or applications.
It is done primarily to analyze and gain knowledge about the way something works but often is used to duplicate or enhance the object. Many things can be reverse-engineered, including software, physical machines, military technology and even biological functions related to how genes work.
Let's clarify one by one the options you've mentioned:
.map
file containing all the information (type, name, address, size, etc.) about program's symbols, so, of course it would be helpful for reverse engineering IF you distribute this file along with your exe (as stated by @RemyLebeau in the comments).There's also the option to generate remote debug symbols, as pointed by @dummzeuch:
.rsm
file, it's the Delphi equivalent of Microsoft's .pdb
Program Database Files. If you distribute this file, you could be on real trouble, because one could easily debug your application, visualize symbols, functions and procedures, single-step your code and so on.Also, I think it's important to say that .map
files are not equivalent to .pdb
files. For Delphi Win32, .rsm
is the equivalent. I have not worked with Delphi for years, but as far as I can remember, no Delphi Win32 version can generate .pdb
files. Only Delphi for .NET can.
That said, let's go back to your questions:
I wonder how much a difference it makes if someone has the map file?
Reverse engineering would be much easier having a .map
file. I've seen some tools in the past that can even convert a .map
file to a .dbg
file for use with a debugger.
Is it easier to reverse engineer or break a Delphi program if the exe file was compiled with debug compiler settings?
Well, one important (and maybe the most noticeable) characteristic of Debug builds is the bigger exe size. That's mainly because in the Debug configuration the compiler disables a number of code optimizations in order to facilitate code debugging. There's also a lot of debug-conditional code (eg.: inside {$IFDEF DEBUG}
directives) that gets linked into the exe.
As a side effect, the code generated by a Debug build is much easier to reverse engineer because it's simpler to understand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With