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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x278
mov eax, dword [0x542040]
xor eax, esp
mov dword [esp + 0x274], eax
push esi
mov eax, ecx
mov esi, edx
push edi
push eax
mov dword [esp + 0x20], esi
mov dword [esp + 0x18], eax
call dword [sym.imp.USER32.dll_GetMenuItemCount]
mov dword [esp + 0x18], eax
cmp eax, 1
jge 0x40837e
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x274]
xor ecx, esp
call fcn.004dadd7
mov esp, ebp
pop ebp
ret
call dword [sym.imp.USER32.dll_CreatePopupMenu]
xor edi, edi
mov dword [esp + 8], eax
mov dword [esp + 0x10], edi
nop
push 0x200
xorps xmm0, xmm0
mov dword [esp + 0x4c], 0
lea eax, [esp + 0x7c]
movlpd qword [esp + 0x34], xmm0
push 0
push eax
movlpd qword [esp + 0x44], xmm0
movlpd qword [esp + 0x4c], xmm0
mov dword [esp + 0x60], 0
mov dword [esp + 0x34], 0x30
mov dword [esp + 0x38], 0x167
mov dword [esp + 0x5c], 0x100
call fcn.004ded20
add esp, 0xc
lea eax, [esp + 0x78]
mov dword [esp + 0x4c], eax
lea eax, [esp + 0x28]
push eax
push 1
push edi
push dword [esp + 0x20]
call dword [sym.imp.USER32.dll_GetMenuItemInfoW]
mov ecx, dword [esp + 0x3c]
test ecx, ecx
je 0x408444
mov edx, esi
call fcn.00408330
test eax, eax
jne 0x408440
mov eax, dword [esi + 4]
mov edx, dword [esp + 8]
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x58], edx
mov dword [esp + 0x5c], ecx
cmp eax, dword [esi + 8]
je 0x408431
mov dword [eax], edx
mov dword [eax + 4], ecx
add dword [esi + 4], 8
jmp 0x408444
lea ecx, [esp + 0x58]
push ecx
push eax
mov ecx, esi
call fcn.0040b6f0
jmp 0x408444
mov dword [esp + 0x3c], eax
push 0
call dword [sym.imp.USER32.dll_GetDC]
mov esi, eax
xorps xmm0, xmm0
push 0x424
lea eax, [esp + 0x64]
movaps xmmword [esp + 0x64], xmm0
push eax
push 0xffffffffffffffff
lea eax, [esp + 0x84]
push eax
push esi
call dword [sym.imp.USER32.dll_DrawTextW]
push esi
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
mov eax, dword [esp + 0x38]
mov dword [esp + 0xc], eax
lea eax, [esp + 0xc]
push eax
lea eax, [esp + 0x24]
push eax
call fcn.0040a610
mov edi, dword [eax]
mov eax, dword [esp + 0x68]
sub eax, dword [esp + 0x60]
mov dword [edi + 0x14], eax
lea eax, [esp + 0x78]
mov dword [edi + 0x18], 0x16
lea edx, [eax + 2]
nop dword [eax]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4084b0
sub eax, edx
sar eax, 1
jne 0x4084c8
mov eax, 0x51b3ac
jmp 0x4084f7
lea esi, [eax + eax]
push ecx
lea eax, [esi + 2]
mov ecx, 0x548dd4
push eax
call fcn.0040a210
push esi
lea ecx, [esp + 0x7c]
mov dword [esp + 0x10], eax
push ecx
push eax
call fcn.004def30
mov eax, dword [esp + 0x18]
add esp, 0xc
xor ecx, ecx
mov word [esi + eax], cx
mov dword [edi + 0x1c], eax
mov eax, dword [esp + 0x38]
mov dword [edi + 0xc], eax
mov eax, dword [esp + 0x30]
mov dword [edi + 0x20], eax
mov eax, dword [esp + 0x30]
mov dword [edi + 0x24], eax
mov eax, dword [esp + 0x34]
mov dword [edi + 0x28], eax
mov eax, dword [esp + 0x3c]
mov dword [edi + 0x2c], eax
mov eax, dword [esp + 0x40]
mov dword [edi + 0x30], eax
mov eax, dword [esp + 0x44]
mov dword [edi + 0x34], eax
mov eax, dword [esp + 0x48]
mov dword [edi + 0x38], eax
mov eax, dword [esp + 0x54]
mov dword [edi + 0x3c], eax
lea eax, [esp + 0x28]
mov edi, dword [esp + 0x10]
or dword [esp + 0x30], 0x100
push eax
push 1
push edi
push dword [esp + 0x14]
call dword [sym.imp.USER32.dll_InsertMenuItemW]
mov esi, dword [esp + 0x1c]
inc edi
mov dword [esp + 0x10], edi
cmp edi, dword [esp + 0x18]
jl 0x408390
mov ecx, dword [esp + 0x27c]
mov eax, dword [esp + 8]
pop edi
pop esi
xor ecx, esp
call fcn.004dadd7
mov esp, ebp
pop ebp
ret