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

Disassembly:
sub esp, 0x2a4
mov eax, dword [0x41f030]
xor eax, esp
mov dword [esp + 0x29c], eax
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov dword [esp + 0x1c], esi
mov edi, 0x64
call fcn.00408020
test al, al
je 0x409db2
xor eax, eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
lea eax, [esp + 0x14]
push eax
lea ebx, [esp + 0x1c]
call fcn.00407e00
add esp, 4
test eax, eax
jl 0x409db2
cmp dword [esp + 0x14], 6
jae 0x409db7
mov edi, 0x50
push 0x60
lea ecx, [esp + 0xa0]
push 0
push ecx
mov dword [esp + 0xa4], edi
call fcn.0040bea0
mov eax, dword [esi + 4]
mov ebp, dword [sym.imp.USER32.dll_SendMessageW]
add esp, 0xc
mov dword [esp + 0x9c], 0x10
mov ecx, dword [eax + 0xc]
lea edx, [esp + 0x98]
push edx
mov edx, dword [eax]
push ecx
push 0x41c
push edx
call ebp
mov edi, dword [esp + 0xb8]
push 0
push 0
push 0x418
push edi
call ebp
mov ebx, eax
mov dword [esp + 0x24], ebx
test ebx, ebx
jle 0x40a0ea
push 0
push 0
push 0x52e
push edi
call ebp
test eax, eax
mov dword [esp + 0x20], eax
setne al
mov byte [esi + 8], al
call dword [sym.imp.USER32.dll_CreatePopupMenu]
lea ecx, [esp + 0x58]
mov dword [esp + 0x14], eax
xor eax, eax
push ecx
xor esi, esi
push edi
mov dword [esp + 0x60], esi
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
call dword [sym.imp.USER32.dll_GetClientRect]
mov dword [esp + 0x18], esi
test ebx, ebx
jle 0x40a0c8
lea edx, [esp + 0x104]
push edx
xor eax, eax
push esi
push 0x417
push edi
mov dword [esp + 0x114], eax
mov dword [esp + 0x118], eax
mov dword [esp + 0x11c], eax
mov dword [esp + 0x120], eax
mov dword [esp + 0x124], eax
call ebp
test byte [esp + 0x10c], 8
jne 0x40a0b9
xor eax, eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
lea eax, [esp + 0x28]
push eax
push esi
push 0x41d
push edi
call ebp
mov eax, dword [esp + 0x10c]
mov ecx, dword [esp + 0x30]
mov bl, al
shr bl, 2
and bl, 1
cmp ecx, dword [esp + 0x60]
jle 0x40a0b9
test ah, 1
je 0x409f1d
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.USER32.dll_GetMenuItemCount]
test eax, eax
jle 0x40a0b9
mov eax, dword [esp + 0x14]
push 0
push 0
push 0x800
push eax
call dword [sym.imp.USER32.dll_AppendMenuW]
jmp 0x40a0b9
mov ecx, dword [esp + 0x1c]
cmp byte [ecx + 8], 0
push 0x18e
push 0
je 0x409fcf
lea eax, [esp + 0x122]
xor edx, edx
push eax
mov word [esp + 0x124], dx
call fcn.0040bea0
push 0x30
lea ecx, [esp + 0x78]
push 0
push ecx
call fcn.0040bea0
add esp, 0x18
mov dword [esp + 0x68], 0x30
call fcn.00407f90
test al, al
je 0x409f73
mov dword [esp + 0x68], 0x2c
mov ecx, dword [esp + 0x20]
lea eax, [esp + 0x68]
push eax
push 1
push esi
lea edx, [esp + 0x124]
push ecx
mov dword [esp + 0x7c], 0x14
mov dword [esp + 0x9c], edx
mov dword [esp + 0xa0], 0xc8
call dword [sym.imp.USER32.dll_GetMenuItemInfoW]
mov edx, dword [esp + 0x8c]
mov eax, dword [esp + 0x7c]
xor ecx, ecx
test bl, bl
sete cl
push edx
mov edx, dword [esp + 0x18]
push eax
or ecx, 0x10
push ecx
push edx
call dword [sym.imp.USER32.dll_AppendMenuW]
jmp 0x40a0b9
lea ecx, [esp + 0x122]
xor eax, eax
push ecx
mov word [esp + 0x124], ax
call fcn.0040bea0
mov ecx, dword [esp + 0x114]
xor eax, eax
add esp, 0xc
mov dword [esp + 0x3c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
lea eax, [esp + 0x38]
push eax
push ecx
lea esi, [esp + 0x120]
push 0x43f
mov edx, esi
push edi
mov dword [esp + 0x48], 0x20
mov dword [esp + 0x4c], 2
mov dword [esp + 0x60], edx
mov dword [esp + 0x64], 0xc8
call ebp
cmp eax, 0xffffffff
je 0x40a053
mov edx, esi
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
jne 0x40a099
mov ecx, dword [esp + 0x108]
mov edx, dword [0x4209f4]
push 0xc8
lea eax, [esp + 0x11c]
push eax
push ecx
push edx
mov esi, 0x41afec
call dword [sym.imp.USER32.dll_LoadStringW]
xor ecx, ecx
test eax, eax
jle 0x40a099
cmp word [esp + ecx*2 + 0x118], 0xa
je 0x40a092
inc ecx
cmp ecx, eax
jl 0x40a080
jmp 0x40a099
lea esi, [esp + ecx*2 + 0x11a]
mov eax, dword [esp + 0x108]
mov edx, dword [esp + 0x14]
xor ecx, ecx
test bl, bl
sete cl
push esi
push eax
push ecx
push edx
call dword [sym.imp.USER32.dll_AppendMenuW]
mov esi, dword [esp + 0x18]
inc esi
cmp esi, dword [esp + 0x24]
mov dword [esp + 0x18], esi
jl 0x409e6b
mov esi, dword [esp + 0x14]
push esi
call dword [sym.imp.USER32.dll_GetMenuItemCount]
test eax, eax
jne 0x40a0ee
test esi, esi
je 0x40a0e2
push esi
call dword [sym.imp.USER32.dll_DestroyMenu]
push 0xffffffffffffffff
call dword [sym.imp.USER32.dll_MessageBeep]
xor al, al
jmp 0x40a0f6
mov eax, dword [esp + 0x1c]
mov dword [eax], esi
mov al, 1
mov ecx, dword [esp + 0x2ac]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040b192
add esp, 0x2a4
ret