Function at 0x406b30
Capabilities:
Link many functions at runtime

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x6c
mov eax, dword [0x409004]
xor eax, esp
mov dword [esp + 0x68], eax
mov eax, dword [ebp + 0x10]
xor edx, edx
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x14]
mov dword [esp + 0x14], eax
mov eax, dword [ebp + 0x1c]
and dword [esp + 0x64], 0
mov dword [esp + 0x20], eax
mov eax, dword [ebp + 0x20]
push ebx
mov dword [esp + 0x1c], eax
mov ebx, ecx
mov eax, dword [ebp + 0x24]
push esi
mov esi, dword [ebp + 0x18]
push edi
mov dword [esp + 0x30], eax
lea edi, [esp + 0x34]
xor eax, eax
mov dword [esp + 0x28], esi
stosd dword es:[edi], eax
push 0xa
pop ecx
mov dword [esp + 0xc], edx
stosd dword es:[edi], eax
mov dword [esp + 0x10], edx
stosd dword es:[edi], eax
xor eax, eax
and dword [esp + 0x6c], eax
lea edi, [esp + 0x40]
rep stosd dword es:[edi], eax
lea edi, [ebx + 8]
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], eax
cmp dword [edi], eax
jne 0x406c52
cmp dword [ebp + 0xc], eax
mov ecx, ebx
push edi
push dword [esp + 0x20]
setne al
push eax
call fcn.004068d3
mov esi, eax
test esi, esi
js 0x406de2
push 0x401a30
push dword [edi]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebx + 0x14], eax
test eax, eax
jne 0x406c02
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [esp + 0xc]
mov esi, eax
test esi, esi
jle 0x406de6
movzx esi, si
or esi, 0x80070000
jmp 0x406de6
push 0x401a68
push dword [edi]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebx + 0x18], eax
test eax, eax
je 0x406be0
push 0x401a84
push dword [edi]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebx + 0x1c], eax
test eax, eax
je 0x406be0
push 0x401aa8
push dword [edi]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebx + 0x20], eax
test eax, eax
je 0x406be0
push 0x401a48
push dword [edi]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, dword [esp + 0x28]
mov dword [ebx + 0x24], eax
cmp dword [ebx + 0x10], 0
jne 0x406da1
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x44]
and dword [esp + 0x38], 0
or ecx, 0x14
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x34]
mov dword [esp + 0x34], 0xc
mov dword [esp + 0x40], 0x28
mov dword [esp + 0x44], ecx
mov dword [esp + 0x58], eax
test esi, esi
je 0x406caa
mov edx, dword [esi]
mov eax, edx
mov esi, dword [esi + 4]
or eax, esi
je 0x406caa
or ecx, 1
mov dword [esp + 0x48], edx
mov dword [esp + 0x44], ecx
mov dword [esp + 0x4c], esi
cmp dword [esp + 0x24], 0
je 0x406d04
mov esi, dword [ebx + 0x14]
lea eax, [esp + 0x70]
push eax
lea eax, [esp + 0x70]
mov ecx, esi
push eax
lea eax, [esp + 0x48]
push eax
call dword [0x40a218]
call esi
mov esi, eax
test esi, esi
js 0x406de2
lea eax, [esp + 0x10]
push eax
push ecx
push dword [esp + 0x74]
mov ecx, ebx
push dword [esp + 0x2c]
call fcn.00406a56
mov edi, dword [esp + 0x10]
mov esi, eax
test esi, esi
js 0x406de6
mov ecx, dword [esp + 0x44]
mov dword [esp + 0xc], edi
jmp 0x406d08
mov edi, dword [esp + 0xc]
cmp dword [ebp + 8], 0
je 0x406d2e
mov eax, dword [esp + 0x2c]
or ecx, 0x480
mov dword [esp + 0x44], ecx
test eax, eax
je 0x406d2e
or ecx, 0x100
mov dword [esp + 0x64], eax
mov dword [esp + 0x44], ecx
mov esi, dword [ebx + 0x14]
lea eax, [esp + 0x70]
push eax
lea eax, [ebx + 0x10]
mov ecx, esi
push eax
lea eax, [esp + 0x48]
push eax
call dword [0x40a218]
call esi
mov esi, eax
test esi, esi
js 0x406de2
mov esi, dword [ebx + 0x24]
test esi, esi
je 0x406da5
cmp dword [ebp + 0xc], 0
mov ecx, esi
push 0
push dword [ebx + 0x10]
je 0x406d8f
xor eax, eax
cmp byte [ebx + 0x34], al
setne al
lea eax, [eax*2 + 2]
push eax
call dword [0x40a218]
call esi
lea esi, [eax + 0x7ff8ffa9]
neg esi
sbb esi, esi
and esi, eax
jl 0x406de2
jmp 0x406da5
push 1
call dword [0x40a218]
call esi
mov esi, eax
test esi, esi
js 0x406de2
jmp 0x406da5
mov edi, dword [esp + 0xc]
lea eax, [esp + 0x14]
push eax
push ecx
push dword [ebx + 0x10]
mov ecx, ebx
push dword [esp + 0x2c]
call fcn.00406a56
mov esi, eax
mov eax, dword [esp + 0x14]
test esi, esi
js 0x406dde
mov ecx, dword [esp + 0x30]
xor esi, esi
and dword [esp + 0x18], 0
mov dword [ecx], eax
mov eax, dword [esp + 0x24]
test eax, eax
je 0x406de2
mov dword [eax], edi
xor edi, edi
jmp 0x406de6
mov dword [esp + 0x18], eax
mov edi, dword [esp + 0xc]
cmp dword [esp + 0x6c], 0
je 0x406e02
mov ebx, dword [ebx + 0x18]
test ebx, ebx
je 0x406e02
push dword [esp + 0x6c]
mov ecx, ebx
call dword [0x40a218]
call ebx
mov ebx, dword [esp + 0x18]
test ebx, ebx
je 0x406e1a
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push ebx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
test edi, edi
je 0x406e2e
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push edi
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [esp + 0x74]
mov eax, esi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00407be0
mov esp, ebp
pop ebp
ret 0x20