Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Midgen - main.s

main.s

Caricato da: ZioCrocifisso
Scarica il programma completo

  1. global _start
  2. global written
  3. global fildes
  4.  
  5. extern headstrp
  6. extern parse
  7.  
  8. section .data
  9.         emptystring dd 0
  10.         fildes dd 1
  11.  
  12. section .text
  13. _start:
  14.         pop ecx
  15.         cmp ecx, 2
  16.         jl .emptyhead
  17.  
  18.         add esp, 4
  19.         pop eax
  20.         mov [headstrp], eax
  21.  
  22.         cmp ecx, 3
  23.         jl .noprint
  24.  
  25.         mov eax, 0x05
  26.         pop ebx
  27.         mov ecx, 1101Q
  28.         mov edx, 644Q
  29.         int 0x80
  30.  
  31.         cmp eax, 0
  32.         jl .noprint
  33.         mov [fildes], eax
  34.         jmp .noprint
  35.  
  36.         .emptyhead:
  37.         mov dword [headstrp], emptystring
  38.         jmp .noprint
  39.  
  40.         .noprint:
  41.         jmp parse
  42.                
  43.         written:
  44.         mov eax, 0x01
  45.         mov ebx, 0x00
  46.         int 0x80
  47.         ret