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

Disassembly:
sub esp, 0x2a4
mov eax, dword [0x4594d4]
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.004015f0
test al, al
je 0x406252
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.004014c0
add esp, 4
test eax, eax
jl 0x406252
cmp dword [esp + 0x14], 6
jae 0x406257
mov edi, 0x50
push 0x60
lea ecx, [esp + 0xa0]
push 0
push ecx
mov dword [esp + 0xa4], edi
call fcn.0042d120
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 0x40658a
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 0x406568
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 0x406559
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 0x406559
test ah, 1
je 0x4063bd
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.USER32.dll_GetMenuItemCount]
test eax, eax
jle 0x406559
mov eax, dword [esp + 0x14]
push 0
push 0
push 0x800
push eax
call dword [sym.imp.USER32.dll_AppendMenuW]
jmp 0x406559
mov ecx, dword [esp + 0x1c]
cmp byte [ecx + 8], 0
push 0x18e
push 0
je 0x40646f
lea eax, [esp + 0x122]
xor edx, edx
push eax
mov word [esp + 0x124], dx
call fcn.0042d120
push 0x30
lea ecx, [esp + 0x78]
push 0
push ecx
call fcn.0042d120
add esp, 0x18
mov dword [esp + 0x68], 0x30
call fcn.00401560
test al, al
je 0x406413
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 0x406559
lea ecx, [esp + 0x122]
xor eax, eax
push ecx
mov word [esp + 0x124], ax
call fcn.0042d120
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 0x4064f3
mov edx, esi
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
jne 0x406539
mov ecx, dword [esp + 0x108]
mov edx, dword [0x45ab34]
push 0xc8
lea eax, [esp + 0x11c]
push eax
push ecx
push edx
mov esi, 0x44c4c8
call dword [sym.imp.USER32.dll_LoadStringW]
xor ecx, ecx
test eax, eax
jle 0x406539
cmp word [esp + ecx*2 + 0x118], 0xa
je 0x406532
inc ecx
cmp ecx, eax
jl 0x406520
jmp 0x406539
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 0x40630b
mov esi, dword [esp + 0x14]
push esi
call dword [sym.imp.USER32.dll_GetMenuItemCount]
test eax, eax
jne 0x40658e
test esi, esi
je 0x406582
push esi
call dword [sym.imp.USER32.dll_DestroyMenu]
push 0xffffffffffffffff
call dword [sym.imp.USER32.dll_MessageBeep]
xor al, al
jmp 0x406596
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.0042bbc1
add esp, 0x2a4
ret