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

Disassembly:
push 0xffffffffffffffff
push 0x100acf03
mov eax, dword fs:[0]
push eax
sub esp, 0x24
push ebx
push ebp
push esi
push edi
mov eax, dword [0x100d3020]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
mov esi, ecx
mov ebp, dword [esi + 0x1c]
xor edi, edi
cmp ebp, edi
mov dword [esp + 0x1c], ebp
je 0x10040c7f
mov eax, dword [ebp]
mov edx, dword [eax]
mov ecx, ebp
call edx
cmp ebp, edi
mov dword [esp + 0x40], edi
je 0x10040e78
cmp dword [esi + 0xc], edi
jne 0x10040cb8
mov dword [esp + 0x40], 0xffffffff
mov eax, dword [ebp]
mov edx, dword [eax + 4]
mov ecx, ebp
call edx
xor al, al
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edi
mov byte [esp + 0x40], 1
mov ecx, dword [esi + 0xc]
mov eax, dword [ecx]
mov eax, dword [eax + 0x80]
lea edx, [esp + 0x28]
push edx
call eax
xor ebx, ebx
mov dword [esp + 0x18], edi
mov esi, dword [esp + 0x2c]
cmp esi, edi
je 0x10040e5a
mov edi, dword [esp + 0x30]
mov ecx, edi
sub ecx, esi
mov eax, 0x6bca1af3
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jae 0x10040e3a
push 0xec
call sub.MSVCR80.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
mov byte [esp + 0x40], 2
je 0x10040d32
push eax
call fcn.10001320
mov edi, eax
jmp 0x10040d34
xor edi, edi
push 0
push 0x100b6894
lea esi, [edi + 0xc]
mov byte [esp + 0x48], 1
call fcn.10002660
mov byte [edi + 0x36], 1
mov dword [edi + 0x28], 2
mov ecx, dword [esp + 0x2c]
test ecx, ecx
je 0x10040d76
mov edx, dword [esp + 0x30]
sub edx, ecx
mov eax, 0x6bca1af3
imul edx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp ebx, eax
jb 0x10040d80
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x18]
lea esi, [edx + ecx]
push 0xffffffffffffffff
lea ebp, [edi + 0x3c]
push 0
mov eax, esi
mov ecx, ebp
call fcn.10002570
mov eax, dword [esi + 0x1c]
push 0xffffffffffffffff
mov dword [ebp + 0x1c], eax
push 0
lea eax, [esi + 0x20]
lea ecx, [ebp + 0x20]
call fcn.10002570
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x3c]
lea ecx, [ebp + 0x3c]
call fcn.10002570
mov cl, byte [esi + 0x58]
push 0xffffffffffffffff
mov byte [ebp + 0x58], cl
push 0
lea eax, [esi + 0x5c]
lea ecx, [ebp + 0x5c]
call fcn.10002570
mov edx, dword [esi + 0x78]
push 0xffffffffffffffff
push 0
lea eax, [esi + 0x7c]
lea ecx, [ebp + 0x7c]
mov dword [ebp + 0x78], edx
call fcn.10002570
mov eax, dword [edi]
mov edx, dword [eax]
mov ecx, edi
mov dword [esp + 0x20], edi
call edx
push ecx
mov byte [esp + 0x44], 3
mov eax, esp
mov dword [eax], edi
mov eax, dword [edi]
mov edx, dword [eax]
mov ecx, edi
mov dword [esp + 0x28], esp
call edx
mov ecx, dword [esp + 0x20]
mov eax, dword [ecx]
mov edx, dword [eax + 0x14]
push 0
push 1
call edx
mov byte [esp + 0x40], 1
mov eax, dword [edi]
mov edx, dword [eax + 4]
mov ecx, edi
call edx
add dword [esp + 0x18], 0x98
mov ebp, dword [esp + 0x1c]
add ebx, 1
xor edi, edi
jmp 0x10040ce1
test esi, esi
je 0x10040e58
mov eax, dword [esp + 0x24]
push eax
push edi
mov eax, esi
call fcn.10039a60
mov ecx, dword [esp + 0x34]
push ecx
call sub.MSVCR80.dll_void___cdecl_operator_delete_void__
add esp, 0xc
xor edi, edi
mov dword [esp + 0x40], 0xffffffff
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edi
mov edx, dword [ebp]
mov eax, dword [edx + 4]
mov ecx, ebp
call eax
mov al, 1
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret