.text:0805755C .text:0805755C ; =============== S U B R O U T I N E ======================================= .text:0805755C .text:0805755C ; Attributes: bp-based frame .text:0805755C .text:0805755C ; int __cdecl modify_crypt_buffer(void *src, struct struct_crypt_infos *cryptcode_struct) .text:0805755C modify_crypt_buffer proc near ; CODE XREF: modify_crypt_buffer_call+17p .text:0805755C ; modify_crypt_buffer_call+28p .text:0805755C .text:0805755C dst = dword ptr -4 .text:0805755C src = dword ptr 8 .text:0805755C cryptcode_struct= dword ptr 0Ch .text:0805755C .text:0805755C 55 push ebp .text:0805755D 8B EC mov ebp, esp .text:0805755F 51 push ecx .text:08057560 56 push esi .text:08057561 57 push edi .text:08057562 8B 75 0C mov esi, [ebp+cryptcode_struct] ; get length of crypt buffer .text:08057565 BF 40 00 00 00 mov edi, 40h .text:0805756A 8B 06 mov eax, [esi] .text:0805756C 3B F8 cmp edi, eax .text:0805756E 7D 02 jge short loc_8057572 .text:08057570 8B F8 mov edi, eax ; new length. cryptcode_length or 0x40 bytes .text:08057572 .text:08057572 loc_8057572: ; CODE XREF: modify_crypt_buffer+12j .text:08057572 57 push edi ; size .text:08057573 E8 6C 9E 02 00 call allocate_ .text:08057578 59 pop ecx .text:08057579 89 45 FC mov [ebp+dst], eax .text:0805757C 33 C0 xor eax, eax .text:0805757E 8B 55 FC mov edx, [ebp+dst] .text:08057581 3B F8 cmp edi, eax .text:08057583 7E 0F jle short loc_8057594 .text:08057585 .text:08057585 loc_8057585: ; CODE XREF: modify_crypt_buffer+36j .text:08057585 8B CF mov ecx, edi .text:08057587 02 C8 add cl, al .text:08057589 40 inc eax .text:0805758A 80 E1 FF and cl, 0FFh .text:0805758D 88 0A mov [edx], cl .text:0805758F 42 inc edx .text:08057590 3B F8 cmp edi, eax .text:08057592 7F F1 jg short loc_8057585 .text:08057594 .text:08057594 loc_8057594: ; CODE XREF: modify_crypt_buffer+27j .text:08057594 6A 40 push 40h ; len .text:08057596 8B 45 08 mov eax, [ebp+src] .text:08057599 50 push eax ; src .text:0805759A 8B 45 FC mov eax, [ebp+dst] .text:0805759D 50 push eax ; dst .text:0805759E E8 BD 1A FF FF call _memcpy .text:080575A3 83 C4 0C add esp, 0Ch .text:080575A6 33 C0 xor eax, eax .text:080575A8 8B 55 FC mov edx, [ebp+dst] .text:080575AB EB 17 jmp short loc_80575C4 .text:080575AD ; --------------------------------------------------------------------------- .text:080575AD .text:080575AD loc_80575AD: ; CODE XREF: modify_crypt_buffer+6Cj .text:080575AD 8B 4E 08 mov ecx, [esi+8] .text:080575B0 8A 0C 01 mov cl, [ecx+eax] .text:080575B3 00 0A add [edx], cl .text:080575B5 8A 0A mov cl, [edx] .text:080575B7 84 C9 test cl, cl .text:080575B9 75 07 jnz short loc_80575C2 .text:080575BB 8B C8 mov ecx, eax .text:080575BD 80 C1 24 add cl, 24h .text:080575C0 88 0A mov [edx], cl .text:080575C2 .text:080575C2 loc_80575C2: ; CODE XREF: modify_crypt_buffer+5Dj .text:080575C2 40 inc eax .text:080575C3 42 inc edx .text:080575C4 .text:080575C4 loc_80575C4: ; CODE XREF: modify_crypt_buffer+4Fj .text:080575C4 8B 0E mov ecx, [esi] .text:080575C6 3B C1 cmp eax, ecx .text:080575C8 7C E3 jl short loc_80575AD .text:080575CA 8B 46 08 mov eax, [esi+8] .text:080575CD 50 push eax ; ptr .text:080575CE E8 3D 9D 02 00 call free_ .text:080575D3 59 pop ecx .text:080575D4 8B 55 FC mov edx, [ebp+dst] .text:080575D7 89 56 08 mov [esi+8], edx .text:080575DA 89 3E mov [esi], edi .text:080575DC 33 C0 xor eax, eax .text:080575DE 89 46 04 mov [esi+4], eax .text:080575E1 5F pop edi .text:080575E2 5E pop esi .text:080575E3 59 pop ecx .text:080575E4 5D pop ebp .text:080575E5 C3 retn .text:080575E5 modify_crypt_buffer endp .text:080575E5 .text:080575E5 ; ---------------------------------------------------------------------------