Function at 0x40a650
Capabilities:
Check os version
Query or enumerate registry value

Disassembly:
push 0xffffffffffffffff
push 0x5771cb
mov eax, dword fs:[0]
push eax
sub esp, 0x24c
mov eax, dword [0x60bd28]
xor eax, esp
mov dword [esp + 0x248], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x60bd28]
xor eax, esp
push eax
lea eax, [esp + 0x260]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x270]
xor edi, edi
push 0x9c
lea eax, [esp + 0x48]
push edi
push eax
mov dword [esp + 0x20], edi
mov byte [ebp], 0
call fcn.0053fd60
mov esi, dword [sym.imp.KERNEL32.dll_GetVersionExA]
add esp, 0xc
lea ecx, [esp + 0x44]
push ecx
mov dword [esp + 0x48], 0x9c
call esi
cmp eax, edi
jne 0x40a6e2
lea edx, [esp + 0x44]
push edx
mov dword [esp + 0x48], 0x94
call esi
test eax, eax
jne 0x40a6e2
xor eax, eax
jmp 0x40ac46
mov eax, dword [esp + 0x54]
sub eax, edi
je 0x40ac29
sub eax, 1
je 0x40ab47
sub eax, 1
jne 0x40ac42
mov esi, 6
xor ebx, ebx
cmp dword [esp + 0x48], esi
jne 0x40a7a8
cmp dword [esp + 0x4c], edi
jne 0x40a80e
cmp byte [esp + 0xde], 1
jne 0x40a99f
lea ecx, [esp + 0x18]
call fcn.00401310
push 0x104
push 0x105
lea ecx, [esp + 0x20]
mov dword [esp + 0x270], edi
call fcn.00402170
push eax
push str.ProductName
push str.SOFTWAREMicrosoftWindows_NTCurrentVersion
push reloc.OLEAUT32.dll_SysReAllocString
call fcn.00425d50
add esp, 0x14
push 0x596424
lea ecx, [esp + 0x1c]
lea ebx, [esi - 5]
call fcn.00409ec0
mov eax, dword [esp + 0x18]
mov edx, ebp
sub edx, eax
lea ecx, [ecx]
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x40a780
lea ecx, [esp + 0x18]
mov dword [esp + 0x14], 9
mov dword [esp + 0x268], 0xffffffff
call fcn.00401340
mov eax, dword [esp + 0x48]
cmp eax, 4
ja 0x40a7d0
mov ecx, dword [str.Windows_NT]
mov dword [ebp], ecx
mov edx, dword [0x596858]
mov dword [ebp + 4], edx
mov ecx, dword [0x59685c]
mov dword [ebp + 8], ecx
mov dword [esp + 0x14], esi
cmp eax, 5
jne 0x40a80e
mov eax, dword [esp + 0x4c]
cmp eax, edi
jne 0x40a9ba
mov edx, dword [str.Windows_2000]
mov dword [ebp], edx
mov eax, dword [0x596848]
mov dword [ebp + 4], eax
mov ecx, dword [0x59684c]
mov dword [ebp + 8], ecx
mov dx, word [0x596850]
mov word [ebp + 0xc], dx
mov dword [esp + 0x14], 7
lea edx, [esp + 0x18]
push edx
push 1
push 0
push str.SYSTEMCurrentControlSetControlProductOptions
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0xe4]
push ecx
push 0
push 0
push str.ProductType
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test ebx, ebx
jne 0x40a936
mov esi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
lea ecx, [esp + 0xe0]
push ecx
push str.WINNT
call esi
test eax, eax
jne 0x40a8af
mov eax, ebp
add eax, 0xffffffff
lea esp, [esp]
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x40a880
mov edx, dword [str.Professional]
mov dword [eax], edx
mov ecx, dword [0x5967f4]
mov dword [eax + 4], ecx
mov edx, dword [0x5967f8]
mov dword [eax + 8], edx
mov cx, word [0x5967fc]
mov word [eax + 0xc], cx
lea edx, [esp + 0xe0]
push edx
push str.LANMANNT
call esi
test eax, eax
jne 0x40a8e2
mov eax, ebp
add eax, 0xffffffff
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x40a8c7
mov ecx, dword [str.Server]
mov dword [eax], ecx
mov edx, dword [0x5967e0]
mov dword [eax + 4], edx
lea eax, [esp + 0xe0]
push eax
push str.SERVERNT
call esi
test eax, eax
jne 0x40a936
mov eax, ebp
add eax, 0xffffffff
lea ebx, [ebx]
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x40a900
mov ecx, dword [str.Advanced_Server]
mov dword [eax], ecx
mov edx, dword [0x5967c0]
mov dword [eax + 4], edx
mov ecx, dword [0x5967c4]
mov dword [eax + 8], ecx
mov edx, dword [0x5967c8]
mov dword [eax + 0xc], edx
mov cl, byte [0x5967cc]
mov byte [eax + 0x10], cl
movzx eax, word [esp + 0x50]
mov ecx, dword [esp + 0x4c]
lea edx, [esp + 0x58]
push edx
mov edx, dword [esp + 0x4c]
push eax
push ecx
push edx
lea eax, [esp + 0x140]
push str.__d._02d._04d__s_
push eax
call fcn.00540420
lea eax, [esp + 0x148]
add esp, 0x18
mov ecx, eax
lea esp, [esp]
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x40a970
sub eax, ecx
add ebp, 0xffffffff
mov esi, ecx
mov edi, ebp
mov cl, byte [edi + 1]
add edi, 1
test cl, cl
jne 0x40a982
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x40ac42
mov ecx, esi
mov esi, str.Windows_Server__Longhorn_
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
mov dword [esp + 0x14], 0xa
jmp 0x40a80e
cmp eax, 1
jne 0x40aa64
mov eax, dword [str.Windows_XP]
mov dword [ebp], eax
mov ecx, dword [0x596784]
mov dword [ebp + 4], ecx
mov edx, dword [0x596788]
mov eax, ebp
add eax, 0xffffffff
test dword [esp + 0xdc], 0x200
mov dword [esp + 0x14], 8
mov dword [ebp + 8], edx
je 0x40aa30
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x40a9f7
mov ecx, dword [str.Home_Edition]
mov dword [eax], ecx
mov edx, dword [0x596774]
mov dword [eax + 4], edx
mov ecx, dword [0x596778]
mov dword [eax + 8], ecx
mov dx, word [0x59677c]
mov word [eax + 0xc], dx
jmp 0x40a936
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x40aa30
mov ecx, dword [str.Professional]
mov dword [eax], ecx
mov edx, dword [0x5967f4]
mov dword [eax + 4], edx
mov ecx, dword [0x5967f8]
mov dword [eax + 8], ecx
mov dx, word [0x5967fc]
mov word [eax + 0xc], dx
jmp 0x40a936
cmp eax, 2
jne 0x40a80e
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
cmp eax, edi
je 0x40a6db
push str.GetNativeSystemInfo
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, edi
je 0x40a936
lea ecx, [esp + 0x20]
push ecx
call eax
push 0x59
call dword [sym.imp.USER32.dll_GetSystemMetrics]
test eax, eax
je 0x40aae0
mov edx, dword [str.Windows_Server_2003_R2]
mov dword [ebp], edx
mov eax, dword [0x596738]
mov dword [ebp + 4], eax
mov ecx, dword [0x59673c]
mov dword [ebp + 8], ecx
mov edx, dword [0x596740]
mov dword [ebp + 0xc], edx
mov eax, dword [0x596744]
mov dword [ebp + 0x10], eax
mov ecx, dword [0x596748]
mov dword [ebp + 0x14], ecx
jmp 0x40a936
mov ax, word [esp + 0x20]
cmp ax, si
je 0x40aaf0
cmp ax, 9
jne 0x40ab0e
cmp byte [esp + 0xde], 1
jne 0x40ab0e
mov ecx, 7
mov esi, str.Windows_XP_Professional_x64
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
jmp 0x40a936
mov edx, dword [str.Windows_Server_2003]
mov dword [ebp], edx
mov eax, dword [0x596700]
mov dword [ebp + 4], eax
mov ecx, dword [0x596704]
mov dword [ebp + 8], ecx
mov edx, dword [0x596708]
mov dword [ebp + 0xc], edx
mov eax, dword [0x59670c]
mov dword [ebp + 0x10], eax
mov cl, byte [0x596710]
mov byte [ebp + 0x14], cl
jmp 0x40a936
mov ecx, 4
cmp dword [esp + 0x48], ecx
jne 0x40ac42
mov eax, dword [esp + 0x4c]
cmp eax, edi
jne 0x40abb6
mov ecx, dword [str.Windows_95]
mov dword [ebp], ecx
mov edx, dword [0x5966f4]
mov dword [ebp + 4], edx
mov eax, dword [0x5966f8]
mov dword [ebp + 8], eax
mov al, byte [esp + 0x59]
cmp al, 0x43
mov dword [esp + 0x14], 2
je 0x40ab90
cmp al, 0x42
jne 0x40ac42
add ebp, 0xffffffff
mov al, byte [ebp + 1]
add ebp, 1
test al, al
jne 0x40ab93
mov ecx, dword [str.OSR2]
mov dword [ebp], ecx
mov dx, word [0x5966ec]
mov word [ebp + 4], dx
jmp 0x40ac42
cmp eax, 0xa
jne 0x40ac00
cmp byte [esp + 0x59], 0x41
mov eax, dword [str.Windows_98]
mov dword [ebp], eax
mov edx, dword [0x5966e0]
mov dword [ebp + 4], edx
mov eax, dword [0x5966e4]
mov dword [esp + 0x14], 3
mov dword [ebp + 8], eax
jne 0x40ac42
add ebp, 0xffffffff
mov edi, ebp
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x40abe8
mov edx, dword [0x5966d8]
mov dword [edi], edx
mov dword [esp + 0x14], ecx
jmp 0x40ac42
cmp eax, 0x5a
jne 0x40ac42
mov eax, dword [str.Windows_ME]
mov dword [ebp], eax
mov ecx, dword [0x5966d0]
mov dword [ebp + 4], ecx
mov edx, dword [0x5966d4]
mov dword [esp + 0x14], 5
mov dword [ebp + 8], edx
jmp 0x40ac42
mov eax, dword [str.Win32s]
mov dword [ebp], eax
mov ecx, dword [0x5966c8]
mov dword [esp + 0x14], 1
mov dword [ebp + 4], ecx
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x260]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x248]
xor ecx, esp
call fcn.0053fab2
add esp, 0x258
ret