|
|
|
|
|
by saagarjha
2309 days ago
|
|
Here's how you'd exec: execv("/path/to/binary", (char *[]){"binary", NULL});
And here's a way to do that without exec: (((int (*)(int, char **))dlsym(dlopen("/path/to/binary", RTLD_LAZY), "main")))(1, (char *[]){"binary", NULL});
A bit uglier, but not all that much harder. |
|
Doesn't that just end up calling open() and mmap()? Might not have access to the args passed through at that point, but that's going to leave a trail and of course anything interesting the mapped program does will end up going through syscalls(opening other "files").