Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main 400B20
- # GCC dictates how the stack is used. Contract between caller and callee on x86:
- # * after call instruction:
- # o %eip points at first instruction of function
- # o %esp+4 points at first argument
- # o %esp points at return address
- # * after ret instruction:
- # o %eip contains return address
- # o %esp points at arguments pushed by caller
- # o called function may have trashed arguments
- # o %eax contains return value (or trash if function is void)
- # o %ecx, %edx may be trashed
- # o %ebp, %ebx, %esi, %edi must contain contents from time of call
- # * Terminology:
- # o %eax, %ecx, %edx are "caller save" registers
- # o %ebp, %ebx, %esi, %edi are "callee save" registers
- push rbx
- # edi/rdi is the number of argument(s)
- # esi/rsi is the value of the argment(s) as a string in memory
- # Check if number of argument equals 1
- cmp edi, 1
- # If no arg, the jump to function that display (usage %password)
- jle short loc_400B45
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement