Function at 0x58ad30
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe4
push ebx
push esi
xor ebx, ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x1c], 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 0x58b0da
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 0x58b0ab
mov eax, dword [ebp - 4]
call fcn.00406160
mov dword [ebp - 0xc], eax
cmp dword [esi + 8], 2
je 0x58ad96
cmp dword [esi + 0x10], 1
jne 0x58adb8
cmp dword [ebp - 0xc], 0x20
jl 0x58adb8
mov eax, dword [ebp - 0xc]
and eax, 0x8000000f
jns 0x58ada5
dec eax
or eax, 0xfffffff0
inc eax
test eax, eax
jne 0x58adaf
mov byte [ebp - 0xd], 0x10
jmp 0x58add8
mov dl, 0x10
sub dl, al
mov byte [ebp - 0xd], dl
jmp 0x58add8
mov eax, dword [ebp - 0xc]
and eax, 0x8000000f
jns 0x58adc7
dec eax
or eax, 0xfffffff0
inc eax
test eax, eax
jne 0x58add1
mov byte [ebp - 0xd], 0
jmp 0x58add8
mov dl, 0x10
sub dl, al
mov byte [ebp - 0xd], dl
cmp dword [esi + 0xc], 2
jne 0x58adff
xor eax, eax
mov al, byte [ebp - 0xd]
add eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
jmp 0x58ae1f
xor eax, eax
mov al, byte [ebp - 0xd]
add eax, dword [ebp - 0xc]
inc eax
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 - 0x14]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
push 0
lea eax, [ebp - 0x1c]
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
cmp dword [esi + 4], 1
jne 0x58ae85
push 0x10
lea eax, [ebp - 0x1c]
mov ecx, 1
mov edx, dword [0x4fc9c8]
call fcn.0040631c
add esp, 4
cmp dword [esi + 0xc], 2
jne 0x58afd3
xor ebx, ebx
jmp 0x58af46
xor eax, eax
mov edx, dword [ebp - 0x14]
mov cl, byte [ebp - 0xd]
mov byte [edx + eax], cl
inc eax
cmp eax, 0x10
jne 0x58ae98
lea eax, [ebx + 0x10]
cmp eax, dword [ebp - 0xc]
jg 0x58aec8
mov eax, dword [ebp - 0x14]
push eax
push 0
push 0x10
mov ecx, ebx
mov edx, dword [ebp - 4]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
jmp 0x58aee3
mov eax, dword [ebp - 0x14]
push eax
push 0
mov eax, dword [ebp - 0xc]
sub eax, ebx
push eax
mov ecx, ebx
mov edx, dword [ebp - 4]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
cmp dword [esi + 4], 1
jne 0x58af01
test ebx, ebx
jle 0x58af01
xor eax, eax
mov edx, dword [ebp - 0x1c]
mov dl, byte [edx + eax]
mov ecx, dword [ebp - 0x14]
xor byte [ecx + eax], dl
inc eax
cmp eax, 0x10
jne 0x58aeef
lea ecx, [ebp - 0x18]
mov edx, dword [ebp - 0x14]
mov eax, esi
call fcn.00589b6c
cmp dword [esi + 4], 1
jne 0x58af2b
mov eax, dword [ebp - 0x1c]
push eax
push 0
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x18]
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 - 0x18]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
add ebx, 0x10
mov eax, dword [ebp - 8]
mov eax, dword [eax]
call fcn.00406160
cmp ebx, eax
jl 0x58ae96
cmp ebx, 0x10
jne 0x58b0ab
xor eax, eax
mov edx, dword [ebp - 0x14]
mov cl, byte [ebp - 0xd]
mov byte [edx + eax], cl
inc eax
cmp eax, 0x10
jne 0x58af63
cmp dword [esi + 4], 1
jne 0x58af8c
xor eax, eax
mov edx, dword [ebp - 0x1c]
mov dl, byte [edx + eax]
mov ecx, dword [ebp - 0x14]
xor byte [ecx + eax], dl
inc eax
cmp eax, 0x10
jne 0x58af7a
lea ecx, [ebp - 0x18]
mov edx, dword [ebp - 0x14]
mov eax, esi
call fcn.00589b6c
cmp dword [esi + 4], 1
jne 0x58afb6
mov eax, dword [ebp - 0x1c]
push eax
push 0
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x18]
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 - 0x18]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
jmp 0x58b0ab
xor ebx, ebx
cmp ebx, dword [ebp - 0xc]
jge 0x58b095
xor eax, eax
mov edx, dword [ebp - 0x14]
mov byte [edx + eax], 0
inc eax
cmp eax, 0x10
jne 0x58afe0
lea eax, [ebx + 0x10]
cmp eax, dword [ebp - 0xc]
jg 0x58b00e
mov eax, dword [ebp - 0x14]
push eax
push 0
push 0x10
mov ecx, ebx
mov edx, dword [ebp - 4]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
jmp 0x58b029
mov eax, dword [ebp - 0x14]
push eax
push 0
mov eax, dword [ebp - 0xc]
sub eax, ebx
push eax
mov ecx, ebx
mov edx, dword [ebp - 4]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
cmp dword [esi + 4], 1
jne 0x58b047
test ebx, ebx
jle 0x58b047
xor eax, eax
mov edx, dword [ebp - 0x1c]
mov dl, byte [edx + eax]
mov ecx, dword [ebp - 0x14]
xor byte [ecx + eax], dl
inc eax
cmp eax, 0x10
jne 0x58b035
lea ecx, [ebp - 0x18]
mov edx, dword [ebp - 0x14]
mov eax, esi
call fcn.00589b6c
cmp dword [esi + 4], 1
jne 0x58b071
mov eax, dword [ebp - 0x1c]
push eax
push 0
push 0x10
xor ecx, ecx
mov edx, dword [ebp - 0x18]
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 - 0x18]
mov eax, dword [0x4fdb68]
call fcn.004ff5c0
add ebx, 0x10
cmp ebx, dword [ebp - 0xc]
jl 0x58afde
mov eax, dword [ebp - 8]
mov eax, dword [eax]
call fcn.00406160
mov edx, dword [ebp - 8]
mov edx, dword [edx]
mov cl, byte [ebp - 0xd]
inc ecx
mov byte [edx + eax], cl
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x58b0e1
lea eax, [ebp - 0x1c]
mov edx, dword [0x4fc9c8]
mov ecx, 3
call fcn.00405840
lea eax, [ebp - 4]
mov edx, dword [0x4fc9c8]
call fcn.0040643c
ret