#include #include #include #include "defs.h" _BYTE *__fastcall sub_1569F0(_BYTE *result, int a2, int a3, unsigned int a4, unsigned int a5) { int v6; // ST08_4 int v7; // ST0C_4 LOWORD(v6) = (unsigned int) ~a2 >> 16; HIWORD(v6) = ~(_WORD) a3; LOWORD(v7) = (unsigned int) ~a3 >> 16; HIWORD(v7) = ~(_WORD) a2; result[3] = (unsigned __int16) (v6 ^ a4) >> 8; *result = a2 ^ a4; result[2] = BYTE1(a2) ^ BYTE1(a4); result[1] = v6 ^ a4; result[4] = (a2 ^ a4) >> 16; result[6] = (a2 ^ a4) >> 24; result[5] = (v6 ^ a4) >> 16; result[7] = (v6 ^ a4) >> 24; result[8] = a3 ^ a5; result[10] = BYTE1(a3) ^ BYTE1(a5); result[9] = a5 ^ v7; result[11] = BYTE1(a5) ^ ((unsigned int) ~a3 >> 24); result[12] = (a3 ^ a5) >> 16; result[14] = (a3 ^ a5) >> 24; result[13] = (a5 ^ v7) >> 16; result[15] = (a5 ^ v7) >> 24; return result; } int main() { int v3; // r4 unsigned int *v4; // r8 char *v5; // r5 int v9; // [sp+10h] [bp-40h] unsigned int v11[2] = {0, 0}; //passwd char *s = "72cfd12fd8c5b472"; v3 = 0; v4 = (unsigned int *) &v11; do { v5 = s; if (strlen(s) <= v3) break; v9 = 0; v9 = (unsigned __int8) v5[2 * v3]; *(_WORD *) ((char *) &v9 + 1) = (unsigned __int8) v5[2 * v3++ + 1]; *(_BYTE *) v4 = strtoul((const char *) &v9, NULL, 16); v4 = (unsigned int *) ((char *) v4 + 1); } while (v3 != 8); // *s = "1000000011388b0e"; // cpu serial : d58d27d3 char *sn = "d58d27d3"; _BYTE *result = malloc(16); sub_1569F0(result, *((_DWORD*)sn), *(((_DWORD*)sn)+1), v11[0], v11[1]); for (int i = 0; i < 16; ++i) { printf("%02x", result[i]); } printf("\n"); for (int i = 0; i < 2; ++i) { printf("%02x", v11[i]); } printf("\n"); return 0; }