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

Disassembly:
sub esp, 0x2a4
mov eax, dword [0x4504f4]
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.00402b70
test al, al
je 0x406212
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.00402a40
add esp, 4
test eax, eax
jl 0x406212
cmp dword [esp + 0x14], 6
jae 0x406217
mov edi, 0x50
push 0x60
lea ecx, [esp + 0xa0]
push 0
push ecx
mov dword [esp + 0xa4], edi
call fcn.00429240
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 0x40654a
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 0x406528
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 0x406519
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 0x406519
test ah, 1
je 0x40637d
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.USER32.dll_GetMenuItemCount]
test eax, eax
jle 0x406519
mov eax, dword [esp + 0x14]
push 0
push 0
push 0x800
push eax
call dword [sym.imp.USER32.dll_AppendMenuW]
jmp 0x406519
mov ecx, dword [esp + 0x1c]
cmp byte [ecx + 8], 0
push 0x18e
push 0
je 0x40642f
lea eax, [esp + 0x122]
xor edx, edx
push eax
mov word [esp + 0x124], dx
call fcn.00429240
push 0x30
lea ecx, [esp + 0x78]
push 0
push ecx
call fcn.00429240
add esp, 0x18
mov dword [esp + 0x68], 0x30
call fcn.00402ae0
test al, al
je 0x4063d3
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 0x406519
lea ecx, [esp + 0x122]
xor eax, eax
push ecx
mov word [esp + 0x124], ax
call fcn.00429240
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 0x4064b3
mov edx, esi
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
jne 0x4064f9
mov ecx, dword [esp + 0x108]
mov edx, dword [0x451b14]
push 0xc8
lea eax, [esp + 0x11c]
push eax
push ecx
push edx
mov esi, 0x445450
call dword [sym.imp.USER32.dll_LoadStringW]
xor ecx, ecx
test eax, eax
jle 0x4064f9
cmp word [esp + ecx*2 + 0x118], 0xa
je 0x4064f2
inc ecx
cmp ecx, eax
jl 0x4064e0
jmp 0x4064f9
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 0x4062cb
mov esi, dword [esp + 0x14]
push esi
call dword [sym.imp.USER32.dll_GetMenuItemCount]
test eax, eax
jne 0x40654e
test esi, esi
je 0x406542
push esi
call dword [sym.imp.USER32.dll_DestroyMenu]
push 0xffffffffffffffff
call dword [sym.imp.USER32.dll_MessageBeep]
xor al, al
jmp 0x406556
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.00427d7d
add esp, 0x2a4
ret