Function at 0x406170
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x13c
mov eax, dword [0x44e4f8]
xor eax, esp
mov dword [esp + 0x138], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, ecx
xor ecx, ecx
cmp dword [ebx], ecx
push esi
mov dword [esp + 0x54], eax
mov eax, dword [ebp + 0x14]
push edi
mov dword [esp + 0x54], ebx
jne 0x4061bf
mov eax, 0x80004005
mov ecx, dword [esp + 0x144]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004322fb
mov esp, ebp
pop ebp
ret 0x10
cmp eax, ecx
mov dword [ebx + 4], edx
mov byte [esp + 0x12], 1
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], ecx
je 0x4062ef
mov byte [esp + 0x12], cl
lea ecx, [esp + 0x20]
push ecx
push 0x3b
mov ebx, eax
call fcn.0040df90
pop ecx
pop ecx
lea eax, [esp + 0x20]
xor edi, edi
call fcn.004011c7
test eax, eax
jbe 0x40623f
push edi
lea esi, [esp + 0x24]
call fcn.00408f1c
mov esi, eax
push 0x442ef0
push esi
mov ebx, 0x442e20
call fcn.0040c849
push 0x5c
push 0x2f
call fcn.0040c89e
push 0x442ee4
push esi
call fcn.0040c919
add esp, 0x18
lea eax, [esp + 0x20]
inc edi
call fcn.004011c7
cmp edi, eax
jb 0x4061fe
mov ebx, dword [esp + 0x24]
cmp ebx, dword [esp + 0x28]
jbe 0x40624e
call fcn.0043217c
lea eax, [esp + 0x20]
mov dword [esp + 0x30], eax
mov dword [esp + 0x38], eax
mov esi, dword [esp + 0x28]
cmp dword [esp + 0x24], esi
mov dword [esp + 0x34], ebx
jbe 0x40626d
call fcn.0043217c
mov dword [esp + 0x3c], esi
lea edi, [esp + 0x38]
lea esi, [esp + 0x30]
call fcn.004050c3
test al, al
je 0x4062d0
call fcn.004050a6
cmp dword [eax + 0x14], 0
mov esi, dword [esp + 0x30]
jne 0x4062b8
push ebx
push dword [esp + 0x2c]
lea eax, [ebx + 0x1c]
call fcn.004073d1
mov eax, dword [esp + 0x30]
pop ecx
pop ecx
push eax
add eax, 0xffffffe4
call fcn.00401788
sub dword [esp + 0x28], 0x1c
mov dword [esp + 0x30], esi
jmp 0x40625a
test esi, esi
jne 0x4062c1
call fcn.0043217c
cmp ebx, dword [esi + 8]
jb 0x4062cb
call fcn.0043217c
add ebx, 0x1c
jmp 0x40625a
lea eax, [esp + 0x20]
call fcn.004011c7
test eax, eax
jne 0x4062eb
lea esi, [esp + 0x20]
call fcn.00401539
jmp 0x4061a3
mov ebx, dword [esp + 0x54]
mov eax, dword [esp + 0x58]
lea esi, [esp + 0xc0]
call fcn.00401aa6
cmp dword [esp + 0xd4], 0
je 0x406315
mov eax, esi
push 0x10
push eax
call fcn.0040d99d
pop ecx
pop ecx
mov eax, dword [ebx]
test eax, eax
mov dword [esp + 0x18], eax
je 0x406324
call fcn.0040e20e
lea eax, [ebx + 8]
call fcn.004159bd
mov edi, eax
xor esi, esi
cmp edi, esi
mov dword [esp + 0x30], edi
jne 0x40636c
cmp dword [esp + 0x18], esi
je 0x406347
mov esi, dword [esp + 0x18]
call fcn.0040e21b
mov edi, 0x80004005
push 0
push 1
lea esi, [esp + 0xc8]
call fcn.00401452
lea esi, [esp + 0x20]
call fcn.00401539
mov eax, edi
jmp 0x4061a8
lea ecx, [esp + 0x40]
mov dword [esp + 0x48], esi
mov dword [esp + 0x4c], esi
mov dword [esp + 0x50], esi
mov dword [esp + 0x40], esi
mov eax, dword [edi]
push ecx
mov ecx, edi
call dword [eax + 0x18]
cmp eax, esi
mov dword [esp + 0x1c], eax
je 0x4063ac
lea esi, [esp + 0x44]
call fcn.004068b9
mov esi, dword [esp + 0x18]
test esi, esi
je 0x4063a6
call fcn.0040e21b
mov edi, dword [esp + 0x1c]
jmp 0x40634c
cmp dword [esp + 0x40], esi
jne 0x4063cc
lea esi, [esp + 0x44]
call fcn.004068b9
mov esi, dword [esp + 0x18]
test esi, esi
je 0x4063c8
call fcn.0040e21b
xor edi, edi
jmp 0x40634c
cmp dword [esp + 0x40], esi
mov dword [esp + 0x14], esi
jbe 0x4064f1
lea eax, [esp + 0x98]
mov byte [esp + 0x13], 0
call fcn.0040e515
mov eax, dword [edi]
lea ecx, [esp + 0x98]
push ecx
push 6
push dword [esp + 0x1c]
mov ecx, edi
call dword [eax + 0x1c]
cmp eax, esi
mov dword [esp + 0x1c], eax
jne 0x4065d2
lea eax, [esp + 0x98]
call fcn.004159bd
cmp eax, 4
jne 0x406432
lea eax, [esp + 0x98]
call fcn.0040e551
test al, al
je 0x406432
mov byte [esp + 0x13], 1
lea eax, [esp + 0x98]
call fcn.0040e53f
mov eax, dword [edi]
lea ecx, [esp + 0x98]
push ecx
push 3
push dword [esp + 0x1c]
mov ecx, edi
call dword [eax + 0x1c]
cmp eax, esi
mov dword [esp + 0x1c], eax
jne 0x4065d2
lea eax, [esp + 0x98]
call fcn.0040fc90
lea esi, [esp + 0xdc]
call fcn.00401aa6
cmp byte [esp + 0x12], 0
je 0x40652d
lea esi, [ebx + 0x30]
mov eax, dword [esi + 4]
mov dword [esp + 0x70], eax
lea eax, [esp + 0x5c]
push eax
lea ebx, [esp + 0x18]
mov dword [esp + 0x70], esi
call fcn.00406868
lea edi, [esp + 0x6c]
mov esi, eax
call fcn.00403be1
test al, al
je 0x4064b9
mov eax, ebx
push eax
lea eax, [esp + 0x48]
call fcn.004068d4
push 0
push 1
lea esi, [esp + 0xe4]
call fcn.00401452
lea eax, [esp + 0x98]
call fcn.0040e52e
mov edi, dword [esp + 0x30]
mov ebx, dword [esp + 0x54]
inc dword [esp + 0x14]
mov eax, dword [esp + 0x14]
xor esi, esi
cmp eax, dword [esp + 0x40]
jb 0x4063da
cmp dword [esp + 0x48], esi
je 0x4063b2
mov eax, dword [esp + 0x4c]
sub eax, dword [esp + 0x48]
sar eax, 2
je 0x4063b2
push 0x140
call fcn.0043237e
cmp eax, esi
pop ecx
je 0x4065e3
mov ebx, eax
call fcn.00410ecc
mov edi, eax
jmp 0x4065e5
cmp byte [esp + 0x13], 0
je 0x406552
push 0
push 1
lea esi, [esp + 0xe4]
call fcn.00401452
lea eax, [esp + 0x98]
call fcn.0040e52e
jmp 0x4064dd
mov esi, dword [esp + 0x24]
cmp esi, dword [esp + 0x28]
jbe 0x406561
call fcn.0043217c
lea eax, [esp + 0x20]
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], esi
mov dword [esp + 0x74], eax
mov esi, dword [esp + 0x28]
cmp dword [esp + 0x24], esi
jbe 0x406580
call fcn.0043217c
mov dword [esp + 0x78], esi
lea edi, [esp + 0x74]
lea esi, [esp + 0x38]
call fcn.004050c3
test al, al
je 0x4064b9
call fcn.004050a6
lea ecx, [esp + 0xdc]
call fcn.0040c782
test al, al
je 0x4065bc
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x48]
call fcn.004068d4
mov eax, dword [esp + 0x3c]
cmp eax, dword [esp + 0x28]
jb 0x4065cb
call fcn.0043217c
add dword [esp + 0x3c], 0x1c
jmp 0x406571
lea eax, [esp + 0x98]
call fcn.0040e52e
jmp 0x406390
xor edi, edi
mov ecx, edi
neg ecx
lea eax, [edi + 8]
sbb ecx, ecx
and ecx, eax
lea esi, [esp + 0x14]
call fcn.004073b6
movzx eax, byte [ebp + 0x10]
push eax
movzx eax, byte [ebp + 0xc]
call fcn.00411482
lea eax, [esp + 0xf8]
call fcn.0040d107
mov ebx, dword [esp + 0x54]
push eax
lea eax, [ebx + 0x14]
push eax
call fcn.0040d970
pop ecx
pop ecx
mov eax, 0x442e20
lea ecx, [esp + 0x7c]
call fcn.0040118b
xor eax, eax
lea ecx, [esp + 0xf8]
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
call fcn.0040d1dd
push edx
push eax
mov eax, ecx
call fcn.00410bd7
push eax
lea eax, [esp + 0x88]
push eax
lea eax, [esp + 0x6c]
push eax
push dword [esp + 0x6c]
mov eax, dword [ebx + 0x10]
push dword [esp + 0x48]
push edi
call fcn.00411352
lea esi, [esp + 0x5c]
call fcn.00401539
push 0
push 1
lea esi, [esp + 0x84]
call fcn.00401452
cmp byte [esp + 0x12], 0
je 0x4066a2
cmp dword [ebx + 0x38], 0
jne 0x4066a2
lea eax, [esp + 0x44]
call fcn.0040692e
mov esi, dword [esp + 0x30]
mov edi, dword [esi]
lea eax, [esp + 0x14]
call fcn.004159bd
push eax
push 0
lea eax, [esp + 0x4c]
push eax
mov ecx, esi
call dword [edi + 0x20]
test eax, eax
mov dword [esp + 0x1c], eax
jne 0x4066fb
cmp byte [esp + 0x12], al
jne 0x4066fb
xor esi, esi
cmp dword [esp + 0x48], 0
je 0x4066fb
mov eax, dword [esp + 0x4c]
sub eax, dword [esp + 0x48]
sar eax, 2
cmp esi, eax
jae 0x4066fb
mov eax, dword [esp + 0x48]
lea eax, [eax + esi*4]
push eax
lea eax, [ebx + 0x30]
lea edi, [esp + 0x60]
call fcn.004067c4
inc esi
jmp 0x4066ce
lea eax, [esp + 0xf8]
call fcn.0040d135
lea eax, [esp + 0x14]
call fcn.004073c5
jmp 0x406390