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

Disassembly:
sub esp, 0x54
mov edx, dword [esp + 0x58]
push ebp
lea eax, [esp + 0x18]
push esi
lea ecx, [esp + 0x10]
push eax
xor ebp, ebp
push ecx
push edx
mov dword [esp + 0x14], ebp
call fcn.00406100
mov esi, eax
add esp, 0xc
cmp esi, ebp
je 0x406582
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.SHELL32.dll_SHGetMalloc]
test eax, eax
jl 0x406582
lea ecx, [esp + 0xc]
lea edx, [esp + 0x1c]
push ecx
push edx
call fcn.0040b530
add esp, 8
test eax, eax
jl 0x406578
mov eax, dword [esp + 0xc]
lea edx, [esp + 0x60]
push edx
mov edx, dword [esp + 0x14]
mov ecx, dword [eax]
push ebp
push 0x41b448
push esi
push edx
mov edx, dword [esp + 0x78]
push edx
push eax
call dword [ecx + 0x28]
test eax, eax
jl 0x40656e
push ebx
push edi
call dword [sym.imp.USER32.dll_CreatePopupMenu]
mov esi, eax
mov eax, dword [esp + 0x68]
push ebp
push 0x7fff
mov ecx, dword [eax]
push 1
push ebp
push esi
push eax
call dword [ecx + 0xc]
push esi
call dword [sym.imp.USER32.dll_GetMenuItemCount]
xor ebx, ebx
cmp eax, ebp
mov dword [esp + 0x1c], eax
jle 0x4064bd
lea edx, [esp + 0x38]
mov ecx, 0xb
push edx
xor eax, eax
lea edi, [esp + 0x3c]
push 1
push ebx
push esi
rep stosd dword es:[edi], eax
mov dword [esp + 0x48], 0x2c
mov dword [esp + 0x70], ebp
mov dword [esp + 0x4c], 4
call dword [sym.imp.USER32.dll_GetMenuItemInfoA]
test eax, eax
je 0x4064a4
mov eax, dword [esp + 0x4c]
cmp eax, ebp
je 0x4064a4
push eax
call dword [sym.imp.USER32.dll_GetMenuItemCount]
cmp eax, 1
jne 0x4064a4
mov eax, dword [esp + 0x4c]
push ebp
push eax
call dword [sym.imp.USER32.dll_GetMenuItemID]
mov ecx, dword [esp + 0x4c]
mov edi, eax
push ecx
call dword [sym.imp.USER32.dll_GetMenuItemCount]
cmp eax, 1
jne 0x4064a4
cmp edi, 0x1d
je 0x4064af
cmp edi, 0x5d
je 0x4064af
mov eax, dword [esp + 0x1c]
inc ebx
cmp ebx, eax
jl 0x406434
jmp 0x4064bd
push ebx
push esi
call fcn.00406290
add esp, 8
mov dword [esp + 0x10], eax
mov edi, dword [esp + 0x6c]
mov edx, dword [esp + 0x74]
mov eax, dword [esp + 0x70]
push ebp
push edi
push ebp
push edx
push eax
push 0x102
push esi
call dword [sym.imp.USER32.dll_TrackPopupMenu]
cmp eax, 0x34bb
jbe 0x4064ff
cmp eax, 0x34ee
jae 0x4064ff
mov ecx, dword [esp + 0x10]
mov edx, dword [0x41ea64]
push eax
push ecx
push edx
call fcn.0040e690
add esp, 0xc
jmp 0x40654e
cmp eax, ebp
je 0x40654e
dec eax
lea edx, [esp + 0x38]
and eax, 0xffff
mov dword [esp + 0x38], 0x24
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x40], edi
mov dword [esp + 0x48], ebp
mov dword [esp + 0x4c], ebp
mov dword [esp + 0x50], 1
mov dword [esp + 0x54], ebp
mov dword [esp + 0x58], ebp
mov ecx, dword [eax]
push edx
push eax
call dword [ecx + 0x10]
push 1
call fcn.00406d30
add esp, 4
mov eax, dword [esp + 0x10]
mov edi, dword [sym.imp.USER32.dll_DestroyMenu]
cmp eax, ebp
je 0x40655f
push eax
call edi
push esi
call edi
mov eax, dword [esp + 0x68]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
pop edi
pop ebx
mov eax, dword [esp + 0xc]
push eax
mov edx, dword [eax]
call dword [edx + 8]
mov eax, dword [esp + 0x18]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
pop esi
pop ebp
add esp, 0x54
ret