You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pwndbg/tests/binaries/host/use-fds.native.c

18 lines
281 B
C

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char* argv[]) {
char buf[16] = {0};
// read 0 bytes so it won't block
read(STDOUT_FILENO, buf, 0);
int fd = open(argv[0], 0);
read(fd, buf, sizeof(buf));
close(fd);
}