Open w296488320 opened 2 years ago
Second argument of execve is char **
, (pointer/array terminated with NULL to pointers to strings (\0
terminated array of char
s)
Your *harg
contains now address (in tracee memory) of argv[0]
, if you use that address on read_path()
you'll copy that string into proot.
Currently you're doing printf %s
on bytes of (tracee) pointer
I found a very interesting question. Here is the code that I executed
char buffer[PATH_MAX];
FILE* fp2 = popen("cat /sys/devices/soc0/serial_number", "r");
if(fgets(buffer, sizeof(buffer), fp2) != nullptr){
LOGI(">>>>>>>>>> popen serial_number: %s",buffer);
} else{
LOGI(">>>>>>>>>> popen serial_number file == null ");
}
pclose(fp2);
The popen () will fork () comes out a process to execute the execve() I tried to print the parameters of syscall execve and found that 32 bits appear bug.But the 64 bits won't be there. The error reason is the Bad system call.I guess it should be the 32-bit program that executed the 64-bit syscall num.Causing of this problem.Is there any good way to avoid it?
I want to try to print the parameters of the syscall execve for 2 。 The prototype of this function is the
I seem to have a little problem now, the print is always messy Do you have any good advice?