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

Disassembly:
push 0xffffffffffffffff
push 0x44fdbf
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x8c
push ebx
push ebp
xor ebx, ebx
push esi
push edi
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], ebx
push ecx
lea ecx, [esp + 0x18]
mov eax, esp
mov dword [esp + 0xa8], ebx
mov dword [esp + 0x20], esp
mov dword [eax], 0xc9
call fcn.00427130
mov eax, dword [esp + 0x14]
mov esi, dword [sym.imp.USER32.dll_IsMenu]
push eax
call esi
cmp eax, ebx
je 0x40f981
lea ecx, [esp + 0x1c]
push 1
push ecx
lea ecx, [esp + 0x1c]
call fcn.00424980
mov eax, dword [eax]
mov dword [esp + 0x10], eax
push eax
call esi
cmp eax, ebx
je 0x40f969
mov edi, dword [esp + 0x10]
push edi
call esi
test eax, eax
je 0x40f820
mov dword [esp + 0x20], edi
push edi
mov byte [esp + 0xa8], 2
call dword [sym.imp.USER32.dll_GetMenuItemCount]
mov ebp, eax
xor esi, esi
cmp ebp, ebx
jle 0x40f820
mov edi, dword [sym.imp.OLEAUT32.dll_SysStringLen]
lea edx, [esp + 0x1c]
push esi
push edx
lea ecx, [esp + 0x28]
call fcn.00424980
mov eax, dword [esp + 0x1c]
mov byte [esp + 0xa4], 3
cmp eax, ebx
je 0x40f74a
push eax
mov ecx, 0x460650
call fcn.004296f0
lea eax, [esp + 0x28]
push 0x400
push eax
push esi
lea ecx, [esp + 0x2c]
mov dword [esp + 0x34], ebx
call fcn.004248d0
mov ecx, dword [esp + 0x28]
push ecx
lea ecx, [esp + 0x30]
call fcn.00425d40
mov edx, dword [esp + 0x28]
mov byte [esp + 0xa4], 4
push edx
call edi
push 1
push ecx
lea eax, [esp + 0x34]
mov ecx, esp
mov dword [esp + 0x38], esp
push eax
call fcn.00425750
lea ecx, [esp + 0x2c]
push ecx
mov ecx, 0x460650
call fcn.00429000
mov eax, dword [esp + 0x24]
mov byte [esp + 0xa4], 5
mov ecx, dword [eax - 8]
cmp ecx, ebx
jle 0x40f7ed
mov eax, ecx
lea ecx, [esp + 0x24]
inc eax
mov dword [esp + 0x6c], 0x30
push eax
mov dword [esp + 0x74], 0x40
mov dword [esp + 0x78], ebx
call fcn.00403630
lea edx, [esp + 0x6c]
lea ecx, [esp + 0x20]
push edx
push 1
push esi
mov dword [esp + 0x9c], eax
call fcn.004249b0
lea ecx, [esp + 0x24]
mov byte [esp + 0xa4], 4
call fcn.00429590
lea ecx, [esp + 0x2c]
mov byte [esp + 0xa4], 3
call fcn.00429590
inc esi
mov byte [esp + 0xa4], 2
cmp esi, ebp
jl 0x40f720
mov eax, dword [esp + 0x18]
mov ebp, dword [sym.imp.USER32.dll_SendMessageA]
push 2
push 0xffffffffffffffff
mov ecx, dword [eax + 0xad0]
push 0x100c
push ecx
call ebp
xor edx, edx
cmp eax, ebx
setge dl
mov edi, edx
mov edx, dword [esp + 0x10]
mov eax, edi
mov esi, dword [sym.imp.USER32.dll_SetMenuItemInfoA]
neg eax
sbb eax, eax
lea ecx, [esp + 0x3c]
and al, 0xfd
push ecx
push ebx
add eax, 3
push 0x3ef
push edx
mov dword [esp + 0x4c], 0x30
mov dword [esp + 0x50], 1
mov dword [esp + 0x58], eax
call esi
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x3c]
push eax
push ebx
push 0x3f2
push ecx
call esi
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x3c]
push edx
push ebx
push 0x3f3
push eax
call esi
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x3c]
push ecx
push ebx
push 0x3f4
push edx
call esi
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x3c]
push eax
push ebx
push 0x3f5
push ecx
call esi
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x3c]
push edx
push ebx
push 0x3f7
push eax
call esi
cmp edi, ebx
je 0x40f93e
mov edi, dword [esp + 0x18]
push 2
push 0xffffffffffffffff
push 0x100c
mov ecx, dword [edi + 0xad0]
push ecx
call ebp
mov edx, dword [edi + 0xad0]
push 0xf000
push eax
push 0x102c
push edx
call ebp
shr eax, 0xc
dec eax
mov dword [esp + 0x48], 3
mov dword [esp + 0x30], eax
je 0x40f92a
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x3c]
push eax
push ebx
push 0x3f5
push ecx
call esi
jmp 0x40f942
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x3c]
push edx
push ebx
push 0x3f7
push eax
call esi
jmp 0x40f942
mov edi, dword [esp + 0x18]
lea ecx, [esp + 0x34]
push ecx
call dword [sym.imp.USER32.dll_GetCursorPos]
mov edi, dword [edi + 4]
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x10]
push ebx
push edi
push ebx
push edx
push eax
push ebx
push ecx
call dword [sym.imp.USER32.dll_TrackPopupMenu]
mov eax, dword [esp + 0x10]
mov byte [esp + 0xa4], bl
cmp eax, ebx
je 0x40f981
lea ecx, [esp + 0x10]
call fcn.0042ff50
mov eax, dword [esp + 0x14]
mov dword [esp + 0xa4], 0xffffffff
cmp eax, ebx
je 0x40f99d
lea ecx, [esp + 0x14]
call fcn.0042ff50
mov ecx, dword [esp + 0x9c]
pop edi
pop esi
pop ebp
xor eax, eax
mov dword fs:[0], ecx
pop ebx
add esp, 0x98
ret 0xc