Function at 0x40e970
Capabilities:
Check for peb ntglobalflag flag
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x51638e
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x568cb8]
xor eax, esp
mov dword [esp + 0x68], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x568cb8]
xor eax, esp
push eax
lea eax, [esp + 0x84]
mov dword fs:[0], eax
mov edi, dword [esp + 0x94]
mov eax, dword [esp + 0x98]
mov ebp, dword [esp + 0xa0]
xor ebx, ebx
mov dword [esp + 0x30], eax
mov dword [esp + 0x24], ecx
mov dword [esp + 0x20], edx
cmp edi, ebx
jne 0x40e9d6
mov eax, 0x80070057
jmp 0x40eeb0
mov ecx, dword [esp + 0x9c]
xor eax, eax
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
mov byte [esp + 0x70], al
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], eax
mov word [esp + 0x72], ax
push ecx
mov eax, edi
lea esi, [esp + 0x5c]
call fcn.00415570
cmp eax, ebx
jne 0x40eeb0
mov edx, dword [edi]
mov eax, dword [edx + 4]
push edi
mov dword [esp + 0x20], edi
call eax
push 0x20
mov dword [esp + 0x90], ebx
call fcn.004bd0c6
add esp, 4
cmp eax, ebx
je 0x40ea4e
mov ecx, dword [esp + 0x6d]
push ebx
push ecx
mov esi, eax
call fcn.0040a6e0
mov esi, eax
jmp 0x40ea50
xor esi, esi
cmp edi, esi
je 0x40ea70
cmp esi, ebx
je 0x40ea60
mov edx, dword [esi]
mov eax, dword [edx + 4]
push esi
call eax
mov ecx, dword [edi]
mov edx, dword [ecx + 8]
push edi
call edx
mov edi, esi
mov dword [esp + 0x1c], edi
jmp 0x40ea74
mov edi, dword [esp + 0x1c]
cmp byte [esp + 0x63], bl
je 0x40ed49
mov eax, dword [esp + 0x20]
cmp dword [eax], ebx
jne 0x40eb57
mov dword [esp + 0x18], ebx
mov byte [esp + 0x8c], 1
mov ecx, dword [ebp]
mov eax, dword [ecx + 0xc]
lea edx, [esp + 0x18]
push edx
push ebp
call eax
mov esi, eax
cmp esi, ebx
je 0x40ead3
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov dword [esp + 0x8c], 0xffffffff
cmp edi, ebx
je 0x40eacc
mov edx, dword [edi]
mov eax, dword [edx + 8]
push edi
call eax
mov eax, esi
jmp 0x40eeb0
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x40eb9a
cmp word [eax], bx
je 0x40eb9a
push 0x24
call fcn.004bd0c6
add esp, 4
cmp eax, ebx
je 0x40eb16
xor ecx, ecx
mov dword [eax], ecx
mov dword [eax + 4], ecx
mov dword [eax + 8], ecx
mov dword [eax + 0xc], ecx
mov dword [eax + 0x10], ecx
mov dword [eax + 0x14], ecx
mov dword [eax + 0x18], ecx
mov dword [eax + 0x1c], ecx
mov dword [eax + 0x20], ebx
mov esi, eax
jmp 0x40eb18
xor esi, esi
inc dword [esi + 0x20]
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.OLEAUT32.dll_SysAllocStringByteLen]
mov edx, dword [esp + 0x18]
push eax
push edx
push esi
call fcn.004109a0
mov eax, dword [esp + 0x20]
mov dword [eax], esi
lea esi, [esp + 0x2c]
mov dword [esp + 0x2c], ebx
call fcn.0040add0
mov byte [esp + 0x8c], bl
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
cmp dword [esp + 0xa4], ebx
je 0x40ec83
mov ebp, dword [esp + 0x24]
mov eax, dword [ebp]
cmp eax, ebx
jne 0x40ec3f
push 0x20
call fcn.004bd0c6
mov edi, eax
add esp, 4
mov dword [esp + 0x24], edi
mov byte [esp + 0x8c], 2
cmp edi, ebx
je 0x40ebc2
push edi
call fcn.0040a4e0
mov dword [edi + 0x1c], ebx
jmp 0x40ebc4
push eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov dword [esp + 0x8c], 0xffffffff
cmp edi, ebx
je 0x40ebb8
mov edx, dword [edi]
mov eax, dword [edx + 8]
push edi
call eax
mov eax, 0xe00e0003
jmp 0x40eeb0
xor edi, edi
inc dword [edi + 0x1c]
mov dword [esp + 0x18], edi
mov byte [esp + 0x8c], 3
mov ecx, dword [esp + 0x20]
mov esi, dword [ecx]
call fcn.00410b30
mov esi, eax
cmp esi, ebx
je 0x40ec0f
lea edi, [esp + 0x18]
call fcn.0040adb0
mov dword [esp + 0x8c], 0xffffffff
mov eax, dword [esp + 0x1c]
cmp eax, ebx
je 0x40ec08
mov edx, dword [eax]
push eax
mov eax, dword [edx + 8]
call eax
mov eax, esi
jmp 0x40eeb0
movzx ecx, byte [esp + 0x64]
push ecx
lea ecx, [esp + 0x78]
mov eax, edi
call fcn.00410b60
mov esi, eax
cmp esi, ebx
jne 0x40ebe4
mov dword [ebp], edi
lea edi, [esp + 0x18]
mov dword [esp + 0x18], ebx
mov byte [esp + 0x8c], bl
call fcn.0040adb0
jmp 0x40ec44
call fcn.00410bd0
push 0x28
call fcn.004bd0c6
mov edi, eax
add esp, 4
cmp edi, ebx
je 0x40ec71
mov ecx, dword [ebp]
mov eax, dword [esp + 0x1c]
push ecx
call fcn.0040a7e0
mov esi, eax
lea edi, [esp + 0x1c]
call fcn.0040ac90
jmp 0x40ed49
xor eax, eax
mov esi, eax
lea edi, [esp + 0x1c]
call fcn.0040ac90
jmp 0x40ed49
push 0x20
call fcn.004bd0c6
mov edi, eax
add esp, 4
mov dword [esp + 0x24], edi
mov byte [esp + 0x8c], 4
cmp edi, ebx
je 0x40ecaa
push edi
call fcn.0040a4e0
mov dword [edi + 0x1c], ebx
jmp 0x40ecac
xor edi, edi
inc dword [edi + 0x1c]
mov dword [esp + 0x18], edi
mov byte [esp + 0x8c], 5
mov edx, dword [esp + 0x20]
mov esi, dword [edx]
call fcn.00410b30
mov esi, eax
cmp esi, ebx
je 0x40ecf7
lea edi, [esp + 0x18]
call fcn.0040adb0
mov dword [esp + 0x8c], 0xffffffff
mov eax, dword [esp + 0x1c]
cmp eax, ebx
je 0x40ecf0
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, esi
jmp 0x40eeb0
movzx eax, byte [esp + 0x64]
push eax
lea ecx, [esp + 0x78]
mov eax, edi
call fcn.00410b60
mov esi, eax
cmp esi, ebx
jne 0x40eccc
push 0x28
call fcn.004bd0c6
mov ecx, eax
add esp, 4
cmp ecx, ebx
je 0x40ed2c
mov eax, dword [esp + 0x1c]
push edi
mov edi, ecx
call fcn.0040a7e0
jmp 0x40ed2e
xor eax, eax
mov esi, eax
lea edi, [esp + 0x1c]
call fcn.0040ac90
lea edi, [esp + 0x18]
mov byte [esp + 0x8c], bl
call fcn.0040adb0
mov edi, dword [esp + 0x69]
mov esi, dword [esp + 0x30]
call fcn.0040b050
mov ecx, dword [esp + 0x69]
mov eax, dword [esi + 8]
push ecx
push ebx
push eax
call fcn.004b83b0
add esp, 0xc
push 0x14
mov dword [esp + 0x2c], ebx
call fcn.004bd0c6
add esp, 4
cmp eax, ebx
je 0x40ed97
mov ecx, dword [esi + 8]
mov edx, dword [esp + 0x69]
mov dword [eax + 4], ebx
mov dword [eax], vtable.NKZ::COutBufStream.0
mov dword [eax + 8], ecx
mov dword [eax + 0xc], edx
mov dword [eax + 0x10], ebx
mov edi, eax
jmp 0x40ed99
xor edi, edi
mov dword [esp + 0x20], edi
cmp edi, ebx
je 0x40eda9
mov edx, dword [edi]
mov eax, dword [edx + 4]
push edi
call eax
push 0x14
mov byte [esp + 0x90], 6
call fcn.004bd0c6
mov esi, eax
add esp, 4
cmp esi, ebx
je 0x40edce
lea eax, [esp + 0x28]
call fcn.0040a5b0
mov esi, eax
jmp 0x40edd0
xor esi, esi
cmp edi, esi
je 0x40edf0
cmp esi, ebx
je 0x40ede0
mov ecx, dword [esi]
mov edx, dword [ecx + 4]
push esi
call edx
cmp edi, ebx
je 0x40edec
mov eax, dword [edi]
mov ecx, dword [eax + 8]
push edi
call ecx
mov dword [esp + 0x20], esi
movzx edi, byte [esp + 0x62]
mov edx, dword [esp + 0x69]
movzx ebp, byte [esp + 0x61]
mov eax, dword [esp + 0x6d]
xor esi, esi
mov dword [esp + 0x38], edi
mov edi, dword [esp + 0x20]
push ebx
mov dword [esp + 0x4c], esi
mov esi, dword [esp + 0x20]
push edi
mov dword [esp + 0x4c], edx
lea edx, [esp + 0x3c]
xor ecx, ecx
push esi
push edx
mov dword [esp + 0x44], ebp
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], ecx
mov dword [esp + 0x4c], ebx
call fcn.0040e740
mov ebp, eax
add esp, 0x10
mov byte [esp + 0x8c], bl
cmp ebp, ebx
je 0x40ee6e
cmp edi, ebx
je 0x40ee53
mov eax, dword [edi]
mov ecx, dword [eax + 8]
push edi
call ecx
mov dword [esp + 0x8c], 0xffffffff
cmp esi, ebx
je 0x40ee6a
mov edx, dword [esi]
mov eax, dword [edx + 8]
push esi
call eax
mov eax, ebp
jmp 0x40eeb0
cmp edi, ebx
je 0x40ee7a
mov ecx, dword [edi]
mov edx, dword [ecx + 8]
push edi
call edx
mov eax, dword [esp + 0x28]
mov dword [esp + 0x8c], 0xffffffff
cmp eax, dword [esp + 0x65]
je 0x40eea2
cmp esi, ebx
je 0x40ee9b
mov ecx, dword [esi]
mov edx, dword [ecx + 8]
push esi
call edx
mov eax, 0xe00e0003
jmp 0x40eeb0
cmp esi, ebx
je 0x40eeae
mov eax, dword [esi]
mov ecx, dword [eax + 8]
push esi
call ecx
xor eax, eax
mov ecx, dword [esp + 0x84]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x68]
xor ecx, esp
call fcn.004b8307
add esp, 0x7c
ret