Function at 0x40c310
Capabilities:
Check os version

Disassembly:
push 0xffffffffffffffff
push 0x4554eb
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xcc
push ebx
push ebp
mov ebp, dword [esp + 0xe4]
push esi
mov esi, ecx
push edi
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], ebp
mov eax, dword [0x46c118]
xor edi, edi
add eax, 0x34
mov dword [esp + 0xe4], edi
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp esi, edi
je 0x40c367
lea ecx, [esi + 4]
mov dword [0x46c10c], ecx
jmp 0x40c36d
mov dword [0x46c10c], edi
mov edx, dword [0x46c118]
mov edi, dword [edx + 4]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push edi
push 0x40cc10
push 5
call dword [sym.imp.USER32.dll_SetWindowsHookExA]
mov ebx, dword [esp + 0xf8]
mov ecx, dword [esp + 0xf4]
mov dword [0x46c110], eax
mov al, byte [esi + 0x80]
mov edi, dword [esi + 4]
and al, 0xf7
or al, 1
push ebx
push ecx
mov byte [esi + 0x80], al
call fcn.00416de0
mov edx, dword [esp + 0x104]
add esp, 8
push edx
push edi
push ebx
push eax
mov eax, dword [esp + 0x100]
push eax
push ebp
call dword [sym.imp.USER32.dll_TrackPopupMenuEx]
mov dword [esp + 0x10], eax
mov al, byte [esi + 0x80]
and al, 0xfe
mov byte [esi + 0x80], al
mov ecx, dword [0x46c110]
push ecx
call dword [sym.imp.USER32.dll_UnhookWindowsHookEx]
mov edx, dword [0x46c118]
xor eax, eax
add edx, 0x34
mov dword [0x46c110], eax
push edx
mov dword [0x46c10c], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esi + 4]
mov edi, dword [sym.imp.USER32.dll_UpdateWindow]
push eax
call edi
mov ebx, dword [esi + 4]
mov ebp, dword [sym.imp.USER32.dll_GetParent]
push ebx
call ebp
test eax, eax
je 0x40c435
push eax
mov ebx, eax
call ebp
test eax, eax
jne 0x40c42c
push ebx
call edi
test byte [esi + 0x80], 4
je 0x40c577
mov eax, dword [esi + 0x18]
dec eax
test eax, eax
jl 0x40c577
mov ecx, dword [esi + 0x14]
mov ebx, dword [ecx + eax*4]
mov dword [esi + 0x18], eax
test ebx, ebx
je 0x40c577
push ebx
xor ebp, ebp
call dword [sym.imp.USER32.dll_GetMenuItemCount]
test eax, eax
jle 0x40c445
mov ecx, 0xc
xor eax, eax
lea edi, [esp + 0x18]
lea edx, [esp + 0x48]
rep stosd dword es:[edi], eax
mov ecx, 0x24
lea edi, [esp + 0x4c]
rep stosd dword es:[edi], eax
push edx
mov dword [esp + 0x1c], 0x30
mov dword [esp + 0x4c], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x40c4bb
mov eax, dword [esp + 0x4c]
cmp eax, 5
jae 0x40c4c3
cmp eax, 4
jne 0x40c4bb
cmp dword [esp + 0x50], 0x5a
jae 0x40c4c3
mov dword [esp + 0x18], 0x2c
lea eax, [esp + 0x18]
mov dword [esp + 0x1c], 0x32
push eax
push 1
push ebp
push ebx
call dword [sym.imp.USER32.dll_GetMenuItemInfoA]
mov eax, dword [esp + 0x38]
test eax, eax
mov edi, eax
je 0x40c562
cmp dword [eax], 0x1313
jne 0x40c562
mov dword [esp + 0x1c], 0x31
mov ecx, dword [eax + 8]
mov dword [esp + 0x20], ecx
mov edx, dword [eax + 0xc]
lea esi, [eax + 4]
mov dword [esp + 0x24], edx
mov eax, dword [esi]
mov dword [esp + 0x3c], eax
mov ecx, dword [esi]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea edx, [esp + 0x18]
mov dword [esp + 0x40], eax
push edx
push 1
push ebp
push ebx
mov dword [esp + 0x48], 0
call dword [sym.imp.USER32.dll_SetMenuItemInfoA]
mov eax, dword [esi]
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
push eax
mov eax, dword [esp + 0x24]
push ecx
or edx, eax
or dh, 4
push edx
push ebp
push ebx
call dword [sym.imp.USER32.dll_ModifyMenuA]
mov eax, dword [esi]
push eax
call fcn.00427e30
push edi
call fcn.00427e30
mov esi, dword [esp + 0x1c]
add esp, 8
push ebx
inc ebp
call dword [sym.imp.USER32.dll_GetMenuItemCount]
cmp ebp, eax
jl 0x40c46f
jmp 0x40c445
mov ecx, dword [esp + 0xdc]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xd8
ret 0x14