Function at 0x450500
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
mov ecx, dword [ebp + 0x10]
sub esp, 0x14
mov eax, dword [ebp + 0x14]
mov edx, 1
push ebx
push esi
mov esi, edx
push edi
mov edi, dword [ebp + 8]
cmp ecx, 3
je 0x450530
mov ecx, eax
xor edx, edx
shl esi, cl
mov eax, 0x200000
div esi
mov ecx, dword [ebp + 0x10]
mov esi, eax
lea eax, [esi + esi*4]
mov dword [ebp - 0x14], esi
lea edx, [eax*8 + 0x14b]
mov eax, dword [ebp + 0xc]
and edx, 0xffffff00
mov dword [ebp - 0xc], edx
test eax, eax
jne 0x450556
mov dword [ebp - 8], 0x200000
jmp 0x450565
add eax, 0x3ffff
add eax, edx
and eax, 0xfffc0000
mov dword [ebp - 8], eax
mov ebx, dword [ebp + 0x18]
cmp ecx, 1
jg 0x450580
push 0xc
call fcn.0044f890
add esp, 4
cmp dword [ebx + 0x1c], eax
jae 0x450580
xor al, al
jmp 0x45059b
push 3
mov byte [ebp - 3], 1
call fcn.0044fa00
add esp, 4
test al, al
je 0x450598
mov cl, 1
mov al, cl
jmp 0x45059d
mov al, byte [ebp - 3]
xor cl, cl
mov byte [ebp + 0xb], cl
mov byte [ebp + 0xf], 0
test edi, edi
je 0x4506c3
mov ecx, dword [ebp + 0x10]
cmp ecx, 1
jg 0x4505fe
cmp dword [edi + 0x38], ecx
jne 0x4505fe
mov eax, dword [ebp - 8]
cmp dword [edi + 0x24], eax
jne 0x4505fe
mov dword [edi + 8], 0
mov dword [edi + 0xc], 0
mov dword [edi + 0x10], 0
mov dword [edi + 0x14], 0
mov dword [edi + 0x18], 0
mov dword [edi + 0x1c], 0
mov dword [edi + 0x2c], 0
mov dword [edi + 0x34], 0
jmp 0x4507bc
mov eax, dword [edi + 0x20]
xor ecx, ecx
mov dword [ebp - 0x10], ecx
test eax, eax
je 0x450691
lea esi, [edi + 0x3d]
test byte [esi], 2
je 0x45067e
cmp byte [ebp + 0xb], 0
jne 0x45062f
push 5
call fcn.0044fa00
add esp, 4
test al, al
je 0x45062f
and byte [esi], 0xfd
jmp 0x45067e
and byte [esi], 0xfd
cmp dword [edi + 0x38], 3
jne 0x45063d
mov edx, dword [edi + 0x24]
jmp 0x450647
mov ecx, dword [edi + 0x30]
mov edx, 1
shl edx, cl
mov al, byte [esi - 1]
movzx ecx, al
imul ecx, edx
add ecx, edi
test al, al
jne 0x45065c
add ecx, dword [edi + 0x28]
sub edx, dword [edi + 0x28]
mov byte [ebp - 1], 0
test edx, edx
je 0x45067e
push dword [ebx + 0x3c]
lea eax, [ebp - 1]
push eax
push edx
push ecx
call fcn.00453c90
add esp, 0x10
cmp byte [ebp - 1], 0
je 0x45067e
or byte [esi], 8
inc dword [ebp - 0x10]
add esi, 0x28
mov eax, dword [edi + 0x20]
mov ecx, dword [ebp - 0x10]
cmp ecx, eax
jb 0x450611
mov esi, dword [ebp - 0x14]
cmp eax, esi
jae 0x450763
push dword [ebx + 0x3c]
lea eax, [ebp - 2]
mov byte [ebp - 2], 0
push eax
push dword [ebp - 0xc]
push edi
call fcn.00453aa0
add esp, 0x10
cmp byte [ebp - 2], 0
je 0x450763
mov byte [ebp + 0xf], 1
jmp 0x450763
mov esi, dword [ebp + 0x1c]
mov byte [ebp - 3], al
lea eax, [ebp - 0x10]
push esi
push eax
lea eax, [ebp + 0xf]
push eax
lea eax, [ebp - 3]
push eax
lea eax, [ebp + 0xb]
push eax
push 0x200000
push dword [ebp - 8]
call fcn.004539d0
mov edi, eax
add esp, 0x1c
test edi, edi
je 0x45073a
cmp byte [ebp + 0xb], 0
jne 0x450743
push dword [ebx + 0x3c]
lea eax, [ebp - 2]
mov byte [ebp - 2], 0
push eax
push dword [ebp - 0xc]
push edi
call fcn.00453aa0
movzx ecx, byte [ebp + 0xf]
add esp, 0x10
cmp byte [ebp - 2], 0
mov edx, 1
cmovne ecx, edx
mov byte [ebp + 0xf], cl
test al, al
jne 0x450743
push esi
push 0
push 0
push dword [ebp - 0x10]
push 0x200000
push edi
call fcn.00453ac0
add esp, 0x18
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x10]
mov dword [edi], eax
mov al, byte [ebp - 3]
mov byte [edi + 4], al
mov al, byte [ebp + 0xb]
push ebx
push dword [ebp - 8]
mov byte [edi + 5], al
call fcn.00450e70
mov esi, dword [ebp - 0x14]
add esp, 8
mov eax, dword [ebp - 0xc]
add eax, 0xfffffff8
push eax
lea eax, [edi + 8]
push 0
push eax
call fcn.00458a10
add esp, 0xc
xor ch, ch
test esi, esi
je 0x4507b9
xor eax, eax
lea eax, [eax + eax*4]
lea edx, [edi + eax*8]
mov byte [edx + 0x3c], ch
inc ch
mov al, byte [edx + 0x3d]
and al, 0xfd
mov byte [edx + 0x3d], al
mov cl, byte [ebp + 0xb]
shl cl, 2
xor cl, al
and cl, 4
xor cl, al
mov byte [edx + 0x3d], cl
mov al, byte [ebp + 0xf]
shl al, 3
xor al, cl
and al, 8
xor al, cl
mov byte [edx + 0x3d], al
movzx eax, ch
cmp eax, esi
jb 0x450780
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp + 0x14]
mov dword [edi + 0x30], eax
mov eax, dword [ebp - 0xc]
mov dword [edi + 0x20], esi
mov esi, dword [ebp - 8]
mov dword [edi + 0x28], eax
mov eax, dword fs:[0x18]
mov dword [edi + 0x38], ecx
mov dword [edi + 0x24], esi
mov dword [edi + 0x34], eax
mov eax, edi
xor eax, dword [0x4a66d4]
mov dword [edi + 0x2c], eax
cmp ecx, 1
jg 0x450828
mov eax, dword [edi + 0x38]
test eax, eax
je 0x450800
cmp eax, 1
jne 0x4507fe
add ebx, 8
jmp 0x450800
xor ebx, ebx
mov dword [edi + 8], 0
mov eax, dword [ebx + 4]
mov dword [edi + 0xc], eax
mov eax, dword [ebx + 4]
test eax, eax
je 0x450823
mov dword [eax + 8], edi
mov eax, edi
mov dword [ebx + 4], edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebx], edi
mov dword [ebx + 4], edi
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret