运行到mov eax, dword ptr [esi-4]就错误,是怎么回事?
char*readfile(){char*buffer;buffer=newchar[0x168c];FILE*fp;fp=fopen(readdir(),"rb");i...
char* readfile()
{
char* buffer;
buffer = new char[0x168c];
FILE *fp;
fp = fopen(readdir(), "rb");
if (!fp)
{
MessageBoxA(0, "读取文件出错", "提示", 0);
ExitProcess(0);
}
fread(buffer, sizeof(char), 0x168c, fp);
fclose(fp);
return buffer;
}
void encode2(char *buffer, char *key)
{
__asm
{
lea eax, pass
push eax
lea eax, key
push eax
lea eax, buffer
push eax
mov ecx, dword ptr [esp+8]
push ebx
push ebp
push esi
mov eax, dword ptr [ecx]
mov edx, dword ptr [ecx+4]
mov ecx, eax
mov esi, edx
shr ecx, 4
and ecx, 0x0F0F0F0F
and esi, 0x0F0F0F0F
xor ecx, esi
push edi
xor edx, ecx
mov dword ptr [esp+0x10], 8
shl ecx, 4
xor eax, ecx
mov esi, edx
mov ecx, eax
and esi, 0x0FFFF
shr ecx, 0x10
xor ecx, esi
xor edx, ecx
shl ecx, 0x10
xor eax, ecx
mov ecx, edx
shr ecx, 2
mov esi, eax
and ecx, 0x33333333
and esi, 0x33333333
xor ecx, esi
xor eax, ecx
shl ecx, 2
xor edx, ecx
mov esi, eax
mov ecx, edx
and esi, 0x0FF00FF
shr ecx, 8
and ecx, 0x0FF00FF
xor ecx, esi
mov esi, dword ptr [esp+0x1C]
xor eax, ecx
shl ecx, 8
xor edx, ecx
mov ecx, edx
add edx, edx
shr ecx, 0x1F
or ecx, edx
mov edx, ecx
xor edx, eax
and edx, 0xAAAAAAAA
xor eax, edx
xor ecx, edx
mov edx, eax
add eax, eax
shr edx, 0x1F
or edx, eax
L058:
mov ebx, dword ptr [esi]
mov eax, ecx
mov edi, ecx
add esi, 4
shl eax, 0x1C
shr edi, 4
or eax, edi
add esi, 4
xor eax, ebx
add esi, 4
mov ebx, eax
mov edi, eax
shr ebx, 0x10
and ebx, 0x3F
add esi, 4
shr edi, 0x18
push eax
lea eax, key3
mov ebp, dword ptr [ebx*4+eax]
pop eax
mov ebx, eax
and edi, 0x3F
and eax, 0x3F
shr ebx, 8
push eax
lea eax, key1
mov edi, dword ptr [edi*4+eax]
pop eax
and ebx, 0x3F
or edi, ebp
push eax
lea eax, key5
mov ebp, dword ptr [ebx*4+eax]
pop eax
push ecx
lea ecx, key7
mov ebx, dword ptr [eax*4+ecx]
pop ecx
mov eax, dword ptr [esi-4]
……
}
} 展开
{
char* buffer;
buffer = new char[0x168c];
FILE *fp;
fp = fopen(readdir(), "rb");
if (!fp)
{
MessageBoxA(0, "读取文件出错", "提示", 0);
ExitProcess(0);
}
fread(buffer, sizeof(char), 0x168c, fp);
fclose(fp);
return buffer;
}
void encode2(char *buffer, char *key)
{
__asm
{
lea eax, pass
push eax
lea eax, key
push eax
lea eax, buffer
push eax
mov ecx, dword ptr [esp+8]
push ebx
push ebp
push esi
mov eax, dword ptr [ecx]
mov edx, dword ptr [ecx+4]
mov ecx, eax
mov esi, edx
shr ecx, 4
and ecx, 0x0F0F0F0F
and esi, 0x0F0F0F0F
xor ecx, esi
push edi
xor edx, ecx
mov dword ptr [esp+0x10], 8
shl ecx, 4
xor eax, ecx
mov esi, edx
mov ecx, eax
and esi, 0x0FFFF
shr ecx, 0x10
xor ecx, esi
xor edx, ecx
shl ecx, 0x10
xor eax, ecx
mov ecx, edx
shr ecx, 2
mov esi, eax
and ecx, 0x33333333
and esi, 0x33333333
xor ecx, esi
xor eax, ecx
shl ecx, 2
xor edx, ecx
mov esi, eax
mov ecx, edx
and esi, 0x0FF00FF
shr ecx, 8
and ecx, 0x0FF00FF
xor ecx, esi
mov esi, dword ptr [esp+0x1C]
xor eax, ecx
shl ecx, 8
xor edx, ecx
mov ecx, edx
add edx, edx
shr ecx, 0x1F
or ecx, edx
mov edx, ecx
xor edx, eax
and edx, 0xAAAAAAAA
xor eax, edx
xor ecx, edx
mov edx, eax
add eax, eax
shr edx, 0x1F
or edx, eax
L058:
mov ebx, dword ptr [esi]
mov eax, ecx
mov edi, ecx
add esi, 4
shl eax, 0x1C
shr edi, 4
or eax, edi
add esi, 4
xor eax, ebx
add esi, 4
mov ebx, eax
mov edi, eax
shr ebx, 0x10
and ebx, 0x3F
add esi, 4
shr edi, 0x18
push eax
lea eax, key3
mov ebp, dword ptr [ebx*4+eax]
pop eax
mov ebx, eax
and edi, 0x3F
and eax, 0x3F
shr ebx, 8
push eax
lea eax, key1
mov edi, dword ptr [edi*4+eax]
pop eax
and ebx, 0x3F
or edi, ebp
push eax
lea eax, key5
mov ebp, dword ptr [ebx*4+eax]
pop eax
push ecx
lea ecx, key7
mov ebx, dword ptr [eax*4+ecx]
pop ecx
mov eax, dword ptr [esi-4]
……
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询