Advertisement
Madmouse

example of a cheap print function

Jan 30th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. _print_foo:
  2.     mov rdx, rsi    ; move size argument into rcx
  3.     mov rsi, rdi    ; move the the text pointer to rsi for printing
  4.     mov rax, 0x1    ; write stuff to stdout
  5.     mov rdi, rax
  6.     syscall
  7.     xor rax, rax    ; return 0
  8.     xor rdi, rdi
  9.     ret
  10.  
  11. ; void print_foo(const char* text, unsigned int size);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement