Obviously, you are writing a 64-bit program and you are using the instruction "int 0x80". "int 0x80" works only in 32-bit programs.
The stack address is in a range that 32-bit programs cannot access. Therefore, it is likely that the "int 0x80" system calls do not allow access to this memory area.
To solve this problem, there are two possibilities:
- 32- ( 32- , EAX 64- , RAX). - 32- 64- Linux.
- "syscall" "int 0x80" . "int 0x80" -!
32- :
mov eax,4 ; In "int 0x80" style 4 means: write
mov ebx,1 ; ... and the first arg. is stored in ebx
mov ecx,esp ; ... and the second arg. is stored in ecx
mov edx,1 ; ... and the third arg. is stored in edx
int 0x80
64- :
mov rax,1 ; In "syscall" style 1 means: write
mov rdi,1 ; ... and the first arg. is stored in rdi (not rbx)
mov rsi,rsp ; ... and the second arg. is stored in rsi (not rcx)
mov rdx,1 ; ... and the third arg. is stored in rdx
syscall
--- ---
:
"int 0x80" 32- . 64- , 32- ( 32- ).
, "int 0x80" 32- , 32 64- .
( Ubuntu 16.10, 64 .)
, "int 0x80" 2 ^ 32 ( 2 ^ 31), 2 ^ 32 32- .
, , 2 ^ 31, "int 0x80" . 2 ^ 32, . (RSP), , 2 ^ 32, , "int 0x80" .
, 2 ^ 32, : "int 0x80 64- ".