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

Disassembly:
sub esp, 0x294
mov eax, dword [0x4a4100]
xor eax, esp
mov dword [esp + 0x290], eax
mov ecx, dword [edi + 8]
mov edx, dword [ecx + 0x10]
mov eax, dword [esp + 0x298]
push ebx
push ebp
push esi
push 0x6d
push edx
mov dword [esp + 0x4c], eax
call dword [sym.imp.USER32.dll_LoadMenuW]
mov ebx, eax
xor ebp, ebp
push ebp
mov dword [esp + 0x20], ebx
call dword [sym.imp.USER32.dll_GetDC]
mov esi, eax
mov eax, dword [edi + 0x44]
push eax
push esi
mov dword [esp + 0x30], esi
call dword [sym.imp.GDI32.dll_SelectObject]
push ebp
push ebx
mov dword [esp + 0x28], eax
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x14], ebp
call dword [sym.imp.USER32.dll_GetSubMenu]
mov ebx, eax
push ebx
mov dword [esp + 0x44], ebx
call dword [sym.imp.USER32.dll_GetMenuItemCount]
cmp eax, ebp
mov dword [esp + 0x3c], eax
mov dword [esp + 0x18], ebp
jle 0x40a9b9
jmp 0x40a824
mov ebx, dword [esp + 0x40]
push 0x200
lea ecx, [esp + 0x9c]
push ebp
push ecx
call fcn.00474b70
add esp, 0xc
push 0x2c
lea edx, [esp + 0x70]
push ebp
push edx
call fcn.00474b70
mov edx, dword [esp + 0x24]
add esp, 0xc
lea ecx, [esp + 0x68]
push ecx
push 1
push edx
lea eax, [esp + 0xa4]
push ebx
mov dword [esp + 0x78], 0x30
mov dword [esp + 0x7c], 0x146
mov dword [esp + 0xa0], 0xff
mov dword [esp + 0x9c], eax
call dword [sym.imp.USER32.dll_GetMenuItemInfoW]
xor eax, eax
mov word [esp + 0x296], ax
cmp dword [esp + 0x7c], ebp
jne 0x40a9a2
mov ebx, dword [esp + 0x78]
push 0x24
call fcn.0046f046
add esp, 4
cmp eax, ebp
je 0x40a8b9
mov dword [eax + 4], ebp
mov dword [eax + 0x18], ebp
mov dword [eax + 0x1c], ebp
mov esi, eax
jmp 0x40a8bb
xor esi, esi
mov dword [esi + 8], ebp
mov dword [esi + 0xc], ebp
mov dword [esi + 0x10], ebp
mov dword [esi + 0x14], ebp
mov dword [esi + 0x20], ebx
mov ecx, dword [edi + 0x30]
mov dword [esi], ecx
lea eax, [esp + 0x68]
mov dword [edi + 0x30], esi
mov dword [esp + 0x48], esi
call fcn.0040a630
mov ebp, eax
mov dword [esi + 4], ebp
lea esi, [edi + 0x18]
lea ebx, [esp + 0x48]
call fcn.0040aae0
test dword [esp + 0x70], 0x800
jne 0x40a9a0
mov eax, dword [ebp]
test eax, eax
je 0x40a943
lea edx, [esp + 0x50]
push edx
push 0x18
push eax
call dword [sym.imp.GDI32.dll_GetObjectW]
cmp eax, 0x18
jne 0x40a922
mov eax, dword [esp + 0x54]
mov ecx, dword [esp + 0x58]
jmp 0x40a926
xor eax, eax
xor ecx, ecx
mov dword [esp + 0x48], eax
cdq
sub eax, edx
sar eax, 1
cmp eax, dword [esp + 0x10]
jle 0x40a939
mov dword [esp + 0x10], eax
cmp ecx, dword [esp + 0xc]
jle 0x40a943
mov dword [esp + 0xc], ecx
mov ecx, dword [esp + 0x28]
xor eax, eax
push 0x400
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x30]
push eax
push 0xffffffffffffffff
add ebp, 0xc
push ebp
push ecx
mov dword [esp + 0x40], 0
call dword [sym.imp.USER32.dll_DrawTextW]
mov eax, dword [esp + 0x34]
sub eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x14]
mov dword [esp + 0x34], eax
jle 0x40a98a
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x38]
sub eax, dword [esp + 0x30]
cmp eax, dword [esp + 0xc]
mov dword [esp + 0x38], eax
jle 0x40a9a0
mov dword [esp + 0xc], eax
xor ebp, ebp
mov eax, dword [esp + 0x18]
inc eax
cmp eax, dword [esp + 0x3c]
mov dword [esp + 0x18], eax
jl 0x40a820
mov esi, dword [esp + 0x28]
mov edx, dword [esp + 0x20]
push edx
push esi
call dword [sym.imp.GDI32.dll_SelectObject]
push esi
push ebp
call dword [sym.imp.USER32.dll_ReleaseDC]
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.USER32.dll_DestroyMenu]
mov edx, dword [0x4aabdc]
lea ecx, [esp + 0x50]
push ecx
push 0x18
push edx
call dword [sym.imp.GDI32.dll_GetObjectW]
cmp eax, 0x18
jne 0x40a9fb
mov eax, dword [esp + 0x54]
mov ecx, dword [esp + 0x58]
jmp 0x40a9ff
xor eax, eax
xor ecx, ecx
mov esi, dword [esp + 0x10]
mov edx, dword [0x4a60c4]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x14]
lea ebx, [eax + esi + 6]
xor esi, esi
cmp dword [edi + 0x1c], ebp
mov dword [esp + 0x24], ecx
mov ecx, dword [0x4a60c8]
jg 0x40aa62
mov edx, dword [0x4a60cc]
mov eax, dword [esp + 0x44]
add ebx, edx
add ebx, dword [0x4a60c4]
pop esi
mov dword [eax], ebx
mov edx, dword [0x4a60d0]
add ecx, edx
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x298]
pop ebp
pop ebx
xor ecx, esp
call fcn.0046f01c
add esp, 0x294
ret 4
xor ebp, ebp
cmp esi, ebp
jl 0x40aac9
cmp esi, dword [edi + 0x1c]
jge 0x40aac9
mov eax, dword [edi + 0x18]
mov eax, dword [eax + esi*4]
mov ebp, dword [eax + 4]
cmp dword [ebp + 4], 0
mov dword [esp + 0x1c], ebp
lea ebp, [ebx + edx]
mov dword [eax + 8], edx
mov dword [eax + 0xc], ecx
mov dword [eax + 0x10], ebp
je 0x40aaa8
mov ebp, dword [esp + 0x24]
or dword [eax + 0x18], 0x8000000
add ecx, ebp
mov dword [eax + 0x14], ecx
cmp dword [edi + 0x2c], eax
jne 0x40aab1
mov dword [edi + 0x2c], 0
jmp 0x40aab1
mov ebp, dword [esp + 0xc]
add ecx, ebp
mov dword [eax + 0x14], ecx
mov eax, dword [esp + 0x10]
mov ebp, dword [esp + 0x1c]
add eax, edx
inc esi
mov dword [ebp + 8], eax
cmp esi, dword [edi + 0x1c]
jl 0x40aa60
jmp 0x40aa26
push ebp
push ebp
push 1
push 0xc000008c
call dword [sym.imp.KERNEL32.dll_RaiseException]