Skip to content

Instantly share code, notes, and snippets.

@paullaffitte
Last active March 19, 2018 20:32
Show Gist options
  • Save paullaffitte/175e5ddee660c0e488d544a45eb19693 to your computer and use it in GitHub Desktop.
Save paullaffitte/175e5ddee660c0e488d544a45eb19693 to your computer and use it in GitHub Desktop.
bits 64
section .text
global rindex:function
extern strlen
extern _GLOBAL_OFFSET_TABLE_
%macro get_GOT 0
call %%getgot
%%getgot:
pop rbx
add rbx, _GLOBAL_OFFSET_TABLE_ + $$ - %%getgot wrt ..gotpc
%endmacro
rindex:
get_GOT
mov r8, strlen wrt ..gotoff
add r8, rbx
call r8
leave
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment