🥋Form - ImaginaryCTF 2023
Analysis

Ý tưởng


Exploit:

Last updated




Last updated
int __cdecl __noreturn main(int argc, const char **argv, const char **envp)
{
char *format; // [rsp+0h] [rbp-20h] BYREF
char *s; // [rsp+8h] [rbp-18h]
FILE *stream; // [rsp+10h] [rbp-10h]
unsigned __int64 v6; // [rsp+18h] [rbp-8h]
v6 = __readfsqword(0x28u);
s = (char *)malloc(0x20uLL);
format = (char *)malloc(0x20uLL);
setbuf(stdin, 0LL);
setbuf(_bss_start, 0LL);
stream = fopen("flag.txt", "r");
fgets(s, 32, stream);
fgets(format, 32, stdin);
s = (char *)&format;
if ( strlen((const char *)&format) <= 0x17 )
printf(format);
_exit(0);
}