Function at 0x40d980
Capabilities:
Link many functions at runtime

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x427b98]
xor eax, ebp
mov dword [ebp - 8], eax
mov dword [ebp - 0x20], 0
call fcn.00404ba0
mov dword [ebp - 4], eax
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x18], 0
cmp dword [0x4389f8], 0
jne 0x40da87
push str.USER32.DLL
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jne 0x40d9de
xor eax, eax
jmp 0x40db92
push str.MessageBoxW
mov eax, dword [ebp - 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
jne 0x40d9fd
xor eax, eax
jmp 0x40db92
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_EncodePointer]
mov dword [0x4389f8], eax
push str.GetActiveWindow
mov edx, dword [ebp - 0x2c]
push edx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
call dword [sym.imp.KERNEL32.dll_EncodePointer]
mov dword [0x4389fc], eax
push str.GetLastActivePopup
mov eax, dword [ebp - 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
call dword [sym.imp.KERNEL32.dll_EncodePointer]
mov dword [0x438a00], eax
push str.GetUserObjectInformationW
mov ecx, dword [ebp - 0x2c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x20], eax
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_EncodePointer]
mov dword [0x438a08], eax
cmp dword [0x438a08], 0
je 0x40da87
push str.GetProcessWindowStation
mov eax, dword [ebp - 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
call dword [sym.imp.KERNEL32.dll_EncodePointer]
mov dword [0x438a04], eax
mov ecx, dword [0x438a04]
cmp ecx, dword [ebp - 4]
je 0x40dafa
mov edx, dword [0x438a08]
cmp edx, dword [ebp - 4]
je 0x40dafa
mov eax, dword [0x438a04]
push eax
call dword [sym.imp.KERNEL32.dll_DecodePointer]
mov dword [ebp - 0x30], eax
mov ecx, dword [0x438a08]
push ecx
call dword [sym.imp.KERNEL32.dll_DecodePointer]
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x30], 0
je 0x40dafa
cmp dword [ebp - 0x34], 0
je 0x40dafa
call dword [ebp - 0x30]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x40daf3
lea edx, [ebp - 0x24]
push edx
push 0xc
lea eax, [ebp - 0x14]
push eax
push 1
mov ecx, dword [ebp - 0x18]
push ecx
call dword [ebp - 0x34]
test eax, eax
je 0x40daf3
mov edx, dword [ebp - 0xc]
and edx, 1
jne 0x40dafa
mov dword [ebp - 0x28], 1
cmp dword [ebp - 0x28], 0
je 0x40db0d
mov eax, dword [ebp + 0x10]
or eax, 0x200000
mov dword [ebp + 0x10], eax
jmp 0x40db64
mov ecx, dword [0x4389fc]
cmp ecx, dword [ebp - 4]
je 0x40db34
mov edx, dword [0x4389fc]
push edx
call dword [sym.imp.KERNEL32.dll_DecodePointer]
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0
je 0x40db34
call dword [ebp - 0x38]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x40db64
mov eax, dword [0x438a00]
cmp eax, dword [ebp - 4]
je 0x40db64
mov ecx, dword [0x438a00]
push ecx
call dword [sym.imp.KERNEL32.dll_DecodePointer]
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
je 0x40db64
mov edx, dword [ebp - 0x1c]
push edx
call dword [ebp - 0x3c]
mov dword [ebp - 0x1c], eax
mov eax, dword [0x4389f8]
push eax
call dword [sym.imp.KERNEL32.dll_DecodePointer]
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
je 0x40db90
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x1c]
push ecx
call dword [ebp - 0x40]
jmp 0x40db92
xor eax, eax
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040b9e0
mov esp, ebp
pop ebp
ret