Function at 0x406624
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x7a8
push ebx
push ebp
mov ebp, dword [esp + 0x7bc]
xor eax, eax
mov dword [esp + 0x14], eax
mov ebx, ecx
mov dword [esp + 0x10], ebx
push esi
mov esi, edx
mov dword [esp + 0x10], esi
push edi
test ebp, ebp
jle 0x406694
mov ecx, dword [esp + 0x7c0]
mov ebx, edx
mov edi, dword [esp + 0x7bc]
sub ecx, edi
mov dword [esp + 0x7c0], ecx
mov esi, dword [ecx + edi]
add eax, ebx
push esi
push dword [edi]
push eax
call fcn.0040dec0
mov eax, dword [esp + 0x28]
lea edi, [edi + 4]
mov ecx, dword [esp + 0x7cc]
add eax, esi
add esp, 0xc
mov dword [esp + 0x1c], eax
dec ebp
jne 0x406664
mov ebx, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
xor ebp, ebp
mov ecx, ebp
mov edx, ebp
test ebx, ebx
jle 0x4066bd
mov edi, dword [esp + 0x7c8]
mov al, byte [ecx + edi]
xor byte [edx + esi], al
inc ecx
xor eax, eax
cmp ecx, dword [esp + 0x7cc]
cmove ecx, eax
inc edx
cmp edx, ebx
jl 0x4066a5
push 0x44c
call fcn.0040f8e1
mov edi, eax
pop ecx
test edi, edi
je 0x4066e9
or dword [edi + 4], 0xffffffff
or dword [edi + 0x238], 0xffffffff
mov dword [edi], ebp
mov dword [edi + 0x23c], ebp
mov dword [edi + 0x240], ebp
jmp 0x4066eb
mov edi, ebp
push ecx
push ebx
push esi
mov ecx, edi
call fcn.0040cec0
mov dword [0x4a07e4], eax
test eax, eax
je 0x40670e
test edi, edi
je 0x40670a
push ecx
mov ecx, edi
call fcn.0040d5a3
mov esi, ebp
jmp 0x406721
push 8
call fcn.0040f8e1
mov esi, eax
pop ecx
mov dword [esi], 1
mov dword [esi + 4], edi
push 5
mov edx, 0x43123c
lea ecx, [esp + 0x3c]
call fcn.00405158
cmp dword [eax + 0x14], 8
jb 0x406739
mov eax, dword [eax]
mov edx, 0x80000
mov ecx, 0x10000
test esi, esi
jne 0x406751
mov dword [0x4a07e4], ecx
mov edi, ecx
jmp 0x40677c
cmp dword [esi], 1
je 0x406760
mov dword [0x4a07e4], edx
mov edi, edx
jmp 0x40677c
lea ecx, [esp + 0x50]
push ecx
lea ecx, [esp + 0x1c]
push ecx
push ecx
mov ecx, dword [esi + 4]
push eax
call fcn.0040d41a
mov edi, eax
mov dword [0x4a07e4], edi
push ebp
push 1
lea ecx, [esp + 0x40]
call fcn.00402572
test edi, edi
je 0x40684d
mov eax, dword [0x49a00c]
cmp dword [eax + 0x14], ebp
je 0x406825
push 4
mov edx, 0x43b4ec
lea ecx, [esp + 0x24]
call fcn.00405158
push edi
sub esp, 0x18
mov esi, eax
lea eax, [esp + 0x29c]
push 6
pop ecx
mov edi, esp
push 0x3ff
push eax
lea eax, [esp + 0x5c]
rep movsd dword es:[edi], dword [esi]
push eax
call fcn.0040660d
add esp, 0x28
lea ecx, [esp + 0x38]
push ebp
push 1
call fcn.00402572
push ebp
push 1
lea ecx, [esp + 0x28]
call fcn.00402572
push 3
mov edx, 0x430ba8
lea ecx, [esp + 0x24]
call fcn.00405158
cmp dword [eax + 0x14], 8
jb 0x406805
mov eax, dword [eax]
push 0x40040
push eax
lea eax, [esp + 0x288]
push eax
push ecx
call fcn.004040ec
push ebp
push 1
lea ecx, [esp + 0x28]
call fcn.00402572
push 0x2f
mov edx, 0x437230
lea ecx, [esp + 0x24]
call fcn.00405158
mov ecx, eax
call fcn.004079a4
push ebp
push 1
lea ecx, [esp + 0x28]
call fcn.00402572
jmp 0x4068ea
mov ebx, dword [esp + 0x27c]
push ebx
call fcn.0040dcc3
mov ebp, eax
pop ecx
test esi, esi
jne 0x40686d
mov dword [0x4a07e4], 0x10000
jmp 0x406892
cmp dword [esi], 1
je 0x40687e
mov dword [0x4a07e4], 0x80000
jmp 0x406892
push ecx
mov ecx, dword [esi + 4]
push ebx
push ebp
push dword [esp + 0x24]
call fcn.0040d4c2
mov dword [0x4a07e4], eax
push ebx
push ebp
push dword [esp + 0x1c]
call fcn.0040dec0
add esp, 0xc
test esi, esi
jne 0x4068b0
mov dword [0x4a07e4], 0x10000
jmp 0x4068e3
cmp dword [esi], 1
je 0x4068c1
mov dword [0x4a07e4], 0x80000
jmp 0x4068e3
mov edi, dword [esi + 4]
mov ecx, edi
call fcn.0040d565
mov dword [0x4a07e4], eax
test edi, edi
je 0x4068dc
push ecx
mov ecx, edi
call fcn.0040d5a3
push esi
call fcn.0040f6d3
pop ecx
push ebp
call fcn.0040f590
pop ecx
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x7a8
ret 0x14