求教:
这二组汇编码有哪些地方不相同呢?C++源码要怎样改才行呢??
第一组:
==========================================
00517E60 /$ 6A FF push -1
00517E62 |. 68 30955800 push 00589530 ; SE 处理程序安装
00517E67 |. 64:A1 0000000>mov eax, dword ptr fs:[0]
00517E6D |. 50 push eax
00517E6E |. 64:8925 00000>mov dword ptr fs:[0], esp
00517E75 |. 83EC 48 sub esp, 48
00517E78 |. 53 push ebx
00517E79 |. 55 push ebp
00517E7A |. 56 push esi
00517E7B |. 8B7424 68 mov esi, dword ptr [esp+68]
00517E7F |. 57 push edi
00517E80 |. 8B7C24 68 mov edi, dword ptr [esp+68]
00517E84 |. 8B1E mov ebx, dword ptr [esi]
00517E86 |. 894C24 10 mov dword ptr [esp+10], ecx
00517E8A |. 8B4F 08 mov ecx, dword ptr [edi+8]
00517E8D |. 83C3 02 add ebx, 2
00517E90 |. 8BC3 mov eax, ebx
00517E92 |. 891E mov dword ptr [esi], ebx
00517E94 |. 66:8B5C08 FE mov bx, word ptr [eax+ecx-2]
00517E99 |. 8B4F 08 mov ecx, dword ptr [edi+8]
00517E9C |. 83C0 02 add eax, 2
00517E9F |. 8906 mov dword ptr [esi], eax
00517EA1 |. 66:8B6C08 FE mov bp, word ptr [eax+ecx-2]
00517EA6 |. 8B4F 08 mov ecx, dword ptr [edi+8]
00517EA9 |. 83C0 04 add eax, 4
00517EAC |. 8906 mov dword ptr [esi], eax
00517EAE |. 8B4408 FC mov eax, dword ptr [eax+ecx-4]
00517EB2 |. 8D4C24 20 lea ecx, dword ptr [esp+20]
00517EB6 |. 894424 68 mov dword ptr [esp+68], eax
00517EBA |. E8 C1D0F1FF call 00434F80
00517EBF |. 8B0E mov ecx, dword ptr [esi]
00517EC1 |. 8B47 08 mov eax, dword ptr [edi+8]
00517EC4 |. 0FBFED movsx ebp, bp
00517EC7 |. 0FBFDB movsx ebx, bx
00517ECA |. 55 push ebp
00517ECB |. 03C8 add ecx, eax
00517ECD |. 53 push ebx
00517ECE |. 51 push ecx
00517ECF |. 8D4C24 2C lea ecx, dword ptr [esp+2C]
00517ED3 |. C74424 6C 000>mov dword ptr [esp+6C], 0
00517EDB |. E8 90D2F1FF call 00435170
00517EE0 |. 8B16 mov edx, dword ptr [esi]
00517EE2 |. 8D4C24 20 lea ecx, dword ptr [esp+20]
00517EE6 |. 03D3 add edx, ebx
00517EE8 |. 8916 mov dword ptr [esi], edx
00517EEA |. E8 51D3F1FF call 00435240
00517EEF |. 85C0 test eax, eax
00517EF1 |. 74 5C je short 00517F4F
00517EF3 |. 8B4424 54 mov eax, dword ptr [esp+54]
00517EF7 |. 33F6 xor esi, esi
00517EF9 |. 3BC6 cmp eax, esi
00517EFB |. 75 52 jnz short 00517F4F
00517EFD |. 8B5424 68 mov edx, dword ptr [esp+68]
00517F01 |. 8B4424 28 mov eax, dword ptr [esp+28]
00517F05 |. 3BD0 cmp edx, eax
00517F07 |. 75 46 jnz short 00517F4F
00517F09 |. BF 54CC5800 mov edi, 0058CC54
00517F0E |. 897C24 14 mov dword ptr [esp+14], edi
00517F12 |. 8B4424 38 mov eax, dword ptr [esp+38]
00517F16 |. 8B4C24 10 mov ecx, dword ptr [esp+10]
00517F1A |. 894424 1C mov dword ptr [esp+1C], eax
00517F1E |. 8D4424 6C lea eax, dword ptr [esp+6C]
00517F22 |. 8B11 mov edx, dword ptr [ecx]
00517F24 |. 50 push eax
00517F25 |. 8D4424 18 lea eax, dword ptr [esp+18]
00517F29 |. C64424 64 01 mov byte ptr [esp+64], 1
00517F2E |. 50 push eax
00517F2F |. 896C24 20 mov dword ptr [esp+20], ebp
00517F33 |. 897424 74 mov dword ptr [esp+74], esi
00517F37 |. FF52 28 call dword ptr [edx+28]
00517F3A |. 56 push esi
00517F3B |. 897424 1C mov dword ptr [esp+1C], esi
00517F3F |. 897424 20 mov dword ptr [esp+20], esi
00517F43 |. 897C24 18 mov dword ptr [esp+18], edi
00517F47 |. E8 F4BF0500 call 00573F40
00517F4C |. 83C4 04 add esp, 4
00517F4F |> 8D4C24 20 lea ecx, dword ptr [esp+20]
00517F53 |. C74424 60 FFF>mov dword ptr [esp+60], -1
00517F5B |. E8 C0D0F1FF call 00435020
00517F60 |. 8B4C24 58 mov ecx, dword ptr [esp+58]
00517F64 |. 5F pop edi
00517F65 |. 5E pop esi
00517F66 |. 5D pop ebp
00517F67 |. 5B pop ebx
00517F68 |. 64:890D 00000>mov dword ptr fs:[0], ecx
00517F6F |. 83C4 54 add esp, 54
00517F72 \. C2 0800 retn 8
C++源代码大概是:
===================================================
void CompressedPacket(DataPack* pDataPack, int& iOffset)
{
short sCompLen, sOrgLen;
DWORD dwCrcValue;
sCompLen = CAPISocket::Parse_GetShort(pDataPack->m_pData, iOffset);
sOrgLen = CAPISocket::Parse_GetShort(pDataPack->m_pData, iOffset);
dwCrcValue = CAPISocket::Parse_GetDword(pDataPack->m_pData, iOffset);
CCompressMng Compressor;
Compressor.PreUncompressWork((char*)(pDataPack->m_pData+iOffset), sCompLen, sOrgLen);
iOffset += sCompLen;
if (Compressor.Extract() == false ||
Compressor.m_nErrorOccurred != 0 ||
dwCrcValue != Compressor.m_dwCrc )
{
return;
}
BYTE* pDecodeBuf = (BYTE*)(Compressor.m_pOutputBuffer);
DataPack DataPackTemp;
DataPackTemp.m_Size = sOrgLen;
DataPackTemp.m_pData = pDecodeBuf;
int iOffset2 = 0;
this->ProcessPacket(&DataPackTemp, iOffset2);
DataPackTemp.m_Size = 0;
DataPackTemp.m_pData = NULL;
}
第二组汇编码:
==============================================
00713930 /$ 64:A1 0000000>mov eax, dword ptr fs:[0]
00713936 |. 6A FF push -1
00713938 |. 68 F8D28300 push 0083D2F8
0071393D |. 50 push eax
0071393E |. 64:8925 00000>mov dword ptr fs:[0], esp
00713945 |. 83EC 10 sub esp, 10
00713948 |. 53 push ebx
00713949 |. 55 push ebp
0071394A |. 56 push esi
0071394B |. 8B7424 30 mov esi, dword ptr [esp+30]
0071394F |. 57 push edi
00713950 |. 8BF9 mov edi, ecx
00713952 |. 8B1E mov ebx, dword ptr [esi]
00713954 |. 8B4C24 30 mov ecx, dword ptr [esp+30]
00713958 |. 83C3 04 add ebx, 4
0071395B |. 33ED xor ebp, ebp
0071395D |. 891E mov dword ptr [esi], ebx
0071395F |. 8B51 04 mov edx, dword ptr [ecx+4]
00713962 |. 8BC3 mov eax, ebx
00713964 |. 3BC2 cmp eax, edx
00713966 |. 7E 06 jle short 0071396E
00713968 |. 896C24 34 mov dword ptr [esp+34], ebp
0071396C |. EB 0B jmp short 00713979
0071396E |> 8B51 08 mov edx, dword ptr [ecx+8]
00713971 |. 8B5402 FC mov edx, dword ptr [edx+eax-4]
00713975 |. 895424 34 mov dword ptr [esp+34], edx
00713979 |> 83C0 04 add eax, 4
0071397C |. 8906 mov dword ptr [esi], eax
0071397E |. 8B51 04 mov edx, dword ptr [ecx+4]
00713981 |. 3BC2 cmp eax, edx
00713983 |. 7E 04 jle short 00713989
00713985 |. 33DB xor ebx, ebx
00713987 |. EB 07 jmp short 00713990
00713989 |> 8B49 08 mov ecx, dword ptr [ecx+8]
0071398C |. 8B5C01 FC mov ebx, dword ptr [ecx+eax-4]
00713990 |> 83C0 04 add eax, 4
00713993 |. 8906 mov dword ptr [esi], eax
00713995 |. 8B47 18 mov eax, dword ptr [edi+18]
00713998 |. 3BC5 cmp eax, ebp
0071399A |. 74 0C je short 007139A8
0071399C |. 50 push eax
0071399D |. E8 DEC10E00 call 007FFB80
007139A2 |. 83C4 04 add esp, 4
007139A5 |. 896F 18 mov dword ptr [edi+18], ebp
007139A8 |> 8D93 00040000 lea edx, dword ptr [ebx+400]
007139AE |. 52 push edx
007139AF |. E8 79EC0E00 call 0080262D
007139B4 |. 8B4C24 34 mov ecx, dword ptr [esp+34]
007139B8 |. 53 push ebx
007139B9 |. 8947 18 mov dword ptr [edi+18], eax
007139BC |. 50 push eax
007139BD |. 8B4424 40 mov eax, dword ptr [esp+40]
007139C1 |. 8B51 08 mov edx, dword ptr [ecx+8]
007139C4 |. 50 push eax
007139C5 |. 8B06 mov eax, dword ptr [esi]
007139C7 |. 03D0 add edx, eax
007139C9 |. 52 push edx
007139CA |. E8 71AFD5FF call 0046E940
007139CF |. 8B4424 48 mov eax, dword ptr [esp+48]
007139D3 |. 8B16 mov edx, dword ptr [esi]
007139D5 |. 03D0 add edx, eax
007139D7 |. 83C4 14 add esp, 14
007139DA |. 8916 mov dword ptr [esi], edx
007139DC |. BE 40C58400 mov esi, 0084C540
007139E1 |. 897424 14 mov dword ptr [esp+14], esi
007139E5 |. 896C24 18 mov dword ptr [esp+18], ebp
007139E9 |. 896C24 1C mov dword ptr [esp+1C], ebp
007139ED |. 8B4F 18 mov ecx, dword ptr [edi+18]
007139F0 |. 8B17 mov edx, dword ptr [edi]
007139F2 |. 896C24 28 mov dword ptr [esp+28], ebp
007139F6 |. 894C24 1C mov dword ptr [esp+1C], ecx
007139FA |. 8D4424 10 lea eax, dword ptr [esp+10]
007139FE |. 8D4C24 14 lea ecx, dword ptr [esp+14]
00713A02 |. 50 push eax
00713A03 |. 51 push ecx
00713A04 |. 8BCF mov ecx, edi
00713A06 |. 895C24 20 mov dword ptr [esp+20], ebx
00713A0A |. 896C24 18 mov dword ptr [esp+18], ebp
00713A0E |. FF52 08 call dword ptr [edx+8]
00713A11 |. 896C24 18 mov dword ptr [esp+18], ebp
00713A15 |. 896C24 1C mov dword ptr [esp+1C], ebp
00713A19 |. C74424 28 FFF>mov dword ptr [esp+28], -1
00713A21 |. 55 push ebp
00713A22 |. 897424 18 mov dword ptr [esp+18], esi
00713A26 |. E8 55C10E00 call 007FFB80
00713A2B |. 8B4C24 24 mov ecx, dword ptr [esp+24]
00713A2F |. 83C4 04 add esp, 4
00713A32 |. 64:890D 00000>mov dword ptr fs:[0], ecx
00713A39 |. 5F pop edi
00713A3A |. 5E pop esi
00713A3B |. 5D pop ebp
00713A3C |. 5B pop ebx
00713A3D |. 83C4 1C add esp, 1C
00713A40 \. C2 0800 retn 8
求教:
这二组汇编码有哪些地方不相同呢?C++源码要怎样改才行呢??
谢谢
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!