I am new to reverse engineering, and I have been looking at a simple program:
char* a = "hello world";
printf(a);
However, when I open this in ollydbg, I am not taken right to the assembly as I would have been in gdb, there are many more instructions first. I was wondering why this was happening.
Thanks!
Depending how you attach to the program with olly, you’ll be take to one of two places(if no errors occurred):
main/WinMain/DllMain): this occurs when you start a program with olly.NtUserBreakPoint: this is when you attach to an existing process.To navigate to where you want you can use
ctrl + eto bring up the modules window, from there, select the module you want. Then usecrtl + nto bring up the symbols window for your current module (note: for non-exported symbols to be available, the pdb’s need to be available or you need to perform an object scan of your obj’s for that build).if your taken to the
ModuleEntryPointyou can also just spelunk down the call chain (generally you want the second call/jmp), this gets you to the crt entrypoint, from there just look for a call with 3/5/4 args, this will bemain/WinMain/DllMain:from here:
we goto here:
then scroll down here:
I’m assuming ollydbg 1.10 is being used.