Function at 0x58a96c
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe8
push ebx
push esi
xor ebx, ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 8], ecx
mov dword [ebp - 4], edx
mov esi, eax
mov eax, dword [ebp - 4]
call fcn.004064a0
xor eax, eax
push ebp
push 0x58ad15
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 8]
mov edx, dword [0x4fc9c8]
call fcn.0040643c
cmp dword [ebp - 4], 0
je 0x58ace6
mov eax, dword [ebp - 4]
call fcn.00406160
mov dword [ebp - 0xc], eax
cmp dword [esi + 0xc], 2
jne 0x58ab4b
mov eax, dword [ebp - 0xc]
and eax, 0x8000000f
jns 0x58a9d9
dec eax
or eax, 0xfffffff0
inc eax
test eax, eax
je 0x58a9f3
mov ecx, 0x58ad2c
mov dl, 1
mov eax, dword [0x40880c]
call fcn.0040e18c
call fcn.00404404
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
push 0x10
lea eax, [ebp - 0x10]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
push 0
lea eax, [ebp - 0x18]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
push 0
lea eax, [ebp - 0x14]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
cmp dword [esi + 4], 1
jne 0x58aa82
push 0x10
lea eax, [ebp - 0x18]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
xor eax, eax
mov edx, dword [ebp - 0x18]
mov byte [edx + eax], 0
inc eax
cmp eax, 0x10
jne 0x58aa75
xor ebx, ebx
cmp ebx, dword [ebp - 0xc]
jge 0x58ab02
mov eax, dword [ebp - 0x10]
push eax
push 0
push 0x10
mov ecx, ebx
mov edx, dword [ebp - 4]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
lea ecx, [ebp - 0x14]
mov edx, dword [ebp - 0x10]
mov eax, esi
call fcn.0058a2a0
cmp dword [esi + 4], 1
jne 0x58aae2
test ebx, ebx
jle 0x58aacb
xor eax, eax
mov edx, dword [ebp - 0x18]
mov dl, byte [edx + eax]
mov ecx, dword [ebp - 0x14]
xor byte [ecx + eax], dl
inc eax
cmp eax, 0x10
jne 0x58aab9
mov eax, dword [ebp - 0x18]
push eax
push 0
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x10]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
mov eax, dword [ebp - 8]
mov eax, dword [eax]
push eax
push ebx
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x14]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
add ebx, 0x10
cmp ebx, dword [ebp - 0xc]
jl 0x58aa89
cmp dword [esi + 0x10], 1
je 0x58ace6
mov eax, dword [ebp - 8]
mov eax, dword [eax]
call fcn.00406160
mov edx, dword [ebp - 8]
mov edx, dword [edx]
mov bl, byte [edx + eax - 1]
cmp bl, 0x10
jbe 0x58ab26
mov bl, 1
xor eax, eax
mov al, bl
mov edx, dword [ebp - 0xc]
sub edx, eax
push edx
mov eax, dword [ebp - 8]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
jmp 0x58ace6
mov eax, dword [ebp - 0xc]
dec eax
and eax, 0x8000000f
jns 0x58ab5b
dec eax
or eax, 0xfffffff0
inc eax
test eax, eax
je 0x58ab75
mov ecx, 0x58ad2c
mov dl, 1
mov eax, dword [0x40880c]
call fcn.0040e18c
call fcn.00404404
mov eax, dword [ebp - 4]
mov edx, dword [ebp - 0xc]
mov bl, byte [eax + edx - 1]
cmp bl, 0x10
jbe 0x58ab9a
mov ecx, 0x58ad2c
mov dl, 1
mov eax, dword [0x40880c]
call fcn.0040e18c
call fcn.00404404
xor eax, eax
mov al, bl
mov edx, dword [ebp - 0xc]
sub edx, eax
push edx
mov eax, dword [ebp - 8]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
push 0x10
lea eax, [ebp - 0x10]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
push 0
lea eax, [ebp - 0x18]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
push 0
lea eax, [ebp - 0x14]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
cmp dword [esi + 4], 1
jne 0x58ac2f
push 0x10
lea eax, [ebp - 0x18]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
xor eax, eax
mov edx, dword [ebp - 0x18]
mov byte [edx + eax], 0
inc eax
cmp eax, 0x10
jne 0x58ac22
xor ebx, ebx
jmp 0x58acda
mov eax, dword [ebp - 0x10]
push eax
push 0
push 0x10
mov ecx, ebx
mov edx, dword [ebp - 4]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
lea ecx, [ebp - 0x14]
mov edx, dword [ebp - 0x10]
mov eax, esi
call fcn.0058a2a0
cmp dword [esi + 4], 1
jne 0x58ac8f
test ebx, ebx
jle 0x58ac78
xor eax, eax
mov edx, dword [ebp - 0x18]
mov dl, byte [edx + eax]
mov ecx, dword [ebp - 0x14]
xor byte [ecx + eax], dl
inc eax
cmp eax, 0x10
jne 0x58ac66
mov eax, dword [ebp - 0x18]
push eax
push 0
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x10]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
mov eax, dword [ebp - 0xc]
dec eax
sub eax, 0x10
cmp ebx, eax
jne 0x58acbf
mov eax, dword [ebp - 8]
mov eax, dword [eax]
push eax
push ebx
mov eax, dword [ebp - 8]
mov eax, dword [eax]
call fcn.00406160
sub eax, ebx
push eax
xor ecx, ecx
mov edx, dword [ebp - 0x14]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
jmp 0x58acd7
mov eax, dword [ebp - 8]
mov eax, dword [eax]
push eax
push ebx
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x14]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
add ebx, 0x10
mov eax, dword [ebp - 0xc]
dec eax
cmp ebx, eax
jl 0x58ac36
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x58ad1c
lea eax, [ebp - 0x18]
mov edx, dword [0x4fc9c8]
mov ecx, 3
call fcn.00405840
lea eax, [ebp - 4]
mov edx, dword [0x4fc9c8]
call fcn.0040643c
ret