Function at 0x585390
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x38
call fcn.00490990
push ebx
mov ebx, dword [esp + 0x4c]
push esi
push ebx
mov dword [esp + 0x38], 0
call fcn.0053a360
push ebx
call fcn.0053a3f0
mov esi, eax
add esp, 8
mov dword [esp + 0xc], esi
test esi, esi
je 0x585726
push ebx
call fcn.0053a3f0
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
je 0x585726
push ebp
push ebx
call fcn.0053a3f0
mov ebp, eax
add esp, 4
mov dword [esp + 0x20], ebp
test ebp, ebp
je 0x585725
push ebx
call fcn.0053a3f0
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
je 0x585725
mov eax, dword [esp + 0x4c]
push edi
mov edi, dword [esp + 0x54]
push edi
push eax
push ebp
call fcn.00585010
add esp, 0xc
test eax, eax
je 0x585724
cmp dword [ebp + 4], 0
je 0x585724
mov ecx, dword [esp + 0x18]
push edi
push ecx
call fcn.005021a0
add esp, 8
test eax, eax
je 0x585724
push ebp
call fcn.00501f20
mov edx, dword [esp + 0x1c]
push edx
mov dword [esp + 0x18], eax
call fcn.00501f20
mov ebx, dword [edi + 4]
add esp, 8
cmp ebx, dword [ebp + 8]
mov dword [esp + 0x38], eax
mov dword [esp + 0x20], ebx
jg 0x58546e
mov eax, ebp
jmp 0x585478
push ebx
push ebp
call fcn.00502160
add esp, 8
test eax, eax
je 0x585720
mov eax, dword [esp + 0x24]
mov eax, dword [eax + 4]
cmp eax, ebx
mov ebp, dword [ebp]
mov dword [esp + 0x2c], ebp
jge 0x58549e
mov ecx, ebx
lea edi, [ebp + eax*4]
sub ecx, eax
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x24]
mov dword [ecx + 4], ebx
cmp ebx, dword [esi + 8]
jg 0x5854ae
mov eax, esi
jmp 0x5854b8
push ebx
push esi
call fcn.00502160
add esp, 8
test eax, eax
je 0x585720
cmp ebx, 1
mov edi, dword [esi]
mov dword [esp + 0x1c], edi
mov dword [edi], 1
jle 0x5854db
add edi, 4
lea ecx, [ebx - 1]
xor eax, eax
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x28]
mov dword [esi + 4], ebx
cmp ebx, dword [edi + 8]
jg 0x5854eb
mov eax, edi
jmp 0x5854f5
push ebx
push edi
call fcn.00502160
add esp, 8
test eax, eax
je 0x585720
mov edi, dword [edi]
mov dword [esp + 0x34], edi
test ebx, ebx
jle 0x58550d
mov ecx, ebx
xor eax, eax
rep stosd dword es:[edi], eax
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x18]
mov dword [edx + 4], ebx
mov ecx, dword [eax]
mov dword [esp + 0x30], ecx
mov edi, edi
cmp dword [esp + 0x10], 0
je 0x5855ef
jmp 0x585530
mov eax, dword [ebp]
test al, 1
jne 0x5855ef
mov edx, dword [esp + 0x1c]
mov edx, dword [edx]
mov edi, eax
mov eax, dword [esp + 0x54]
mov ecx, dword [eax]
mov eax, dword [ecx]
mov ebx, edx
and ebx, 1
neg ebx
and eax, ebx
xor edx, eax
mov eax, dword [esp + 0x20]
dec eax
xor esi, esi
test eax, eax
jle 0x5855cd
mov eax, dword [esp + 0x1c]
sub ebp, eax
mov dword [esp + 0x40], ebp
mov ebp, 0xfffffffc
sub ebp, eax
lea ecx, [eax + 4]
mov dword [esp + 0x44], ebp
lea esp, [esp]
mov eax, dword [esp + 0x40]
mov eax, dword [eax + ecx]
mov ebp, eax
shl ebp, 0x1f
shr edi, 1
or ebp, edi
mov edi, dword [esp + 0x2c]
mov dword [edi + esi*4], ebp
mov ebp, dword [esp + 0x54]
mov ebp, dword [ebp]
mov edi, eax
mov eax, dword [esp + 0x44]
add eax, ecx
mov eax, dword [eax + ebp + 4]
and eax, ebx
xor eax, dword [ecx]
shr edx, 1
mov ebp, eax
shl ebp, 0x1f
or ebp, edx
mov edx, eax
mov eax, dword [esp + 0x20]
mov dword [ecx - 4], ebp
inc esi
dec eax
add ecx, 4
cmp esi, eax
jl 0x585580
mov ebp, dword [esp + 0x2c]
mov ecx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x20]
shr edi, 1
shr edx, 1
sub dword [esp + 0x10], 1
mov dword [ebp + esi*4], edi
mov dword [ecx + esi*4], edx
mov esi, dword [esp + 0x14]
jne 0x585530
mov edx, dword [esp + 0x10]
cmp edx, 0x20
jg 0x58560c
mov eax, dword [ebp]
test eax, eax
je 0x585720
cmp eax, 1
je 0x5856db
mov ecx, dword [esp + 0x38]
cmp edx, ecx
jge 0x58565c
mov ebp, dword [esp + 0x30]
mov eax, edx
mov edx, dword [esp + 0x18]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x24], edx
mov edx, dword [esp + 0x28]
mov dword [esp + 0x18], eax
mov eax, dword [eax]
mov dword [esp + 0x10], ecx
mov ecx, esi
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x34]
mov esi, dword [esp + 0x14]
mov dword [esp + 0x30], eax
mov eax, dword [ecx]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x1c], edx
mov dword [esp + 0x34], eax
test ebx, ebx
jle 0x585691
mov edx, dword [esp + 0x30]
mov esi, dword [esp + 0x34]
mov ecx, dword [esp + 0x1c]
sub edx, ebp
sub esi, ebp
mov eax, ebp
sub ecx, ebp
mov edi, ebx
mov ebx, dword [edx + eax]
xor dword [eax], ebx
mov ebx, dword [esi + eax]
xor dword [ecx + eax], ebx
add eax, 4
sub edi, 1
jne 0x585676
mov ebx, dword [esp + 0x20]
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x38]
jne 0x585520
dec eax
cdq
and edx, 0x1f
add eax, edx
mov esi, eax
sar esi, 5
mov eax, dword [ebp + esi*4]
test eax, eax
jne 0x5856c0
test esi, esi
je 0x5856c0
mov eax, dword [ebp + esi*4 - 4]
dec esi
test eax, eax
je 0x5856b3
push eax
call fcn.00501e90
shl esi, 5
add esp, 4
add eax, esi
mov esi, dword [esp + 0x14]
mov dword [esp + 0x10], eax
jmp 0x585520
mov eax, dword [esi + 4]
test eax, eax
jle 0x5856f9
mov ecx, dword [esi]
lea ecx, [ecx + eax*4 - 4]
mov edx, dword [ecx]
sub ecx, 4
test edx, edx
jne 0x5856f6
dec eax
test eax, eax
jg 0x5856e8
mov dword [esi + 4], eax
cmp dword [esi + 4], 0
jne 0x585706
mov dword [esi + 0xc], 0
mov eax, dword [esp + 0x4c]
push esi
push eax
call fcn.005021a0
add esp, 8
test eax, eax
je 0x585720
mov dword [esp + 0x3c], 1
mov ebx, dword [esp + 0x58]
pop edi
pop ebp
push ebx
call fcn.0053a3b0
mov eax, dword [esp + 0x38]
add esp, 4
pop esi
pop ebx
add esp, 0x38
ret