(fix): bof.s
This commit is contained in:
parent
d8178c293c
commit
45cc265531
10
bof.s
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 #
|
||||
#---------------------------------------------------------------#-----------------------------------------------#
|
||||
# #
|
||||
#---------------------------------------------------------------------------------------------------------------#
|
||||
|
Loading…
Reference in New Issue
Block a user