Function at 0x409950
Capabilities:
Check os version

Disassembly:
sub esp, 0x518
push ebx
push ebp
push esi
mov esi, dword [esp + 0x528]
push edi
mov ecx, 0x13
xor eax, eax
lea edi, [esp + 0xa8]
mov dword [esp + 0xa4], 0x50
rep stosd dword es:[edi], eax
mov eax, dword [esi + 4]
mov edi, dword [sym.imp.USER32.dll_SendMessageW]
mov dword [esp + 0xa8], 0x10
lea ecx, [esp + 0xa4]
mov edx, dword [eax + 0xc]
mov eax, dword [eax]
push ecx
push edx
push 0x41c
push eax
call edi
mov eax, dword [esp + 0xc4]
push 0
push 0
push 0x418
push eax
mov ebp, eax
call edi
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x30], ebx
jg 0x4099d4
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x518
ret 4
push 0
push 0
push 0x52e
push ebp
call edi
test eax, eax
setne cl
mov dword [esp + 0x2c], eax
mov byte [esi + 8], cl
call dword [sym.imp.USER32.dll_CreatePopupMenu]
xor edx, edx
mov dword [esp + 0x10], eax
mov dword [esp + 0x48], edx
lea eax, [esp + 0x44]
xor esi, esi
mov dword [esp + 0x4c], edx
push eax
push ebp
mov dword [esp + 0x4c], esi
mov dword [esp + 0x58], edx
call dword [sym.imp.USER32.dll_GetClientRect]
test ebx, ebx
mov dword [esp + 0x14], esi
jle 0x409cb9
xor ecx, ecx
lea edx, [esp + 0x18]
mov dword [esp + 0x1c], ecx
push edx
mov dword [esp + 0x24], ecx
push esi
mov dword [esp + 0x2c], ecx
push 0x417
push ebp
mov dword [esp + 0x28], 0
mov dword [esp + 0x38], ecx
call edi
test byte [esp + 0x20], 8
jne 0x409ca8
xor eax, eax
lea ecx, [esp + 0x34]
mov dword [esp + 0x38], eax
push ecx
push esi
mov dword [esp + 0x44], eax
push 0x41d
push ebp
mov dword [esp + 0x44], 0
mov dword [esp + 0x50], eax
call edi
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x4c]
mov bl, al
shr bl, 2
and bl, 1
cmp edx, ecx
jle 0x409ca8
test ah, 1
je 0x409ac6
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.USER32.dll_GetMenuItemCount]
test eax, eax
jle 0x409ca8
mov ecx, dword [esp + 0x10]
push 0
push 0
push 0x800
push ecx
call dword [sym.imp.USER32.dll_AppendMenuW]
jmp 0x409ca8
mov edx, dword [esp + 0x52c]
mov al, byte [edx + 8]
test al, al
je 0x409bb8
mov ecx, 0x63
xor eax, eax
lea edi, [esp + 0x39a]
mov word [esp + 0x398], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ecx, 0xc
xor eax, eax
lea edi, [esp + 0x74]
rep stosd dword es:[edi], eax
mov ecx, 0x44
lea edi, [esp + 0x288]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x284]
mov dword [esp + 0x74], 0x30
push eax
mov dword [esp + 0x288], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
je 0x409b4f
mov eax, dword [esp + 0x288]
cmp eax, 5
jae 0x409b57
cmp eax, 4
jne 0x409b4f
cmp dword [esp + 0x28c], 0x5a
jae 0x409b57
mov dword [esp + 0x74], 0x2c
mov eax, dword [esp + 0x2c]
lea edx, [esp + 0x74]
push edx
push 1
lea ecx, [esp + 0x3a0]
push esi
push eax
mov dword [esp + 0x88], 0x14
mov dword [esp + 0xa8], ecx
mov dword [esp + 0xac], 0xc8
call dword [sym.imp.USER32.dll_GetMenuItemInfoW]
mov ecx, dword [esp + 0x98]
mov edx, dword [esp + 0x88]
xor eax, eax
push ecx
mov ecx, dword [esp + 0x14]
push edx
test bl, bl
sete al
or al, 0x10
push eax
push ecx
call dword [sym.imp.USER32.dll_AppendMenuW]
jmp 0x409ca2
mov ecx, 0x63
xor eax, eax
lea edi, [esp + 0xf6]
mov word [esp + 0xf4], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ecx, 7
xor eax, eax
lea edi, [esp + 0x58]
lea edx, [esp + 0xf4]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x54]
push eax
push ecx
push 0x43f
push ebp
lea esi, [esp + 0x104]
mov dword [esp + 0x64], 0x20
mov dword [esp + 0x68], 2
mov dword [esp + 0x7c], edx
mov dword [esp + 0x80], 0xc8
call dword [sym.imp.USER32.dll_SendMessageW]
cmp eax, 0xffffffff
je 0x409c3b
lea edx, [esp + 0xf4]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
jne 0x409c85
mov eax, dword [0x41e640]
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0xf4]
push 0xc8
mov eax, dword [eax + 8]
push ecx
push edx
push eax
mov esi, 0x41e738
call dword [sym.imp.USER32.dll_LoadStringW]
xor ecx, ecx
test eax, eax
jle 0x409c85
lea edx, [esp + 0xf4]
cmp word [edx], 0xa
je 0x409c7e
inc ecx
add edx, 2
cmp ecx, eax
jl 0x409c6e
jmp 0x409c85
lea esi, [esp + ecx*2 + 0xf6]
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
xor ecx, ecx
push esi
test bl, bl
sete cl
push eax
push ecx
push edx
call dword [sym.imp.USER32.dll_AppendMenuW]
mov esi, dword [esp + 0x14]
mov edi, dword [sym.imp.USER32.dll_SendMessageW]
mov eax, dword [esp + 0x30]
inc esi
cmp esi, eax
mov dword [esp + 0x14], esi
jl 0x409a22
mov esi, dword [esp + 0x10]
push esi
call dword [sym.imp.USER32.dll_GetMenuItemCount]
test eax, eax
jne 0x409cea
test esi, esi
je 0x409cd3
push esi
call dword [sym.imp.USER32.dll_DestroyMenu]
push 0xffffffffffffffff
call dword [sym.imp.USER32.dll_MessageBeep]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x518
ret 4
mov eax, dword [esp + 0x52c]
pop edi
mov dword [eax], esi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x518
ret 4