QWXFB-2024/正式赛/Pwn/newbie_fmt/newbie_fmt.c
2024-09-16 11:38:20 +08:00

23 lines
440 B
C

// gcc ./newbie_fmt.c -o ./pwn
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
void init() {
setvbuf(stdin, 0LL, 2, 0LL);
setvbuf(stdout, 0LL, 2, 0LL);
setvbuf(stderr, 0LL, 2, 0LL);
}
int main () {
char dummpy[0x200];
char buf[8];
int fd = open("flag", O_RDONLY);
init();
read(fd, dummpy+0x1a0, 0x30);
close(fd);
read(0, buf, 8);
printf(buf);
}