Function at 0x509da0
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x4c
call fcn.0059cab0
mov eax, dword [0x65fec0]
xor eax, esp
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x54]
push ebx
push ebp
mov ebp, dword [esp + 0x60]
push esi
mov esi, dword [esp + 0x5c]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x6c]
mov dword [esp + 0x1c], eax
mov bl, byte [esi]
mov ecx, dword [esi + 0x28]
mov eax, dword [esi + 0x2c]
mov dword [esp + 0x38], esi
mov dword [esp + 0x24], ebp
mov byte [esp + 0x13], bl
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], eax
push edi
test bl, 0x40
jne 0x509e05
push eax
lea eax, [esi + 0x10]
push eax
push esi
call ecx
add esp, 0xc
add dword [esi + 0x20], 1
adc dword [esi + 0x24], 0
movzx eax, bl
mov edx, 0xf
and eax, 7
xor ecx, ecx
sub edx, eax
mov byte [esi], al
mov dword [esp + 0x44], edx
cmp edx, 0xf
jae 0x509e33
nop
movzx eax, byte [esi + edx]
or ecx, eax
mov byte [esi + edx], 0
inc edx
shl ecx, 8
cmp edx, 0xf
jb 0x509e20
movzx eax, byte [esi + 0xf]
mov edi, dword [esp + 0x6c]
or ecx, eax
mov byte [esi + 0xf], 1
cmp ecx, edi
je 0x509e5b
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0059c3d3
add esp, 0x4c
ret
lea eax, [edi + 0xf]
or eax, 8
shr eax, 3
add dword [esi + 0x20], eax
adc dword [esi + 0x24], 0
cmp dword [esi + 0x24], 0x20000000
jb 0x509e94
ja 0x509e7c
cmp dword [esi + 0x20], 0
jbe 0x509e94
pop edi
pop esi
pop ebp
mov eax, 0xfffffffe
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0059c3d3
add esp, 0x4c
ret
mov ebx, edi
lea eax, [esi + 0x10]
shr ebx, 4
test ebx, ebx
je 0x509edc
push eax
push esi
push dword [esp + 0x20]
push ebx
push ebp
push dword [esp + 0x24]
call dword [esp + 0x38]
shl ebx, 4
add esp, 0x18
add dword [esp + 0x10], ebx
add ebp, ebx
mov dword [esp + 0x28], ebp
sub edi, ebx
je 0x50a053
shr ebx, 4
push ebx
push esi
call fcn.0050a1e0
lea eax, [esi + 0x10]
add esp, 8
mov ecx, eax
jmp 0x509ee6
mov ecx, eax
test edi, edi
je 0x50a053
test edi, edi
je 0x50a0bd
mov edx, dword [esp + 0x10]
mov ebx, edi
mov al, byte [edx]
lea edx, [edx + 1]
xor byte [ecx], al
lea ecx, [ecx + 1]
sub ebx, 1
jne 0x509ef4
mov ebx, dword [esp + 0x18]
lea eax, [esi + 0x10]
push ebx
push eax
push eax
call dword [esp + 0x28]
push ebx
lea eax, [esp + 0x58]
push eax
push esi
call dword [esp + 0x34]
mov ebx, dword [esp + 0x28]
add esp, 0x18
xor edx, edx
mov dword [esp + 0x20], edi
cmp edi, 0x40
jb 0x50a02c
lea eax, [esp + edi + 0x47]
cmp ebp, eax
ja 0x509f4f
lea eax, [ebp - 1]
mov dword [esp + 0x20], edi
lea ecx, [esp + 0x48]
add eax, edi
cmp eax, ecx
jae 0x50a02c
mov ecx, dword [esp + 0x10]
lea eax, [ecx - 1]
add eax, edi
cmp ebp, eax
ja 0x509f6f
lea eax, [ebp - 1]
mov dword [esp + 0x20], edi
add eax, edi
mov ebx, ecx
cmp eax, ecx
jae 0x50a02c
mov ebx, ecx
mov dword [esp + 0x40], ecx
sub ebx, ebp
mov dword [esp + 0x20], edi
mov dword [esp + 0x2c], ebx
mov eax, edi
lea ebx, [esp + 0x48]
and eax, 0xffffffc0
sub ebx, ebp
mov dword [esp + 0x24], eax
mov dword [esp + 0x30], ebx
lea eax, [ecx + 0x30]
mov ecx, dword [esp + 0x2c]
lea ebx, [esp + 0x58]
mov esi, dword [esp + 0x30]
sub ebx, ebp
mov dword [esp + 0x34], ebx
lea ebx, [esp + 0x68]
mov dword [esp + 0x10], eax
sub ebx, ebp
mov edi, dword [esp + 0x10]
lea eax, [ebp + 0x10]
mov ebp, dword [esp + 0x34]
mov dword [esp + 0x38], ebx
movups xmm0, xmmword [edi - 0x30]
lea edi, [edi + 0x40]
movups xmm1, xmmword [esp + edx + 0x48]
add edx, 0x40
lea eax, [eax + 0x40]
pxor xmm1, xmm0
movups xmm0, xmmword [ecx + eax - 0x40]
movups xmmword [eax - 0x50], xmm1
movups xmm1, xmmword [esi + eax - 0x40]
pxor xmm1, xmm0
movups xmm0, xmmword [edi - 0x50]
movups xmmword [eax - 0x40], xmm1
movups xmm1, xmmword [eax + ebp - 0x40]
pxor xmm1, xmm0
movups xmm0, xmmword [edi - 0x40]
movups xmmword [eax - 0x30], xmm1
movups xmm1, xmmword [ebx + eax - 0x40]
pxor xmm1, xmm0
movups xmmword [eax - 0x20], xmm1
cmp edx, dword [esp + 0x24]
jb 0x509fc0
mov esi, dword [esp + 0x3c]
mov eax, edx
mov ebp, dword [esp + 0x28]
mov ebx, dword [esp + 0x40]
mov dword [esp + 0x24], edx
cmp eax, dword [esp + 0x20]
jae 0x50a053
lea eax, [esp + 0x48]
mov edi, ebp
mov ebp, dword [esp + 0x20]
sub ebx, eax
sub edi, eax
nop word [eax + eax]
lea ecx, [esp + 0x48]
add ecx, edx
inc edx
mov al, byte [ecx + ebx]
xor al, byte [ecx]
mov byte [ecx + edi], al
cmp edx, ebp
jb 0x50a040
mov ebp, dword [esp + 0x1c]
mov ebx, dword [esp + 0x18]
mov ecx, dword [esp + 0x44]
cmp ecx, 0x10
jae 0x50a07a
mov eax, 0x10
sub eax, ecx
push eax
lea eax, [ecx + esi]
push 0
push eax
call fcn.0059e1f0
add esp, 0xc
push ebx
lea eax, [esp + 0x4c]
push eax
push esi
call ebp
mov eax, dword [esp + 0x54]
add esp, 0xc
xor dword [esi + 0x10], eax
mov eax, dword [esp + 0x4c]
xor dword [esi + 0x14], eax
mov eax, dword [esp + 0x50]
xor dword [esi + 0x18], eax
mov eax, dword [esp + 0x54]
xor dword [esi + 0x1c], eax
mov al, byte [esp + 0x17]
mov ecx, dword [esp + 0x58]
pop edi
mov byte [esi], al
xor eax, eax
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0059c3d3
add esp, 0x4c
ret
mov ebx, dword [esp + 0x18]
mov ebp, dword [esp + 0x1c]
push ebx
push eax
push eax
call ebp
push ebx
lea eax, [esp + 0x58]
push eax
push esi
call ebp
add esp, 0x18
jmp 0x50a05b