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
| int __fastcall main(int argc, const char **argv, const char **envp) { __int64 v4; __WAIT_STATUS stat_loc; int i; int j; unsigned int pid; int v9; __int64 __rsi; unsigned __int64 v12; __int64 v13; __int64 v14; __int64 v15; __int64 v16; __int64 v17; __int64 v18; __int64 v19; char v20[32]; __int64 _rbp; unsigned __int64 _rax; __int64 _rsi; __int64 _rdi; __int64 v25[8];
v25[7] = __readfsqword(0x28u); pid = fork(); if ( !pid ) { ptrace(PTRACE_TRACEME, 0LL, 0LL, 0LL); execl("puppet", "puppet", 0LL); } wait((__WAIT_STATUS)&stat_loc); if ( ((__int64)stat_loc.__uptr & 0x7F) == 0 ) return 0; ptrace(PTRACE_SYSCALL, pid, 0LL, 0LL); HIDWORD(stat_loc.__iptr) = 0; __rsi = 0LL; while ( 1 ) { wait((__WAIT_STATUS)&stat_loc); if ( ((__int64)stat_loc.__uptr & 0x7F) == 0 ) break; if ( !ptrace(PTRACE_PEEKUSER, pid, 0x78LL, 0LL) ) { ptrace(PTRACE_GETREGS, pid, 0LL, v20); if ( HIDWORD(stat_loc.__iptr) ) { if ( __rsi && _rax ) { v12 = 8 * ((_rax >> 3) + 1); for ( i = 0; (__int64)(v12 + 6) >= i; i += 8 ) { v4 = ptrace(PTRACE_PEEKDATA, pid, __rsi + i, 0LL); v25[0] = v4; v13 = (unsigned __int8)v4; LOBYTE(v25[0]) = BYTE5(v4); BYTE5(v25[0]) = v4; v14 = BYTE1(v4); BYTE1(v25[0]) = HIBYTE(v4); HIBYTE(v25[0]) = BYTE1(v4); v15 = BYTE2(v4); BYTE2(v25[0]) = BYTE6(v4); BYTE6(v25[0]) = BYTE2(v4); for ( j = 0; i + j < _rax && j <= 7; ++j ) *((_BYTE *)v25 + j) -= j + i; v16 = BYTE3(v25[0]); BYTE3(v25[0]) = BYTE4(v25[0]); BYTE4(v25[0]) = v16; ptrace(PTRACE_POKEDATA, pid, i + __rsi, v25[0]); } __rsi = 0LL; break; } HIDWORD(stat_loc.__iptr) = 0; } else { HIDWORD(stat_loc.__iptr) = 1; if ( !_rdi ) __rsi = _rsi; } } ptrace(PTRACE_SYSCALL, pid, 0LL, 0LL); } ptrace(PTRACE_SINGLESTEP, pid, 0LL, 0LL); v9 = 0; v25[0] = 0xA39C3E6994313F40LL; v25[1] = 0x17872470565B9B60LL; v25[2] = 0x11A918AABA97CA68LL; v25[3] = 0xB8F1B0AB9B3DD3B0LL; v25[4] = 0x488749FB6A1835E4LL; v25[5] = 0x82926F78FE98158LL; while ( 1 ) { wait((__WAIT_STATUS)&stat_loc); if ( ((__int64)stat_loc.__uptr & 0x7F) == 0 ) break; v17 = ptrace(PTRACE_PEEKUSER, pid, 0x80LL, 0LL); v18 = ptrace(PTRACE_PEEKDATA, pid, v17, 0LL); if ( (v17 & 0xFFF) == 0x292 && (v18 & 0xFFFFFFFFFFLL) == 0xA4458BC289LL ) { ptrace(PTRACE_GETREGS, pid, 0LL, v20); v19 = (unsigned int)ptrace(PTRACE_PEEKDATA, pid, _rbp - 0x5C, 0LL); _rax = (unsigned int)_rax + (unsigned __int64)*((unsigned __int8 *)v25 + v19); ptrace(PTRACE_SETREGS, pid, 0LL, v20); v9 = 1; } ptrace(PTRACE_SINGLESTEP, pid, 0LL, 0LL); } do { ptrace(PTRACE_CONT, pid, 0LL, 0LL); wait((__WAIT_STATUS)&stat_loc); } while ( ((__int64)stat_loc.__uptr & 0x7F) != 0 ); return 0; }
|