Function at 0x502320
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x1c8
movdqa xmm0, xmmword [0x7d4d70]
mov eax, edx
mov ebx, ecx
lea ecx, [esp + 8]
lea edx, [esp + 0x1c]
movdqu xmmword [esp + 0x1c], xmm0
mov byte [esp + 0x2c], 0
push eax
call fcn.0053abe0
add esp, 4
cmp dword [esp + 8], 0x80000000
je 0x50238b
mov eax, dword [esp + 0x10]
test eax, eax
je 0x50238b
mov ecx, dword [esp + 0xc]
shl eax, 4
add ecx, 0xc
nop word cs:[eax + eax]
nop dword [eax]
mov byte [ecx], 0
add ecx, 0x10
add eax, 0xfffffff0
jne 0x502380
lea ecx, [esp + 8]
mov edx, 1
call fcn.0053d160
mov esi, dword [esp + 8]
cmp esi, 0x80000000
jne 0x5023ae
mov byte [ebx + 0xc], 2
jmp 0x5025d3
mov edx, dword [esp + 0xc]
mov edi, dword [esp + 0x10]
lea ecx, [esp + 0x30]
mov dword [esp + 4], edx
push edi
call fcn.004fc0f0
add esp, 4
cmp dword [esp + 0x30], 0x80000007
mov dword [esp + 0x18], esi
jne 0x5023e6
mov byte [ebx + 0xc], 2
test edi, edi
jne 0x502584
jmp 0x5025ba
test edi, edi
je 0x50256f
mov eax, dword [esp + 4]
cmp edi, 1
mov esi, dword [eax + 8]
je 0x502571
lea ecx, [edi + 0xfffffff]
xor edx, edx
mov eax, ecx
and eax, 0xfffffff
cmp eax, 8
jb 0x50254c
and ecx, 7
mov edx, eax
movd xmm0, esi
mov dword [esp + 0x14], ecx
sub edx, ecx
mov ecx, dword [esp + 4]
pshufd xmm1, xmm0, 0
movdqa xmm0, xmmword [0x7d4550]
movdqa xmm2, xmm1
lea esi, [ecx + 0x88]
mov ecx, edx
nop word cs:[eax + eax]
nop dword [eax]
movd xmm3, dword [esi - 0x40]
movd xmm5, dword [esi - 0x50]
movd xmm4, dword [esi - 0x70]
movd xmm6, dword [esi - 0x20]
movd xmm7, dword [esi - 0x30]
punpckldq xmm5, xmm3
movd xmm3, dword [esi - 0x60]
punpckldq xmm7, xmm6
movdqa xmm6, xmm1
pxor xmm1, xmm0
punpckldq xmm4, xmm3
movd xmm3, dword [esi]
punpcklqdq xmm4, xmm5
movd xmm5, dword [esi - 0x10]
sub esi, 0xffffff80
add ecx, 0xfffffff8
punpckldq xmm5, xmm3
punpcklqdq xmm7, xmm5
movdqa xmm5, xmm4
pxor xmm5, xmm0
pcmpgtd xmm1, xmm5
movdqa xmm5, xmm2
pxor xmm2, xmm0
pand xmm6, xmm1
pandn xmm1, xmm4
por xmm1, xmm6
movdqa xmm6, xmm7
pxor xmm6, xmm0
pcmpgtd xmm2, xmm6
pand xmm5, xmm2
pandn xmm2, xmm7
por xmm2, xmm5
jne 0x502450
movdqa xmm4, xmm2
movdqa xmm3, xmm1
cmp dword [esp + 0x14], 0
pxor xmm4, xmm0
pxor xmm3, xmm0
pcmpgtd xmm3, xmm4
pand xmm1, xmm3
pandn xmm3, xmm2
por xmm3, xmm1
pshufd xmm2, xmm3, 0xee
movdqa xmm1, xmm3
movdqa xmm4, xmm2
pxor xmm1, xmm0
pxor xmm4, xmm0
pcmpgtd xmm1, xmm4
pand xmm3, xmm1
pandn xmm1, xmm2
por xmm1, xmm3
movdqa xmm3, xmm1
pshufd xmm2, xmm1, 0x55
pxor xmm3, xmm0
pxor xmm0, xmm2
pcmpgtd xmm3, xmm0
pand xmm1, xmm3
pandn xmm3, xmm2
por xmm3, xmm1
movd esi, xmm3
je 0x502571
mov ecx, dword [esp + 4]
sub eax, edx
shl edx, 4
lea ecx, [edx + ecx + 0x18]
nop dword [eax]
mov edx, dword [ecx]
cmp esi, edx
cmovbe esi, edx
add ecx, 0x10
dec eax
jne 0x502560
jmp 0x502571
xor esi, esi
lea edx, [esp + 0x30]
mov ecx, ebx
push esi
call fcn.00501940
add esp, 4
test edi, edi
je 0x5025ba
mov eax, dword [esp + 4]
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
lea esi, [eax + 4]
jmp 0x5025a6
add esi, 0x10
dec edi
je 0x5025ba
cmp dword [esi - 4], 0
je 0x5025a0
push dword [esi]
push 0
push dword [0x94bf18]
call ebx
jmp 0x5025a0
cmp dword [esp + 0x18], 0
je 0x5025d3
push dword [esp + 4]
push 0
push dword [0x94bf18]
call dword [sym.imp.kernel32.dll_HeapFree]
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret