Function at 0x503330
Capabilities:
Check os version

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x240
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, ecx
test esi, esi
je 0x503357
push esi
call dword [sym.imp.USER32.dll_IsMenu]
test eax, eax
jne 0x503357
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4
test byte [edi + 0x86], 1
je 0x50336d
cmp dword [edi + 0x44], 0
je 0x50336d
mov ecx, edi
call fcn.00501dd0
mov eax, dword [edi + 0x44]
test eax, eax
je 0x503381
test byte [edi + 0x58], 2
jne 0x503381
push eax
call dword [sym.imp.USER32.dll_DestroyMenu]
test byte [edi + 0x84], 2
mov dword [edi + 0x44], esi
jne 0x503567
mov eax, dword [edi + 4]
push ebx
mov ebx, dword [sym.imp.USER32.dll_SendMessageW]
push 0
push 0
push 0xb
push eax
call ebx
mov ecx, dword [edi + 4]
push 0
push 0
push 0x418
push ecx
call ebx
test eax, eax
jle 0x5033d2
mov esi, eax
lea esp, [esp]
mov edx, dword [edi + 4]
push 0
push 0
push 0x416
push edx
call ebx
dec esi
jne 0x5033c0
mov eax, dword [edi + 0x44]
test eax, eax
je 0x503542
push eax
call dword [sym.imp.USER32.dll_GetMenuItemCount]
xor esi, esi
mov dword [ebp + 8], eax
test eax, eax
jle 0x503542
push 0x30
lea eax, [ebp - 0x64]
push 0
push eax
call fcn.006100a0
push pe_nt_image_headers32
lea ecx, [ebp - 0x23c]
push 0
push ecx
mov dword [ebp - 0x64], 0x30
call fcn.006100a0
add esp, 0x18
lea edx, [ebp - 0x240]
push edx
mov dword [ebp - 0x240], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
je 0x50344f
mov eax, dword [ebp - 0x23c]
cmp eax, 5
jae 0x503456
cmp eax, 4
jne 0x50344f
cmp dword [ebp - 0x238], 0x5a
jae 0x503456
mov dword [ebp - 0x64], 0x2c
mov edx, dword [edi + 0x44]
lea ecx, [ebp - 0x64]
push ecx
push 1
push esi
lea eax, [ebp - 0x12c]
push edx
mov dword [ebp - 0x60], 0x15
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], 0x64
call dword [sym.imp.USER32.dll_GetMenuItemInfoW]
lea eax, [ebp - 0x12c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, 0x63
jle 0x5034b8
mov edx, dword [edi + 0x44]
lea ecx, [ebp - 0x64]
push ecx
push 1
push esi
push edx
mov dword [ebp - 0x5c], 4
call dword [sym.imp.USER32.dll_SetMenuItemInfoW]
xor eax, eax
mov word [ebp - 0x12c], ax
mov ecx, dword [ebp - 0x58]
xor eax, eax
and cl, 3
neg cl
lea edx, [ebp - 0x14]
push edx
sbb cl, cl
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], eax
mov dword [ebp - 4], eax
push 0xffffffffffffffff
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x14], eax
and cl, 0xfc
mov dword [ebp - 8], eax
mov dword [ebp - 4], eax
mov eax, dword [edi + 4]
push 0x443
add cl, 4
push eax
mov dword [ebp - 0x10], esi
mov byte [ebp - 0xc], cl
mov byte [ebp - 0xb], 0x18
call ebx
xor eax, eax
lea edx, [ebp - 0x34]
push edx
push esi
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x18], eax
mov eax, dword [edi + 4]
push 0x440
lea ecx, [ebp - 0x12c]
push eax
mov dword [ebp - 0x34], 0x20
mov dword [ebp - 0x30], 2
mov dword [ebp - 0x1c], ecx
call ebx
inc esi
cmp esi, dword [ebp + 8]
jl 0x5033f1
mov ecx, dword [edi + 4]
push 0
push 1
push 0xb
push ecx
call ebx
mov edx, dword [edi + 4]
push 1
push 0
push edx
call dword [sym.imp.USER32.dll_InvalidateRect]
mov eax, dword [edi + 4]
push eax
call dword [sym.imp.USER32.dll_UpdateWindow]
pop ebx
pop edi
mov eax, 1
pop esi
mov esp, ebp
pop ebp
ret 4