Function at 0x409472
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x884
mov eax, dword [0x449020]
xor eax, esp
mov dword [esp + 0x87c], eax
cmp dword [esp + 0x89c], 0x18
mov eax, ecx
mov ecx, dword [esp + 0x890]
mov edx, dword [esp + 0x88c]
push ebx
push ebp
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x89c]
push esi
push edi
mov edi, dword [esp + 0x8b4]
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x8b0]
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], edx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x20], edi
jbe 0x4094d8
xor al, al
jmp 0x4096dc
xor ebx, ebx
lea esi, [eax + 0xf4]
mov ebp, ebx
push edx
mov ecx, esi
call fcn.00414fb3
test al, al
je 0x409510
mov eax, dword [esp + 0x8ac]
lea ecx, [esi + 0x10]
cmp dword [ecx + 0x30], eax
jne 0x409510
push 0x10
push dword [esp + 0x14]
push ecx
call fcn.00424f0a
add esp, 0xc
test eax, eax
je 0x409522
inc ebp
add esi, 0x84
cmp ebp, 4
jae 0x40956d
mov edx, dword [esp + 0x14]
jmp 0x4094e2
push 0x20
pop ebp
push ebp
lea eax, [esi + 0x20]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.00424830
add esp, 0xc
lea ecx, [esp + 0x28]
mov edx, ebp
push ebx
push ebx
call fcn.00415035
push ebp
lea eax, [esi + 0x44]
push eax
lea eax, [esp + 0x50]
push eax
call fcn.00424830
add esp, 0xc
lea eax, [esi + 0x64]
push ebp
push eax
lea eax, [esp + 0x70]
push eax
call fcn.00424830
add esp, 0xc
jmp 0x40965b
push ecx
mov ecx, dword [esp + 0x20]
lea edx, [esp + 0x8c]
call fcn.00418696
mov ebp, dword [esp + 0x8ac]
xor eax, eax
mov esi, dword [esp + 0x10]
inc eax
mov ecx, ebp
shl eax, cl
push eax
lea eax, [esp + 0x4c]
push eax
lea eax, [esp + 0x70]
push eax
lea eax, [esp + 0x34]
push eax
push ecx
lea eax, [esp + 0x9c]
push esi
push eax
call fcn.004283c0
pop ecx
mov edx, eax
lea ecx, [esp + 0xa0]
call fcn.004092af
mov edx, 0x800
lea ecx, [esp + 0x88]
call fcn.00414eeb
mov edx, dword [esp + 0x18]
push dword [esp + 0x14]
mov ecx, dword [edx + 0x304]
lea edi, [edx + 0xf4]
mov eax, ecx
and eax, 3
imul eax, eax, 0x84
add edi, eax
lea eax, [ecx + 1]
mov dword [edx + 0x304], eax
mov ecx, edi
mov dword [edi + 0x40], ebp
call fcn.00409b8a
push 0x10
lea eax, [edi + 0x10]
push esi
push eax
call fcn.00424830
add esp, 0xc
lea eax, [esp + 0x28]
lea esi, [edi + 0x20]
push 0x20
pop ebp
push ebp
push eax
push esi
call fcn.00424830
add esp, 0xc
lea eax, [esp + 0x48]
push ebp
push eax
lea eax, [edi + 0x44]
push eax
call fcn.00424830
add esp, 0xc
lea eax, [esp + 0x68]
push ebp
push eax
lea eax, [edi + 0x64]
push eax
call fcn.00424830
add esp, 0xc
mov edx, ebp
mov ecx, esi
push ebx
push 1
call fcn.00415035
mov edi, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
test eax, eax
je 0x409672
push ebp
lea ecx, [esp + 0x6c]
push ecx
push eax
call fcn.00424830
add esp, 0xc
test edi, edi
je 0x40969e
push 8
push ebx
push edi
call fcn.00424db0
add esp, 0xc
mov al, byte [esp + ebx + 0x48]
mov ecx, ebx
and ecx, 7
xor byte [ecx + edi], al
inc ebx
cmp ebx, ebp
jb 0x409682
mov edx, ebp
lea ecx, [esp + 0x48]
call fcn.00414eeb
cmp dword [esp + 0x8a8], 0
je 0x4096cf
push dword [esp + 0x8a8]
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x2c]
push 0x100
push eax
push dword [esp + 0x8a4]
add ecx, 0x30c
call fcn.004143c7
mov edx, ebp
lea ecx, [esp + 0x28]
call fcn.00414eeb
mov al, 1
mov ecx, dword [esp + 0x88c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00423145
add esp, 0x884
ret 0x20