请问密学高人,这是一种标准算法还是作者自己设计的?我感觉是标准算法,但不知道是何算法,路过的高人指点一下:
0059D7C8 /$ 55 push ebp ; 加密函数
0059D7C9 |. 8BEC mov ebp,esp
0059D7CB |. B9 05000000 mov ecx,5
0059D7D0 |> 6A 00 /push 0
0059D7D2 |. 6A 00 |push 0
0059D7D4 |. 49 |dec ecx
0059D7D5 |.^ 75 F9 \jnz short My.0059D7D0
0059D7D7 |. 51 push ecx
0059D7D8 |. 53 push ebx
0059D7D9 |. 56 push esi
0059D7DA |. 57 push edi
0059D7DB |. 8955 F8 mov [local.2],edx
0059D7DE |. 8945 FC mov [local.1],eax ; 字符串 String
0059D7E1 |. 8B45 FC mov eax,[local.1]
0059D7E4 |. E8 8F76E6FF call My.00404E78 ; System.@LStrAddRef(void;void):Pointer;
0059D7E9 |. 33C0 xor eax,eax
0059D7EB |. 55 push ebp
0059D7EC |. 68 57D95900 push My.0059D957
0059D7F1 |. 64:FF30 push dword ptr fs:[eax]
0059D7F4 |. 64:8920 mov dword ptr fs:[eax],esp
0059D7F7 |. 8B45 F8 mov eax,[local.2]
0059D7FA |. E8 C971E6FF call My.004049C8 ; System.@LStrClr(void;void);
0059D7FF |. 8D45 E8 lea eax,[local.6]
0059D802 |. E8 C171E6FF call My.004049C8 ; System.@LStrClr(void;void);
0059D807 |. 33C0 xor eax,eax
0059D809 |. 8945 F0 mov [local.4],eax
0059D80C |. C645 EF 00 mov byte ptr ss:[ebp-11],0
0059D810 |. 33FF xor edi,edi
0059D812 |. 33F6 xor esi,esi
0059D814 |. 8B45 FC mov eax,[local.1]
0059D817 |. E8 7474E6FF call My.00404C90 ; System.@LStrLen(String):Integer;
0059D81C |. 8945 F4 mov [local.3],eax ; Length(string)
0059D81F |. 3B75 F4 cmp esi,[local.3] ; ESI 循环变量i
0059D822 |. 0F8D D4000000 jge My.0059D8FC
0059D828 |> 817D F0 10270>/cmp [local.4],2710 ; 10000
0059D82F |. 0F8D C7000000 |jge My.0059D8FC ; >=10000
0059D835 |. 8B45 FC |mov eax,[local.1] ; string
0059D838 |. 0FB60430 |movzx eax,byte ptr ds:[eax+esi] ; string[i]
0059D83C |. 8D4F 02 |lea ecx,dword ptr ds:[edi+2] ; i+2
0059D83F |. D3E8 |shr eax,cl ; string[i] shr 2
0059D841 |. 8BD8 |mov ebx,eax
0059D843 |. 0A5D EF |or bl,byte ptr ss:[ebp-11]
0059D846 |. 80E3 3F |and bl,3F
0059D849 |. 8B45 FC |mov eax,[local.1]
0059D84C |. 0FB60430 |movzx eax,byte ptr ds:[eax+esi] ; string[i]
0059D850 |. 8D57 02 |lea edx,dword ptr ds:[edi+2] ; i+2
0059D853 |. B9 08000000 |mov ecx,8
0059D858 |. 2BCA |sub ecx,edx ; 8-i+2
0059D85A |. D3E0 |shl eax,cl ; string[i] shl 8-i+2
0059D85C |. C1E8 02 |shr eax,2
0059D85F |. 24 3F |and al,3F
0059D861 |. 8845 EF |mov byte ptr ss:[ebp-11],al
0059D864 |. 83C7 02 |add edi,2 ; i=i+2
0059D867 |. 83FF 06 |cmp edi,6 ; i<6
0059D86A |. 7C 69 |jl short My.0059D8D5
0059D86C |. 817D F0 0F270>|cmp [local.4],270F ; 9999
0059D873 |. 7C 1F |jl short My.0059D894
0059D875 |. 8D45 E4 |lea eax,[local.7]
0059D878 |. 33D2 |xor edx,edx
0059D87A |. 8AD3 |mov dl,bl
0059D87C |. 83C2 3C |add edx,3C
0059D87F |. E8 2473E6FF |call My.00404BA8
0059D884 |. 8B55 E4 |mov edx,[local.7]
0059D887 |. 8D45 E8 |lea eax,[local.6]
0059D88A |. E8 0974E6FF |call My.00404C98
0059D88F |. FF45 F0 |inc [local.4]
0059D892 |. EB 39 |jmp short My.0059D8CD
0059D894 |> 8D45 E0 |lea eax,[local.8]
0059D897 |. 33D2 |xor edx,edx
0059D899 |. 8AD3 |mov dl,bl
0059D89B |. 83C2 3C |add edx,3C
0059D89E |. E8 0573E6FF |call My.00404BA8
0059D8A3 |. 8B55 E0 |mov edx,[local.8]
0059D8A6 |. 8D45 E8 |lea eax,[local.6]
0059D8A9 |. E8 EA73E6FF |call My.00404C98
0059D8AE |. 8D45 DC |lea eax,[local.9]
0059D8B1 |. 33D2 |xor edx,edx
0059D8B3 |. 8A55 EF |mov dl,byte ptr ss:[ebp-11]
0059D8B6 |. 83C2 3C |add edx,3C
0059D8B9 |. E8 EA72E6FF |call My.00404BA8
0059D8BE |. 8B55 DC |mov edx,[local.9]
0059D8C1 |. 8D45 E8 |lea eax,[local.6]
0059D8C4 |. E8 CF73E6FF |call My.00404C98
0059D8C9 |. 8345 F0 02 |add [local.4],2
0059D8CD |> 33FF |xor edi,edi
0059D8CF |. C645 EF 00 |mov byte ptr ss:[ebp-11],0
0059D8D3 |. EB 1D |jmp short My.0059D8F2
0059D8D5 |> 8D45 D8 |lea eax,[local.10]
0059D8D8 |. 33D2 |xor edx,edx
0059D8DA |. 8AD3 |mov dl,bl
0059D8DC |. 83C2 3C |add edx,3C
0059D8DF |. E8 C472E6FF |call My.00404BA8 ; System.@LStrFromChar(String;String;Char);
0059D8E4 |. 8B55 D8 |mov edx,[local.10]
0059D8E7 |. 8D45 E8 |lea eax,[local.6]
0059D8EA |. E8 A973E6FF |call My.00404C98 ; System.@LStrCat;
0059D8EF |. FF45 F0 |inc [local.4]
0059D8F2 |> 46 |inc esi ; i=i+1
0059D8F3 |. 3B75 F4 |cmp esi,[local.3] ; i<length(string)
0059D8F6 |.^ 0F8C 2CFFFFFF \jl My.0059D828
0059D8FC |> 85FF test edi,edi
0059D8FE |. 7E 1E jle short My.0059D91E
0059D900 |. 8D45 D4 lea eax,[local.11]
0059D903 |. 33D2 xor edx,edx
0059D905 |. 8A55 EF mov dl,byte ptr ss:[ebp-11]
0059D908 |. 83C2 3C add edx,3C
0059D90B |. E8 9872E6FF call My.00404BA8
0059D910 |. 8B55 D4 mov edx,[local.11]
0059D913 |. 8D45 E8 lea eax,[local.6]
0059D916 |. E8 7D73E6FF call My.00404C98
0059D91B |. FF45 F0 inc [local.4]
0059D91E |> 8D45 E8 lea eax,[local.6]
0059D921 |. 8B55 F0 mov edx,[local.4]
0059D924 |. E8 EB76E6FF call My.00405014 ; System.@LStrSetLength;
0059D929 |. 8B45 F8 mov eax,[local.2]
0059D92C |. 8B55 E8 mov edx,[local.6]
0059D92F |. E8 E870E6FF call My.00404A1C
0059D934 |. 33C0 xor eax,eax
0059D936 |. 5A pop edx
0059D937 |. 59 pop ecx
0059D938 |. 59 pop ecx
0059D939 |. 64:8910 mov dword ptr fs:[eax],edx
0059D93C |. 68 5ED95900 push My.0059D95E
0059D941 |> 8D45 D4 lea eax,[local.11]
0059D944 |. BA 06000000 mov edx,6
0059D949 |. E8 9E70E6FF call My.004049EC
0059D94E |. 8D45 FC lea eax,[local.1]
0059D951 |. E8 7270E6FF call My.004049C8
0059D956 \. C3 retn
0059D957 .^ E9 D469E6FF jmp My.00404330
0059D95C .^ EB E3 jmp short My.0059D941
0059D95E . 5F pop edi
0059D95F . 5E pop esi
0059D960 . 5B pop ebx
0059D961 . 8BE5 mov esp,ebp
0059D963 . 5D pop ebp
0059D964 . C3 retn
0059D968 /$ 55 push ebp ; 解密函数
0059D969 |. 8BEC mov ebp,esp
0059D96B |. 83C4 D8 add esp,-28
0059D96E |. 53 push ebx
0059D96F |. 56 push esi
0059D970 |. 57 push edi
0059D971 |. 33C9 xor ecx,ecx ; 初始化变量
0059D973 |. 894D D8 mov [local.10],ecx ; 0
0059D976 |. 894D DC mov [local.9],ecx ; 0
0059D979 |. 894D E0 mov [local.8],ecx ; 0
0059D97C |. 8955 F8 mov [local.2],edx ; 0
0059D97F |. 8945 FC mov [local.1],eax ; 待解密字符串,记为MwString
0059D982 |. 8B45 FC mov eax,[local.1]
0059D985 |. E8 EE74E6FF call My.00404E78 ; System.@LStrAddRef(void;void):Pointer;
0059D98A |. 33C0 xor eax,eax
0059D98C |. 55 push ebp
0059D98D |. 68 CCDA5900 push My.0059DACC
0059D992 |. 64:FF30 push dword ptr fs:[eax]
0059D995 |. 64:8920 mov dword ptr fs:[eax],esp
0059D998 |. 8B45 F8 mov eax,[local.2]
0059D99B |. E8 2870E6FF call My.004049C8 ; System.@LStrClr(void;void);
0059D9A0 |. 8D45 E0 lea eax,[local.8]
0059D9A3 |. E8 2070E6FF call My.004049C8 ; System.@LStrClr(void;void);
0059D9A8 |. C645 EA FC mov byte ptr ss:[ebp-16],0FC ; $FC Byte类型变量
0059D9AC |. C645 EC F0 mov byte ptr ss:[ebp-14],0F0 ; $F0
0059D9B0 |. C645 EE C0 mov byte ptr ss:[ebp-12],0C0 ; $C0
0059D9B4 |. 33C0 xor eax,eax
0059D9B6 |. 8945 F0 mov [local.4],eax ; 0
0059D9B9 |. C645 E6 00 mov byte ptr ss:[ebp-1A],0 ; 0
0059D9BD |. BB 02000000 mov ebx,2
0059D9C2 |. 33FF xor edi,edi
0059D9C4 |. 33F6 xor esi,esi ; i=0
0059D9C6 |. 8B45 FC mov eax,[local.1] ; MwString
0059D9C9 |. E8 C272E6FF call My.00404C90 ; System.@LStrLen(String):Integer;
0059D9CE |. 8945 F4 mov [local.3],eax ; Length(MwString)
0059D9D1 |. 3B75 F4 cmp esi,[local.3] ; ESI=循环变量i,Length(MwString)
0059D9D4 |. 0F8D B9000000 jge My.0059DA93
0059D9DA |> 8B45 FC /mov eax,[local.1] ; MwString
0059D9DD |. 0FB60430 |movzx eax,byte ptr ds:[eax+esi] ; MwString[i] i=0 to Length(MwString)
0059D9E1 |. 83E8 3C |sub eax,3C ; MwString[i]-$3C
0059D9E4 |. 79 2A |jns short My.0059DA10 ; 符号位为0转移 即MwString[i]>$3C
0059D9E6 |. 8D45 DC |lea eax,[local.9]
0059D9E9 |. 8B55 FC |mov edx,[local.1] ; MwString
0059D9EC |. 8A1432 |mov dl,byte ptr ds:[edx+esi] ; MwString[i]
0059D9EF |. E8 B471E6FF |call My.00404BA8 ; System.@LStrFromChar(String;String;Char);
0059D9F4 |. 8B55 DC |mov edx,[local.9]
0059D9F7 |. 8D45 E0 |lea eax,[local.8]
0059D9FA |. E8 9972E6FF |call My.00404C98 ; System.@LStrCat;
0059D9FF |. FF45 F0 |inc [local.4]
0059DA02 |. 46 |inc esi ; i=i+1
0059DA03 |. C645 E6 00 |mov byte ptr ss:[ebp-1A],0 ; 0
0059DA07 |. BB 02000000 |mov ebx,2
0059DA0C |. 33FF |xor edi,edi
0059DA0E |. EB 7A |jmp short My.0059DA8A
0059DA10 |> 8B45 FC |mov eax,[local.1] ; MwString
0059DA13 |. 8A0430 |mov al,byte ptr ds:[eax+esi] ; MwString[i]
0059DA16 |. 2C 3C |sub al,3C ; MwString[i]-$3C
0059DA18 |. 8845 E7 |mov byte ptr ss:[ebp-19],al ; 保存 MwString[i]-$3C
0059DA1B |. 8B45 F0 |mov eax,[local.4] ; ?
0059DA1E |. 3B45 F4 |cmp eax,[local.3] ; Length(MwString)
0059DA21 |. 7D 70 |jge short My.0059DA93
0059DA23 |. 8D47 06 |lea eax,dword ptr ds:[edi+6] ; edi+6
0059DA26 |. 83F8 08 |cmp eax,8
0059DA29 |. 7C 44 |jl short My.0059DA6F
0059DA2B |. 8A45 E7 |mov al,byte ptr ss:[ebp-19] ; MwString[i]-$3C
0059DA2E |. 24 3F |and al,3F ; (MwString[i]-$3C) And 3F
0059DA30 |. 8BF8 |mov edi,eax
0059DA32 |. 81E7 FF000000 |and edi,0FF ; 去高位
0059DA38 |. B9 06000000 |mov ecx,6
0059DA3D |. 2BCB |sub ecx,ebx
0059DA3F |. D3EF |shr edi,cl
0059DA41 |. 8D45 D8 |lea eax,[local.10]
0059DA44 |. 33D2 |xor edx,edx
0059DA46 |. 8A55 E6 |mov dl,byte ptr ss:[ebp-1A]
0059DA49 |. 0BD7 |or edx,edi
0059DA4B |. E8 5871E6FF |call My.00404BA8 ; System.@LStrFromChar(String;String;Char);
0059DA50 |. 8B55 D8 |mov edx,[local.10]
0059DA53 |. 8D45 E0 |lea eax,[local.8]
0059DA56 |. E8 3D72E6FF |call My.00404C98 ; System.@LStrCat;
0059DA5B |. FF45 F0 |inc [local.4]
0059DA5E |. 33FF |xor edi,edi
0059DA60 |. 83FB 06 |cmp ebx,6
0059DA63 |. 7C 07 |jl short My.0059DA6C
0059DA65 |. BB 02000000 |mov ebx,2
0059DA6A |. EB 1D |jmp short My.0059DA89
0059DA6C |> 83C3 02 |add ebx,2
0059DA6F |> 8BCB |mov ecx,ebx
0059DA71 |. 8A45 E7 |mov al,byte ptr ss:[ebp-19] ; MwString[i]-$3C
0059DA74 |. D2E0 |shl al,cl ; (MwString[i]-$3C) Shr CL
0059DA76 |. 8845 E6 |mov byte ptr ss:[ebp-1A],al ; 保存 (MwString[i]-$3C) Shr CL
0059DA79 |. 8A441D E8 |mov al,byte ptr ss:[ebp+ebx-18] ; 00FC0000
0059DA7D |. 2045 E6 |and byte ptr ss:[ebp-1A],al ; (MwString[i]-$3C) Shr CL And $FC
0059DA80 |. B8 08000000 |mov eax,8
0059DA85 |. 2BC3 |sub eax,ebx
0059DA87 |. 03F8 |add edi,eax
0059DA89 |> 46 |inc esi ; 循环变量 i=i+1
0059DA8A |> 3B75 F4 |cmp esi,[local.3] ; Length(MwString)
0059DA8D |.^ 0F8C 47FFFFFF \jl My.0059D9DA ; i < Length(MwString)
0059DA93 |> 8D45 E0 lea eax,[local.8] ; 解密结束,存放的是解密后的字符串,记为MingWen
0059DA96 |. 8B55 F0 mov edx,[local.4] ; Length(MingWen)
0059DA99 |. E8 7675E6FF call My.00405014 ; System.@LStrSetLength;
0059DA9E |. 8B45 F8 mov eax,[local.2]
0059DAA1 |. 8B55 E0 mov edx,[local.8]
0059DAA4 |. E8 736FE6FF call My.00404A1C ; System.@LStrAsg(void;void;void;void);
0059DAA9 |. 33C0 xor eax,eax
0059DAAB |. 5A pop edx
0059DAAC |. 59 pop ecx
0059DAAD |. 59 pop ecx
0059DAAE |. 64:8910 mov dword ptr fs:[eax],edx
0059DAB1 |. 68 D3DA5900 push My.0059DAD3
0059DAB6 |> 8D45 D8 lea eax,[local.10]
0059DAB9 |. BA 03000000 mov edx,3
0059DABE |. E8 296FE6FF call My.004049EC ; System.@LStrArrayClr(void;void;Integer);
0059DAC3 |. 8D45 FC lea eax,[local.1]
0059DAC6 |. E8 FD6EE6FF call My.004049C8 ; System.@LStrClr(void;void);
0059DACB \. C3 retn
0059DACC .^ E9 5F68E6FF jmp My.00404330
0059DAD1 .^ EB E3 jmp short My.0059DAB6
0059DAD3 . 5F pop edi
0059DAD4 . 5E pop esi
0059DAD5 . 5B pop ebx
0059DAD6 . 8BE5 mov esp,ebp
0059DAD8 . 5D pop ebp
0059DAD9 . C3 retn
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)