Newbie Spellweaver
- Joined
- Feb 4, 2023
- Messages
- 47
- Reaction score
- 99
IGC Client DecryptFile Func from IGC.dll
IGC.dll Version:18.1.3.17
==============Good luck for u=============
If you like it, please like it. :d
I m sorry to that,this code not decrypt file,my mistake,sorry,it should be ComputerCrc,src as follow:
IGC.dll Version:18.1.3.17
C++:
void DecryptIGCClientBuffer(unsigned char* m_byBuffer, int iSize)
{
int v2; // eax
int i; // esi
int v5; // ecx
int v6; // eax
int v7; // edx
int v8; // ecx
int v9; // edx
int v10; // ecx
int v11; // edx
int v12; // ecx
int v13; // edx
v2 = 0;
for (i = iSize - 1; i >= 0; --i)
{
v5 = *m_byBuffer++;
v6 = (v5 << 8) ^ v2;
v7 = (2 * v6) ^ 0x10213465;
if ((v6 & 0x8000) == 0)
v7 = 2 * v6;
v8 = (2 * v7) ^ 0x10213465;
if ((v7 & 0x8000) == 0)
v8 = 2 * v7;
v9 = (2 * v8) ^ 0x10213465;
if ((v8 & 0x8000) == 0)
v9 = 2 * v8;
v10 = (2 * v9) ^ 0x10213465;
if ((v9 & 0x8000) == 0)
v10 = 2 * v9;
v11 = (2 * v10) ^ 0x10213465;
if ((v10 & 0x8000) == 0)
v11 = 2 * v10;
v12 = (2 * v11) ^ 0x10213465;
if ((v11 & 0x8000) == 0)
v12 = 2 * v11;
v13 = (2 * v12) ^ 0x10213465;
if ((v12 & 0x8000) == 0)
v13 = 2 * v12;
v2 = (2 * v13) ^ 0x10213465;
if ((v13 & 0x8000) == 0)
v2 = 2 * v13;
}
}
C++:
void DecryptIGCClientFile(const char* fileName)
{
FILE* fp = fopen(fileName, "rb");
if (fp == nullptr) return;
fseek(fp, 0, SEEK_END);
int iSize = ftell(fp);
fseek(fp, 0, SEEK_SET);
unsigned char* decBuffer = new unsigned char[iSize];
fread(decBuffer, 1, iSize, fp);
DecryptIGCClientBuffer(decBuffer, iSize);
fclose(fp);
unsigned char tempBuffer[8192 + 1024] = {0};
memcpy(tempBuffer, decBuffer, iSize);
}
==============Good luck for u=============
If you like it, please like it. :d
I m sorry to that,this code not decrypt file,my mistake,sorry,it should be ComputerCrc,src as follow:
C++:
DWORD __fastcall CEncDec::ComputeCRC(BYTE* data, int size)
{
int crc, i;
crc = 0;
BYTE* ptr = data;
int count = size;
while(--count >= 0)
{
crc = crc ^ (int)*ptr++ << 8;
for(i = 0; i < 8; ++i)
if(crc & 0x8000)
crc = crc << 1 ^ 0x10213465;
else
crc = crc << 1;
}
return (crc & 0xFFFFFFFF);
}
DWORD __fastcall CEncDec::ComputeFileCRC(char* file)
{
FILE* hFile = fopen(file, "rb");
if(!hFile)
return 0;
fseek(hFile, 0, SEEK_END);
long size = ftell(hFile);
fseek(hFile, 0, SEEK_SET);
BYTE* buff = new BYTE[size];
fread(buff, 1, size, hFile);
DWORD crc = ComputeCRC(buff, size);
fclose(hFile);
delete [] buff;
return crc;
}
Last edited: