Advertisement
Guest User

Untitled

a guest
Feb 13th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <asm/unistd_32.h>
  2.     .data
  3.     .text
  4.     .global _start
  5. _start:
  6.     pushl   %esi
  7.     pushl   %edi
  8. loopa:
  9.     movl    $__NR_read, %eax
  10.     movl    $0, %ebx
  11.     addl    $4, %esp
  12.     movl    %esp, %ecx
  13.     movl    $1, %edx
  14.     int     $0x80
  15.  
  16.     cmpl    $0, %eax
  17.     jle     exit
  18.  
  19.     movl    (%esp), %esi
  20.     cmpl    $'0', %esi
  21.     jl  write
  22.    
  23.     movl    $'9', %edi
  24.     cmpl    %esi, %edi
  25.     jl  write
  26.    
  27.     movl    $'0', %edi
  28.     movl    %edi, (%esp)   
  29. write:
  30.     movl    $__NR_write, %eax
  31.     movl    $1, %ebx
  32.     movl    (%esp), %ecx
  33.     subl    $4, %esp
  34.     movl    $1, %edx
  35.     int     $0x80
  36.    
  37.     jmp loopa
  38. exit:
  39.     popl    %edi
  40.     popl    %esi
  41.     movl    $__NR_exit, %eax
  42.     movl    $0, %ebx
  43.     int     $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement