Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .data
  2.     text db "Hello, world!", 10, 0
  3.  
  4. section .text
  5.  
  6. global main
  7. main:
  8.     push ebp
  9.     mov ebp, esp
  10.     sub esp, 8
  11.  
  12.     mov dword[esp], text
  13.     mov dword[esp + 4], 0xe
  14.     call print_string
  15.  
  16.     xor eax, eax
  17.     leave
  18.     ret
  19.  
  20. print_string:
  21.     push ebp
  22.     mov ebp, esp
  23.  
  24.     mov eax, 0x4
  25.     mov ebx, 0x1
  26.     mov ecx, [ebp + 8]
  27.     mov edx, [ebp + 12]
  28.  
  29.     push .ret
  30.     push ecx
  31.     push edx
  32.  
  33.     push ebp
  34.     mov ebp, esp
  35.     sysenter
  36. .ret:
  37.  
  38.     leave
  39.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement