Al3XS0n

asm

Nov 10th, 2020
1,283
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     .intel_syntax noprefix
  2.     .text
  3.     .globl my_exit
  4.     .globl read
  5.     .globl write
  6.     .globl _start
  7. my_exit:
  8.     sub rsp, 8
  9.     mov esi, edi
  10.     xor eax, eax
  11.     mov edi, 60
  12.     call syscall
  13.     pop rax
  14.     ret
  15. read:
  16.     sub rsp, 8
  17.     mov ecx, edx
  18.     xor eax, eax
  19.     mov rdx, rsi
  20.     mov esi, edi
  21.     xor edi, edi
  22.     call syscall
  23.     pop rdx
  24.     ret
  25. write:
  26.     sub rsp, 8
  27.     mov ecx, edx
  28.     xor eax, eax
  29.     mov rdx, rsi
  30.     mov esi, edi
  31.     mov edi, 1
  32.     call syscall
  33.     pop rdx
  34.     ret
  35. _start:
  36.     push rbx
  37.     xor edi, edi
  38.     mov edx, 131071
  39.     sub rsp, 131088
  40.     lea rbx, 8[rsp]
  41.     mov rax, QWORD PTR fs:40
  42.     mov QWORD PTR 131080[rsp], rax
  43.     xor eax, eax
  44.     mov rsi, rbx
  45.     call read
  46.     mov rsi, rbx
  47.     mov edx, eax
  48.     mov edi, 1
  49.     call write
  50.     xor edi, edi
  51.     call my_exit
  52.     mov rax, QWORD PTR 131080[rsp]
  53.     xor rax, QWORD PTR fs:40
  54.     add rsp, 131088
  55.     pop rbx
  56.     ret
RAW Paste Data