|
楼主 |
发表于 2024-4-17 17:09:35
|
显示全部楼层
int __cdecl Decrypt(std::string sCipherText, std::string *sPlainText, rc4_key_struct decryptKey)
{
unsigned int Myres; // ebp
std::string::_Bxty *Ptr; // eax
int v5; // eax
int v6; // esi
_BYTE v8[1028]; // [esp-414h] [ebp-634h] BYREF
char *v9; // [esp-10h] [ebp-230h]
int v10; // [esp-Ch] [ebp-22Ch]
char *v11; // [esp-8h] [ebp-228h]
unsigned int *p_length; // [esp-4h] [ebp-224h]
unsigned int length; // [esp+Ch] [ebp-214h] BYREF
char sDecrypted[255]; // [esp+10h] [ebp-210h] BYREF
char sDeBase64ed[255]; // [esp+110h] [ebp-110h] BYREF
int v16; // [esp+21Ch] [ebp-4h]
Myres = sCipherText._Myres;
memset(sDeBase64ed, 0, sizeof(sDeBase64ed));
memset(sDecrypted, 0, sizeof(sDecrypted));
Ptr = (std::string::_Bxty *)sCipherText._Bx._Ptr;
v16 = 0;
length = 255;
if ( sCipherText._Myres < 0x10 )
Ptr = &sCipherText._Bx;
v5 = Base64Decode(Ptr->_Buf, sDeBase64ed, 255);
p_length = &length;
v11 = sDecrypted;
v10 = v5;
v9 = sDeBase64ed;
qmemcpy(v8, &decryptKey, sizeof(v8));
v6 = NC_NRC4_decrypt();
if ( v6 )
{
if ( Myres >= 0x10 )
operator delete(sCipherText._Bx._Ptr);
return v6;
}
else
{
std::string::assign(sPlainText, sDecrypted, strlen(sDecrypted));
if ( Myres >= 0x10 )
operator delete(sCipherText._Bx._Ptr);
return 0;
}
}
这是IDA反汇编处理的伪代码,主要是看这些伪代码实现 直接看pdb文件没法看的。可以通过IDA打开gDBGW.exe 搜索Decrypt这个函数 解密过程走通了就可以加密了 |
|