Function at 0x409492
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x884
mov eax, dword [0x449020]
xor eax, esp
mov dword [esp + 0x87c], eax
mov eax, dword [esp + 0x890]
mov edx, dword [esp + 0x88c]
push ebx
push ebp
mov dword [esp + 0x14], eax
xor ebx, ebx
cmp dword [esp + 0x8a4], 0x18
mov eax, dword [esp + 0x89c]
push esi
mov esi, dword [esp + 0x8b0]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x8ac]
push edi
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], edx
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], esi
jbe 0x40951a
test eax, eax
je 0x409501
push 0x20
push ebx
push eax
call fcn.00424b20
add esp, 0xc
test esi, esi
je 0x40971a
push 8
push ebx
push esi
call fcn.00424b20
add esp, 0xc
jmp 0x40971a
mov ebp, ebx
lea edi, [ecx + 0xf4]
push edx
mov ecx, edi
call fcn.00414d9f
test al, al
je 0x409550
mov eax, dword [esp + 0x8ac]
lea ecx, [edi + 0x10]
cmp dword [ecx + 0x30], eax
jne 0x409550
push 0x10
push dword [esp + 0x14]
push ecx
call fcn.00424c7a
add esp, 0xc
test eax, eax
je 0x409562
inc ebp
add edi, 0x84
cmp ebp, 4
jae 0x4095ad
mov edx, dword [esp + 0x14]
jmp 0x409522
push 0x20
pop ebp
push ebp
lea eax, [edi + 0x20]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.004245a0
add esp, 0xc
lea ecx, [esp + 0x28]
mov edx, ebp
push ebx
push ebx
call fcn.00414e21
push ebp
lea eax, [edi + 0x44]
push eax
lea eax, [esp + 0x50]
push eax
call fcn.004245a0
add esp, 0xc
lea eax, [edi + 0x64]
push ebp
push eax
lea eax, [esp + 0x70]
push eax
call fcn.004245a0
add esp, 0xc
jmp 0x40969b
push ecx
mov ecx, dword [esp + 0x20]
lea edx, [esp + 0x8c]
call fcn.00418403
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.00428130
pop ecx
mov edx, eax
lea ecx, [esp + 0xa0]
call fcn.004092cf
mov edx, 0x800
lea ecx, [esp + 0x88]
call fcn.00414cd7
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.00409bba
push 0x10
lea eax, [edi + 0x10]
push esi
push eax
call fcn.004245a0
add esp, 0xc
lea eax, [esp + 0x28]
lea esi, [edi + 0x20]
push 0x20
pop ebp
push ebp
push eax
push esi
call fcn.004245a0
add esp, 0xc
lea eax, [esp + 0x48]
push ebp
push eax
lea eax, [edi + 0x44]
push eax
call fcn.004245a0
add esp, 0xc
lea eax, [esp + 0x68]
push ebp
push eax
lea eax, [edi + 0x64]
push eax
call fcn.004245a0
add esp, 0xc
mov edx, ebp
mov ecx, esi
push ebx
push 1
call fcn.00414e21
mov esi, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
test eax, eax
je 0x4096b2
push ebp
lea ecx, [esp + 0x6c]
push ecx
push eax
call fcn.004245a0
add esp, 0xc
test esi, esi
je 0x4096de
push 8
push ebx
push esi
call fcn.00424b20
add esp, 0xc
mov al, byte [esp + ebx + 0x48]
mov ecx, ebx
and ecx, 7
xor byte [ecx + esi], al
inc ebx
cmp ebx, ebp
jb 0x4096c2
mov edx, ebp
lea ecx, [esp + 0x48]
call fcn.00414cd7
cmp dword [esp + 0x8a8], 0
je 0x40970f
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.004141b3
mov edx, ebp
lea ecx, [esp + 0x28]
call fcn.00414cd7
mov ecx, dword [esp + 0x88c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00422eb5
add esp, 0x884
ret 0x20