Function at 0x501870
Capabilities:
Encode data using xor

Disassembly:
push 0xffffffffffffffff
push 0x5aa379
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push ebp
push esi
push edi
mov eax, dword [0x628d00]
xor eax, esp
push eax
lea eax, [esp + 0x28]
mov dword fs:[0], eax
mov ebp, ecx
mov ebx, dword [esp + 0x3c]
xor esi, esi
mov dword [esp + 0x14], esi
mov eax, dword [ebx + 4]
mov ecx, dword [ebp + 4]
cmp eax, ecx
jb 0x50199c
shl eax, 5
lea edi, [eax + 0x1f]
shr edi, 5
push edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x24], edi
call fcn.004956b0
add esp, 4
cmp edi, esi
je 0x5018e1
lea eax, [edi*4]
push eax
call fcn.004932e0
add esp, 4
mov esi, eax
mov dword [esp + 0x24], esi
test edi, edi
je 0x5018fd
lea ecx, [edi - 1]
mov dword [esi], 0
test ecx, ecx
je 0x5018fd
lea edi, [esi + 4]
xor eax, eax
rep stosd dword es:[edi], eax
mov edi, dword [ebp + 4]
mov ecx, dword [ebx + 8]
mov eax, dword [ebp + 8]
mov dword [esp + 0x30], 1
test edi, edi
je 0x50192b
mov edx, esi
sub ecx, eax
sub edx, eax
mov ebx, dword [ecx + eax]
xor ebx, dword [eax]
add eax, 4
dec edi
mov dword [edx + eax - 4], ebx
jne 0x501918
mov ebx, dword [esp + 0x3c]
mov eax, dword [ebp + 4]
mov edx, dword [ebx + 8]
mov ecx, dword [ebx + 4]
lea edx, [edx + eax*4]
lea edi, [esi + eax*4]
cmp edi, edx
je 0x50194f
sub ecx, eax
add ecx, ecx
add ecx, ecx
push ecx
push edx
push edi
call fcn.00530fb0
add esp, 0xc
mov ebp, dword [esp + 0x18]
mov ebx, dword [esp + 0x38]
push ebp
mov dword [ebx + 4], ebp
call fcn.004956b0
add esp, 4
test ebp, ebp
jne 0x50196b
xor eax, eax
jmp 0x50197b
lea ecx, [ebp*4]
push ecx
call fcn.004932e0
add esp, 4
mov ecx, dword [ebx + 4]
mov dword [ebx + 8], eax
cmp eax, esi
je 0x501997
lea edx, [ecx*4]
push edx
push esi
push eax
call fcn.00530fb0
add esp, 0xc
jmp 0x501a83
shl ecx, 5
lea edi, [ecx + 0x1f]
shr edi, 5
push edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x24], edi
call fcn.004956b0
add esp, 4
cmp edi, esi
je 0x5019cc
lea eax, [edi*4]
push eax
call fcn.004932e0
add esp, 4
mov esi, eax
mov dword [esp + 0x24], esi
test edi, edi
je 0x5019e8
lea ecx, [edi - 1]
mov dword [esi], 0
test ecx, ecx
je 0x5019e8
lea edi, [esi + 4]
xor eax, eax
rep stosd dword es:[edi], eax
mov edi, dword [ebx + 4]
mov ecx, dword [ebx + 8]
mov eax, dword [ebp + 8]
mov dword [esp + 0x30], 2
test edi, edi
je 0x501a16
mov edx, esi
sub ecx, eax
sub edx, eax
mov ebx, dword [ecx + eax]
xor ebx, dword [eax]
add eax, 4
dec edi
mov dword [edx + eax - 4], ebx
jne 0x501a03
mov ebx, dword [esp + 0x3c]
mov ecx, dword [ebp + 4]
mov eax, dword [ebx + 4]
mov ebp, dword [ebp + 8]
lea edx, [ebp + eax*4]
lea edi, [esi + eax*4]
cmp edi, edx
je 0x501a3b
sub ecx, eax
add ecx, ecx
add ecx, ecx
push ecx
push edx
push edi
call fcn.00530fb0
add esp, 0xc
mov ebp, dword [esp + 0x18]
mov ebx, dword [esp + 0x38]
push ebp
mov dword [ebx + 4], ebp
call fcn.004956b0
add esp, 4
test ebp, ebp
jne 0x501a57
xor eax, eax
jmp 0x501a67
lea ecx, [ebp*4]
push ecx
call fcn.004932e0
add esp, 4
mov ecx, dword [ebx + 4]
mov dword [ebx + 8], eax
cmp eax, esi
je 0x501a83
lea edx, [ecx*4]
push edx
push esi
push eax
call fcn.00530fb0
add esp, 0xc
xor eax, eax
mov ecx, ebp
mov edi, esi
push esi
mov dword [esp + 0x18], 1
mov byte [esp + 0x34], al
rep stosd dword es:[edi], eax
call fcn.00493190
mov eax, ebx
add esp, 4
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 8