Function at 0x405640
Capabilities:
Access peb ldr_data
Check for peb beingdebugged flag
Get number of processors
Get process heap flags
Get process heap force flags

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x64
mov eax, dword [0x452004]
xor eax, esp
mov dword [esp + 0x60], eax
push esi
push 6
push 0
call dword [sym.imp.ole32.dll_CoInitializeEx]
nop
test eax, eax
js 0x4058ab
sub esp, 8
push dword [ebp + 8]
call fcn.0040ce00
test eax, eax
js 0x4058ab
mov eax, dword fs:[0x18]
lea ecx, [esp + 0x30]
mov dword [esp + 0x30], 1
mov edx, 2
mov dword [esp + 0x40], 0x1c
mov dword [esp + 0x44], str.PhSetupMutant_
mov dword [esp + 0x48], 8
mov eax, dword [eax + 0x20]
push 0x10
mov dword [esp + 0x5c], eax
call fcn.0040d200
mov esi, eax
movzx ecx, word [esi]
mov word [esp + 0x28], cx
movzx ecx, word [esi]
add cx, 2
mov word [esp + 0x2a], cx
mov ecx, dword [esi + 4]
mov dword [esp + 0x2c], ecx
mov dword [esp + 0xc], 0x18
call fcn.0040c600
mov dword [esp + 0x10], eax
lea eax, [esp + 0x28]
mov dword [esp + 0x14], eax
lea eax, [esp + 0xc]
push 1
push eax
push 1
lea eax, [esp + 0x30]
mov dword [esp + 0x24], 0x40
push eax
mov dword [esp + 0x2c], 0
mov dword [esp + 0x30], 0
call dword [sym.imp.ntdll.dll_NtCreateMutant]
lea ecx, [esi - 8]
or eax, 0xffffffff
lock xadd dword [ecx + 4], eax
dec eax
jne 0x405730
call fcn.00409ce0
mov edx, dword [0x453abc]
mov ecx, 0x28
call fcn.00409c00
mov esi, eax
push 0x40
push 4
push dword [0x453afc]
mov dword [esi], 8
mov dword [esi + 4], 0x410180
mov dword [esi + 8], 0x4101a0
mov dword [esi + 0xc], 0x10
call dword [sym.imp.ntdll.dll_RtlAllocateHeap]
mov ecx, dword [esi + 0xc]
shl ecx, 2
push ecx
push 0xff
push eax
mov dword [esi + 0x10], eax
call fcn.00415060
mov eax, dword ds:[esi + 0xc]
add esp, 0xc
mov dword [esi + 0x14], eax
shl eax, 4
push eax
push 4
push dword [0x453afc]
call dword [sym.imp.ntdll.dll_RtlAllocateHeap]
mov edx, dword [0x453abc]
mov ecx, 0x28
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], 0
mov dword [esi + 0x20], 0xffffffff
mov dword [esi + 0x24], 0
call fcn.00409c00
mov esi, eax
push 0x40
push 4
push dword [0x453afc]
mov dword [esi], 0xc
mov dword [esi + 4], 0x40ff00
mov dword [esi + 8], 0x40ff30
mov dword [esi + 0xc], 0x10
call dword [sym.imp.ntdll.dll_RtlAllocateHeap]
mov ecx, dword [esi + 0xc]
shl ecx, 2
push ecx
push 0xff
push eax
mov dword [esi + 0x10], eax
call fcn.00415060
mov eax, dword [esi + 0xc]
add esp, 0xc
mov dword [esi + 0x14], eax
lea eax, [eax + eax*4]
shl eax, 2
push eax
push 4
push dword [0x453afc]
call dword [sym.imp.ntdll.dll_RtlAllocateHeap]
push 0x31
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], 0
mov dword [esi + 0x20], 0xffffffff
mov dword [esi + 0x24], 0
mov dword [0x453dac], esi
call dword [sym.imp.USER32.dll_GetSystemMetrics]
push 0x32
call dword [sym.imp.USER32.dll_GetSystemMetrics]
push 0xb
call dword [sym.imp.USER32.dll_GetSystemMetrics]
push 0xc
call dword [sym.imp.USER32.dll_GetSystemMetrics]
push 0
call dword [sym.imp.USER32.dll_GetDC]
mov esi, eax
test esi, esi
je 0x40588f
push 0x5a
push esi
call dword [sym.imp.GDI32.dll_GetDeviceCaps]
push esi
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
call fcn.004050c0
xor eax, eax
pop esi
mov ecx, dword [esp + 0x60]
xor ecx, esp
call fcn.00413aae
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [esp + 0x64]
mov eax, 1
pop esi
xor ecx, esp
call fcn.00413aae
mov esp, ebp
pop ebp
ret 0x10