项目急需,盼高手解惑!简单的加密函数反汇编
项目需要反汇编一动态链接库的Encode和Decode函数,现将Decode汇编代码贴出(IDA Pro5反汇编),请高手解惑,写成c++的函数,谢谢!
.text:10001390 ; Exported entry 56. ?Decode@Net
.text:10001390 ; Exported entry 58. ?Encode@Net
.text:10001390
.text:10001390 public void __cdecl Net::Decode(unsigned char *, int, unsigned char &)
.text:10001390 void __cdecl Net::Decode(unsigned char *, int, unsigned char &) proc near
.text:10001390
.text:10001390 arg_0 = dword ptr 4
.text:10001390 arg_4 = dword ptr 8
.text:10001390 arg_8 = dword ptr 0Ch
.text:10001390
.text:10001390 mov ecx, [esp+arg_4] ; void __cdecl Net::Decode(unsigned char *, int, unsigned char &)
.text:10001394 test ecx, ecx
.text:10001396 jle short locret_100013B0
.text:10001396
.text:10001398 mov eax, [esp+arg_0]
.text:1000139C push ebx
.text:1000139D push esi
.text:1000139E mov esi, [esp+8+arg_8]
.text:1000139E
.text:100013A2
.text:100013A2 loc_100013A2:
.text:100013A2 mov bl, [eax]
.text:100013A4 mov dl, [esi]
.text:100013A6 xor bl, dl
.text:100013A8 mov [eax], bl
.text:100013AA inc eax
.text:100013AB dec ecx
.text:100013AC jnz short loc_100013A2
.text:100013AC
.text:100013AE pop esi
.text:100013AF pop ebx
.text:100013AF
.text:100013B0
.text:100013B0 locret_100013B0:
.text:100013B0 retn
.text:100013B0
.text:100013B0 void __cdecl Net::Decode(unsigned char *, int, unsigned char &) endp
.text:100013B0