void FillMiscDatas(Skype_Inst *pInst, unsigned int *Datas) { BYTE Buffer[0x400]; DWORD BufSz = 0x400; int ret; int64_t PlatForm; PlatForm = PlatFormSpecific(); Datas[0] = *(unsigned int *)&PlatForm; Datas[1] = *(unsigned int *)&pInst->NodeID; if (!QueryRegValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ProductId", (LPBYTE)Buffer, &BufSz)) return; Datas[2] = BytesSHA1(Buffer, BufSz); BufSz = 0x400; if (!QueryRegValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\MultifunctionAdapter\\*\\DiskController\\*\\DiskPeripheral\\*\\Identifier", (LPBYTE)Buffer, &BufSz)) return; Datas[3] = BytesSHA1(Buffer, BufSz); ret = GetVolumeInformationA("C:\\", 0, 0, (LPDWORD)Buffer, 0, 0, 0, 0); Datas[4] = BytesSHA1(Buffer, 0x04); }
void FillMiscDatas(unsigned int *Datas) { BYTE Buffer[0x400]; HKEY rKey; DWORD BufSz = 0x400; int ret; double PlatForm; PlatForm = PlatFormSpecific(); Datas[0] = *(unsigned int *)&PlatForm; Datas[1] = *(unsigned int *)GetNodeId(); ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", 0, KEY_QUERY_VALUE, &rKey); if (ret) return ; ret = RegQueryValueExA(rKey, "ProductId", NULL, NULL, (LPBYTE)Buffer, &BufSz); if (ret) return ; RegCloseKey(rKey); Datas[2] = BytesSHA1(Buffer, BufSz); ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\MultifunctionAdapter\\8\\DiskController\\0\\DiskPeripheral\\0", 0, KEY_QUERY_VALUE, &rKey); if (ret) return ; ret = RegQueryValueExA(rKey, "Identifier", NULL, NULL, (LPBYTE)Buffer, &BufSz); if (ret) return ; RegCloseKey(rKey); Datas[3] = BytesSHA1(Buffer, BufSz); ret = GetVolumeInformationA("C:\\", 0, 0, (LPDWORD)Buffer, 0, 0, 0, 0); Datas[4] = BytesSHA1(Buffer, 0x04); }
unsigned int BytesRandom() { BYTE Buffer[0x464]; SHA_CTX Context; int idx; idx = 0; memcpy(Buffer, RandomSeed, SHA_DIGEST_LENGTH); idx += sizeof(RandomSeed); GlobalMemoryStatus((LPMEMORYSTATUS)&Buffer[idx]); idx += sizeof(MEMORYSTATUS); UuidCreate((UUID *)&Buffer[idx]); idx += sizeof(UUID); GetCursorPos((LPPOINT)&Buffer[idx]); idx += sizeof(POINT); *(DWORD *)(Buffer + idx) = GetTickCount(); *(DWORD *)(Buffer + idx + 4) = GetMessageTime(); *(DWORD *)(Buffer + idx + 8) = GetCurrentThreadId(); *(DWORD *)(Buffer + idx + 12) = GetCurrentProcessId(); idx += 16; QueryPerformanceCounter((LARGE_INTEGER *)&Buffer[idx]); SHA1_Init(&Context); SHA1_Update(&Context, Buffer, 0x464); SHA1_Update(&Context, "additional salt...", 0x13); SHA1_Final(RandomSeed, &Context); return BytesSHA1(Buffer, 0x464); }
unsigned int BytesRandom() { uchar Buffer[0x464]; FillRndBuffer(Buffer); return BytesSHA1(Buffer, 0x464); }