Function at 0x50e7e0
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
sub esp, 0x9c
push ebp
mov ebp, dword [esp + 0xb0]
push esi
mov esi, dword [esp + 0xac]
push eax
push ecx
mov ecx, dword [esp + 0xd4]
lea eax, [esp + 0x58]
push edx
mov edx, dword [esp + 0xd4]
push eax
push ecx
push edx
push esi
push ebp
call fcn.00547180
add esp, 0x20
test eax, eax
je 0x50e836
pop esi
mov eax, 1
pop ebp
add esp, 0x9c
ret
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x64]
push ebx
mov ebx, dword [esi + 8]
mov esi, dword [ebp + 8]
mov ebp, dword [esp + 0x58]
sub ebp, dword [esp + 0x60]
sub eax, edx
mov dword [esp + 0x1c], esi
mov ecx, dword [esp + 0x74]
push edi
mov edi, dword [esp + 0x70]
lea ebp, [ebx + ebp*2]
sub ecx, edi
mov dword [esp + 0x2c], ebp
lea ebp, [eax + eax]
sub esi, ebp
imul edi, dword [esp + 0x20]
mov dword [esp + 0x30], esi
mov esi, dword [esp + 0x60]
imul esi, ebx
mov ebp, dword [esp + 0x5c]
lea edi, [edi + edx*2]
mov dword [esp + 0x48], eax
mov dword [esp + 0x3c], ebx
lea esi, [esi + ebp*2]
mov ebp, dword [esp + 0xb4]
add esi, dword [ebp + 4]
mov ebp, dword [esp + 0xbc]
add edi, dword [ebp + 4]
cmp byte [esp + 0x58], 0
je 0x50ebaf
and dl, 1
mov dword [esp + 0x20], eax
mov byte [esp + 0x27], dl
je 0x50e8bd
dec eax
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x20]
mov edx, eax
sar eax, 3
and edx, 7
mov dword [esp + 0x20], eax
mov al, dl
and al, 1
sar edx, 1
test ecx, ecx
mov byte [esp + 0x1f], al
mov dword [esp + 0x18], edx
jle 0x50ed1a
mov dword [esp + 0x28], ecx
mov al, byte [esp + 0x27]
test al, al
je 0x50e95d
mov eax, dword [esp + 0xc8]
mov cx, word [edi]
and eax, 0xf0
xor ebx, ebx
mov bx, word [esi]
add edi, 2
shl eax, 0xc
add eax, ebx
mov bx, word [eax*2 + 0x62ee04]
mov eax, ecx
not eax
mov ebp, ebx
sar eax, 1
shr ebp, 1
and eax, 0x7bef
and ebp, 0x7bef
xor eax, ebp
mov ebp, ecx
not ebp
and ebp, ebx
add eax, ebp
and eax, 0xffff8410
add ax, 0x3df0
sar ax, 5
and eax, 0xfbff
add eax, 0x200
xor eax, 0x3ef
mov ebp, eax
or eax, ecx
or ebp, ebx
sub eax, ebp
add esi, 2
mov word [edi - 2], ax
mov eax, dword [esp + 0x20]
test eax, eax
jle 0x50eaae
mov ebp, dword [esp + 0xcc]
mov dword [esp + 0x14], eax
and ebp, 0xf0
shl ebp, 0xc
mov eax, dword [esi]
xor edx, edx
mov ecx, eax
and eax, 0xffff
shr ecx, 0x10
add ecx, ebp
add eax, ebp
mov dx, word [ecx*2 + 0x62ee04]
xor ecx, ecx
mov cx, word [eax*2 + 0x62ee04]
shl edx, 0x10
add edx, ecx
mov ecx, edi
mov dword [esp + 0x10], edx
lea edx, [esp + 0x10]
push edx
call fcn.004eec20
mov eax, dword [esi + 4]
xor edx, edx
mov ecx, eax
and eax, 0xffff
shr ecx, 0x10
add ecx, ebp
add eax, ebp
mov dx, word [ecx*2 + 0x62ee04]
xor ecx, ecx
mov cx, word [eax*2 + 0x62ee04]
shl edx, 0x10
add edx, ecx
lea ecx, [edi + 4]
mov dword [esp + 0x10], edx
lea edx, [esp + 0x10]
push edx
call fcn.004eec20
mov eax, dword [esi + 8]
mov ebx, dword [edi + 8]
mov ecx, eax
xor edx, edx
shr ecx, 0x10
add ecx, ebp
and eax, 0xffff
add eax, ebp
mov dx, word [ecx*2 + 0x62ee04]
mov ecx, edx
xor edx, edx
mov dx, word [eax*2 + 0x62ee04]
shl ecx, 0x10
add ecx, edx
mov edx, ebx
not edx
mov eax, edx
and edx, ecx
xor eax, ecx
shr eax, 1
and eax, 0x7bef7bef
add eax, edx
and eax, 0x84108410
add eax, 0x3df7bdf0
sar eax, 5
and eax, 0xfbff7bff
add eax, 0x2004200
xor eax, 0x3ef7bef
mov edx, eax
or eax, ebx
or edx, ecx
sub eax, edx
xor edx, edx
mov dword [edi + 8], eax
mov eax, dword [esi + 0xc]
mov ecx, eax
and eax, 0xffff
shr ecx, 0x10
add ecx, ebp
add eax, ebp
mov dx, word [ecx*2 + 0x62ee04]
xor ecx, ecx
mov cx, word [eax*2 + 0x62ee04]
shl edx, 0x10
add edx, ecx
mov dword [esp + 0x10], edx
lea edx, [esp + 0x10]
push edx
lea ecx, [edi + 0xc]
call fcn.004eec20
mov eax, dword [esp + 0x14]
add edi, 0x10
add esi, 0x10
dec eax
mov dword [esp + 0x14], eax
jne 0x50e97d
mov edx, dword [esp + 0x18]
test edx, edx
jle 0x50eb46
mov ebx, dword [esp + 0xcc]
mov dword [esp + 0x14], edx
and ebx, 0xf0
shl ebx, 0xc
mov eax, dword [esi]
mov ebp, dword [edi]
mov ecx, eax
xor edx, edx
shr ecx, 0x10
add ecx, ebx
and eax, 0xffff
add eax, ebx
add edi, 4
mov dx, word [ecx*2 + 0x62ee04]
add esi, 4
mov ecx, edx
xor edx, edx
mov dx, word [eax*2 + 0x62ee04]
shl ecx, 0x10
add ecx, edx
mov edx, ebp
not edx
mov eax, edx
and edx, ecx
xor eax, ecx
shr eax, 1
and eax, 0x7bef7bef
add eax, edx
and eax, 0x84108410
add eax, 0x3df7bdf0
sar eax, 5
and eax, 0xfbff7bff
add eax, 0x2004200
xor eax, 0x3ef7bef
mov edx, eax
or eax, ebp
or edx, ecx
sub eax, edx
mov dword [edi - 4], eax
mov eax, dword [esp + 0x14]
dec eax
mov dword [esp + 0x14], eax
jne 0x50eaca
mov edx, dword [esp + 0x18]
mov al, byte [esp + 0x1f]
test al, al
je 0x50eb87
mov eax, dword [esp + 0xc8]
xor ecx, ecx
mov cx, word [esi]
and eax, 0xf0
shl eax, 0xc
add eax, ecx
mov ecx, edi
mov dx, word [eax*2 + 0x62ee04]
lea eax, [esp + 0x34]
push eax
mov word [esp + 0x38], dx
call fcn.004eebc0
mov edx, dword [esp + 0x18]
add edi, 2
add esi, 2
mov ebx, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x28]
add edi, ebx
add esi, ecx
dec eax
mov dword [esp + 0x28], eax
jne 0x50e8e7
pop edi
pop ebx
pop esi
xor eax, eax
pop ebp
add esp, 0x9c
ret
mov edx, dword [esp + 0x98]
mov ebp, dword [esp + 0x8c]
add edx, edx
mov dword [esp + 0x34], ebp
mov ebp, dword [esp + 0x90]
mov dword [esp + 0x38], edx
mov edx, ebx
mov dword [esp + 0x4c], ebp
imul edx, dword [esp + 0xa8]
mov ebp, dword [esp + 0xa0]
mov dword [esp + 0x40], edx
mov dword [esp + 0x2c], ebp
mov ebp, dword [esp + 0x94]
mov dword [esp + 0x44], ebp
mov ebp, dword [esp + 0xa4]
mov dword [esp + 0x30], ebp
mov ebp, dword [esp + 0x9c]
test ecx, ecx
jle 0x50ed1a
mov dword [esp + 0x10], ecx
jmp 0x50ec1a
mov ebp, dword [esp + 0x28]
add ebp, dword [esp + 0x2c]
mov dword [esp + 0x28], ebp
js 0x50ec30
mov ecx, dword [esp + 0x30]
add esi, ebx
sub ebp, ecx
mov dword [esp + 0x28], ebp
mov ecx, dword [esp + 0x34]
mov dword [esp + 0x50], esi
test eax, eax
mov dword [esp + 0x18], ecx
jle 0x50ecfe
mov edx, dword [esp + 0xc8]
mov ebx, edi
and edx, 0xf0
mov dword [esp + 0x14], eax
shl edx, 0xc
mov dword [esp + 0x54], edx
jmp 0x50ec64
mov edx, dword [esp + 0x54]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x4c]
add eax, ecx
mov dword [esp + 0x18], eax
js 0x50ec81
mov ecx, dword [esp + 0x44]
add esi, 2
sub eax, ecx
mov dword [esp + 0x18], eax
mov cx, word [ebx]
xor eax, eax
mov ax, word [esi]
add ebx, 2
add eax, edx
mov dx, word [eax*2 + 0x62ee04]
mov eax, ecx
not eax
mov ebp, edx
sar eax, 1
shr ebp, 1
and eax, 0x7bef
and ebp, 0x7bef
xor eax, ebp
mov ebp, ecx
not ebp
and ebp, edx
add eax, ebp
and eax, 0xffff8410
add ax, 0x3df0
sar ax, 5
and eax, 0xfbff
add eax, 0x200
xor eax, 0x3ef
mov ebp, eax
or eax, ecx
or ebp, edx
mov edx, dword [esp + 0x38]
sub eax, ebp
add esi, edx
mov word [ebx - 2], ax
mov eax, dword [esp + 0x14]
dec eax
mov dword [esp + 0x14], eax
jne 0x50ec60
mov ebx, dword [esp + 0x3c]
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x50]
mov ebp, dword [esp + 0x20]
add edi, ebp
lea esi, [ecx + edx]
mov ecx, dword [esp + 0x10]
dec ecx
mov dword [esp + 0x10], ecx
jne 0x50ec16
pop edi
pop ebx
pop esi
xor eax, eax
pop ebp
add esp, 0x9c
ret