Function at 0x506510
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x1f8
call fcn.004c3410
mov eax, dword [0x5f4760]
xor eax, esp
mov dword [esp + 0x1f4], eax
mov eax, dword [esp + 0x204]
push ebx
push ebp
mov ebp, dword [esp + 0x220]
push esi
mov esi, dword [esp + 0x208]
push edi
mov edi, dword [esp + 0x220]
push edi
mov dword [esp + 0x24], eax
mov dword [esp + 0x1c], 1
call fcn.004df260
mov ebx, eax
add esp, 4
mov dword [esp + 0x1c], ebx
test ebx, ebx
jl 0x5065d2
lea ecx, [esp + 0xf4]
push ecx
call fcn.0053ced0
mov edx, dword [esp + 0x228]
add esp, 4
mov dword [esp + 0x14], edx
test esi, esi
jne 0x50658a
xor eax, eax
jmp 0x5065a9
mov eax, dword [esp + 0x210]
cmp eax, 0xffffffff
jne 0x5065a9
mov eax, esi
lea edx, [eax + 1]
jmp 0x5065a0
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x5065a0
sub eax, edx
push 0
push edi
push eax
lea eax, [esp + 0x100]
push esi
push eax
call fcn.0053cbe0
add esp, 0x14
test eax, eax
jne 0x5065d6
lea ecx, [esp + 0xf4]
push ecx
call fcn.0053cf70
add esp, 4
xor eax, eax
jmp 0x5065f5
cmp dword [esp + 0x224], 0
jne 0x506614
lea eax, [esp + 0xf4]
push eax
call fcn.0053cf70
add esp, 4
mov eax, 1
mov ecx, dword [esp + 0x204]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004a314d
add esp, 0x1f8
ret
mov ebx, dword [esp + 0x1c]
mov edi, dword [esp + 0x14]
cmp edi, ebx
jle 0x50661e
mov edi, ebx
mov eax, dword [esp + 0x18]
mov edx, eax
shr edx, 0x18
mov ecx, eax
mov byte [esp + 0x10], dl
shr ecx, 0x10
mov edx, eax
mov byte [esp + 0x13], al
lea eax, [esp + 0xf4]
mov byte [esp + 0x11], cl
push eax
lea ecx, [esp + 0x28]
shr edx, 8
push ecx
mov byte [esp + 0x1a], dl
call fcn.0053cf00
add esp, 8
test eax, eax
je 0x50679e
mov edx, dword [esp + 0x218]
mov eax, dword [esp + 0x20]
push edx
push eax
lea ecx, [esp + 0x2c]
push ecx
call fcn.0053ce00
add esp, 0xc
test eax, eax
je 0x5067d6
push 4
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x2c]
push eax
call fcn.0053ce00
add esp, 0xc
test eax, eax
je 0x5067d6
push 0
lea ecx, [esp + 0x1c8]
push ecx
lea edx, [esp + 0x2c]
push edx
call fcn.0053ce20
add esp, 0xc
test eax, eax
je 0x5067d6
lea eax, [esp + 0x24]
push eax
call fcn.0053cf70
push edi
lea ecx, [esp + 0x1cc]
push ecx
push ebp
call fcn.004ad550
mov ebx, 1
add esp, 0x10
cmp dword [esp + 0x21c], ebx
jle 0x506781
lea esp, [esp]
lea edx, [esp + 0xf4]
push edx
lea eax, [esp + 0x28]
push eax
call fcn.0053cf00
add esp, 8
test eax, eax
je 0x5065c2
mov ecx, dword [esp + 0x1c]
push ecx
lea edx, [esp + 0x1c8]
push edx
lea eax, [esp + 0x2c]
push eax
call fcn.0053ce00
add esp, 0xc
test eax, eax
je 0x5067b5
push 0
lea ecx, [esp + 0x1c8]
push ecx
lea edx, [esp + 0x2c]
push edx
call fcn.0053ce20
add esp, 0xc
test eax, eax
je 0x5067b5
lea eax, [esp + 0x24]
push eax
call fcn.0053cf70
add esp, 4
test edi, edi
jle 0x506773
lea ecx, [esp + 0x1c4]
mov eax, ebp
sub ecx, ebp
mov esi, edi
mov dl, byte [ecx + eax]
xor byte [eax], dl
inc eax
sub esi, 1
jne 0x506768
inc ebx
cmp ebx, dword [esp + 0x21c]
jl 0x5066f0
mov eax, dword [esp + 0x14]
inc dword [esp + 0x18]
sub eax, edi
add ebp, edi
mov dword [esp + 0x14], eax
test eax, eax
jne 0x506610
jmp 0x5065e0
lea eax, [esp + 0xf4]
push eax
call fcn.0053cf70
add esp, 4
xor eax, eax
jmp 0x5065f5
lea edx, [esp + 0xf4]
push edx
call fcn.0053cf70
lea eax, [esp + 0x28]
push eax
call fcn.0053cf70
add esp, 8
xor eax, eax
jmp 0x5065f5
lea ecx, [esp + 0xf4]
push ecx
call fcn.0053cf70
lea edx, [esp + 0x28]
push edx
call fcn.0053cf70
add esp, 8
xor eax, eax
jmp 0x5065f5