Function at 0x50ed30
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
sub esp, 0x98
push ebx
mov ebx, dword [esp + 0xac]
push edi
mov edi, dword [esp + 0xa8]
push eax
push ecx
mov ecx, dword [esp + 0xd0]
lea eax, [esp + 0x54]
push edx
mov edx, dword [esp + 0xd0]
push eax
push ecx
push edx
push edi
push ebx
call fcn.00547180
add esp, 0x20
test eax, eax
je 0x50ed86
pop edi
mov eax, 1
pop ebx
add esp, 0x98
ret
mov eax, dword [esp + 0x68]
mov edx, dword [esp + 0x60]
push ebp
mov ebp, dword [edi + 8]
mov edi, dword [ebx + 8]
mov ebx, dword [esp + 0x54]
sub ebx, dword [esp + 0x5c]
sub eax, edx
mov dword [esp + 0x1c], edi
mov ecx, dword [esp + 0x70]
push esi
mov esi, dword [esp + 0x6c]
lea ebx, [ebp + ebx*2]
sub ecx, esi
mov dword [esp + 0x2c], ebx
lea ebx, [eax + eax]
sub edi, ebx
imul esi, dword [esp + 0x20]
mov dword [esp + 0x28], edi
mov edi, dword [esp + 0x5c]
imul edi, ebp
mov ebx, dword [esp + 0x58]
lea esi, [esi + edx*2]
mov dword [esp + 0x44], eax
mov dword [esp + 0x34], ebp
lea edi, [edi + ebx*2]
mov ebx, dword [esp + 0xb0]
add edi, dword [ebx + 4]
mov ebx, dword [esp + 0xb8]
add esi, dword [ebx + 4]
mov bl, byte [esp + 0x54]
test bl, bl
je 0x50f0e5
and dl, 1
mov dword [esp + 0x10], eax
mov byte [esp + 0x1b], dl
je 0x50ee0f
dec eax
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
mov ebx, eax
sar eax, 3
and ebx, 7
mov dword [esp + 0x10], eax
mov al, bl
and al, 1
sar ebx, 1
test ecx, ecx
mov byte [esp + 0x1a], al
mov dword [esp + 0x1c], ebx
jle 0x50f23b
mov dword [esp + 0x24], ecx
mov al, byte [esp + 0x1b]
test al, al
je 0x50ee98
mov eax, dword [esp + 0xc4]
mov dx, word [esi]
and eax, 0xf0
xor ecx, ecx
mov cx, word [edi]
add esi, 2
shl eax, 0xc
add eax, ecx
mov cx, word [eax*2 + 0x82ee04]
mov eax, edx
not eax
mov ebp, eax
xor eax, ecx
and ebp, ecx
and eax, 0x7bde
lea eax, [eax + ebp*2]
shr eax, 5
and eax, 0x421
add eax, 0x3def
xor eax, 0x3def
mov ebp, eax
or eax, edx
or ebp, ecx
sub eax, ebp
add edi, 2
mov word [esi - 2], ax
mov eax, dword [esp + 0x10]
test eax, eax
jle 0x50f003
mov ebp, dword [esp + 0xc8]
mov dword [esp + 0x20], eax
and ebp, 0xf0
shl ebp, 0xc
mov eax, dword [edi]
xor ecx, ecx
mov edx, eax
and eax, 0xffff
shr edx, 0x10
add edx, ebp
add eax, ebp
mov cx, word [edx*2 + 0x82ee04]
xor edx, edx
mov dx, word [eax*2 + 0x82ee04]
lea eax, [esp + 0x14]
shl ecx, 0x10
add ecx, edx
push eax
mov dword [esp + 0x18], ecx
mov ecx, esi
call fcn.0050f250
mov eax, dword [edi + 4]
mov edx, dword [esi + 4]
mov ecx, eax
xor ebx, ebx
shr ecx, 0x10
add ecx, ebp
and eax, 0xffff
add eax, ebp
mov bx, word [ecx*2 + 0x82ee04]
mov ecx, ebx
xor ebx, ebx
mov bx, word [eax*2 + 0x82ee04]
mov eax, edx
shl ecx, 0x10
not eax
add ecx, ebx
mov ebx, eax
xor ebx, ecx
and eax, ecx
and ebx, 0x7bde7bde
lea eax, [ebx + eax*2]
shr eax, 5
and eax, 0x4210421
add eax, 0x3def3def
xor eax, 0x3def3def
mov ebx, eax
or eax, edx
or ebx, ecx
xor ecx, ecx
sub eax, ebx
mov dword [esi + 4], eax
mov eax, dword [edi + 8]
mov edx, eax
and eax, 0xffff
shr edx, 0x10
add edx, ebp
add eax, ebp
mov cx, word [edx*2 + 0x82ee04]
xor edx, edx
mov dx, word [eax*2 + 0x82ee04]
lea eax, [esp + 0x14]
shl ecx, 0x10
add ecx, edx
push eax
mov dword [esp + 0x18], ecx
lea ecx, [esi + 8]
call fcn.0050f250
mov eax, dword [edi + 0xc]
mov edx, dword [esi + 0xc]
mov ecx, eax
xor ebx, ebx
shr ecx, 0x10
add ecx, ebp
and eax, 0xffff
add eax, ebp
mov bx, word [ecx*2 + 0x82ee04]
mov ecx, ebx
xor ebx, ebx
mov bx, word [eax*2 + 0x82ee04]
mov eax, edx
shl ecx, 0x10
not eax
add ecx, ebx
mov ebx, eax
xor ebx, ecx
and eax, ecx
and ebx, 0x7bde7bde
add esi, 0x10
add edi, 0x10
lea eax, [ebx + eax*2]
shr eax, 5
and eax, 0x4210421
add eax, 0x3def3def
xor eax, 0x3def3def
mov ebx, eax
or eax, edx
or ebx, ecx
sub eax, ebx
mov dword [esi - 4], eax
mov eax, dword [esp + 0x20]
dec eax
mov dword [esp + 0x20], eax
jne 0x50eeb8
mov ebx, dword [esp + 0x1c]
test ebx, ebx
jle 0x50f05d
mov ebp, dword [esp + 0xc8]
and ebp, 0xf0
shl ebp, 0xc
mov eax, dword [edi]
xor ecx, ecx
mov edx, eax
and eax, 0xffff
shr edx, 0x10
add edx, ebp
add eax, ebp
mov cx, word [edx*2 + 0x82ee04]
xor edx, edx
mov dx, word [eax*2 + 0x82ee04]
lea eax, [esp + 0x14]
shl ecx, 0x10
add ecx, edx
push eax
mov dword [esp + 0x18], ecx
mov ecx, esi
call fcn.0050f250
add esi, 4
add edi, 4
dec ebx
jne 0x50f017
mov ebx, dword [esp + 0x1c]
mov al, byte [esp + 0x1a]
test al, al
je 0x50f0bd
mov ecx, dword [esp + 0xc4]
mov dx, word [esi]
and ecx, 0xf0
xor eax, eax
mov ax, word [edi]
add esi, 2
shl ecx, 0xc
add ecx, eax
mov eax, edx
not eax
mov cx, word [ecx*2 + 0x82ee04]
mov ebp, eax
xor eax, ecx
and ebp, ecx
and eax, 0x7bde
lea eax, [eax + ebp*2]
shr eax, 5
and eax, 0x421
add eax, 0x3def
xor eax, 0x3def
mov ebp, eax
or eax, edx
or ebp, ecx
sub eax, ebp
add edi, 2
mov word [esi - 2], ax
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x24]
add esi, edx
add edi, ecx
dec eax
mov dword [esp + 0x24], eax
jne 0x50ee39
pop esi
pop ebp
pop edi
xor eax, eax
pop ebx
add esp, 0x98
ret
mov edx, dword [esp + 0x94]
mov ebx, dword [esp + 0x88]
add edx, edx
mov dword [esp + 0x30], ebx
mov ebx, dword [esp + 0x8c]
mov dword [esp + 0x50], edx
mov edx, ebp
mov dword [esp + 0x48], ebx
imul edx, dword [esp + 0xa4]
mov ebx, dword [esp + 0x9c]
mov dword [esp + 0x3c], edx
mov dword [esp + 0x2c], ebx
mov ebx, dword [esp + 0x90]
mov dword [esp + 0x40], ebx
mov ebx, dword [esp + 0xa0]
mov dword [esp + 0x28], ebx
mov ebx, dword [esp + 0x98]
test ecx, ecx
jle 0x50f23b
mov dword [esp + 0x14], ecx
jmp 0x50f150
mov ebx, dword [esp + 0x24]
add ebx, dword [esp + 0x2c]
mov dword [esp + 0x24], ebx
js 0x50f166
mov ecx, dword [esp + 0x28]
add edi, ebp
sub ebx, ecx
mov dword [esp + 0x24], ebx
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x4c], edi
test eax, eax
mov dword [esp + 0x10], ecx
jle 0x50f21f
mov ecx, dword [esp + 0xc4]
mov edx, esi
and ecx, 0xf0
mov dword [esp + 0x1c], eax
shl ecx, 0xc
mov dword [esp + 0x38], ecx
jmp 0x50f19a
mov ecx, dword [esp + 0x38]
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x48]
add eax, ebx
mov dword [esp + 0x10], eax
js 0x50f1b7
mov ebx, dword [esp + 0x40]
add edi, 2
sub eax, ebx
mov dword [esp + 0x10], eax
mov ax, word [edx]
xor ebx, ebx
mov bx, word [edi]
add edx, 2
add ebx, ecx
not eax
mov cx, word [ebx*2 + 0x82ee04]
mov ebp, ecx
mov ebx, ecx
xor ebp, eax
and ebx, eax
and ebp, 0x7bde
lea eax, [ebp + ebx*2]
shr eax, 5
and eax, 0x421
add eax, 0x3def
xor eax, 0x3def
mov ebx, eax
or ebx, ecx
mov cx, word [edx - 2]
or eax, ecx
sub eax, ebx
mov ebx, dword [esp + 0x50]
mov word [edx - 2], ax
mov eax, dword [esp + 0x1c]
add edi, ebx
dec eax
mov dword [esp + 0x1c], eax
jne 0x50f196
mov ebp, dword [esp + 0x34]
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x4c]
mov ebx, dword [esp + 0x20]
add esi, ebx
lea edi, [ecx + edx]
mov ecx, dword [esp + 0x14]
dec ecx
mov dword [esp + 0x14], ecx
jne 0x50f14c
pop esi
pop ebp
pop edi
xor eax, eax
pop ebx
add esp, 0x98
ret