print function in pwn read gets scanf

read

ssize_t read(int fildes, void *buf, size_t nbyte);

不一定读满nbyte,读到换行符n就停止(n会被读入)。

rop到read的时候可以忽略第三个参数。

gets

char * gets(char *str);

读到换行符n为止,可以读入x00

scanf

int scanf(const char *format, ...);

读到换行符n为止,可以读入x00,注意格式参数。

scanf("%256s",buffer) 会在最后加'x00',有可能造成one-byte-off