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

Disassembly:
sub esp, 0xa4
push ebx
push ebp
mov ebp, dword [esp + 0xb0]
push esi
push edi
xor edi, edi
mov esi, dword [ebp + 0x40]
mov dword [esp + 0x2c], edi
cmp esi, 0x400
mov dword [esp + 0x1c], edi
mov eax, 0x400
jl 0x40be1d
mov eax, esi
push eax
call fcn.004df770
add esp, 4
cmp eax, edi
mov dword [esp + 0x18], eax
je 0x40bf10
push 0x5c
call fcn.004df770
mov ebx, eax
add esp, 4
cmp ebx, edi
je 0x40bf10
mov eax, 0x400
mov dword [ebp + 0x3910], ebx
cdq
idiv esi
mov ecx, eax
mov edi, ecx
test edi, edi
jne 0x40be61
mov edi, 1
mov eax, 0x400
push edi
cdq
idiv esi
mov eax, ecx
mov ecx, dword [esp + 0x1c]
push ecx
mov ecx, dword [ebp + 0x38f0]
mov esi, edx
mov edx, dword [esp + 0x20]
add esi, edx
cdq
mov dword [esp + 0x2c], eax
add eax, ecx
mov ecx, dword [ebp + 0x38f4]
mov dword [esp + 0x30], edx
adc edx, ecx
mov dword [esp + 0x38], esi
push edx
push eax
push ebp
call fcn.00404780
add esp, 0x14
cmp eax, edi
jne 0x40bf10
cmp word [esi + 0x38], 0xef53
je 0x40bf77
cmp byte [ebp + 0x3900], 0x8e
jne 0x40bf10
mov dword [esp + 0x10], 0
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x24]
push edi
push edx
cdq
add eax, ecx
mov ecx, dword [esp + 0x30]
adc edx, ecx
mov ecx, dword [ebp + 0x38f0]
add eax, ecx
mov ecx, dword [ebp + 0x38f4]
adc edx, ecx
push edx
push eax
push ebp
call fcn.00404780
add esp, 0x14
cmp eax, edi
jne 0x40bf10
cmp word [esi + 0x38], 0xef53
mov eax, dword [esp + 0x10]
je 0x40bf53
inc eax
cmp eax, 0x1000
mov dword [esp + 0x10], eax
jl 0x40bec2
mov eax, dword [ebp + 0x3910]
test eax, eax
je 0x40bf2d
push eax
call fcn.0040bd80
add esp, 4
mov dword [ebp + 0x3910], 0
mov eax, dword [esp + 0x18]
push eax
call fcn.004df7a0
mov ecx, dword [esp + 0x20]
push ecx
call fcn.004df7a0
mov eax, dword [esp + 0x34]
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xa4
ret
cmp eax, 0x1000
jge 0x40bf10
mov ecx, dword [ebp + 0x38f0]
cdq
add ecx, eax
mov dword [ebp + 0x38f0], ecx
mov eax, dword [ebp + 0x38f4]
adc eax, edx
mov dword [ebp + 0x38f4], eax
mov ecx, dword [esi + 0x18]
mov eax, dword [esi + 0x20]
mov edi, 0x400
shl edi, cl
test eax, eax
mov dword [esp + 0x20], edi
je 0x40bf10
mov eax, 0x400
xor edx, edx
div edi
push edi
mov dword [esp + 0x28], eax
call fcn.004df770
add esp, 4
mov dword [ebx + 0x20], eax
test eax, eax
je 0x40bf10
push edi
mov dword [ebx + 0x24], 0xffffffff
call fcn.004df770
add esp, 4
mov dword [ebx + 0x28], eax
test eax, eax
je 0x40bf10
push edi
mov dword [ebx + 0x2c], 0xffffffff
call fcn.004df770
push edi
mov dword [ebx + 0x30], eax
call fcn.004df770
mov ecx, dword [ebx + 0x30]
add esp, 8
test ecx, ecx
mov dword [ebx + 0x34], eax
je 0x40bf10
test eax, eax
je 0x40bf10
or eax, 0xffffffff
push edi
mov dword [ebx + 0x3c], eax
mov dword [ebx + 0x38], eax
call fcn.004df770
push edi
mov dword [ebx + 0x40], eax
call fcn.004df770
push edi
mov dword [ebx + 0x44], eax
call fcn.004df770
mov ecx, dword [ebx + 0x40]
add esp, 0xc
test ecx, ecx
mov dword [ebx + 0x48], eax
je 0x40bf10
mov ecx, dword [ebx + 0x44]
test ecx, ecx
je 0x40bf10
test eax, eax
je 0x40bf10
or eax, 0xffffffff
mov dword [ebx + 4], edi
mov dword [ebx + 0x54], eax
mov dword [ebx + 0x50], eax
mov dword [ebx + 0x4c], eax
mov eax, dword [esi + 4]
mov ecx, dword [esi + 0x14]
xor edx, edx
sub eax, ecx
mov ecx, edi
dec eax
div dword [esi + 0x20]
shr ecx, 5
mov word [ebx + 0x1c], 0x20
mov dword [ebx + 0xc], ecx
inc eax
mov dword [ebx + 8], eax
mov eax, edi
shr eax, 3
je 0x40c07d
mov edx, dword [ebx + 0x14]
inc edx
sar eax, 1
mov dword [ebx + 0x14], edx
jne 0x40c072
mov eax, dword [ebx + 8]
xor edx, edx
lea eax, [ecx + eax - 1]
div ecx
mov dword [esp + 0x10], eax
imul eax, edi
push eax
call fcn.004df770
add esp, 4
mov dword [ebx + 0x18], eax
test eax, eax
je 0x40bf10
push 0x400
call fcn.004df760
add esp, 4
mov dword [ebx], eax
test eax, eax
je 0x40bf10
mov ecx, 0x100
mov edi, eax
mov eax, dword [esp + 0x10]
rep movsd dword es:[edi], dword [esi]
xor edi, edi
cmp eax, edi
jle 0x40c11a
mov dword [esp + 0x14], edi
mov ecx, dword [esp + 0x24]
mov esi, dword [esp + 0x30]
push edi
push ecx
push esi
push ebx
call fcn.0040c2f0
mov edx, dword [esp + 0x24]
mov ecx, dword [ebx + 0x18]
add edx, ecx
push 1
push edx
push eax
push ebp
call fcn.0040b550
add esp, 0x20
cmp eax, 1
jne 0x40bf10
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
add ecx, eax
mov eax, dword [esp + 0x10]
inc edi
mov dword [esp + 0x14], ecx
cmp edi, eax
jl 0x40c0d1
jmp 0x40c11e
mov esi, dword [esp + 0x30]
lea ecx, [esp + 0x34]
push ecx
push 2
push ebx
push ebp
call fcn.0040b770
add esp, 0x10
cmp eax, 0xffffffff
je 0x40bf10
test dword [esp + 0x54], 0x80000
je 0x40c212
mov dword [ebx + 0x58], 1
mov ax, word [esi + 0xfe]
mov word [ebx + 0x1c], ax
mov cl, byte [esi + 0x60]
test cl, 0x80
je 0x40c175
cmp ax, 0x40
jb 0x40bf10
cmp ax, 0x400
jbe 0x40c17b
jmp 0x40bf10
mov word [ebx + 0x1c], 0x20
mov eax, dword [ebx + 4]
xor ecx, ecx
mov cx, word [ebx + 0x1c]
xor edx, edx
div ecx
mov edx, dword [ebx + 0x18]
push edx
mov dword [ebx + 0xc], eax
call fcn.004df7a0
mov ecx, dword [ebx + 0xc]
mov eax, dword [ebx + 8]
xor edx, edx
lea eax, [ecx + eax - 1]
div ecx
mov dword [esp + 0x14], eax
imul eax, dword [esp + 0x24]
push eax
call fcn.004df770
add esp, 8
mov dword [ebx + 0x18], eax
test eax, eax
je 0x40bf10
mov eax, dword [esp + 0x10]
xor edi, edi
cmp eax, edi
jle 0x40c224
mov dword [esp + 0x14], edi
mov ecx, dword [esp + 0x24]
push edi
push ecx
push esi
push ebx
call fcn.0040c2f0
mov edx, dword [esp + 0x24]
mov ecx, dword [ebx + 0x18]
add edx, ecx
push 1
push edx
push eax
push ebp
call fcn.0040b550
add esp, 0x20
cmp eax, 1
jne 0x40bf10
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
add ecx, eax
mov eax, dword [esp + 0x10]
inc edi
mov dword [esp + 0x14], ecx
cmp edi, eax
jl 0x40c1cd
jmp 0x40c224
push esi
push ebx
call fcn.0040c380
add esp, 8
test eax, eax
je 0x40bf10
mov ecx, dword [ebx + 4]
mov edx, dword [esp + 0x38]
lea eax, [ecx + edx - 1]
xor edx, edx
div ecx
mov edi, eax
imul ecx, edi
push ecx
call fcn.004df760
push 0
mov dword [esp + 0x24], eax
push eax
mov eax, dword [esp + 0x44]
push 0
push eax
lea ecx, [esp + 0x48]
push edi
push ecx
push ebx
push ebp
push 0
call fcn.0040b820
add esp, 0x28
cmp eax, edi
jne 0x40bf10
mov eax, dword [ebp + 0x3920]
test eax, eax
jne 0x40c28c
mov edx, dword [esp + 0x1c]
mov ecx, dword [ebp + 0x1428]
lea eax, [esp + 0x34]
push edx
push eax
push esi
push ebx
push ecx
push ebp
call fcn.0040b9e0
add esp, 0x18
mov edi, dword [0x7150f4]
mov ecx, 0x10000
xor eax, eax
add esi, 0x78
rep stosd dword es:[edi], eax
mov edx, dword [0x7150f4]
mov eax, dword [esi]
push 0x400
add ebp, 0x185c
mov dword [edx], eax
mov ecx, dword [esi + 4]
push 0xfde9
push ebp
mov dword [edx + 4], ecx
mov eax, dword [esi + 8]
push 0xffffffffffffffff
mov dword [edx + 8], eax
mov ecx, dword [esi + 0xc]
mov dword [edx + 0xc], ecx
mov edx, dword [0x7150f4]
push edx
call fcn.0042d900
add esp, 0x14
mov dword [esp + 0x2c], 1
jmp 0x40bf2d