Function at 0x59c980
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
push edi
xor ebx, ebx
lea edi, [ecx + 4]
mov dword [ebp - 0xc], ecx
mov ecx, edi
mov dword [ebp - 4], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x1c], ebx
call fcn.004078c0
mov ecx, dword [ebp - 0xc]
cdq
and edx, 3
lea esi, [edx + eax]
add ecx, 0x20
sar esi, 2
mov dword [ebp - 8], esi
mov dword [ebp - 0x18], ecx
call fcn.004078c0
cdq
and edx, 3
add eax, edx
sar eax, 2
mov ecx, edi
mov dword [ebp - 0x14], eax
call fcn.0041b6d0
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x10], eax
call fcn.0041b6d0
xor edi, edi
mov dword [ebp - 0x18], eax
test esi, esi
jle 0x59ca3b
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 0x10]
movzx esi, byte [eax + ecx]
inc eax
cdq
idiv dword [ebp + 0x14]
shl esi, 8
inc edi
movzx ecx, byte [edx + ecx]
lea eax, [edx + 1]
cdq
idiv dword [ebp + 0x14]
mov eax, dword [ebp + 0x10]
or ecx, esi
shl ecx, 8
movzx esi, byte [edx + eax]
lea eax, [edx + 1]
cdq
idiv dword [ebp + 0x14]
or esi, ecx
mov ecx, dword [ebp + 0x10]
shl esi, 8
movzx ecx, byte [edx + ecx]
lea eax, [edx + 1]
cdq
idiv dword [ebp + 0x14]
mov eax, dword [ebp - 0x10]
or ecx, esi
xor dword [eax + edi*4 - 4], ecx
mov dword [ebp - 4], edx
cmp edi, dword [ebp - 8]
jl 0x59c9e3
mov esi, dword [ebp - 8]
mov edi, dword [ebp + 8]
test esi, esi
mov esi, dword [ebp + 0xc]
mov dword [ebp + 0x14], ebx
jle 0x59cafc
lea esp, [esp]
movzx edx, byte [ebx + edi]
mov dword [ebp + 0x10], edx
lea eax, [ebx + 1]
cdq
idiv esi
mov eax, dword [ebp + 0x10]
shl eax, 8
push 0
movzx ecx, byte [edx + edi]
or ecx, eax
lea eax, [edx + 1]
cdq
idiv esi
shl ecx, 8
movzx ebx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
or ebx, ecx
shl ebx, 8
movzx ecx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
or ecx, ebx
xor dword [ebp - 0x20], ecx
movzx ebx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
shl ebx, 8
movzx ecx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
or ecx, ebx
shl ecx, 8
movzx ebx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
or ebx, ecx
shl ebx, 8
movzx ecx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
or ecx, ebx
xor dword [ebp - 0x1c], ecx
mov ecx, dword [ebp - 0xc]
lea eax, [ebp - 0x20]
push eax
mov ebx, edx
call fcn.0059c760
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x20]
mov dword [ecx + eax*4], edx
mov edx, dword [ebp - 0x1c]
mov dword [ecx + eax*4 + 4], edx
add eax, 2
mov dword [ebp + 0x14], eax
cmp eax, dword [ebp - 8]
jl 0x59ca50
cmp dword [ebp - 0x14], 0
mov dword [ebp + 0x14], 0
jle 0x59cbbc
lea ecx, [ecx]
movzx eax, byte [ebx + edi]
mov dword [ebp + 0x10], eax
lea eax, [ebx + 1]
cdq
idiv esi
mov eax, dword [ebp + 0x10]
shl eax, 8
push 0
movzx ecx, byte [edx + edi]
or ecx, eax
lea eax, [edx + 1]
cdq
idiv esi
shl ecx, 8
movzx ebx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
or ebx, ecx
shl ebx, 8
movzx ecx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
or ecx, ebx
xor dword [ebp - 0x20], ecx
movzx ebx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
shl ebx, 8
movzx ecx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
or ecx, ebx
shl ecx, 8
movzx ebx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
or ebx, ecx
shl ebx, 8
movzx ecx, byte [edx + edi]
lea eax, [edx + 1]
cdq
idiv esi
or ecx, ebx
xor dword [ebp - 0x1c], ecx
lea ecx, [ebp - 0x20]
push ecx
mov ecx, dword [ebp - 0xc]
mov ebx, edx
call fcn.0059c760
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x20]
mov dword [ecx + eax*4], edx
mov edx, dword [ebp - 0x1c]
mov dword [ecx + eax*4 + 4], edx
add eax, 2
mov dword [ebp + 0x14], eax
cmp eax, dword [ebp - 0x14]
jl 0x59cb10
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10