Function at 0x406c10
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [0x4118ca]
sub esp, 0x2c
test eax, eax
push ebx
push ebp
je 0x407024
mov eax, dword [0x414500]
mov ecx, dword [0x4144dc]
push 0x104
push eax
push ecx
call dword [0x4143d0]
test eax, eax
je 0x407024
mov edx, dword [0x414500]
push 0x80000000
push edx
call fcn.00401a70
mov ebp, eax
add esp, 8
cmp ebp, 0xffffffff
je 0x407024
mov eax, dword [0x4118ca]
push 0
push eax
push ebp
call fcn.00401b70
add esp, 0xc
mov word [esp + 0x28], 0
push esi
push edi
lea ecx, [esp + 0x30]
push 0xc
push ecx
push ebp
call fcn.00401ac0
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x406fcf
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
or edx, eax
je 0x406fb9
push ebp
call fcn.00401b40
mov edi, dword [esp + 0x38]
mov esi, dword [esp + 0x3c]
add esp, 4
add eax, edi
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x30]
adc edx, esi
and eax, 0xffff
add eax, 0xffffedcc
mov dword [esp + 0x2c], edx
cmp eax, 8
ja case.0x406cd9.4664
jmp dword [eax*4 + 0x407038]
push 0x4144b0
call fcn.004020e0
push 0
lea ecx, [esp + 0x38]
push 0x4144b0
push ecx
push ebp
call fcn.00401be0
add esp, 0x14
jmp 0x406fa0
lea edx, [esp + 0x24]
push 2
push edx
push ebp
call fcn.00401ac0
add esp, 0xc
xor esi, esi
mov eax, dword [esp + 0x24]
mov dword [esp + 0x1c], esi
cmp ax, 1
jb 0x406d29
mov eax, 1
cmp si, ax
jae case.0x406cd9.4664
lea eax, [esp + 0x10]
push 2
push eax
push ebp
call fcn.00401ac0
mov eax, dword [esp + 0x1c]
add esp, 0xc
test ax, ax
je 0x406de4
and esi, 0xffff
and eax, 0xffff
lea esi, [esi*4 + 0x41448c]
lea ecx, [eax*4 + 4]
push esi
push ecx
call fcn.00402060
add esp, 8
test eax, eax
je 0x406fc8
mov esi, dword [esi]
xor edi, edi
cmp word [esp + 0x10], di
jbe 0x406de4
lea edx, [esp + 0x18]
push 2
push edx
push ebp
call fcn.00401ac0
mov eax, dword [esp + 0x24]
push esi
and eax, 0xffff
lea ecx, [eax + eax + 2]
push ecx
call fcn.00402060
add esp, 0x14
test eax, eax
je 0x406ddf
mov eax, dword [esp + 0x18]
test ax, ax
je 0x406dca
mov edx, dword [esi]
and eax, 0xffff
add eax, eax
push eax
push edx
push ebp
call fcn.00401ac0
add esp, 0xc
add esi, 4
inc edi
cmp di, word [esp + 0x10]
jb 0x406d85
mov esi, dword [esp + 0x1c]
inc esi
jmp 0x406d16
mov ebx, 7
mov esi, dword [esp + 0x1c]
inc esi
jmp 0x406d16
push ebp
call fcn.004070e0
add esp, 4
jmp 0x406fa0
lea eax, [esp + 0x14]
lea ecx, [esp + 0x20]
push eax
lea edx, [esp + 0x34]
push ecx
push edx
push ebp
call fcn.00401be0
mov ebx, eax
mov eax, dword [esp + 0x24]
add esp, 0x10
test eax, eax
jbe case.0x406cd9.4664
mov ecx, dword [0x414494]
test ecx, ecx
jne 0x406e40
mov ecx, dword [esp + 0x20]
mov dword [0x414490], eax
mov dword [0x414494], ecx
jmp case.0x406cd9.4664
mov edx, dword [0x414490]
push 0x414494
add edx, eax
push edx
call fcn.004020a0
add esp, 8
test eax, eax
je 0x406fc8
mov eax, dword [0x414494]
mov ecx, dword [0x414490]
cmp word [eax + ecx*2 - 2], 0
lea edi, [eax + ecx*2 - 2]
jne case.0x406cd9.4664
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x20]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x14]
mov ecx, dword [0x414490]
lea edx, [ecx + eax - 1]
mov dword [0x414490], edx
jmp case.0x406cd9.4664
push ebp
call fcn.004072f0
add esp, 4
jmp 0x406fa0
push ebp
call fcn.00407570
add esp, 4
jmp 0x406fa0
mov eax, dword [0x4144b8]
test eax, eax
jne 0x406fa6
push 0x4144b4
lea eax, [esp + 0x34]
push 0x4144b8
push eax
push ebp
call fcn.00401be0
mov ebx, eax
add esp, 0x10
test ebx, ebx
mov dword [esp + 0x1c], ebx
jne 0x406fd4
mov eax, dword [0x4144b4]
mov ecx, dword [0x4144b8]
sub eax, 8
mov edx, eax
mov dword [0x4144b4], eax
mov esi, dword [ecx]
xor edx, 0x1b5b
cmp edx, esi
jne 0x406f79
push eax
add ecx, 8
push eax
push ecx
call fcn.00407060
mov ecx, dword [0x4144b8]
add esp, 0xc
cmp eax, dword [ecx + 4]
jne 0x406f79
mov eax, dword [0x4144b4]
lea edx, [ecx + 8]
push eax
push edx
push ecx
call fcn.004084f0
mov ecx, dword [0x4144b4]
add esp, 0xc
xor eax, eax
mov dl, 0x5b
test ecx, ecx
jbe 0x406fa6
mov esi, dword [0x4144b8]
mov cl, byte [esi + eax]
mov bl, cl
xor bl, dl
mov byte [esi + eax], bl
mov bl, al
add bl, cl
mov ecx, dword [0x4144b4]
add dl, bl
inc eax
cmp eax, ecx
jb 0x406f52
mov ebx, dword [esp + 0x1c]
jmp 0x406fa6
push 0x4144b8
call fcn.004020e0
add esp, 4
jmp 0x406fa6
push 0x4144ec
lea eax, [esp + 0x34]
push 0x4144f0
push eax
push ebp
call fcn.00401be0
add esp, 0x10
mov ebx, eax
test ebx, ebx
jne 0x406fd4
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
push ecx
push edx
push ebp
call fcn.00401b70
add esp, 0xc
cmp word [esp + 0x30], 0x7f7f
jne 0x406c7b
jmp 0x406fd4
mov ebx, 7
jmp 0x406fd4
mov ebx, 8
push ebp
call fcn.00401c50
add esp, 4
test ebx, ebx
pop edi
pop esi
je 0x40702c
lea eax, [esp + 0xc]
push eax
push 0x800
call fcn.00402060
add esp, 8
test eax, eax
je 0x407024
mov ecx, dword [0x414500]
mov edx, dword [esp + 0xc]
push ecx
push ebx
push edx
call fcn.00404a10
mov eax, dword [esp + 0x18]
push 0x40
push eax
call fcn.004049e0
lea ecx, [esp + 0x20]
push ecx
call fcn.004020e0
add esp, 0x18
pop ebp
xor eax, eax
pop ebx
add esp, 0x2c
ret
pop ebp
mov eax, 1
pop ebx
add esp, 0x2c
ret