Function at 0x406e87
Capabilities:
Print debug messages
Resolve function by parsing pe exports

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x34
mov edx, dword [ebp + 8]
xor eax, eax
push ebx
push esi
push edi
mov byte [esp + 0x14], 1
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov byte [esp + 0x18], al
cmp dword [edx + 4], eax
je 0x41142e
cmp dword [edx + 0x10], eax
je 0x41142e
cmp dword [edx + 0x14], eax
je 0x41142e
mov edi, dword [ebp + 0xc]
push 0xe
lea esi, [esp + 0x20]
call fcn.0040ce98
mov ebx, eax
xor edi, edi
cmp ebx, edi
je 0x42bf1f
mov eax, dword [ebx + 0xe0]
mov ecx, dword [ebx + 0xf4]
cmp ecx, dword [eax + 0xc]
jne 0x42bf28
mov ecx, dword [ebx + 0xf8]
cmp ecx, dword [eax + 0x10]
jne 0x42bf28
lea edi, [ebx + 0x174]
lea ecx, [ebx + 0x18c]
mov eax, edi
call fcn.00405805
mov eax, dword [ebx + 0xe0]
push dword [ebx + 0x1ec]
mov eax, dword [eax + 0x10]
push eax
call fcn.0040c15a
test byte [ebx + 0x382], 2
mov dword [esp + 0x1c], eax
jne 0x42bf9b
movzx eax, word [ebx + 0x382]
test al, 1
je 0x406f55
test al, 2
jne 0x406f55
mov byte [esp + 0x18], 1
mov eax, dword [ebx + 0xe0]
push dword [eax + 0x10]
lea esi, [ebx + 0x1dc]
call fcn.0040c19c
cmp byte [ebx + 0x37c], 0
mov dword [esp + 0x10], eax
je 0x42bfd1
cmp byte [ebx + 0x170], 0
jne 0x4113ef
mov edi, dword [ebp + 8]
cmp byte [edi + 0x40], 0
je 0x406f9d
cmp byte [ebx + 0x2b9], 0
jne 0x42c016
movzx edx, word [ebx + 0x400]
push edx
movzx edx, word [ebx + 0x3fe]
push edx
push dword [esp + 0x20]
mov byte [ebx + 0x321], 0
cmp dword [edi + 0x3c], 0
lea eax, [ebx + 0x148]
setne dl
movzx edx, dl
push edx
push eax
lea esi, [ebx + 0x320]
push esi
lea ecx, [ebx + 0x10c]
push ecx
push dword [esp + 0x30]
lea eax, [ebx + 0x174]
push dword [edi + 0x34]
lea esi, [ebx + 0x110]
push eax
push dword [esp + 0x44]
mov eax, dword [esp + 0x3c]
push ebx
lea edx, [ebx + 0x14c]
call fcn.0040c6d1
test eax, eax
jne 0x40717b
movzx ecx, word [ebx + 0x382]
test cl, 1
je 0x40705e
and dword [esp + 0x18], eax
movzx eax, word [ebx + 0x3fe]
movzx esi, word [ebx + 0x400]
shl eax, 0x10
shl esi, 0x10
mov dword [esp + 0x38], eax
mov dword [esp + 0x30], esi
test cl, 2
jne 0x42c0bc
push esi
push eax
lea eax, [ebx + 0x174]
call fcn.00406e1f
cmp byte [esp + 0x14], 0
je 0x40705e
test byte [ebx + 0x382], 2
jne 0x42c243
mov eax, dword [ebp + 0xc]
lea ecx, [eax + 0x6a]
push ecx
lea ecx, [eax + 0xbc]
push ecx
lea ecx, [eax + 0x7c]
push ecx
lea ecx, [eax + 0x78]
lea edx, [eax + 0x74]
lea esi, [eax + 0x70]
lea edi, [eax + 0x6c]
movzx eax, word [ebx + 0x400]
push ecx
push eax
movzx eax, word [ebx + 0x3fe]
push eax
movzx eax, word [ebx + 0x382]
push eax
lea eax, [ebx + 0x174]
call fcn.0040cd34
mov eax, dword [ebx + 0x17c]
movsx ecx, word [eax + 0x28]
mov edx, dword [eax + 0x20]
movzx ecx, word [edx + ecx*2 - 2]
mov esi, dword [eax]
lea edx, [ecx + 2]
movzx edx, dx
inc ecx
movzx edi, cx
mov ecx, dword [esi + edx*4]
sub ecx, dword [esi + edi*4]
mov esi, dword [eax + 4]
mov dword [esp + 0x30], ecx
mov ecx, dword [esi + edx*4]
sub ecx, dword [esi + edi*4]
movsx edx, word [eax + 0x28]
mov esi, dword [eax + 0x20]
movzx edx, word [esi + edx*2 - 2]
mov edi, dword [eax]
lea esi, [edx + 4]
add edx, 3
movzx edx, dx
shl edx, 2
mov edi, dword [edx + edi]
mov dword [esp + 0x38], edx
mov edx, dword [eax]
mov eax, dword [eax + 4]
movzx esi, si
sub edi, dword [edx + esi*4]
mov edx, dword [esp + 0x38]
mov edx, dword [eax + edx]
sub edx, dword [eax + esi*4]
mov eax, dword [esp + 0x30]
mov esi, dword [ebp + 0xc]
shl eax, 0xa
shl edi, 0xa
shl edx, 0xa
shl ecx, 0xa
mov dword [esp + 0x38], eax
mov dword [esi + 0x48], eax
mov dword [esi + 0x4c], ecx
mov dword [esi + 0xa8], edi
mov dword [esi + 0xac], edx
movzx eax, word [ebx + 0x382]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], edx
test al, 1
je 0x40714b
test al, 0x40
je 0x42c05f
mov al, byte [ebx + 0x320]
mov byte [esi + 0x68], al
mov eax, dword [ebx + 0xe0]
push dword [ebx + 0x1e8]
mov eax, dword [eax + 0x10]
push eax
call fcn.0040c15a
mov dword [esi + 0x80], eax
mov dword [ebx + 0x16c], 0x1e
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0
push dword [esp + 0x14]
lea esi, [ebx + 0x14c]
push edi
mov edi, dword [esp + 0x28]
push esi
lea eax, [ebx + 0x110]
push ebx
mov byte [ebx + 0x170], 0
call fcn.00411348
test eax, eax
jne 0x42bfe2
test byte [ebx + 0x382], 2
je 0x406f87
jmp 0x42bfee
mov eax, 0x1003
jmp 0x40717b
mov eax, dword [esp + 0x1c]
jmp 0x40717b
lea ecx, [ebx + 0x18c]
push ecx
push dword [eax + 0xc]
lea esi, [ebx + 0x174]
call fcn.0040e796
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x1c]
push eax
push dword [esi]
mov eax, dword [ebx + 0xe0]
push dword [eax + 0x10]
lea eax, [ebx + 0x14c]
push eax
lea esi, [ebx + 0x1dc]
push ebx
mov dword [esp + 0x30], edi
mov dword [esp + 0x3c], edi
mov dword [esp + 0x48], edi
mov dword [esp + 0x4c], edi
call fcn.004105b4
push 0x24
push dword [ebx + 0xe0]
lea eax, [ebx + 0xe8]
push eax
call sub.MSVCR100_CLR0400.dll_memcpy
add esp, 0xc
jmp 0x406f08
mov eax, dword [ebx + 0xe0]
push dword [ebx + 0x240]
mov eax, dword [eax + 0x10]
push eax
call fcn.0040c15a
mov dword [esp + 0x20], eax
mov eax, dword [ebx + 0xe0]
push dword [eax + 0x10]
lea esi, [ebx + 0x1dc]
call fcn.004463ae
mov dword [esp + 0x24], eax
jmp 0x406f41
mov byte [ebx + 0x170], 0
mov byte [esp + 0x14], 0
jmp 0x406f7a
mov byte [ebx + 0x37c], 0
jmp 0x40717b
mov edi, dword [esp + 0x20]
push 0
push dword [esp + 0x28]
lea eax, [ebx + 0x174]
push eax
push esi
lea eax, [ebx + 0x384]
push ebx
call fcn.00411348
test eax, eax
je 0x406f87
jmp 0x42bfe2
push ebx
lea edi, [esp + 0x34]
lea eax, [ebx + 0x328]
mov byte [ebx + 0x321], 1
call fcn.00446bef
test eax, eax
jne 0x40717b
lea eax, [esp + 0x38]
push eax
push ebx
lea edi, [ebx + 0x328]
call fcn.00446e32
test eax, eax
jne 0x40717b
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x3c]
mov edi, dword [esp + 0x38]
jmp 0x407107
movzx edi, word [ebx + 0x3fe]
mov eax, edi
shr eax, 1
add eax, dword [esp + 0x38]
cdq
idiv edi
mov dword [esi + 0x48], eax
movzx edi, word [ebx + 0x400]
mov eax, edi
shr eax, 1
add eax, ecx
cdq
idiv edi
mov dword [esi + 0x4c], eax
movzx ecx, word [ebx + 0x3fe]
mov eax, ecx
shr eax, 1
add eax, dword [esp + 0x30]
cdq
idiv ecx
mov dword [esi + 0xa8], eax
movzx ecx, word [ebx + 0x400]
mov eax, ecx
shr eax, 1
add eax, dword [esp + 0x2c]
cdq
idiv ecx
mov dword [esi + 0xac], eax
jmp 0x40714b
cmp byte [ebx + 0x2b9], 0
je 0x42c130
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x14]
push eax
push ebx
lea eax, [ebx + 0x328]
lea edi, [esp + 0x24]
call fcn.00446c97
test eax, eax
jne 0x40717b
mov edi, dword [ebp + 8]
mov esi, dword [esp + 0x18]
movzx eax, word [ebx + 0x148]
test ax, ax
je 0x42c1be
test esi, esi
je 0x42c1be
push eax
mov eax, dword [esp + 0x20]
lea ecx, [eax + 0xe0]
push ecx
call dword [eax + 0xa4]
mov ecx, eax
mov eax, esi
call fcn.00410480
test eax, eax
jns 0x42c1c3
neg eax
jmp 0x42c1c3
mov eax, dword [ebx + 0x17c]
movsx ecx, word [eax + 0x28]
mov edx, dword [eax + 0x20]
movzx edx, word [edx + ecx*2 - 2]
mov ecx, dword [eax]
lea esi, [edx + 2]
inc edx
movzx esi, si
mov esi, dword [ecx + esi*4]
movzx edx, dx
sub esi, dword [ecx + edx*4]
movsx edx, word [eax + 0x28]
mov eax, dword [eax + 0x20]
mov ax, word [eax + edx*2 - 2]
inc ax
movzx eax, ax
mov dword [esp + 0x10], 0x7fffffff
mov dword [esp + 0x28], 0x80000000
mov dword [esp + 0x18], esi
test eax, eax
jle 0x42c1ae
mov dword [esp + 0x2c], eax
mov edx, dword [ecx]
cmp edx, dword [esp + 0x28]
jle 0x42c18d
mov dword [esp + 0x28], edx
cmp edx, dword [esp + 0x10]
jge 0x42c197
mov dword [esp + 0x10], edx
add ecx, 4
dec dword [esp + 0x2c]
jne 0x42c181
cmp dword [esp + 0x10], 0x7fffffff
jne 0x42c0ee
push 0x42c260
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x42c0ee
mov eax, 0x10000
mov ecx, dword [esp + 0x20]
mov dword [ecx + 0x170], eax
movzx eax, word [ebx + 0x400]
push eax
movzx eax, word [ebx + 0x3fe]
push eax
mov al, byte [ebx + 0x382]
and al, 1
cmp dword [edi + 0x3c], 0
movzx eax, al
push eax
setne al
movzx eax, al
push eax
lea eax, [ebx + 0x148]
push eax
lea eax, [ebx + 0x320]
push eax
lea eax, [ebx + 0x10c]
push eax
push dword [esp + 0x30]
lea eax, [ebx + 0x174]
push dword [edi + 0x34]
lea esi, [ebx + 0x384]
push eax
mov eax, dword [esp + 0x4c]
push ecx
push ebx
lea edx, [ebx + 0x14c]
call fcn.0040c6d1
test eax, eax
jne 0x40717b
mov esi, dword [esp + 0x30]
mov eax, dword [esp + 0x38]
jmp 0x40703d
movzx eax, word [ebx + 0x3fe]
imul eax, dword [esp + 0x18]
push eax
lea eax, [ebx + 0x174]
call fcn.00446b03
jmp 0x40705e