Last active
March 19, 2018 20:32
-
-
Save paullaffitte/175e5ddee660c0e488d544a45eb19693 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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