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

Disassembly:
sub esp, 0x8c
mov eax, dword [0x4a0fe0]
xor eax, esp
mov dword [esp + 0x88], eax
mov eax, dword [esp + 0x94]
push ebx
push ebp
mov ebp, dword [esp + 0x98]
xor edx, edx
cmp ebp, edx
push esi
push edi
mov dword [esp + 0x24], ebp
mov dword [esp + 0x18], eax
mov dword [esp + 0x28], ecx
mov dword [esp + 0x14], edx
je 0x40d026
mov edi, str.:memory:
mov esi, ebp
mov ecx, 9
xor ebx, ebx
repe cmpsb byte [esi], byte es:[edi]
mov dword [esp + 0x1c], 1
je 0x40d02a
mov dword [esp + 0x1c], edx
mov esi, dword [eax]
push 0x18
mov dword [esp + 0x24], esi
call fcn.004031b0
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40d0d2
xor eax, eax
test byte [esp + 0xa8], 0x40
mov dword [ebx], eax
mov dword [ebx + 4], eax
mov dword [ebx + 8], eax
mov dword [ebx + 0xc], eax
mov dword [ebx + 0x10], eax
mov dword [ebx + 0x14], eax
mov byte [ebx + 8], al
mov eax, dword [esp + 0x18]
mov dword [ebx], eax
jne 0x40d17a
cmp dword [esp + 0x1c], 0
jne 0x40d17a
test dword [eax + 0xc], 0x100000
jne 0x40d17a
test ebp, ebp
je 0x40d17a
cmp byte [ebp], 0
je 0x40d17a
cmp dword [0x4a61c4], 0
je 0x40d17a
mov esi, dword [esi + 8]
add esi, 1
push esi
call fcn.004031b0
mov edi, eax
mov eax, dword [esp + 0x1c]
mov byte [ebx + 9], 1
or dword [eax + 0xc], 0x80000
add esp, 4
test edi, edi
jne 0x40d0dc
push ebx
call fcn.004032c0
add esp, 4
mov eax, 7
jmp 0x40d3ad
mov eax, dword [esp + 0x20]
mov edx, dword [eax + 0x28]
push edi
push esi
push ebp
push eax
call edx
push 2
call fcn.004034d0
mov ebp, eax
add esp, 0x14
push ebp
call fcn.004035c0
mov eax, dword [0x4a61c0]
add esp, 4
test eax, eax
mov esi, eax
je 0x40d15a
lea esp, [esp]
mov eax, dword [esi]
mov ecx, dword [eax + 0x5c]
mov eax, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x40d137
test dl, dl
je 0x40d133
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x40d137
add eax, 2
add ecx, 2
test dl, dl
jne 0x40d117
xor eax, eax
jmp 0x40d13c
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x40d14a
mov eax, dword [esi]
mov ecx, dword [esp + 0x20]
cmp dword [eax], ecx
je 0x40d153
mov esi, dword [esi + 0x54]
test esi, esi
jne 0x40d110
jmp 0x40d15a
mov dword [ebx + 4], esi
add dword [esi + 0x50], 1
add dword [ebp + 0x1c], 0xffffffff
push ebp
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push edi
call fcn.004032c0
add esp, 4
test esi, esi
jne 0x40d3e9
mov esi, dword [esp + 0x20]
push 0x64
call fcn.004031b0
mov edi, eax
add esp, 4
test edi, edi
je 0x40d2cb
push 0x64
push 0
push edi
call fcn.0046e670
mov edx, dword [esp + 0xb8]
mov eax, dword [esp + 0x30]
add esp, 0xc
push edx
push eax
mov eax, dword [esp + 0xb0]
lea ebp, [edi + 0x44]
push edi
mov ecx, esi
mov dword [ebp], 0x40cf90
mov dword [edi + 0x48], edi
call fcn.00409640
add esp, 0xc
test eax, eax
mov dword [esp + 0x14], eax
jne 0x40d382
mov ecx, dword [edi]
push ecx
lea esi, [esp + 0x30]
call fcn.00409ae0
add esp, 4
test eax, eax
mov dword [esp + 0x14], eax
jne 0x40d382
mov edx, dword [edi]
mov dword [edx + 0x78], ebp
mov dword [ebx + 4], edi
mov eax, dword [edi]
mov dword [eax + 0xc4], 0x40cf30
mov ecx, dword [edi]
mov dword [ecx + 0xc8], 0x40cf60
mov eax, dword [edi]
xor ebp, ebp
mov dword [edi + 8], ebp
mov dword [edi + 0xc], ebp
mov dl, byte [eax + 0x10]
xor ecx, ecx
mov byte [edi + 0x11], dl
mov ch, byte [esp + 0x3c]
movzx dx, byte [esp + 0x3d]
lea esi, [edi + 0x1c]
or cx, dx
cmp cx, 0x200
mov word [esi], cx
jb 0x40d2d8
cmp cx, 0x8000
ja 0x40d2d8
movzx ecx, cx
lea edx, [ecx - 1]
test ecx, edx
jne 0x40d2d8
movzx ecx, byte [esp + 0x41]
movzx eax, byte [esp + 0x40]
mov byte [edi + 0x12], cl
mov dl, byte [esp + 0x42]
mov byte [edi + 0x13], dl
movzx ecx, byte [esp + 0x43]
mov byte [edi + 0x14], cl
mov byte [edi + 0x15], 1
movzx edx, byte [esp + 0x60]
movzx ecx, byte [esp + 0x61]
shl edx, 8
or edx, ecx
movzx ecx, byte [esp + 0x62]
shl edx, 8
or edx, ecx
movzx ecx, byte [esp + 0x63]
shl edx, 8
or edx, ecx
setne dl
mov byte [edi + 0x16], dl
movzx ecx, byte [esp + 0x6c]
movzx edx, byte [esp + 0x6d]
shl ecx, 8
or ecx, edx
movzx edx, byte [esp + 0x6e]
shl ecx, 8
or ecx, edx
movzx edx, byte [esp + 0x6f]
shl ecx, 8
or ecx, edx
setne cl
mov byte [edi + 0x17], cl
jmp 0x40d306
mov dword [esp + 0x14], 7
jmp 0x40d38d
push esi
mov word [esi], bp
call fcn.00409a50
mov al, 0x20
add esp, 4
cmp dword [esp + 0x24], ebp
mov byte [edi + 0x12], 0x40
mov byte [edi + 0x13], al
mov byte [edi + 0x14], al
je 0x40d304
cmp dword [esp + 0x1c], ebp
jne 0x40d304
mov byte [edi + 0x16], 0
mov byte [edi + 0x17], 0
xor eax, eax
mov dx, word [esi]
sub dx, ax
mov eax, dword [edi]
push esi
mov word [edi + 0x1e], dx
call fcn.00409a50
add esp, 4
cmp byte [ebx + 9], 0
je 0x40d485
push 2
mov dword [edi + 0x50], 1
call fcn.004034d0
add esp, 4
push 0x24
mov ebp, eax
call fcn.004031b0
mov esi, eax
xor eax, eax
add esp, 4
cmp esi, eax
je 0x40d36b
mov dword [esi], eax
mov dword [esi + 4], eax
mov dword [esi + 8], eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], eax
mov dword [esi + 0x1c], eax
mov dword [esi + 0x20], eax
push esi
mov dword [esi + 0x18], eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
test esi, esi
mov dword [edi + 0x40], esi
jne 0x40d3c6
mov eax, dword [esp + 0x18]
mov dword [esp + 0x14], 7
mov byte [eax + 0x1e], 0
mov eax, dword [edi]
test eax, eax
je 0x40d38d
call fcn.00409ee0
push edi
call fcn.004032c0
add esp, 4
push ebx
call fcn.004032c0
mov ecx, dword [esp + 0x2c]
add esp, 4
mov dword [ecx], 0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x98]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0046d626
add esp, 0x8c
ret
push ebp
call fcn.004035c0
mov ecx, dword [0x4a61c0]
add esp, 4
mov dword [edi + 0x54], ecx
add dword [ebp + 0x1c], 0xffffffff
push ebp
mov dword [0x4a61c0], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp byte [ebx + 9], 0
je 0x40d485
mov esi, dword [esp + 0x18]
xor edx, edx
cmp dword [esi + 4], edx
jle 0x40d485
mov ecx, dword [esi + 8]
add ecx, 4
mov eax, dword [ecx]
test eax, eax
je 0x40d414
cmp byte [eax + 9], 0
jne 0x40d427
add edx, 1
add ecx, 0x18
cmp edx, dword [esi + 4]
jl 0x40d408
mov eax, dword [esp + 0x28]
mov dword [eax], ebx
jmp 0x40d3a9
cmp dword [eax + 0x14], 0
je 0x40d439
lea ecx, [ecx]
mov eax, dword [eax + 0x14]
cmp dword [eax + 0x14], 0
jne 0x40d430
mov edx, dword [ebx + 4]
cmp edx, dword [eax + 4]
jae 0x40d459
mov dword [ebx + 0x10], eax
mov dword [ebx + 0x14], 0
mov dword [eax + 0x14], ebx
mov eax, dword [esp + 0x28]
mov dword [eax], ebx
jmp 0x40d3a9
cmp dword [eax + 0x10], 0
je 0x40d470
nop
mov ecx, dword [eax + 0x10]
cmp dword [ecx + 4], edx
jae 0x40d470
mov eax, ecx
cmp dword [eax + 0x10], 0
jne 0x40d460
mov edx, dword [eax + 0x10]
mov ecx, edx
test ecx, ecx
mov dword [ebx + 0x10], edx
mov dword [ebx + 0x14], eax
je 0x40d482
mov dword [ecx + 0x14], ebx
mov dword [eax + 0x10], ebx
mov eax, dword [esp + 0x28]
mov dword [eax], ebx
jmp 0x40d3a9