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

Disassembly:
sub esp, 0x13c
mov eax, dword [0x445030]
xor eax, esp
mov dword [esp + 0x134], eax
push ebx
push ebp
push esi
mov esi, edx
xor ebx, ebx
push edi
mov edi, ecx
cmp esi, ebx
je 0x407851
push esi
call dword [sym.imp.USER32.dll_IsMenu]
test eax, eax
je 0x407a3d
test byte [edi + 0x86], 1
je 0x407864
cmp dword [edi + 0x44], ebx
je 0x407864
call fcn.00408280
mov eax, dword [edi + 0x44]
cmp eax, ebx
je 0x407878
test byte [edi + 0x58], 2
jne 0x407878
push eax
call dword [sym.imp.USER32.dll_DestroyMenu]
test byte [edi + 0x84], 2
mov dword [edi + 0x44], esi
jne 0x407a38
mov eax, dword [edi + 4]
mov ebp, dword [sym.imp.USER32.dll_SendMessageW]
push ebx
push ebx
push 0xb
push eax
call ebp
mov ecx, dword [edi + 4]
push ebx
push ebx
push 0x418
push ecx
call ebp
cmp eax, ebx
jle 0x4078c2
mov esi, eax
jmp 0x4078b0
mov edx, dword [edi + 4]
push ebx
push ebx
push 0x416
push edx
call ebp
sub esi, 1
jne 0x4078b0
mov eax, dword [edi + 0x44]
cmp eax, ebx
je 0x407a16
push eax
call dword [sym.imp.USER32.dll_GetMenuItemCount]
xor esi, esi
cmp eax, ebx
mov dword [esp + 0x10], eax
jle 0x407a16
push 0x30
lea eax, [esp + 0x38]
push ebx
push eax
call fcn.0041c990
add esp, 0xc
mov dword [esp + 0x34], 0x30
call fcn.0040ddf0
test al, al
je 0x40790b
mov dword [esp + 0x34], 0x2c
mov eax, dword [edi + 0x44]
lea edx, [esp + 0x34]
push edx
push 1
push esi
lea ecx, [esp + 0x84]
push eax
mov dword [esp + 0x48], 0x15
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x68], ecx
mov dword [esp + 0x6c], 0x64
call dword [sym.imp.USER32.dll_GetMenuItemInfoW]
lea ecx, [esp + 0x78]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, 0x63
jle 0x40796d
mov eax, dword [edi + 0x44]
lea edx, [esp + 0x34]
push edx
push 1
push esi
push eax
mov dword [esp + 0x4c], 4
call dword [sym.imp.USER32.dll_SetMenuItemInfoW]
xor ecx, ecx
mov word [esp + 0x78], cx
mov edx, dword [esp + 0x40]
mov ecx, dword [edi + 4]
xor eax, eax
and dl, 3
mov dword [esp + 0x6c], eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], eax
neg dl
lea eax, [esp + 0x64]
push eax
sbb dl, dl
push 0xffffffffffffffff
and dl, 0xfc
push 0x443
add dl, 4
push ecx
mov dword [esp + 0x74], ebx
mov dword [esp + 0x78], esi
mov byte [esp + 0x7c], dl
mov byte [esp + 0x7d], 0x18
mov dword [esp + 0x80], ebx
mov dword [esp + 0x84], ebx
call ebp
mov ecx, dword [edi + 4]
xor eax, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x30], eax
lea eax, [esp + 0x14]
push eax
push esi
push 0x440
lea edx, [esp + 0x84]
push ecx
mov dword [esp + 0x24], 0x20
mov dword [esp + 0x28], 2
mov dword [esp + 0x3c], edx
call ebp
inc esi
cmp esi, dword [esp + 0x10]
jl 0x4078e2
mov edx, dword [edi + 4]
push ebx
push 1
push 0xb
push edx
call ebp
mov eax, dword [edi + 4]
push 1
push ebx
push eax
call dword [sym.imp.USER32.dll_InvalidateRect]
mov ecx, dword [edi + 4]
push ecx
call dword [sym.imp.USER32.dll_UpdateWindow]
mov eax, 1
mov ecx, dword [esp + 0x144]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0041b3f1
add esp, 0x13c
ret