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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
| int __cdecl main(int argc, const char **argv, const char **envp) { __int64 v3; int CMD; signed int reqSize; __int64 v6; unsigned __int64 v7; int c; int i; int index; int CMDB; int size; unsigned __int64 v14;
v14 = __readfsqword(0x28u); CMDB = 0; write_n("\n", 1LL); write_n( " ============================================================================\n" "// _|_|_|_|_| _|_|_| _| _| _| _| _|_|_| _|_| _|_|_| \\\\\n" "|| _| _| _|_| _| _| _| _| _| _| _| _| _| ||\n" "|| _| _| _| _| _| _| _|_|_| _|_|_|_| _| _| ||\n" "|| _| _| _| _|_| _| _| _| _| _| _| ||\n" "\\\\ _| _|_|_| _| _| _| _| _| _| _|_|_| //\n" " ============================================================================\n", 563LL); write_n("\n", 1LL); do { for ( i = 0; i <= 3; ++i ) { LOBYTE(c) = i + '1'; writeln("+------------------------------------------------------------------------------+\n", 81LL); write_n(" # INDEX: ", 12LL); writeln((char *)&c, 1LL); write_n(" # CONTENT: ", 12LL); if ( *(_QWORD *)&tinypad.field_0[16 * (i + 16LL) + 8] ) { v3 = strlen(*(const char **)&tinypad.field_0[16 * (i + 16LL) + 8]); writeln(*(char **)&tinypad.field_0[16 * (i + 16LL) + 8], v3); } writeln("\n", 1LL); } index = 0; CMD = getcmd(); CMDB = CMD; if ( CMD == 'D' ) { write_n("(INDEX)>>> ", 11LL); index = read_int(); if ( index > 0 && index <= 4 ) { if ( *(_QWORD *)&tinypad.field_0[16 * (index - 1 + 16LL)] ) { free(*(void **)&tinypad.field_0[16 * (index - 1 + 16LL) + 8]); *(_QWORD *)&tinypad.field_0[16 * (index - 1 + 16LL)] = 0LL; writeln("\nDeleted.", 9LL); } else { writeln("Not used", 8LL); } } else { writeln("Invalid index", 13LL); } } else if ( CMD > 'D' ) { if ( CMD != 'E' ) { if ( CMD == 'Q' ) continue; LABEL_43: writeln("No such a command", 17LL); continue; } write_n("(INDEX)>>> ", 11LL); index = read_int(); if ( index > 0 && index <= 4 ) { if ( *(_QWORD *)&tinypad.field_0[16 * (index - 1 + 16LL)] ) { c = '0'; strcpy(tinypad.field_0, *(const char **)&tinypad.field_0[16 * (index - 1 + 16LL) + 8]); while ( toupper((char *)(unsigned int)c) != 'Y' ) { write_n("CONTENT: ", 9LL); v6 = strlen(tinypad.field_0); writeln(tinypad.field_0, v6); write_n("(CONTENT)>>> ", 13LL); v7 = strlen(*(const char **)&tinypad.field_0[16 * (index - 1 + 16LL) + 8]); read_until(tinypad.field_0, v7, 0xAu); writeln("Is it OK?", 9LL); write_n("(Y/n)>>> ", 9LL); read_until((char *)&c, 1uLL, 0xAu); } strcpy(*(char **)&tinypad.field_0[16 * (index - 1 + 16LL) + 8], tinypad.field_0); writeln("\nEdited.", 8LL); } else { writeln("Not used", 8LL); } } else { writeln("Invalid index", 13LL); } } else { if ( CMD != 'A' ) goto LABEL_43; while ( index <= 3 && *(_QWORD *)&tinypad.field_0[16 * (index + 16LL)] ) ++index; if ( index == 4 ) { writeln("No space is left.", 17LL); } else { size = -1; write_n("(SIZE)>>> ", 10LL); size = read_int(); if ( size <= 0 ) { reqSize = 1; } else { reqSize = size; if ( (unsigned __int64)size > 0x100 ) reqSize = 256; } size = reqSize; *(_QWORD *)&tinypad.field_0[16 * (index + 16LL)] = reqSize; *(_QWORD *)&tinypad.field_0[16 * (index + 16LL) + 8] = malloc(size); if ( !*(_QWORD *)&tinypad.field_0[16 * (index + 16LL) + 8] ) { writerrln("[!] No memory is available.", 27LL); exit(-1); } write_n("(CONTENT)>>> ", 13LL); read_until(*(char **)&tinypad.field_0[16 * (index + 16LL) + 8], size, '\n'); writeln("\nAdded.", 7LL); } } } while ( CMDB != 'Q' ); return 0; }
|