Function at 0x1005e500
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0xc
cmp dword [esp + 0x20], 0
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
push esi
push edi
mov edi, eax
mov eax, dword [esp + 0x2c]
mov esi, dword [eax]
mov ebx, ecx
je 0x1005e613
test esi, esi
je 0x1005e544
test ebx, ebx
je 0x1005e544
mov ecx, dword [esp + 0x20]
mov dl, byte [ecx]
xor byte [esi + edi], dl
mov al, byte [esi + edi]
mov byte [ebp], al
inc ecx
inc esi
inc ebp
dec ebx
and esi, 0xf
mov dword [esp + 0x20], ecx
jne 0x1005e524
cmp ebx, 0x10
jb 0x1005e5c4
mov ecx, dword [esp + 0x20]
mov eax, ebp
sub eax, edi
mov dword [esp + 0x30], eax
mov eax, ecx
sub eax, edi
mov dword [esp + 0x10], eax
mov eax, ebx
shr eax, 4
mov dword [esp + 0x14], eax
shl eax, 4
add ebp, eax
add ecx, eax
mov dword [esp + 0x20], ecx
mov eax, dword [esp + 0x28]
push eax
push edi
push edi
call dword [esp + 0x40]
add esp, 0xc
cmp esi, 0x10
jae 0x1005e5ac
mov ecx, 0xf
sub ecx, esi
shr ecx, 2
lea eax, [esi + edi]
inc ecx
mov edx, dword [esp + 0x10]
mov edx, dword [edx + eax]
xor dword [eax], edx
mov edx, dword [eax]
mov esi, dword [esp + 0x30]
mov dword [esi + eax], edx
add eax, 4
sub ecx, 1
jne 0x1005e592
mov eax, 0x10
add dword [esp + 0x30], eax
add dword [esp + 0x10], eax
sub ebx, eax
xor esi, esi
sub dword [esp + 0x14], 1
jne 0x1005e571
test ebx, ebx
je 0x1005e6ff
mov eax, dword [esp + 0x28]
push eax
push edi
push edi
call dword [esp + 0x40]
mov ecx, dword [esp + 0x2c]
sub ebp, edi
add esp, 0xc
lea eax, [esi + edi]
sub ecx, edi
mov dword [esp + 0x30], ebp
add esi, ebx
jmp 0x1005e5f0
movzx edx, byte [eax + ecx]
xor byte [eax], dl
mov dl, byte [eax]
mov edi, dword [esp + 0x30]
dec ebx
mov byte [eax + edi], dl
inc eax
test ebx, ebx
jne 0x1005e5f0
mov eax, dword [esp + 0x2c]
pop edi
mov dword [eax], esi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
test esi, esi
je 0x1005e639
test ebx, ebx
je 0x1005e639
mov ecx, dword [esp + 0x20]
mov dl, byte [esi + edi]
mov al, byte [ecx]
xor dl, al
mov byte [ebp], dl
mov byte [esi + edi], al
inc ecx
inc esi
inc ebp
dec ebx
and esi, 0xf
mov dword [esp + 0x20], ecx
jne 0x1005e617
cmp ebx, 0x10
jb 0x1005e6c2
mov eax, ebp
sub eax, edi
mov dword [esp + 0x30], eax
mov eax, ebx
shr eax, 4
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x28]
push eax
push edi
push edi
call dword [esp + 0x40]
add esp, 0xc
cmp esi, 0x10
jae 0x1005e6a8
mov ecx, dword [esp + 0x20]
sub ecx, ebp
mov dword [esp + 0x10], ecx
mov ecx, 0xf
sub ecx, esi
shr ecx, 2
lea eax, [esi + edi]
inc ecx
mov edi, edi
mov edx, dword [esp + 0x30]
mov esi, dword [esp + 0x10]
add edx, eax
mov esi, dword [edx + esi]
mov dword [esp + 0x14], esi
mov esi, dword [eax]
xor esi, dword [esp + 0x14]
add eax, 4
sub ecx, 1
mov dword [edx], esi
mov edx, dword [esp + 0x14]
mov dword [eax - 4], edx
jne 0x1005e680
mov eax, 0x10
add dword [esp + 0x30], eax
add dword [esp + 0x20], eax
sub ebx, eax
add ebp, eax
xor esi, esi
sub dword [esp + 0x18], 1
jne 0x1005e653
test ebx, ebx
je 0x1005e6ff
mov eax, dword [esp + 0x28]
push eax
push edi
push edi
call dword [esp + 0x40]
mov ecx, dword [esp + 0x2c]
sub ecx, ebp
add esp, 0xc
lea eax, [esi + edi]
sub ebp, edi
mov dword [esp + 0x10], ecx
add esi, ebx
jmp 0x1005e6eb
mov ecx, dword [esp + 0x10]
mov dl, byte [eax]
lea edi, [eax + ebp]
mov cl, byte [edi + ecx]
xor dl, cl
mov byte [edi], dl
dec ebx
mov byte [eax], cl
inc eax
test ebx, ebx
jne 0x1005e6e7
mov eax, dword [esp + 0x2c]
pop edi
mov dword [eax], esi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret