While reversing an executable with olly, theres compiler code and user code. So how do i recognise the compiler codes ? Lets say if the executable is visual basic, it has a jmp and a call in the first 2 instructions and the winmain comes later.
Asked
Active
Viewed 239 times
1 Answers
1
You just need to identify the main function. Everything called from main is user code. If you want to check if a function is part of user code, recursively check the xref starting from that function and see if it ends up in main. As for how to identify main, it depends on the OS that the executable is compiled for and possibly the specific compiler too. But for ELF files compiled by gcc for Linux, main is the last value pushed before calling __libc_start_main in start.

yellowbyte
- 186
- 6
main
(even if only a lowlyprintf ("Please supply an argument to this command\n");
), but there may also be template calls insidemain
to initialize global data, call system maintenance routines, or prologues and epilogues, etc. – Jongware Jan 15 '17 at 13:41