Investigative Reversing 0
Problem
Solution
void main(void) { FILE *flag_stream; FILE *image_steam; size_t sVar1; long in_FS_OFFSET; int i; int local_50; char local_38 [4]; char local_34; char local_33; char local_29; long local_10; local_10 = *(long *)(in_FS_OFFSET + 0x28); flag_stream = fopen("flag.txt","r"); image_steam = fopen("mystery.png","a"); if (flag_stream == (FILE *)0x0) { puts("No flag found, please make sure this is run on the server"); } if (image_steam == (FILE *)0x0) { puts("mystery.png is missing, please run this on the server"); } sVar1 = fread(local_38,0x1a,1,flag_stream); if ((int)sVar1 < 1) { /* WARNING: Subroutine does not return */ exit(0); } puts("at insert"); fputc((int)local_38[0],image_steam); fputc((int)local_38[1],image_steam); fputc((int)local_38[2],image_steam); fputc((int)local_38[3],image_steam); fputc((int)local_34,image_steam); fputc((int)local_33,image_steam); i = 6; while (i < 0xf) { fputc((int)(char)(local_38[i] + '\x05'),image_steam); i = i + 1; } fputc((int)(char)(local_29 + -3),image_steam); local_50 = 0x10; while (local_50 < 0x1a) { fputc((int)local_38[local_50],image_steam); local_50 = local_50 + 1; } fclose(image_steam); fclose(flag_stream); if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) { /* WARNING: Subroutine does not return */ __stack_chk_fail(); } return; }$ xxd -g 1 mystery.png | tail 0001e7f0: 82 20 08 82 20 08 82 20 08 82 20 64 1f 32 12 21 . .. .. .. d.2.! 0001e800: 08 82 20 08 82 20 08 82 20 08 42 f6 21 23 11 82 .. .. .. .B.!#.. 0001e810: 20 08 82 20 08 82 20 08 82 20 64 1f 32 12 21 08 .. .. .. d.2.!. 0001e820: 82 20 08 82 20 08 82 20 08 42 f6 21 23 11 82 20 . .. .. .B.!#.. 0001e830: 08 82 20 08 82 20 08 82 20 64 1f 32 12 21 08 82 .. .. .. d.2.!.. 0001e840: 20 08 82 20 08 82 20 08 42 f6 21 23 11 82 20 08 .. .. .B.!#.. . 0001e850: 82 20 08 82 20 08 82 20 64 17 ff ef ff fd 7f 5e . .. .. d......^ 0001e860: ed 5a 9d 38 d0 1f 56 00 00 00 00 49 45 4e 44 ae .Z.8..V....IEND. 0001e870: 42 60 82 70 69 63 6f 43 54 4b 80 6b 35 7a 73 69 B`.picoCTK.k5zsi 0001e880: 64 36 71 5f 35 32 36 36 61 38 35 37 7d d6q_5266a857}
Flag
Last updated