I know some C and a little bit of assembly and wanted to start learning about reverse engineering, so I downloaded the trial of Hopper Disassembler for Mac. I created a super basic C program:
int main() {
int a = 5;
return 0;
}
And compiled it with the -g flag (because I saw this before and wasn't sure if it mattered):
gcc -g simple.c
Then I opened the a.out
file in Hopper Disassembler and clicked on the Pseudo Code button and it gave me:
int _main() {
rax = 0x0;
var_4 = 0x0;
var_8 = 0x5;
rsp = rsp + 0x8;
rbp = stack[2047];
return 0x0;
}
The only line I sort of understand here is setting a variable to 0x5
. I'm unable to comprehend what all these additional lines are for (such as the rsp = rsp + 0x8;
), for such a simple program. Would anyone be willing to explain this to me?
Also if anyone knows of good sources/tutorials for an intro into reverse engineering that'd be very helpful as well. Thanks.