Function at 0x59d650
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
push eax
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x20]
mov ebx, dword [esp + 0x1c]
mov ebp, dword [esp + 0x18]
mov edi, dword [ecx]
test edi, edi
je 0x59d69d
test eax, eax
je 0x59d69d
nop word cs:[eax + eax]
movzx ecx, byte [edx + edi]
xor cl, byte [ebp]
inc ebp
mov byte [ebx], cl
inc ebx
lea ecx, [eax - 1]
inc edi
and edi, 0xf
je 0x59d69f
cmp eax, 1
mov eax, ecx
jne 0x59d680
jmp 0x59d69f
mov ecx, eax
mov edx, dword [esp + 0x34]
mov esi, dword [esp + 0x28]
mov eax, dword [esp + 0x24]
cmp ecx, 0x10
jb 0x59d7d2
nop word cs:[eax + eax]
mov dword [esp], ecx
push eax
mov eax, dword [esp + 0x30]
push eax
push esi
mov edi, esi
mov esi, ebp
mov ebp, ebx
mov ebx, edx
call edx
mov edx, ebx
mov ebx, ebp
mov ebp, esi
mov esi, edi
add esp, 0xc
movzx eax, byte [edi + 0xf]
inc eax
mov byte [edi + 0xf], al
shr eax, 8
movzx ecx, byte [edi + 0xe]
add ecx, eax
mov byte [edi + 0xe], cl
shr ecx, 8
movzx eax, byte [edi + 0xd]
add eax, ecx
mov byte [edi + 0xd], al
shr eax, 8
movzx ecx, byte [edi + 0xc]
add ecx, eax
mov byte [edi + 0xc], cl
shr ecx, 8
movzx eax, byte [edi + 0xb]
add eax, ecx
mov byte [edi + 0xb], al
shr eax, 8
movzx ecx, byte [edi + 0xa]
add ecx, eax
mov byte [edi + 0xa], cl
shr ecx, 8
movzx eax, byte [edi + 9]
add eax, ecx
mov byte [edi + 9], al
shr eax, 8
movzx ecx, byte [edi + 8]
add ecx, eax
mov byte [edi + 8], cl
shr ecx, 8
movzx eax, byte [edi + 7]
add eax, ecx
mov byte [edi + 7], al
shr eax, 8
movzx ecx, byte [edi + 6]
add ecx, eax
mov byte [edi + 6], cl
shr ecx, 8
movzx eax, byte [edi + 5]
add eax, ecx
mov byte [edi + 5], al
shr eax, 8
movzx ecx, byte [edi + 4]
add ecx, eax
mov byte [edi + 4], cl
shr ecx, 8
movzx eax, byte [edi + 3]
add eax, ecx
mov byte [edi + 3], al
shr eax, 8
movzx ecx, byte [edi + 2]
add ecx, eax
mov byte [edi + 2], cl
shr ecx, 8
movzx eax, byte [edi + 1]
add eax, ecx
mov ecx, dword [esp]
mov byte [edi + 1], al
add byte [edi], ah
mov edi, dword [esp + 0x2c]
mov eax, dword [edi]
xor eax, dword [ebp]
mov dword [ebx], eax
mov eax, dword [edi + 4]
xor eax, dword [ebp + 4]
mov dword [ebx + 4], eax
mov eax, dword [edi + 8]
xor eax, dword [ebp + 8]
mov dword [ebx + 8], eax
mov eax, dword [edi + 0xc]
xor eax, dword [ebp + 0xc]
mov dword [ebx + 0xc], eax
mov eax, dword [esp + 0x24]
add ecx, 0xfffffff0
add ebx, 0x10
add ebp, 0x10
cmp ecx, 0xf
ja 0x59d6c0
xor edi, edi
test ecx, ecx
je 0x59d8b2
push eax
mov eax, dword [esp + 0x30]
push eax
push esi
mov dword [esp + 0xc], ecx
call edx
mov edx, dword [esp + 0xc]
add esp, 0xc
movzx eax, byte [esi + 0xf]
inc eax
mov byte [esi + 0xf], al
shr eax, 8
movzx ecx, byte [esi + 0xe]
add ecx, eax
mov byte [esi + 0xe], cl
shr ecx, 8
movzx eax, byte [esi + 0xd]
add eax, ecx
mov byte [esi + 0xd], al
shr eax, 8
movzx ecx, byte [esi + 0xc]
add ecx, eax
mov byte [esi + 0xc], cl
shr ecx, 8
movzx eax, byte [esi + 0xb]
add eax, ecx
mov byte [esi + 0xb], al
shr eax, 8
movzx ecx, byte [esi + 0xa]
add ecx, eax
mov byte [esi + 0xa], cl
shr ecx, 8
movzx eax, byte [esi + 9]
add eax, ecx
mov byte [esi + 9], al
shr eax, 8
movzx ecx, byte [esi + 8]
add ecx, eax
mov byte [esi + 8], cl
shr ecx, 8
movzx eax, byte [esi + 7]
add eax, ecx
mov byte [esi + 7], al
shr eax, 8
movzx ecx, byte [esi + 6]
add ecx, eax
mov byte [esi + 6], cl
shr ecx, 8
movzx eax, byte [esi + 5]
add eax, ecx
mov byte [esi + 5], al
shr eax, 8
movzx ecx, byte [esi + 4]
add ecx, eax
mov byte [esi + 4], cl
shr ecx, 8
movzx eax, byte [esi + 3]
add eax, ecx
mov byte [esi + 3], al
shr eax, 8
movzx ecx, byte [esi + 2]
add ecx, eax
mov byte [esi + 2], cl
shr ecx, 8
movzx eax, byte [esi + 1]
add eax, ecx
mov byte [esi + 1], al
add byte [esi], ah
test dl, 1
jne 0x59d8b6
mov eax, edx
mov esi, dword [esp + 0x2c]
cmp edx, 1
jne 0x59d8d0
jmp 0x59d8f2
mov ecx, edi
jmp 0x59d8f2
mov esi, dword [esp + 0x2c]
movzx ecx, byte [esi + edi]
xor cl, byte [ebp + edi]
lea eax, [edx - 1]
mov byte [ebx + edi], cl
inc edi
mov ecx, edi
cmp edx, 1
je 0x59d8f2
movzx ecx, byte [esi + edi]
xor cl, byte [ebp + edi]
mov byte [ebx + edi], cl
movzx edx, byte [esi + edi + 1]
xor dl, byte [ebp + edi + 1]
lea ecx, [edi + 2]
mov byte [ebx + edi + 1], dl
mov edi, ecx
add eax, 0xfffffffe
jne 0x59d8d0
mov eax, dword [esp + 0x30]
mov dword [eax], ecx
add esp, 4
pop esi
pop edi
pop ebx
pop ebp
ret