Function at 0x50aff0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x639edd
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x6a6040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
call fcn.00409430
mov eax, dword [esi + 4]
lea ecx, [ebp - 0x10]
xor ebx, ebx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 4], ebx
mov eax, dword [esi + 0x18]
test al, 1
je 0x50b045
lea esi, [ebx + 2]
jmp 0x50b1fa
xor edi, edi
test al, 2
jne 0x50b08c
mov ecx, dword [ebp + 8]
xor eax, eax
mov edx, 9
ror eax, 0x19
xor eax, dword [ecx]
add ecx, 4
sub edx, 1
jne 0x50b055
div dword [esi + 0x10]
mov eax, dword [esi + 0x14]
lea edi, [eax + edx*4]
mov dword [ebp - 0x14], edi
mov edi, dword [edi]
test edi, edi
je 0x50b089
push dword [ebp + 8]
lea ecx, [edi + 4]
call fcn.004f9520
test al, al
jne 0x50b0b3
mov edi, dword [edi]
test edi, edi
jne 0x50b074
mov edi, dword [ebp - 0x14]
mov edx, dword [esi + 0xc]
mov eax, dword [esi + 8]
cmp edx, eax
jb 0x50b1b6
mov edi, 2
lea ecx, [eax + eax]
cmp eax, edi
cmovb ecx, edi
cmp ecx, edx
jae 0x50b0bd
lea esi, [edi + 1]
jmp 0x50b1fa
mov esi, 1
jmp 0x50b1fa
push dword [esi + 0x18]
mov eax, dword [esi]
push esi
push ecx
mov ecx, esi
call dword [eax + 8]
mov edx, eax
mov dword [ebp - 0x14], edx
test edx, edx
je 0x50b1d0
mov cl, byte [edx + 0x18]
not cl
test cl, 1
je 0x50b1d0
cmp dword [esi + 0x14], 0
je 0x50b184
cmp dword [esi + 0x10], 0
mov dword [ebp - 0x18], 0
jbe 0x50b184
xor ecx, ecx
xor ebx, ebx
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], ebx
nop dword [eax]
mov eax, dword [esi + 0x14]
mov edi, dword [ecx + eax]
test edi, edi
je 0x50b162
nop word [eax + eax]
mov ebx, dword [edi]
lea ecx, [edi + 4]
dec dword [esi + 0xc]
mov edx, 9
xor eax, eax
nop
ror eax, 0x19
lea ecx, [ecx + 4]
xor eax, dword [ecx - 4]
sub edx, 1
jne 0x50b130
mov ecx, dword [ebp - 0x14]
div dword [ecx + 0x10]
mov eax, dword [ecx + 0x14]
lea ecx, [eax + edx*4]
mov edx, dword [ebp - 0x14]
mov eax, dword [ecx]
mov dword [edi], eax
mov dword [ecx], edi
mov edi, ebx
inc dword [edx + 0xc]
test ebx, ebx
jne 0x50b120
mov ecx, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x20]
mov eax, dword [esi + 0x14]
add ecx, 4
mov dword [ebp - 0x1c], ecx
mov dword [ebx + eax], 0
add ebx, 4
mov eax, dword [ebp - 0x18]
inc eax
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x18], eax
cmp eax, dword [esi + 0x10]
jb 0x50b110
mov eax, dword [esi]
mov ecx, esi
push edx
call dword [eax + 4]
mov ecx, dword [ebp - 0x14]
push 1
mov eax, dword [ecx]
call dword [eax + 0xc]
mov ecx, dword [ebp + 8]
xor eax, eax
mov edx, 9
ror eax, 0x19
xor eax, dword [ecx]
add ecx, 4
sub edx, 1
jne 0x50b1a0
div dword [esi + 0x10]
mov eax, dword [esi + 0x14]
lea edi, [eax + edx*4]
push ecx
lea ecx, [esi + 4]
push ecx
mov ecx, dword [ecx]
call fcn.0050d100
mov ebx, eax
mov dword [ebp - 0x10], ebx
test ebx, ebx
jne 0x50b1d7
lea esi, [eax + 2]
jmp 0x50b1fa
mov ebx, dword [ebp - 0x10]
mov esi, edi
jmp 0x50b1fa
push dword [ebp + 0xc]
mov ecx, ebx
push dword [ebp + 8]
call fcn.0050d250
mov eax, dword [ebp - 0x10]
xor ebx, ebx
mov ecx, dword [edi]
mov dword [eax], ecx
mov eax, dword [ebp - 0x10]
mov dword [edi], eax
inc dword [esi + 0xc]
xor esi, esi
mov dword [ebp - 0x10], ebx
test ebx, ebx
je 0x50b20c
push ecx
mov ecx, dword [ebp - 0x24]
lea eax, [ebp - 0x28]
push eax
push ebx
call fcn.0050cff0
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc