(fix): bof.s

This commit is contained in:
bfu4 2022-03-31 11:15:19 -04:00
parent d8178c293c
commit 45cc265531
No known key found for this signature in database
GPG Key ID: FD1D952871D22043

10
bof.s

@ -71,18 +71,20 @@
call printf@plt #-----------------------------------------------#
# Since this function is not called in the #
#---------------------------------------------------------------# program, the goal is to jump to this #
jmp _exit # function (_get_rich_fast) via overflow. #
jmp _bye # function (_get_rich_fast) via overflow. #
#---------------------------------------------------------------#-----------------------------------------------#
_start: # #
push %rbp # push the frame pointer #
call _get_input # call our input retrieving function #
mov $0, %rax # clean up rax #
pop %rbp # cleanup, jump to our exit routine #
jmp _exit # #
jmp _bye # #
#---------------------------------------------------------------#-----------------------------------------------#
_exit: # exit(0) #
_bye: # exit(0) #
mov $60, %al #-----------------------------------------------#
xor %rdi, %rdi # sys_exit = 60 (dec) #
syscall # exit code = 0 #
syscall # exit code 0 #
retq # bye bye #
#---------------------------------------------------------------#-----------------------------------------------#
# #
#---------------------------------------------------------------------------------------------------------------#