Function at 0x501230
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 ebp
mov ebp, 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 ebp
call fcn.00547180
add esp, 0x20
test eax, eax
je 0x501286
pop edi
mov eax, 1
pop ebp
add esp, 0x98
ret
mov eax, dword [esp + 0x68]
mov edx, dword [esp + 0x60]
push ebx
mov ebx, dword [edi + 8]
mov edi, dword [ebp + 8]
mov ebp, dword [esp + 0x54]
sub ebp, dword [esp + 0x5c]
sub eax, edx
mov dword [esp + 0x10], edi
mov ecx, dword [esp + 0x70]
push esi
mov esi, dword [esp + 0x6c]
lea ebp, [ebx + ebp*2]
sub ecx, esi
mov dword [esp + 0x2c], ebp
lea ebp, [eax + eax]
sub edi, ebp
imul esi, dword [esp + 0x14]
mov dword [esp + 0x28], edi
mov edi, dword [esp + 0x5c]
imul edi, ebx
mov ebp, dword [esp + 0x58]
lea esi, [esi + edx*2]
mov dword [esp + 0x44], eax
mov dword [esp + 0x34], ebx
lea edi, [edi + ebp*2]
mov ebp, dword [esp + 0xb0]
add edi, dword [ebp + 4]
mov ebp, dword [esp + 0xb8]
add esi, dword [ebp + 4]
cmp byte [esp + 0x54], 0
je 0x501614
and dl, 1
mov dword [esp + 0x18], eax
mov byte [esp + 0x1f], dl
je 0x50130d
dec eax
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x18]
mov ebx, eax
sar eax, 3
and ebx, 7
mov dword [esp + 0x18], eax
mov al, bl
and al, 1
sar ebx, 1
test ecx, ecx
mov byte [esp + 0x1e], al
mov dword [esp + 0x20], ebx
jle 0x50176b
mov dword [esp + 0x24], ecx
mov al, byte [esp + 0x1f]
test al, al
je 0x50139d
mov eax, dword [esp + 0xc4]
xor ecx, ecx
mov cx, word [edi]
and eax, 0xf0
mov dx, word [esi]
add esi, 2
shl eax, 0xc
add eax, ecx
mov cx, word [eax*2 + 0x62ee04]
mov eax, ecx
mov ebp, ecx
xor eax, edx
and ebp, edx
shr eax, 1
and eax, 0x7bef
add eax, ebp
and eax, 0xffff8410
add ax, 0x3df0
sar ax, 5
and eax, 0xfbff
add eax, 0x200
xor eax, 0x3ef
sub ecx, eax
add ecx, edx
or ecx, eax
add edi, 2
mov word [esi - 2], cx
mov eax, dword [esp + 0x18]
test eax, eax
jle 0x5014f2
mov ebp, dword [esp + 0xc8]
mov dword [esp + 0x14], 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 + 0x62ee04]
xor edx, edx
mov dx, word [eax*2 + 0x62ee04]
lea eax, [esp + 0x10]
shl ecx, 0x10
add ecx, edx
push eax
mov dword [esp + 0x14], ecx
mov ecx, esi
call fcn.004ee700
mov eax, dword [edi + 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, [esi + 4]
mov dword [esp + 0x10], edx
lea edx, [esp + 0x10]
push edx
call fcn.004ee700
mov eax, dword [edi + 8]
xor ebx, ebx
mov ecx, eax
and eax, 0xffff
shr ecx, 0x10
add ecx, ebp
mov edx, dword [esi + 8]
add eax, ebp
mov dword [esp + 0x10], edx
mov bx, word [ecx*2 + 0x62ee04]
mov ecx, ebx
xor ebx, ebx
mov bx, word [eax*2 + 0x62ee04]
shl ecx, 0x10
add ecx, ebx
mov ebx, dword [esp + 0x10]
mov eax, ecx
xor eax, edx
mov edx, ecx
shr eax, 1
and eax, 0x7bef7bef
and edx, ebx
add eax, edx
xor edx, edx
and eax, 0x84108410
add eax, 0x3df7bdf0
sar eax, 5
and eax, 0xfbff7bff
add eax, 0x2004200
xor eax, 0x3ef7bef
sub ecx, eax
add ecx, ebx
or ecx, eax
mov dword [esi + 8], ecx
mov eax, dword [edi + 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, [esi + 0xc]
call fcn.004ee700
mov eax, dword [esp + 0x14]
add esi, 0x10
add edi, 0x10
dec eax
mov dword [esp + 0x14], eax
jne 0x5013bd
mov ebx, dword [esp + 0x20]
test ebx, ebx
jle 0x501586
mov ebp, dword [esp + 0xc8]
mov dword [esp + 0x14], ebx
and ebp, 0xf0
shl ebp, 0xc
mov eax, dword [edi]
xor ebx, ebx
mov ecx, eax
and eax, 0xffff
shr ecx, 0x10
add ecx, ebp
mov edx, dword [esi]
add eax, ebp
add esi, 4
mov bx, word [ecx*2 + 0x62ee04]
add edi, 4
mov ecx, ebx
xor ebx, ebx
mov bx, word [eax*2 + 0x62ee04]
shl ecx, 0x10
add ecx, ebx
mov eax, ecx
mov ebx, ecx
xor eax, edx
and ebx, edx
shr eax, 1
and eax, 0x7bef7bef
add eax, ebx
and eax, 0x84108410
add eax, 0x3df7bdf0
sar eax, 5
and eax, 0xfbff7bff
add eax, 0x2004200
xor eax, 0x3ef7bef
sub ecx, eax
add ecx, edx
or ecx, eax
mov eax, dword [esp + 0x14]
mov dword [esi - 4], ecx
dec eax
mov dword [esp + 0x14], eax
jne 0x50150e
mov ebx, dword [esp + 0x20]
mov al, byte [esp + 0x1e]
test al, al
je 0x5015ec
mov eax, dword [esp + 0xc4]
xor ecx, ecx
mov cx, word [edi]
and eax, 0xf0
mov dx, word [esi]
add esi, 2
shl eax, 0xc
add eax, ecx
mov cx, word [eax*2 + 0x62ee04]
mov eax, ecx
mov ebp, ecx
xor eax, edx
and ebp, edx
shr eax, 1
and eax, 0x7bef
add eax, ebp
and eax, 0xffff8410
add ax, 0x3df0
sar ax, 5
and eax, 0xfbff
add eax, 0x200
xor eax, 0x3ef
sub ecx, eax
add ecx, edx
or ecx, eax
add edi, 2
mov word [esi - 2], cx
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 0x501337
pop esi
pop ebx
pop edi
xor eax, eax
pop ebp
add esp, 0x98
ret
mov edx, dword [esp + 0x94]
mov ebp, dword [esp + 0x88]
add edx, edx
mov dword [esp + 0x30], ebp
mov ebp, dword [esp + 0x8c]
mov dword [esp + 0x50], edx
mov edx, ebx
mov dword [esp + 0x48], ebp
imul edx, dword [esp + 0xa4]
mov ebp, dword [esp + 0x9c]
mov dword [esp + 0x3c], edx
mov dword [esp + 0x2c], ebp
mov ebp, dword [esp + 0x90]
mov dword [esp + 0x40], ebp
mov ebp, dword [esp + 0xa0]
mov dword [esp + 0x28], ebp
mov ebp, dword [esp + 0x98]
test ecx, ecx
jle 0x50176b
mov dword [esp + 0x10], ecx
jmp 0x50167f
mov ebp, dword [esp + 0x24]
add ebp, dword [esp + 0x2c]
mov dword [esp + 0x24], ebp
js 0x501695
mov ecx, dword [esp + 0x28]
add edi, ebx
sub ebp, ecx
mov dword [esp + 0x24], ebp
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x4c], edi
test eax, eax
mov dword [esp + 0x18], ecx
jle 0x50174f
mov ecx, dword [esp + 0xc4]
mov ebx, esi
and ecx, 0xf0
mov dword [esp + 0x20], eax
shl ecx, 0xc
mov dword [esp + 0x38], ecx
jmp 0x5016c9
mov ecx, dword [esp + 0x38]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x48]
add eax, edx
mov dword [esp + 0x18], eax
js 0x5016e6
mov edx, dword [esp + 0x40]
add edi, 2
sub eax, edx
mov dword [esp + 0x18], eax
xor eax, eax
mov dx, word [ebx]
mov ax, word [edi]
add ebx, 2
add eax, ecx
mov cx, word [eax*2 + 0x62ee04]
mov eax, ecx
mov ebp, ecx
xor eax, edx
and ebp, edx
shr eax, 1
and eax, 0x7bef
add eax, ebp
and eax, 0xffff8410
add ax, 0x3df0
sar ax, 5
and eax, 0xfbff
add eax, 0x200
xor eax, 0x3ef
sub ecx, eax
add ecx, edx
mov edx, dword [esp + 0x50]
or ecx, eax
mov eax, dword [esp + 0x20]
mov word [ebx - 2], cx
add edi, edx
dec eax
mov dword [esp + 0x20], eax
jne 0x5016c5
mov ebx, dword [esp + 0x34]
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x4c]
mov ebp, dword [esp + 0x14]
add esi, ebp
lea edi, [ecx + edx]
mov ecx, dword [esp + 0x10]
dec ecx
mov dword [esp + 0x10], ecx
jne 0x50167b
pop esi
pop ebx
pop edi
xor eax, eax
pop ebp
add esp, 0x98
ret