这是加密函数
int mir_ndecod(char* EnBuf, char *huanbuf, int buflen, int tag)
{
int ntag; // [sp+0h] [bp-1Ch]@1
int vbiao; // [sp+9h] [bp-13h]@2
int vnow; // [sp+Ah] [bp-12h]@2
int len; // [sp+10h] [bp-Ch]@1
//int huanbuf; // [sp+14h] [bp-8h]@1
//int EnBuf; // [sp+18h] [bp-4h]@1
PBYTE EnTab08=(PBYTE)0x;//;表1 都是4个字节表
PBYTE EnTab0c=(PBYTE)0x;// 表2 都是4个字节表
PBYTE EnTab10=(PBYTE)0x;//;表3 都是4个字节表
len = buflen;
//huanbuf = hbuf;
//EnBuf = sendbuf;
int i=0,k=0;
ntag = tag;
if ( tag )
{
vbiao = 3;
vnow = 0;
if ( buflen )
{
do
{
vnow |=EnBuf[i] & EnTab10[(unsigned __int8)vbiao];
huanbuf[k] = (EnBuf[i] & EnTab0c[(unsigned __int8)vbiao] | ((unsigned int)(unsigned __int8)(EnBuf[i] & EnTab08[(unsigned __int8)vbiao]) >> 2))
+ 60;
--tag;
if ( !tag )
break;
++k;
--vbiao;
if ( !vbiao )
{
huanbuf[k] = ((unsigned int)vnow >> 1) + 60;
--tag;
if ( !tag )
break;
++k;
vbiao = 3;
vnow = 0;
}
++i;
--len;
}
while ( len );
}
if ( !len && vbiao != 3 )
{
huanbuf[k] = ((unsigned int)vnow >> 1) + 60;
--tag;
++k;
}
if ( tag )
huanbuf[k] = 0;
}
return ntag - tag;
}
自身的解迷函数
int jimi_code(int Enjbuf, int Huanjbuf, unsigned int Enjlen, int Enjtag)
{
int tag; // [sp+0h] [bp-1Ch]@1
char index1; // [sp+7h] [bp-15h]@2
char nown; // [sp+8h] [bp-14h]@1
char now2; // [sp+8h] [bp-14h]@5
unsigned int len; // [sp+10h] [bp-Ch]@1
int hbuf; // [sp+14h] [bp-8h]@1
int Xjmbuf; // [sp+18h] [bp-4h]@1
PBYTE JIETab14=(PBYTE)0x//表1
PBYTE JIETab18=(PBYTE)0x//表2
PBYTE JIETab1C=(PBYTE)0x//表3
len = Enjlen;
hbuf = Huanjbuf;
Xjmbuf = Enjbuf;
nown = 0;
tag = Enjtag;
if ( Enjtag )
{
index1 = 3;
if ( Enjlen > 1 )
{
do
{
if ( index1 == 3 )
{
if ( len <= 3 )
now2 = *(BYTE *)(Xjmbuf + len - 1);
else
now2 = *(BYTE *)(Xjmbuf + 3);
nown = 2 * (now2 - 60);
}
*(BYTE *)hbuf = nown &JIETab1C[(unsigned __int8)index1] | (*(BYTE *)Xjmbuf - 60) & JIETab18[(unsigned __int8)index1] | (unsigned __int8)(4 * ((*(BYTE *)Xjmbuf - 60) & JIETab14[(unsigned __int8)index1]));
--Enjtag;
if ( !Enjtag )
break;
++hbuf;
--index1;
if ( !index1 )
{
--len;
if ( !len )
break;
++Xjmbuf;
index1 = 3;
}
--len;
++Xjmbuf;
}
while ( len > 1 );
}
if ( Enjtag )
*(BYTE *)hbuf = 0;
}
return tag - Enjtag;
}
用自身的解迷函数解迷错误
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)