Function at 0x520020
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x48
call fcn.0058c590
mov eax, dword [0x6639c4]
xor eax, esp
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x4c]
push ebx
mov ebx, dword [esp + 0x54]
mov dword [esp + 4], eax
test ebx, ebx
je 0x520351
cmp dword [0x66b85c], 0
push ebp
je 0x5200a5
lea eax, [esp + 0x10]
push eax
call fcn.004f5b50
push 0xdf
push str..crypto_randmd_rand.c
push 0x13
push 5
call fcn.004f5d30
lea eax, [esp + 0x24]
push eax
push 0x66bc8c
call fcn.004f5ae0
neg eax
push 0xe1
push str..crypto_randmd_rand.c
sbb ebp, ebp
push 0x13
inc ebp
push 6
mov dword [esp + 0x38], ebp
call fcn.004f5d30
add esp, 0x2c
test ebp, ebp
jne 0x5200c1
jmp 0x5200ab
xor ebp, ebp
mov dword [esp + 0xc], ebp
push 0xe6
push str..crypto_randmd_rand.c
push 0x12
push 9
call fcn.004f5d30
add esp, 0x10
mov ecx, dword [0x66b844]
mov eax, dword [0x66b848]
movups xmm0, xmmword [0x66b864]
push esi
push edi
mov dword [esp + 0x20], eax
mov edi, ecx
mov eax, dword [0x66b84c]
add ecx, ebx
mov dword [esp + 0x24], eax
mov eax, dword [0x66b874]
mov dword [esp + 0x50], eax
mov dword [0x66b844], ecx
movups xmmword [esp + 0x40], xmm0
cmp ecx, 0x3ff
jl 0x52012f
mov eax, 0x7fdff7fd
mov dword [0x66b840], 0x3ff
imul ecx
sub edx, ecx
sar edx, 9
mov eax, edx
shr eax, 0x1f
add eax, edx
imul eax, eax, 0x3ff
add ecx, eax
mov dword [0x66b844], ecx
jmp 0x520145
mov eax, dword [0x66b840]
cmp eax, 0x3ff
jge 0x520145
cmp ecx, eax
cmovg eax, ecx
mov dword [0x66b840], eax
mov eax, 0x66666667
mov ecx, ebx
imul ebx
sar edx, 3
mov esi, edx
shr esi, 0x1f
add esi, edx
lea eax, [esi + esi*4]
shl eax, 2
sub ecx, eax
xor eax, eax
test ecx, ecx
setg al
add eax, esi
add dword [0x66b84c], eax
test ebp, ebp
jne 0x520189
push 0x106
push str..crypto_randmd_rand.c
push 0x12
push 0xa
call fcn.004f5d30
add esp, 0x10
lea eax, [esp + 0x28]
push eax
call fcn.004f94f0
add esp, 4
test ebx, ebx
jle 0x5202b2
lea ecx, [ebx - 1]
mov eax, 0xcccccccd
mul ecx
mov eax, edx
shr eax, 4
inc eax
mov dword [esp + 0x18], eax
mov eax, 0x14
cmp ebx, 0x14
mov esi, ebx
push 0
cmovg esi, eax
call fcn.004f95e0
push eax
lea eax, [esp + 0x30]
push eax
call fcn.004f90d0
push 0x14
lea eax, [esp + 0x50]
push eax
lea eax, [esp + 0x3c]
push eax
call fcn.004f9280
lea ebp, [edi - 0x3ff]
add esp, 0x18
add ebp, esi
test ebp, ebp
jle 0x52021c
mov eax, esi
sub eax, ebp
push eax
lea eax, [edi + 0x66b878]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.004f9280
push ebp
lea eax, [esp + 0x38]
push 0x66b878
push eax
call fcn.004f9280
add esp, 0x18
jmp 0x520231
push esi
lea eax, [edi + 0x66b878]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.004f9280
add esp, 0xc
mov ebp, dword [esp + 0x10]
lea eax, [esp + 0x28]
push esi
push ebp
push eax
call fcn.004f9280
push 8
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x3c]
push eax
call fcn.004f9280
push 0
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x48]
push eax
call fcn.004f9030
inc dword [esp + 0x48]
add ebp, esi
add esp, 0x24
mov dword [esp + 0x10], ebp
xor ecx, ecx
test esi, esi
jle 0x52029b
nop word [eax + eax]
mov al, byte [esp + ecx + 0x40]
xor byte [edi + 0x66b878], al
inc edi
xor eax, eax
cmp edi, 0x3ff
cmovge edi, eax
inc ecx
cmp ecx, esi
jl 0x520280
sub ebx, 0x14
mov eax, 0x14
sub dword [esp + 0x18], 1
jne 0x5201b7
mov ebp, dword [esp + 0x14]
lea eax, [esp + 0x28]
push eax
call fcn.004f9290
add esp, 4
pop edi
pop esi
test ebp, ebp
jne 0x5202db
push 0x137
push str..crypto_randmd_rand.c
push 0x12
push 9
call fcn.004f5d30
add esp, 0x10
movups xmm1, xmmword [0x66b864]
xor ecx, ecx
mov edx, 4
movups xmm0, xmmword [esp + 0x38]
pxor xmm1, xmm0
movups xmmword [0x66b864], xmm1
nop dword [eax]
mov al, byte [esp + ecx + 0x48]
lea ecx, [ecx + 1]
xor byte [ecx + 0x66b873], al
sub edx, 1
jne 0x520300
movsd xmm0, qword [0x5e29d8]
movsd xmm1, qword [0x66b850]
comisd xmm0, xmm1
jbe 0x520336
addsd xmm1, qword [esp + 0x5c]
movsd qword [0x66b850], xmm1
test ebp, ebp
pop ebp
jne 0x520351
push 0x144
push str..crypto_randmd_rand.c
push 0x12
push 0xa
call fcn.004f5d30
add esp, 0x10
mov ecx, dword [esp + 0x48]
pop ebx
xor ecx, esp
call fcn.0058b4aa
add esp, 0x48
ret