Function at 0x58cfd0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [0x6ce488]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x2c], esi
mov bl, byte [esi]
mov edi, dword [esi + 0x28]
mov eax, dword [esi + 0x2c]
mov byte [ebp - 0x15], bl
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x20], eax
test bl, 0x40
jne 0x58d010
push eax
lea eax, [esi + 0x10]
push eax
push esi
call edi
add esp, 0xc
movzx eax, bl
mov edx, 0xf
and eax, 7
xor ecx, ecx
sub edx, eax
mov byte [esi], al
mov dword [ebp - 0x30], edx
cmp edx, 0xf
jae 0x58d043
nop dword [eax]
movzx eax, byte [esi + edx]
or ecx, eax
mov byte [esi + edx], 0
inc edx
shl ecx, 8
cmp edx, 0xf
jb 0x58d030
movzx eax, byte [esi + 0xf]
or ecx, eax
mov byte [esi + 0xf], 1
mov eax, dword [ebp + 0x14]
cmp ecx, eax
je 0x58d068
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005c358e
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp + 0xc]
cmp eax, 0x10
jb 0x58d0fa
mov edi, 0xfffffff8
sub edi, esi
shr eax, 4
mov dword [ebp - 0x28], eax
push dword [ebp - 0x20]
lea eax, [ebp - 0x14]
push eax
push esi
call dword [ebp - 0x24]
add esp, 0xc
lea eax, [esi + 0x10]
add byte [eax - 1], 1
lea eax, [eax - 1]
jne 0x58d0a2
lea ecx, [edi + eax]
test ecx, ecx
jne 0x58d092
mov ecx, dword [ebx]
mov eax, dword [ebx + 4]
mov edx, dword [ebp - 0x1c]
xor eax, dword [ebp - 0x10]
xor ecx, dword [ebp - 0x14]
push dword [ebp - 0x20]
mov dword [edx + 4], eax
mov dword [edx], ecx
xor dword [esi + 0x14], eax
xor dword [esi + 0x10], ecx
mov ecx, dword [ebx + 8]
mov eax, dword [ebx + 0xc]
xor eax, dword [ebp - 8]
xor ecx, dword [ebp - 0xc]
mov dword [edx + 0xc], eax
mov dword [edx + 8], ecx
xor dword [esi + 0x1c], eax
lea eax, [esi + 0x10]
xor dword [esi + 0x18], ecx
push eax
push eax
call dword [ebp - 0x24]
mov eax, dword [ebp + 0x14]
add esp, 0xc
add dword [ebp - 0x1c], 0x10
sub eax, 0x10
add ebx, 0x10
mov dword [ebp + 0x14], eax
sub dword [ebp - 0x28], 1
jne 0x58d081
mov edi, dword [ebp - 0x24]
test eax, eax
je 0x58d153
push dword [ebp - 0x20]
lea eax, [ebp - 0x14]
push eax
push esi
call edi
mov edi, dword [ebp + 0x14]
add esp, 0xc
xor edx, edx
test edi, edi
je 0x58d140
lea eax, [ebp - 0x14]
sub ebx, eax
sub dword [ebp - 0x1c], eax
lea eax, [esi + 0x10]
mov esi, dword [ebp - 0x1c]
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x14]
add eax, edx
mov cl, byte [ebx + eax]
xor cl, byte [eax]
mov byte [esi + eax], cl
mov eax, dword [ebp - 0x28]
xor byte [eax + edx], cl
inc edx
cmp edx, edi
jb 0x58d125
mov esi, dword [ebp - 0x2c]
mov ebx, dword [ebp - 0x20]
lea eax, [esi + 0x10]
mov edi, dword [ebp - 0x24]
push ebx
push eax
push eax
call edi
add esp, 0xc
jmp 0x58d156
mov ebx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x30]
cmp edx, 0x10
jae 0x58d17b
mov ecx, 0x10
lea edi, [edx + esi]
sub ecx, edx
xor eax, eax
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [ebp - 0x24]
push ebx
lea eax, [ebp - 0x14]
push eax
push esi
call edi
mov eax, dword [ebp - 0x14]
add esp, 0xc
xor dword [esi + 0x10], eax
mov eax, dword [ebp - 0x10]
xor dword [esi + 0x14], eax
mov eax, dword [ebp - 0xc]
xor dword [esi + 0x18], eax
mov eax, dword [ebp - 8]
xor dword [esi + 0x1c], eax
mov al, byte [ebp - 0x15]
mov ecx, dword [ebp - 4]
pop edi
mov byte [esi], al
xor ecx, ebp
pop esi
xor eax, eax
pop ebx
call fcn.005c358e
mov esp, ebp
pop ebp
ret