I am having difficulties getting execve (syscall 11) working in Linux NASM, I don't clearly understand what ecx and edx should contain.
I am trying to call an assembly routine from another assembly routine and pass one value.
Here is the (last) code I've used:
.....
mov eax,11
mov ebx,j3
mov ecx,ctr11
mov edx,dumy
int 0x80
.....
j3 db "j3",0,0
ctr11 db "any value",0,0,0
dumy db 0,0,0,0,0,0,0,0
.....
and here is the result:
[rene@lt cgi-bin]$ strace ./j2
execve("./j2", ["./j2"], [/* 34 vars */]) = 0
write(1, "This is --- J2 --- \n", 20This is --- J2 ---
) = 20
execve("/var/www/cgi-bin/j3", [umovestr: Input/output error
0x20796e61, umovestr: Input/output error
0x756c6176, umovestr: Input/output error
0x65], [/* 0 vars */]) = -1 EFAULT (Bad address)
_exit(0) = ?
[rene@lt cgi-bin]$
Thank you for your help.