fork download
  1. BITS 32
  2.  
  3. section .text
  4. global _start
  5.  
  6. _start:
  7. jmp short two
  8. one:
  9. ; mprotect (_start, 40, 0x02)
  10. mov eax, 226
  11. mov ebx, _start
  12. mov ecx, 40
  13. mov edx, 2
  14. int 0x80
  15.  
  16. pop ebx
  17. xor eax, eax
  18. mov [ebx + 7], al
  19. mov [ebx + 8], ebp
  20. mov [ebx + 12], eax
  21. lea ecx, [ebp + 8]
  22. lea edx, [ebp + 12]
  23. mov al, 11
  24. int 0x80
  25. ; exit(0)
  26. ;mov al, 1
  27. ;xor ebx, ebx
  28. ;int 0x80
  29. two:
  30. call one
  31. db '/bin/shXAAAABBBB'
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:31:6: warning: character constant too long for its type
   db '/bin/shXAAAABBBB'
      ^
prog.cpp:1:1: error: 'BITS' does not name a type
 BITS 32
 ^
prog.cpp:9:14: error: expected constructor, destructor, or type conversion before '(' token
   ; mprotect (_start, 40, 0x02)
              ^
prog.cpp:25:9: error: expected constructor, destructor, or type conversion before '(' token
   ; exit(0)
         ^
prog.cpp:26:4: error: 'mov' does not name a type
   ;mov al, 1
    ^
prog.cpp:27:4: error: expected unqualified-id before 'xor' token
   ;xor ebx, ebx
    ^
prog.cpp:28:8: error: expected unqualified-id before numeric constant
   ;int 0x80
        ^
stdout
Standard output is empty