Function at 0x50e9a0
Capabilities:
Encode data using xor

Disassembly:
mov eax, 8
call fcn.0047be20
cmp dword [esp + 0x24], 0
mov eax, dword [esp + 0x20]
mov eax, dword [eax]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x28]
push edi
mov edi, dword [esp + 0x24]
je 0x50eaa5
test eax, eax
je 0x50e9f8
jmp 0x50e9d0
test edi, edi
je 0x50e9f8
mov ebx, dword [esp + 0x1c]
movzx ecx, byte [ebx]
xor byte [eax + esi], cl
mov cl, byte [eax + esi]
mov edx, dword [esp + 0x20]
mov byte [edx], cl
inc edx
inc ebx
inc eax
dec edi
and eax, 0xf
mov dword [esp + 0x20], edx
mov dword [esp + 0x1c], ebx
jne 0x50e9d0
cmp edi, 0x10
jb 0x50ea62
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
mov eax, edi
shr eax, 4
mov ebx, ecx
mov ebp, edx
mov dword [esp + 0x34], eax
shl eax, 4
add ecx, eax
sub ebx, esi
sub ebp, esi
add edx, eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x1c], edx
mov edx, dword [esp + 0x28]
push edx
push esi
push esi
call dword [esp + 0x44]
add esp, 0xc
mov eax, esi
mov edx, 4
lea ebx, [ebx]
mov ecx, dword [eax + ebp]
xor dword [eax], ecx
mov ecx, dword [eax]
mov dword [ebx + eax], ecx
add eax, 4
sub edx, 1
jne 0x50ea40
sub edi, 0x10
add ebx, 0x10
add ebp, 0x10
sub dword [esp + 0x34], 1
jne 0x50ea25
xor ebx, ebx
test edi, edi
je 0x50ea97
mov edx, dword [esp + 0x28]
push edx
push esi
push esi
call dword [esp + 0x44]
mov ecx, dword [esp + 0x28]
mov ebp, dword [esp + 0x2c]
add esp, 0xc
sub ecx, esi
mov eax, esi
sub ebp, esi
mov ebx, edi
movzx edx, byte [eax + ecx]
xor byte [eax], dl
mov dl, byte [eax]
dec edi
mov byte [eax + ebp], dl
inc eax
test edi, edi
jne 0x50ea86
mov eax, dword [esp + 0x30]
pop edi
pop esi
pop ebp
mov dword [eax], ebx
pop ebx
add esp, 8
ret
mov ebp, dword [esp + 0x20]
mov ebx, dword [esp + 0x1c]
test eax, eax
je 0x50ead3
test edi, edi
je 0x50eacb
mov dl, byte [eax + esi]
mov cl, byte [ebx]
xor dl, cl
mov byte [ebp], dl
mov byte [eax + esi], cl
inc eax
inc ebp
inc ebx
dec edi
and eax, 0xf
jne 0x50eab1
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x24], edi
cmp edi, 0x10
jb 0x50eb46
mov eax, ebp
sub eax, esi
shr edi, 4
mov dword [esp + 0x34], eax
mov dword [esp + 0x14], edi
mov eax, dword [esp + 0x28]
push eax
push esi
push esi
call dword [esp + 0x44]
mov edi, ebx
add esp, 0xc
mov eax, esi
sub edi, ebp
mov dword [esp + 0x10], 4
mov ecx, dword [esp + 0x34]
mov ebx, dword [eax]
add ecx, eax
mov edx, dword [ecx + edi]
xor ebx, edx
mov dword [ecx], ebx
mov dword [eax], edx
mov ecx, 1
add eax, 4
sub dword [esp + 0x10], ecx
jne 0x50eb03
mov edi, dword [esp + 0x24]
mov ebx, dword [esp + 0x1c]
add dword [esp + 0x34], 0x10
sub edi, 0x10
add ebx, 0x10
add ebp, 0x10
sub dword [esp + 0x14], ecx
mov dword [esp + 0x24], edi
mov dword [esp + 0x1c], ebx
jne 0x50eae7
xor eax, eax
test edi, edi
je 0x50eb7c
mov edx, dword [esp + 0x28]
push edx
push esi
push esi
call dword [esp + 0x44]
add esp, 0xc
sub ebx, ebp
mov eax, esi
sub ebp, esi
mov dword [esp + 0x34], edi
mov dl, byte [eax]
lea esi, [eax + ebp]
mov cl, byte [esi + ebx]
xor dl, cl
mov byte [esi], dl
dec edi
mov byte [eax], cl
inc eax
test edi, edi
jne 0x50eb64
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x30]
pop edi
pop esi
pop ebp
mov dword [ecx], eax
pop ebx
add esp, 8
ret