Function at 0x50b1e0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 0x1c]
and dword [eax], 0
push ebx
mov ebx, dword [ebp + 0x14]
push ebx
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x1c], ecx
call fcn.00508bd9
pop ecx
test eax, eax
jne 0x50b455
mov ecx, dword [ebp + 0x18]
imul ebx, ebx, 0x68
test byte [ebp + 0x18], 7
push esi
mov esi, dword [ebx + 0x567a68]
setne al
shr ecx, 3
push edi
mov dword [ebp - 0xc], esi
add eax, ecx
mov edi, eax
mov eax, dword [ebp + 0x10]
cmp eax, edi
ja 0x50b450
lea eax, [esi + eax + 2]
cmp edi, eax
jb 0x50b450
mov esi, dword [ebp + 0xc]
cmp esi, edi
jne 0x50b450
push edi
call sub.msvcrt.dll_malloc
push edi
mov dword [ebp - 4], eax
call sub.msvcrt.dll_malloc
push edi
mov dword [ebp + 0xc], eax
call sub.msvcrt.dll_malloc
push edi
mov dword [ebp - 0x14], eax
call sub.msvcrt.dll_malloc
xor ecx, ecx
add esp, 0x10
mov dword [ebp - 8], eax
cmp dword [ebp - 4], ecx
je 0x50b41f
cmp dword [ebp + 0xc], ecx
je 0x50b416
cmp dword [ebp - 0x14], ecx
je 0x50b416
cmp eax, ecx
je 0x50b416
mov ecx, dword [ebp + 8]
cmp byte [ecx + esi - 1], 0xbc
je 0x50b2a4
push 7
pop edi
jmp 0x50b3ef
mov esi, edi
sub esi, dword [ebp - 0xc]
lea eax, [esi - 1]
push eax
push ecx
push dword [ebp - 4]
call sub.msvcrt.dll_memcpy
mov ecx, dword [ebp + 8]
push dword [ebp - 0xc]
mov eax, edi
sub eax, dword [ebp - 0xc]
lea eax, [eax + ecx - 1]
push eax
push dword [ebp - 8]
call sub.msvcrt.dll_memcpy
mov ecx, edi
shl ecx, 3
sub ecx, dword [ebp + 0x18]
add esp, 0x18
inc ecx
mov dword [ebp + 0x18], 0xff
sar dword [ebp + 0x18], cl
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 8]
not eax
test byte [ecx], al
jne 0x50b29c
mov edx, dword [ebp - 8]
mov ecx, dword [ebp + 0x14]
lea eax, [esi - 1]
push eax
push dword [ebp + 0xc]
push dword [ebp - 0xc]
call fcn.0050c4f3
mov edi, eax
test edi, edi
jne 0x50b3ef
mov eax, dword [ebp - 4]
lea edx, [esi - 1]
test edx, edx
jbe 0x50b32e
mov ecx, dword [ebp + 0xc]
mov edi, eax
sub ecx, eax
mov dword [ebp + 8], edx
mov dl, byte [ecx + edi]
xor byte [edi], dl
inc edi
dec dword [ebp + 8]
jne 0x50b323
mov cl, byte [ebp + 0x18]
and byte [eax], cl
sub esi, dword [ebp + 0x10]
xor ecx, ecx
add esi, 0xfffffffe
je 0x50b34c
cmp byte [ecx + eax], 0
jne 0x50b29c
inc ecx
cmp ecx, esi
jb 0x50b33d
lea esi, [ecx + eax]
cmp byte [esi], 1
jne 0x50b29c
lea eax, [ebp - 0x10]
push eax
call dword [ebx + fcn.00567ab4]
mov edi, eax
pop ecx
test edi, edi
jne 0x50b3ef
push 8
push dword [ebp + 0xc]
call fcn.00508bbf
push 8
push dword [ebp + 0xc]
lea eax, [ebp - 0x10]
push eax
call dword [ebx + fcn.00567ab8]
mov edi, eax
add esp, 0x14
test edi, edi
jne 0x50b3ef
push dword [ebp - 0x18]
lea eax, [ebp - 0x10]
push dword [ebp - 0x1c]
push eax
call dword [ebx + fcn.00567ab8]
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x50b3ef
push dword [ebp + 0x10]
inc esi
lea eax, [ebp - 0x10]
push esi
push eax
call dword [ebx + fcn.00567ab8]
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x50b3ef
push dword [ebp + 0xc]
lea eax, [ebp - 0x10]
push eax
call dword [ebx + fcn.00567abc]
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x50b3ef
mov ecx, dword [ebp - 0xc]
mov edi, dword [ebp - 8]
mov esi, dword [ebp + 0xc]
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x50b3ed
mov eax, dword [ebp + 0x1c]
mov dword [eax], 1
xor edi, edi
push dword [ebp - 8]
call sub.msvcrt.dll_free
push dword [ebp - 0x14]
call sub.msvcrt.dll_free
push dword [ebp + 0xc]
call sub.msvcrt.dll_free
push dword [ebp - 4]
call sub.msvcrt.dll_free
add esp, 0x10
mov eax, edi
jmp 0x50b453
push dword [ebp - 4]
call sub.msvcrt.dll_free
pop ecx
cmp dword [ebp + 0xc], 0
je 0x50b42e
push dword [ebp + 0xc]
call sub.msvcrt.dll_free
pop ecx
cmp dword [ebp - 0x14], 0
je 0x50b43d
push dword [ebp - 0x14]
call sub.msvcrt.dll_free
pop ecx
cmp dword [ebp - 8], 0
je 0x50b44c
push dword [ebp - 8]
call sub.msvcrt.dll_free
pop ecx
push 0xd
jmp 0x50b452
push 0x16
pop eax
pop edi
pop esi
pop ebx
leave
ret 0x18