Created
May 2, 2018 03:24
-
-
Save adrianparvino/85bdaafbae1ea13565087cedac53593c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* Written 2011 Nicholas J. Kain, released as Public Domain */ | |
.weak _init | |
.weak _fini | |
.text | |
.global _start | |
_start: | |
xor %rbp,%rbp /* rbp:undefined -> mark as zero 0 (ABI) */ | |
mov %rdx,%r9 /* 6th arg: ptr to register with atexit() */ | |
pop %rsi /* 2nd arg: argc */ | |
mov %rsp,%rdx /* 3rd arg: argv */ | |
andq $-16,%rsp /* align stack pointer */ | |
mov $_fini,%r8 /* 5th arg: fini/dtors function */ | |
mov $_init,%rcx /* 4th arg: init/ctors function */ | |
mov $main,%rdi /* 1st arg: application entry ip */ | |
call __libc_start_main /* hlibc init will run the program */ | |
1: jmp 1b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment