这是个字串的解密算法,核心算法,我想做个加密算法,无奈看不大明白该算法
该算法是否可逆,另外,该算法的最终步骤就是将每4个字节和密钥的4个字节进行异或运算
附上算法
004E651E |. 8B01 mov eax, dword ptr [ecx] EAX = 3A7FE3DC
004E6520 |. 8BC8 mov ecx, eax ECX = 3A7FE3DC
004E6522 |. C1E9 04 shr ecx, 4 ECX = 03A7FE3D
004E6525 |. 33CA xor ecx, edx EDX = 71D7FDE3 ECX = 727003DE
004E6527 |. 81E1 0F0F0F0F and ecx, 0F0F0F0F ECX = 0200030E
004E652D |. 33D1 xor edx, ecx EDX = 73D7FEED
004E652F |. C1E1 04 shl ecx, 4 ECX = 200030E0
004E6532 |. 33C1 xor eax, ecx
004E6534 |. 8BC8 mov ecx, eax
004E6536 |. C1E9 10 shr ecx, 10
004E6539 |. 33CA xor ecx, edx
004E653B |. 81E1 FFFF0000 and ecx, 0FFFF
004E6541 |. 33D1 xor edx, ecx
004E6543 |. C1E1 10 shl ecx, 10
004E6546 |. 33C1 xor eax, ecx
004E6548 |. 8BCA mov ecx, edx
004E654A |. C1E9 02 shr ecx, 2
004E654D |. 33C8 xor ecx, eax
004E654F |. 81E1 33333333 and ecx, 33333333
004E6555 |. 33C1 xor eax, ecx
004E6557 |. C1E1 02 shl ecx, 2
004E655A |. 33D1 xor edx, ecx
004E655C |. 8BCA mov ecx, edx
004E655E |. C1E9 08 shr ecx, 8
004E6561 |. 33C8 xor ecx, eax
004E6563 |. 81E1 FF00FF00 and ecx, 0FF00FF
004E6569 |. 33C1 xor eax, ecx
004E656B |. C1E1 08 shl ecx, 8
004E656E |. 33D1 xor edx, ecx
004E6570 |. 8BCA mov ecx, edx
004E6572 |. 03D2 add edx, edx
004E6574 |. C1E9 1F shr ecx, 1F
004E6577 |. 0BCA or ecx, edx
004E6579 |. 8BD1 mov edx, ecx
004E657B |. 33D0 xor edx, eax
004E657D |. 81E2 AAAAAAAA and edx, AAAAAAAA
004E6583 |. 33C2 xor eax, edx
004E6585 |. 33CA xor ecx, edx
004E6587 |. 8BD0 mov edx, eax
004E6589 |. C1EA 1F shr edx, 1F
004E658C |. 03C0 add eax, eax
004E658E |. 0BD0 or edx, eax
004E6590 |. C74424 10 080>mov dword ptr [esp+10], 8
004E6598 |> 8B1F /mov ebx, dword ptr [edi]
004E659A |. 8BC1 |mov eax, ecx
004E659C |. C1E0 1C |shl eax, 1C
004E659F |. 8BF1 |mov esi, ecx
004E65A1 |. C1EE 04 |shr esi, 4
004E65A4 |. 0BC6 |or eax, esi
004E65A6 |. 33C3 |xor eax, ebx
004E65A8 |. 8BD8 |mov ebx, eax
004E65AA |. C1EB 10 |shr ebx, 10
004E65AD |. 83E3 3F |and ebx, 3F
004E65B0 |. 8B2C9D B07C65>|mov ebp, dword ptr [ebx*4+657CB0]
004E65B7 |. 8BF0 |mov esi, eax
004E65B9 |. C1EE 18 |shr esi, 18
004E65BC |. 83E6 3F |and esi, 3F
004E65BF |. 8B34B5 B07A65>|mov esi, dword ptr [esi*4+657AB0]
004E65C6 |. 0BF5 |or esi, ebp
004E65C8 |. 8BD8 |mov ebx, eax
004E65CA |. C1EB 08 |shr ebx, 8
004E65CD |. 83E3 3F |and ebx, 3F
004E65D0 |. 0B349D B07E65>|or esi, dword ptr [ebx*4+657EB0]
004E65D7 |. 83E0 3F |and eax, 3F
004E65DA |. 8B1C85 B08065>|mov ebx, dword ptr [eax*4+6580B0]
004E65E1 |. 8B47 04 |mov eax, dword ptr [edi+4]
004E65E4 |. 0BF3 |or esi, ebx
004E65E6 |. 33C1 |xor eax, ecx
004E65E8 |. 83C7 04 |add edi, 4
004E65EB |. 8BD8 |mov ebx, eax
004E65ED |. C1EB 18 |shr ebx, 18
004E65F0 |. 83E3 3F |and ebx, 3F
004E65F3 |. 8B1C9D B07B65>|mov ebx, dword ptr [ebx*4+657BB0]
004E65FA |. 8BE8 |mov ebp, eax
004E65FC |. C1ED 10 |shr ebp, 10
004E65FF |. 83E5 3F |and ebp, 3F
004E6602 |. 0B1CAD B07D65>|or ebx, dword ptr [ebp*4+657DB0]
004E6609 |. 8BE8 |mov ebp, eax
004E660B |. C1ED 08 |shr ebp, 8
004E660E |. 83E5 3F |and ebp, 3F
004E6611 |. 0B1CAD B07F65>|or ebx, dword ptr [ebp*4+657FB0]
004E6618 |. 83E0 3F |and eax, 3F
004E661B |. 0B1C85 B08165>|or ebx, dword ptr [eax*4+6581B0]
004E6622 |. 0BDE |or ebx, esi
004E6624 |. 33D3 |xor edx, ebx
004E6626 |. 8B5F 04 |mov ebx, dword ptr [edi+4]
004E6629 |. 83C7 04 |add edi, 4
004E662C |. 8BC2 |mov eax, edx
004E662E |. C1E0 1C |shl eax, 1C
004E6631 |. 8BF2 |mov esi, edx
004E6633 |. C1EE 04 |shr esi, 4
004E6636 |. 0BC6 |or eax, esi
004E6638 |. 33C3 |xor eax, ebx
004E663A |. 8BD8 |mov ebx, eax
004E663C |. C1EB 10 |shr ebx, 10
004E663F |. 83E3 3F |and ebx, 3F
004E6642 |. 8B2C9D B07C65>|mov ebp, dword ptr [ebx*4+657CB0]
004E6649 |. 8BF0 |mov esi, eax
004E664B |. C1EE 18 |shr esi, 18
004E664E |. 83E6 3F |and esi, 3F
004E6651 |. 8B34B5 B07A65>|mov esi, dword ptr [esi*4+657AB0]
004E6658 |. 8BD8 |mov ebx, eax
004E665A |. C1EB 08 |shr ebx, 8
004E665D |. 83E3 3F |and ebx, 3F
004E6660 |. 0BF5 |or esi, ebp
004E6662 |. 8B2C9D B07E65>|mov ebp, dword ptr [ebx*4+657EB0]
004E6669 |. 83E0 3F |and eax, 3F
004E666C |. 8B1C85 B08065>|mov ebx, dword ptr [eax*4+6580B0]
004E6673 |. 8B47 04 |mov eax, dword ptr [edi+4]
004E6676 |. 83C7 04 |add edi, 4
004E6679 |. 0BF5 |or esi, ebp
004E667B |. 0BF3 |or esi, ebx
004E667D |. 33C2 |xor eax, edx
004E667F |. 8BD8 |mov ebx, eax
004E6681 |. C1EB 18 |shr ebx, 18
004E6684 |. 8BE8 |mov ebp, eax
004E6686 |. 83E3 3F |and ebx, 3F
004E6689 |. 8B1C9D B07B65>|mov ebx, dword ptr [ebx*4+657BB0]
004E6690 |. C1ED 10 |shr ebp, 10
004E6693 |. 83E5 3F |and ebp, 3F
004E6696 |. 83C7 04 |add edi, 4
004E6699 |. 0B1CAD B07D65>|or ebx, dword ptr [ebp*4+657DB0]
004E66A0 |. 8BE8 |mov ebp, eax
004E66A2 |. C1ED 08 |shr ebp, 8
004E66A5 |. 83E5 3F |and ebp, 3F
004E66A8 |. 0B1CAD B07F65>|or ebx, dword ptr [ebp*4+657FB0]
004E66AF |. 83E0 3F |and eax, 3F
004E66B2 |. 8B2C85 B08165>|mov ebp, dword ptr [eax*4+6581B0]
004E66B9 |. 8B4424 10 |mov eax, dword ptr [esp+10]
004E66BD |. 0BDD |or ebx, ebp
004E66BF |. 0BDE |or ebx, esi
004E66C1 |. 33CB |xor ecx, ebx
004E66C3 |. 48 |dec eax
004E66C4 |. 894424 10 |mov dword ptr [esp+10], eax
004E66C8 |.^ 0F85 CAFEFFFF \jnz 004E6598
004E66CE |. 8BC1 mov eax, ecx
004E66D0 |. D1E9 shr ecx, 1
004E66D2 |. C1E0 1F shl eax, 1F
004E66D5 |. 0BC1 or eax, ecx
004E66D7 |. 8BC8 mov ecx, eax
004E66D9 |. 33CA xor ecx, edx
004E66DB |. 81E1 AAAAAAAA and ecx, AAAAAAAA
004E66E1 |. 33D1 xor edx, ecx
004E66E3 |. 33C1 xor eax, ecx
004E66E5 |. 8BCA mov ecx, edx
004E66E7 |. D1EA shr edx, 1
004E66E9 |. C1E1 1F shl ecx, 1F
004E66EC |. 0BCA or ecx, edx
004E66EE |. 8BD1 mov edx, ecx
004E66F0 |. C1EA 08 shr edx, 8
004E66F3 |. 33D0 xor edx, eax
004E66F5 |. 81E2 FF00FF00 and edx, 0FF00FF
004E66FB |. 33C2 xor eax, edx
004E66FD |. C1E2 08 shl edx, 8
004E6700 |. 33CA xor ecx, edx
004E6702 |. 8BD1 mov edx, ecx
004E6704 |. C1EA 02 shr edx, 2
004E6707 |. 33D0 xor edx, eax
004E6709 |. 81E2 33333333 and edx, 33333333
004E670F |. 33C2 xor eax, edx
004E6711 |. C1E2 02 shl edx, 2
004E6714 |. 33CA xor ecx, edx
004E6716 |. 8BD0 mov edx, eax
004E6718 |. C1EA 10 shr edx, 10
004E671B |. 33D1 xor edx, ecx
004E671D |. 81E2 FFFF0000 and edx, 0FFFF
004E6723 |. 33CA xor ecx, edx
004E6725 |. C1E2 10 shl edx, 10
004E6728 |. 33C2 xor eax, edx
004E672A |. 8BD0 mov edx, eax
004E672C |. C1EA 04 shr edx, 4
004E672F |. 33D1 xor edx, ecx
004E6731 |. 81E2 0F0F0F0F and edx, 0F0F0F0F
004E6737 |. 8BF2 mov esi, edx
004E6739 |. C1E6 04 shl esi, 4
004E673C |. 33F0 xor esi, eax
004E673E |. 8B4424 18 mov eax, dword ptr [esp+18]
004E6742 |. 5F pop edi
004E6743 |. 8930 mov dword ptr [eax], esi
004E6745 |. 5E pop esi
004E6746 |. 33D1 xor edx, ecx
004E6748 |. 5D pop ebp
004E6749 |. 8950 04 mov dword ptr [eax+4], edx
004E674C |. 5B pop ebx
004E674D |. 59 pop ecx
004E674E \. C3 retn
本人用DES标准算法比对过,貌似很类似DES算法,难道是变种?
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)