Function at 0x520370
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0xd8
call fcn.0053f090
mov eax, dword [0x5ef2a0]
xor eax, esp
mov dword [esp + 0xd4], eax
mov eax, dword [esp + 0xdc]
push ebx
mov ebx, dword [esp + 0xf0]
push ebp
mov ebp, dword [esp + 0xf0]
push esi
mov esi, dword [esp + 0xf0]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x100]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x104]
shr esi, 3
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x108]
mov dword [esp + 0x20], ebp
mov dword [esp + 0x44], ebx
mov dword [esp + 0x54], eax
mov dword [esp + 0x38], 0
mov dword [esp + 0x30], 0
mov dword [esp + 0x2c], 2
push edi
mov edi, dword [esp + 0x110]
mov dword [esp + 0x1c], edi
cmp esi, 0x14
je 0x520411
cmp esi, 0x1c
je 0x520411
cmp esi, 0x20
je 0x520411
xor eax, eax
jmp 0x520b0a
test ebp, ebp
jne 0x520446
cmp esi, 0x14
jne 0x520427
call fcn.004c9550
mov ebp, eax
mov dword [esp + 0x24], ebp
jmp 0x520451
cmp esi, 0x1c
jne 0x520439
call fcn.004c9560
mov ebp, eax
mov dword [esp + 0x24], ebp
jmp 0x520451
call fcn.004c9570
mov ebp, eax
mov dword [esp + 0x24], ebp
jmp 0x520451
push ebp
call fcn.004d9030
add esp, 4
mov esi, eax
mov ecx, dword [esp + 0xf0]
mov eax, 0x200
cmp ecx, eax
cmovb ecx, eax
lea eax, [ecx + 0x3f]
and eax, 0xffffffc0
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x100]
test eax, eax
je 0x520482
xor ecx, ecx
cmp eax, esi
cmovb ebx, ecx
mov dword [esp + 0x48], ebx
cmp eax, esi
cmova eax, esi
mov dword [esp + 0x100], eax
test ebx, ebx
je 0x5204a4
push eax
lea eax, [esp + 0xa8]
push ebx
push eax
call fcn.0053da30
add esp, 0xc
call fcn.00502a80
mov dword [esp + 0x2c], eax
test eax, eax
je 0x520b06
call fcn.004d4de0
mov ebx, eax
mov dword [esp + 0x10], ebx
test ebx, ebx
je 0x520afa
push ebx
call fcn.004d4e60
push ebx
call fcn.004d4d80
push dword [esp + 0x18]
mov ebx, eax
call fcn.004d4d80
push dword [esp + 0x1c]
mov dword [esp + 0x38], eax
call fcn.004d4d80
push dword [esp + 0x20]
mov dword [esp + 0x58], eax
call fcn.004d4d80
push dword [esp + 0x24]
mov dword [esp + 0x38], eax
call fcn.004d4d80
push dword [esp + 0x28]
mov dword [esp + 0x6c], eax
call fcn.004d4d80
push dword [esp + 0x2c]
mov dword [esp + 0x6c], eax
call fcn.004d4d80
push dword [esp + 0x30]
mov dword [esp + 0x3c], eax
call fcn.004d4d80
add esp, 0x24
mov dword [esp + 0x14], eax
test eax, eax
je 0x520ae7
mov eax, dword [esp + 0x38]
dec eax
push eax
call fcn.004d5930
push eax
push dword [esp + 0x1c]
call fcn.004f2fd0
add esp, 0xc
test eax, eax
je 0x520ae7
lea esp, [esp]
push dword [esp + 0x34]
push 0
push edi
call fcn.0051e400
inc dword [esp + 0x40]
add esp, 0xc
test eax, eax
je 0x520ae7
cmp dword [esp + 0x100], 0
je 0x520597
cmp dword [esp + 0x48], 0
je 0x520597
xor edi, edi
mov dword [esp + 0x100], edi
jmp 0x5205b5
lea eax, [esp + 0xa4]
push esi
push eax
call fcn.004d4830
add esp, 8
test eax, eax
jle 0x520ae7
mov edi, 1
push esi
lea eax, [esp + 0xa8]
push eax
lea eax, [esp + 0x8c]
push eax
call fcn.0053da30
push esi
lea eax, [esp + 0xb4]
push eax
lea eax, [esp + 0xd8]
push eax
call fcn.0053da30
lea eax, [esi - 1]
add esp, 0x18
test eax, eax
js 0x5205fc
jmp 0x5205f0
inc byte [esp + eax + 0x84]
jne 0x5205fc
dec eax
jns 0x5205f0
push 0
push ebp
push 0
lea eax, [esp + 0x70]
push eax
lea eax, [esp + 0xb4]
push esi
push eax
call fcn.004cff10
add esp, 0x18
test eax, eax
je 0x520ae7
push 0
push ebp
push 0
lea eax, [esp + 0xd0]
push eax
lea eax, [esp + 0x94]
push esi
push eax
call fcn.004cff10
add esp, 0x18
test eax, eax
je 0x520ae7
xor ecx, ecx
test esi, esi
jle 0x5206c0
cmp esi, 0x20
jb 0x5206a9
mov eax, esi
and eax, 0x8000001f
jns 0x52065e
dec eax
or eax, 0xffffffe0
inc eax
mov edx, esi
sub edx, eax
jmp 0x520670
movdqu xmm0, xmmword [esp + ecx + 0x64]
movdqu xmm1, xmmword [esp + ecx + 0xc4]
pxor xmm1, xmm0
movdqu xmmword [esp + ecx + 0x64], xmm1
movdqu xmm0, xmmword [esp + ecx + 0x74]
movdqu xmm1, xmmword [esp + ecx + 0xd4]
pxor xmm1, xmm0
movdqu xmmword [esp + ecx + 0x74], xmm1
add ecx, 0x20
cmp ecx, edx
jl 0x520670
cmp ecx, esi
jge 0x5206c0
lea ecx, [ecx]
mov al, byte [esp + ecx + 0xc4]
xor byte [esp + ecx + 0x64], al
inc ecx
cmp ecx, esi
jl 0x5206b0
push dword [esp + 0x20]
or byte [esp + 0x68], 0x80
lea eax, [esp + 0x68]
or byte [esp + esi + 0x67], 1
push esi
push eax
call fcn.004d5090
add esp, 0xc
test eax, eax
je 0x520ae7
push dword [esp + 0x1c]
push edi
push dword [esp + 0x18]
push 0x40
push dword [esp + 0x30]
call fcn.0051e670
add esp, 0x14
test eax, eax
jg 0x52070e
jne 0x520ae7
mov edi, dword [esp + 0x1c]
jmp 0x520560
mov ebp, dword [esp + 0x1c]
push 0
push 2
push ebp
call fcn.0051e400
add esp, 0xc
test eax, eax
je 0x520ae7
push 0
push 3
push ebp
call fcn.0051e400
add esp, 0xc
test eax, eax
je 0x520ae7
mov ecx, dword [esp + 0x38]
mov eax, 0xcccccccd
xor edi, edi
mov dword [esp + 0x40], edi
lea ecx, [ecx - 1]
mul ecx
mov ebp, edx
shr ebp, 7
test edi, edi
je 0x520770
push edi
push 0
push dword [esp + 0x24]
call fcn.0051e400
add esp, 0xc
test eax, eax
je 0x520ae7
push 0
push dword [esp + 0x48]
call fcn.004d5890
add esp, 8
xor edi, edi
test ebp, ebp
js 0x520816
lea eax, [esi - 1]
test eax, eax
js 0x52079c
nop
inc byte [esp + eax + 0x84]
jne 0x52079c
dec eax
jns 0x520790
push 0
push dword [esp + 0x28]
lea eax, [esp + 0x6c]
push 0
push eax
lea eax, [esp + 0x94]
push esi
push eax
call fcn.004cff10
add esp, 0x18
test eax, eax
je 0x520ae7
push ebx
lea eax, [esp + 0x68]
push esi
push eax
call fcn.004d5090
add esp, 0xc
test eax, eax
je 0x520ae7
lea eax, [esi*8]
imul eax, edi
push eax
push ebx
push ebx
call fcn.004f2fd0
add esp, 0xc
test eax, eax
je 0x520ae7
mov eax, dword [esp + 0x44]
push ebx
push eax
push eax
call fcn.004f1230
add esp, 0xc
test eax, eax
je 0x520ae7
inc edi
cmp edi, ebp
jle 0x520788
mov eax, dword [esp + 0x38]
mov edi, dword [esp + 0x44]
dec eax
push eax
push edi
call fcn.004d5610
add esp, 8
test eax, eax
je 0x520ae7
push edi
mov edi, dword [esp + 0x54]
push edi
call fcn.004d5460
add esp, 8
test eax, eax
je 0x520ae7
push dword [esp + 0x14]
push edi
push edi
call fcn.004f1230
add esp, 0xc
test eax, eax
je 0x520ae7
push dword [esp + 0x20]
push ebx
call fcn.004f3140
add esp, 8
test eax, eax
je 0x520ae7
push dword [esp + 0x10]
push ebx
push edi
push dword [esp + 0x58]
push 0
call fcn.00506920
add esp, 0x14
test eax, eax
je 0x520ae7
call fcn.004d5930
push eax
push dword [esp + 0x50]
push ebx
call fcn.004f12c0
add esp, 0xc
test eax, eax
je 0x520ae7
push ebx
push edi
mov edi, dword [esp + 0x20]
push edi
call fcn.004f12c0
add esp, 0xc
test eax, eax
je 0x520ae7
push dword [esp + 0x14]
push edi
call fcn.004d5200
add esp, 8
test eax, eax
js 0x5208f4
mov edi, dword [esp + 0x1c]
push edi
push 1
push dword [esp + 0x18]
push 0x40
push dword [esp + 0x28]
call fcn.0051e670
add esp, 0x14
test eax, eax
jg 0x520916
jne 0x520ae7
mov edi, dword [esp + 0x40]
inc edi
mov dword [esp + 0x40], edi
cmp edi, 0x1000
jl 0x520755
mov ebp, dword [esp + 0x24]
mov edi, dword [esp + 0x1c]
jmp 0x520560
push 1
push 2
push edi
call fcn.0051e400
add esp, 0xc
test eax, eax
je 0x520ae7
call fcn.004d5930
push eax
push dword [esp + 0x1c]
push dword [esp + 0x1c]
call fcn.004f12c0
add esp, 0xc
test eax, eax
je 0x520ae7
mov ebp, dword [esp + 0x10]
push ebp
push dword [esp + 0x24]
push dword [esp + 0x1c]
push 0
push ebx
call fcn.00506920
add esp, 0x14
test eax, eax
je 0x520ae7
push 2
push dword [esp + 0x18]
call fcn.004d5890
add esp, 8
test eax, eax
je 0x520ae7
push ebp
push dword [esp + 0x1c]
push dword [esp + 0x34]
call fcn.00502ae0
add esp, 0xc
test eax, eax
je 0x520ae7
push dword [esp + 0x2c]
push ebp
push dword [esp + 0x20]
push ebx
push dword [esp + 0x24]
push dword [esp + 0x3c]
call fcn.00501600
add esp, 0x18
test eax, eax
je 0x520ae7
lea ebx, [ebx]
mov ecx, dword [esp + 0x28]
cmp dword [ecx + 4], 1
jne 0x520a1a
mov eax, dword [ecx]
cmp dword [eax], 1
jne 0x520a1a
cmp dword [ecx + 0xc], 0
jne 0x520a1a
call fcn.004d5930
push eax
mov eax, dword [esp + 0x18]
push eax
push eax
call fcn.004f1230
add esp, 0xc
test eax, eax
je 0x520ae7
push dword [esp + 0x2c]
inc dword [esp + 0x34]
push ebp
push dword [esp + 0x20]
push ebx
push dword [esp + 0x24]
push dword [esp + 0x3c]
call fcn.00501600
add esp, 0x18
test eax, eax
jne 0x5209c0
jmp 0x520ae7
push 1
push 3
push edi
call fcn.0051e400
add esp, 0xc
test eax, eax
je 0x520ae7
mov ebx, dword [esp + 0x60]
mov dword [esp + 0x3c], 1
jmp 0x520a40
mov eax, dword [ebx + 0xc]
test eax, eax
je 0x520a50
push eax
call fcn.004d5570
add esp, 4
mov eax, dword [ebx + 0x10]
test eax, eax
je 0x520a60
push eax
call fcn.004d5570
add esp, 4
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x520a70
push eax
call fcn.004d5570
add esp, 4
push dword [esp + 0x18]
call fcn.004d5530
push dword [esp + 0x24]
mov dword [ebx + 0xc], eax
call fcn.004d5530
push dword [esp + 0x30]
mov dword [ebx + 0x10], eax
call fcn.004d5530
add esp, 0xc
mov dword [ebx + 0x14], eax
cmp dword [ebx + 0xc], 0
je 0x520adf
cmp dword [ebx + 0x10], 0
je 0x520adf
test eax, eax
je 0x520adf
mov ecx, dword [esp + 0x5c]
test ecx, ecx
je 0x520ab5
mov eax, dword [esp + 0x40]
mov dword [ecx], eax
mov ecx, dword [esp + 0x58]
test ecx, ecx
je 0x520ac3
mov eax, dword [esp + 0x30]
mov dword [ecx], eax
mov eax, dword [esp + 0x54]
test eax, eax
je 0x520ae7
push esi
lea ecx, [esp + 0xa8]
push ecx
push eax
call fcn.0053da30
add esp, 0xc
jmp 0x520ae7
mov dword [esp + 0x3c], 0
mov ebx, dword [esp + 0x10]
push ebx
call fcn.004d4d10
push ebx
call fcn.004d4d50
add esp, 8
push dword [esp + 0x2c]
call fcn.00502a40
add esp, 4
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0xe4]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0053d5c4
add esp, 0xd8
ret