Код: Выделить всё
Breakpoint 2, 0x0000000000401069 in exit ()
(gdb) si
0x000000000040106b in exit ()
(gdb) si
0x000000000040106e in exit ()
(gdb) x/i $pc
=> 0x40106e : syscall
(gdb) si
0x0000000000401070 in ?? ()
(gdb) x/i $pc
=> 0x401070: add %al,(%rax)
(gdb) disass/r exit
Dump of assembler code for function exit:
0x0000000000401069 : b0 3c mov $0x3c,%al
0x000000000040106b : 40 b7 00 mov $0x0,%dil
0x000000000040106e : 0f 05 syscall
End of assembler dump.
Код: Выделить всё
%include "fileio.s"
global _start
section .text
_start:
openat -100, file, U_EXEC+UGO_RW, STDIN
mov rdi, rax
mov al, 0x8
mov rsi, 00
mov rdx, 0x2
syscall
fchmod rdi, UGO_RW
write rdi, message, len
syncfs rdi
close rdi
exit:
mov al, 0x3c
mov dil, 0x0
syscall
section .data
file:
db "Payload.txt", 0
message:
db "Ahoy Matey", 0xa
len equ $-message
Подробнее здесь: https://stackoverflow.com/questions/791 ... tion-fault