Given assembled machine code bytes, execute them, and wait for the process to die. Returns: The exit code of the process. Example: >>> insn_bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;') >>> run_shellcode_exitcode(insn_bytes) 3
(bytes)
| 91 | |
| 92 | @LocalContext |
| 93 | def run_shellcode_exitcode(bytes): |
| 94 | """ |
| 95 | Given assembled machine code bytes, execute them, and wait for |
| 96 | the process to die. |
| 97 | |
| 98 | Returns: |
| 99 | |
| 100 | The exit code of the process. |
| 101 | |
| 102 | Example: |
| 103 | |
| 104 | >>> insn_bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;') |
| 105 | >>> run_shellcode_exitcode(insn_bytes) |
| 106 | 3 |
| 107 | """ |
| 108 | p = run_shellcode(bytes) |
| 109 | p.wait_for_close() |
| 110 | return p.poll() |
nothing calls this directly
no test coverage detected