[Pwnable.kr] BrainFuck
第二部分的第一题,150分(比第一部分总和还高……),F5整理一下代码还是很容易看懂的:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
int __cdecl main(int argc, const char **argv, const char **envp) { int result; // eax@4 int v4; // edx@4 size_t i; // [esp+28h] [ebp-40Ch]@1 int v6; // [esp+2Ch] [ebp-408h]@1 int v7; // [esp+42Ch] [ebp-8h]@1 v7 = *MK_FP(__GS__, 20); setvbuf(stdout, 0, 2, 0); setvbuf(stdin, 0, 1, 0); p = (int)&tape; puts("welcome to brainfuck testing system!!"); puts("type some brainfuck instructions except [ ]"); memset(&v6, 0, 0x400u); fgets((char *)&v6, 1024, stdin); for ( i = 0; i < strlen((const char *)&v6); ++i ) do_brainfuck(*((_BYTE *)&v6 + i)); result = 0; v4 = *MK_FP(__GS__, 20) ^ v7; return result; } int __cdecl do_brainfuck(char a1) { int result; // eax@1 _BYTE *v2; // ebx@7 |