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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x7c
mov eax, dword [0x4f8d30]
xor eax, esp
mov dword [esp + 0x78], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x24]
mov edx, dword [ebp + 0x28]
push ebx
mov dword [esp + 0x40], eax
mov eax, dword [ebp + 0x18]
push esi
mov dword [esp + 0x18], ecx
mov ecx, dword [ebp + 0x2c]
mov dword [esp + 0x38], eax
mov eax, dword [eax + 0x30]
mov esi, dword [eax]
push edi
mov edi, dword [ebp + 0x20]
mov dword [esp + 0x28], edx
mov edx, dword [ebp + 0x30]
mov dword [esp + 0x18], ecx
push 0
lea ecx, [esp + 0x30]
mov dword [esp + 0x14], edx
mov dword [esp + 0x44], esi
call fcn.0047c84d
mov eax, dword [esi + 4]
cmp eax, 0xffffffff
jae 0x4060a4
inc eax
mov dword [esi + 4], eax
lea ecx, [esp + 0x2c]
call fcn.0047c875
lea ecx, [esp + 0x40]
push ecx
call fcn.00407550
add esp, 4
push 0
lea ecx, [esp + 0x28]
mov dword [esp + 0x44], eax
call fcn.0047c84d
mov eax, dword [esi + 4]
test eax, eax
je 0x4060d9
cmp eax, 0xffffffff
jae 0x4060d9
dec eax
mov dword [esi + 4], eax
mov ebx, dword [esi + 4]
neg ebx
sbb ebx, ebx
not ebx
lea ecx, [esp + 0x24]
and ebx, esi
call fcn.0047c875
xor esi, esi
cmp ebx, esi
je 0x4060fd
mov edx, dword [ebx]
mov eax, dword [edx]
push 1
mov ecx, ebx
call eax
mov ebx, dword [esp + 0x40]
mov edx, dword [ebx]
mov edx, dword [edx + 0xc]
lea eax, [esp + 0x68]
push eax
mov ecx, ebx
call edx
mov eax, dword [ebx]
mov edx, dword [eax + 8]
mov ecx, ebx
call edx
mov byte [esp + 0x24], al
mov al, byte [edi]
mov dword [esp + 0x60], 0xf
mov dword [esp + 0x5c], esi
mov byte [esp + 0x4c], 0
cmp al, 0x2b
je 0x40613b
mov dword [esp + 0x34], esi
cmp al, 0x2d
jne 0x406143
mov dword [esp + 0x34], 1
call fcn.0047e1da
mov eax, dword [eax]
mov ebx, dword [esp + 0x10]
mov cl, byte [eax]
push ebx
push 0x65
push edi
mov byte [esp + 0x2c], cl
mov word [esp + 0x2d], 0x65
call fcn.0047e260
movsx edx, byte [esp + 0x2c]
add esp, 0xc
push ebx
push edx
push edi
mov esi, eax
call fcn.0047e260
add esp, 0xc
mov dword [esp + 0x14], eax
test eax, eax
jne 0x406185
mov dword [esp + 0x18], eax
mov ecx, dword [esp + 0x7c]
mov edx, dword [esp + 0x68]
mov eax, edx
cmp ecx, 0x10
jae 0x406198
lea eax, [esp + 0x68]
cmp byte [eax], 0x7f
je 0x4062de
mov eax, edx
cmp ecx, 0x10
jae 0x4061ac
lea eax, [esp + 0x68]
cmp byte [eax], 0
jle 0x4062de
push ebx
push edi
lea ecx, [esp + 0x54]
call fcn.00406b00
test esi, esi
jne 0x4061da
mov eax, dword [esp + 0x18]
push 0x30
push eax
lea ecx, [esp + 0x54]
call fcn.00402d10
mov ebx, dword [esp + 0x14]
jmp 0x406209
mov ebx, dword [esp + 0x14]
test ebx, ebx
jne 0x4061f6
mov ecx, dword [esp + 0x1c]
push 0x30
push ecx
lea ecx, [esp + 0x54]
call fcn.00402d10
mov dword [esp + 0x1c], ebx
mov edx, dword [esp + 0x18]
push 0x30
push edx
sub esi, edi
push esi
lea ecx, [esp + 0x58]
call fcn.00402fb0
push 0x30
test ebx, ebx
jne 0x40621f
mov eax, dword [esp + 0x20]
push eax
lea ecx, [esp + 0x54]
call fcn.00402d10
jmp 0x40624c
mov ecx, dword [esp + 0x2c]
sub ebx, edi
push ecx
lea edx, [ebx + 1]
push edx
lea ecx, [esp + 0x58]
call fcn.00402fb0
mov eax, dword [esp + 0x1c]
push 0x30
push eax
push ebx
lea ecx, [esp + 0x58]
call fcn.00402fb0
mov dword [esp + 0x28], 0
mov ebx, dword [esp + 0x68]
mov esi, 0x10
mov dword [esp + 0x1c], 0
cmp dword [esp + 0x7c], esi
jae 0x406267
lea ebx, [esp + 0x68]
mov eax, dword [esp + 0x4c]
cmp dword [esp + 0x60], esi
jae 0x406275
lea eax, [esp + 0x4c]
lea ecx, [esp + 0x20]
push ecx
push eax
call fcn.0047e320
mov edi, eax
mov al, byte [ebx]
add esp, 8
cmp al, 0x7f
je 0x4062be
jmp 0x406290
test al, al
jle 0x4062be
mov edx, edi
sub edx, dword [esp + 0x34]
movsx eax, al
cmp eax, edx
jae 0x4062be
push 0
sub edi, eax
push 1
push edi
lea ecx, [esp + 0x58]
call fcn.00402fb0
cmp byte [ebx + 1], 0
jle 0x4062b8
inc ebx
mov al, byte [ebx]
cmp al, 0x7f
jne 0x406290
mov edi, dword [esp + 0x4c]
cmp dword [esp + 0x60], esi
jae 0x4062cc
lea edi, [esp + 0x4c]
mov eax, dword [esp + 0x5c]
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], eax
mov ebx, eax
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x3c]
lea eax, [ebx + ecx]
add eax, dword [esp + 0x28]
mov ecx, dword [edx + 0x20]
add eax, dword [esp + 0x1c]
cmp dword [edx + 0x24], 0
jl 0x40630c
jg 0x406300
test ecx, ecx
je 0x40630c
cmp ecx, eax
jbe 0x40630c
sub ecx, eax
mov dword [esp + 0x14], ecx
jmp 0x406314
mov dword [esp + 0x14], 0
mov eax, dword [edx + 0x14]
mov esi, dword [ebp + 8]
and eax, 0x1c0
cmp eax, 0x40
je 0x4063bb
cmp eax, 0x100
je 0x406358
mov edx, dword [esp + 0x14]
mov eax, dword [ebp + 0x1c]
mov ecx, dword [ebp + 0x14]
push edx
mov edx, dword [ebp + 0x10]
push eax
push ecx
push edx
lea eax, [esp + 0x44]
push eax
push esi
call fcn.00406960
mov ecx, dword [eax]
mov dword [ebp + 0x10], ecx
mov edx, dword [eax + 4]
mov dword [ebp + 0x14], edx
jmp 0x4063b0
cmp dword [esp + 0x34], 0
jbe 0x406389
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
push 1
push edi
push eax
push ecx
lea edx, [esp + 0x44]
push edx
push esi
call fcn.00406cb0
mov ecx, dword [eax]
add esp, 0x18
mov dword [ebp + 0x10], ecx
mov edx, dword [eax + 4]
inc edi
dec ebx
mov dword [ebp + 0x14], edx
mov dword [esp + 0x10], ebx
mov eax, dword [esp + 0x14]
mov ecx, dword [ebp + 0x1c]
mov edx, dword [ebp + 0x14]
push eax
mov eax, dword [ebp + 0x10]
push ecx
push edx
push eax
lea ecx, [esp + 0x44]
push ecx
push esi
call fcn.00406960
mov edx, dword [eax]
mov dword [ebp + 0x10], edx
mov eax, dword [eax + 4]
mov dword [ebp + 0x14], eax
mov dword [esp + 0x2c], 0
add esp, 0x18
movsx ecx, byte [esp + 0x20]
push ebx
push ecx
push edi
call fcn.0047e260
add esp, 0xc
test eax, eax
je 0x40648f
mov edx, dword [esp + 0x24]
mov ecx, dword [ebp + 0x14]
sub eax, edi
push edx
mov edx, dword [ebp + 0x10]
lea ebx, [eax + 1]
lea eax, [ebx - 1]
push eax
push edi
push ecx
push edx
lea eax, [esp + 0x48]
push eax
push esi
call fcn.00406d20
mov ecx, dword [eax]
mov dword [ebp + 0x10], ecx
mov edx, dword [eax + 4]
mov ecx, dword [esp + 0x38]
add esp, 0x1c
push ecx
mov dword [ebp + 0x14], edx
mov edx, dword [eax + 4]
mov eax, dword [eax]
push 0x30
push edx
push eax
lea ecx, [esp + 0x44]
push ecx
push esi
call fcn.00406960
mov edx, dword [eax]
mov ecx, dword [esp + 0x58]
mov dword [ebp + 0x10], edx
mov eax, dword [eax + 4]
mov dword [ebp + 0x14], eax
mov edx, dword [ecx]
mov eax, dword [edx + 4]
add esp, 0x18
call eax
mov edx, dword [ebp + 0x14]
push 1
mov byte [esp + 0x30], al
mov ecx, dword [esp + 0x30]
mov eax, dword [ebp + 0x10]
push ecx
push edx
push eax
lea ecx, [esp + 0x50]
push ecx
push esi
call fcn.00406960
mov edx, dword [eax]
mov dword [ebp + 0x10], edx
mov ecx, dword [eax + 4]
mov edx, dword [esp + 0x40]
push edx
mov dword [ebp + 0x14], ecx
mov ecx, dword [eax + 4]
mov edx, dword [eax]
push 0x30
push ecx
push edx
lea eax, [esp + 0x54]
push eax
push esi
call fcn.00406960
mov ecx, dword [eax]
add edi, ebx
add esp, 0x30
sub dword [esp + 0x10], ebx
mov ebx, dword [esp + 0x10]
mov dword [ebp + 0x10], ecx
mov edx, dword [eax + 4]
mov dword [ebp + 0x14], edx
push ebx
push 0x65
push edi
call fcn.0047e260
add esp, 0xc
test eax, eax
je 0x406543
mov edx, dword [ebp + 0x14]
sub eax, edi
lea ebx, [eax + 1]
mov eax, dword [esp + 0x24]
push eax
mov eax, dword [ebp + 0x10]
lea ecx, [ebx - 1]
push ecx
push edi
push edx
push eax
lea ecx, [esp + 0x40]
push ecx
push esi
call fcn.00406d20
mov edx, dword [eax]
add esp, 0x1c
mov dword [ebp + 0x10], edx
mov ecx, dword [eax + 4]
mov edx, dword [esp + 0x18]
push edx
mov dword [ebp + 0x14], ecx
mov ecx, dword [eax + 4]
mov edx, dword [eax]
push 0x30
push ecx
push edx
lea eax, [esp + 0x3c]
push eax
push esi
call fcn.00406960
mov ecx, dword [eax]
mov dword [ebp + 0x10], ecx
mov ecx, dword [esp + 0x54]
mov edx, dword [eax + 4]
add esp, 0x18
test byte [ecx + 0x14], 4
mov dword [ebp + 0x14], edx
mov dword [esp + 0x18], 0
mov ecx, 0x4f2364
jne 0x406516
mov ecx, 0x4f2368
mov edx, dword [eax + 4]
mov eax, dword [eax]
push 1
push ecx
push edx
push eax
lea ecx, [esp + 0x3c]
push ecx
push esi
call fcn.00406cb0
mov edx, dword [eax]
add edi, ebx
add esp, 0x18
sub dword [esp + 0x10], ebx
mov ebx, dword [esp + 0x10]
mov dword [ebp + 0x10], edx
mov eax, dword [eax + 4]
mov dword [ebp + 0x14], eax
mov ecx, dword [esp + 0x24]
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp + 0x10]
push ecx
push ebx
push edi
push edx
push eax
lea ecx, [esp + 0x40]
push ecx
push esi
call fcn.00406d20
mov edx, dword [eax]
add esp, 0x1c
mov dword [ebp + 0x10], edx
mov ecx, dword [eax + 4]
mov edx, dword [esp + 0x18]
push edx
mov dword [ebp + 0x14], ecx
mov ecx, dword [eax + 4]
mov edx, dword [eax]
push 0x30
push ecx
push edx
lea eax, [esp + 0x3c]
push eax
push esi
call fcn.00406960
mov ecx, dword [eax]
mov edx, dword [esp + 0x54]
mov edi, dword [esp + 0x60]
mov dword [ebp + 0x10], ecx
mov eax, dword [eax + 4]
xor ebx, ebx
mov dword [edx + 0x20], ebx
mov dword [edx + 0x24], ebx
mov edx, dword [esp + 0x2c]
push edx
mov edx, dword [ebp + 0x1c]
push edx
push eax
push ecx
push edi
push esi
mov dword [ebp + 0x14], eax
call fcn.00406960
mov esi, 0x10
add esp, 0x30
cmp dword [esp + 0x60], esi
jb 0x4065cc
mov eax, dword [esp + 0x4c]
push eax
call fcn.0047d6df
add esp, 4
mov dword [esp + 0x60], 0xf
mov dword [esp + 0x5c], ebx
mov byte [esp + 0x4c], bl
cmp dword [esp + 0x7c], esi
jb 0x4065ef
mov ecx, dword [esp + 0x68]
push ecx
call fcn.0047d6df
add esp, 4
mov ecx, dword [esp + 0x84]
mov eax, edi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0047e30d
mov esp, ebp
pop ebp
ret