Skip to content

Instantly share code, notes, and snippets.

@SafeEval
Last active August 29, 2015 14:28
Show Gist options
  • Save SafeEval/96149a59ff6e0499c80f to your computer and use it in GitHub Desktop.
Save SafeEval/96149a59ff6e0499c80f to your computer and use it in GitHub Desktop.
Call exit() syscall with return code 42.
; exit_x86-linux-intel.s
[SECTION .text]
global _start
_start:
xor eax,eax ; zero out eax, no null
xor ebx,ebx ; zero out ebx, no null
mov bl,42 ; return code is 42
mov al,1 ; exit is syscall 1
int 0x80 ; syscall interrupt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment