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

Disassembly:
push 0xffffffffffffffff
push 0x460f06
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xf4
push ebx
push ebp
push esi
push edi
push 0x64
call fcn.0043fd6b
mov ebp, eax
mov ecx, 0x19
xor eax, eax
mov edi, ebp
rep stosd dword es:[edi], eax
mov ecx, 0x27
lea edi, [esp + 0x1c]
rep stosd dword es:[edi], eax
mov edi, 0x47fec0
or ecx, 0xffffffff
add esp, 4
mov dword [esp + 0x18], 0x9c
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x18]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.KERNEL32.dll_GetVersionExA]
call esi
mov ebx, eax
test ebx, ebx
jne 0x40ba08
lea ecx, [esp + 0x18]
mov dword [esp + 0x18], 0x94
push ecx
call esi
test eax, eax
jne 0x40ba08
push ebp
call fcn.0043fd94
add esp, 4
or eax, 0xffffffff
jmp 0x40be89
mov eax, dword [esp + 0x28]
sub eax, 0
je 0x40be46
dec eax
je 0x40bd4d
dec eax
jne 0x40be70
cmp dword [esp + 0x1c], 4
ja 0x40ba5e
mov edi, str.Microsoft_Windows_NT
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [0x4805f8], 1
cmp dword [esp + 0x1c], 5
jne 0x40bad9
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x40ba9e
mov edi, str.Microsoft_Windows_2000
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp dword [esp + 0x1c], 5
jne 0x40bad9
cmp dword [esp + 0x20], 1
jne 0x40bad9
mov edi, str.Microsoft_Windows_XP
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [0x4805f4], 1
test ebx, ebx
je 0x40bb37
mov al, byte [esp + 0xb2]
cmp al, 1
jne 0x40bb08
mov eax, dword [esp + 0xb0]
test ah, 2
je 0x40bafe
mov edi, str.Personal
jmp 0x40bc10
mov edi, str.Professional
jmp 0x40bc10
cmp al, 3
jne 0x40bc35
mov al, byte [esp + 0xb0]
test al, 0x80
je 0x40bb25
mov edi, str.DataCenter_Server
jmp 0x40bc10
test al, 2
jne 0x40bc0b
mov edi, str.Server
jmp 0x40bc10
lea eax, [esp + 0x10]
push eax
push 1
push 0
push str.SYSTEMCurrentControlSetControlProductOptions
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x14]
lea edx, [esp + 0xb4]
push ecx
push edx
push 0
push 0
push str.ProductType
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
lea edx, [esp + 0xb4]
push edx
push str.WINNT
call ebx
test eax, eax
jne 0x40bbbd
mov edi, str.Professional
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [esp + 0xb4]
push eax
push str.LANMANNT
call ebx
test eax, eax
jne 0x40bbf8
mov edi, str.Server
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [esp + 0xb4]
push eax
push str.SERVERNT
call ebx
test eax, eax
jne 0x40bc35
mov edi, str.Advanced_Server
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x1c]
cmp eax, 4
ja 0x40bccb
mov ecx, dword [0x47d0a4]
mov dword [esp + 0x14], ecx
mov edx, dword [esp + 0x24]
lea ecx, [esp + 0x2c]
and edx, 0xffff
mov dword [esp + 0x10c], 0
push edx
mov edx, dword [esp + 0x24]
push ecx
push edx
push eax
lea eax, [esp + 0x24]
push str._n_rversion__d._d__s___Build__d__
push eax
call fcn.00435348
mov edi, dword [esp + 0x2c]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x18
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x10c], 0xffffffff
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x14]
call fcn.0043f69a
mov dword [0x4805f0], 1
jmp 0x40be70
mov eax, dword [0x47d0a4]
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x24]
lea edx, [esp + 0x2c]
and ecx, 0xffff
lea eax, [esp + 0x10]
push ecx
push edx
push str._n_r_s___Build__d__
push eax
mov dword [esp + 0x11c], 1
call fcn.00435348
mov edi, dword [esp + 0x20]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x10c], 0xffffffff
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x10]
call fcn.0043f69a
mov dword [0x4805f0], 1
jmp 0x40be70
mov eax, dword [esp + 0x1c]
mov edx, 4
cmp eax, edx
jne 0x40be70
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x40bdd0
mov edi, str.Microsoft_Windows_95
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov al, byte [esp + 0x2d]
cmp al, 0x43
je 0x40bd9c
cmp al, 0x42
jne 0x40bdc6
mov edi, str.OSR2
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp dword [esp + 0x1c], edx
jne 0x40be70
cmp dword [esp + 0x20], 0xa
jne 0x40be38
mov edi, str.Microsoft_Windows_98
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp byte [esp + 0x2d], 0x41
jne 0x40be32
mov edi, 0x47cadc
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp dword [esp + 0x1c], edx
jne 0x40be70
cmp dword [esp + 0x20], 0x5a
jne 0x40be70
mov edi, str.Microsoft_Windows_Me
jmp 0x40be4b
mov edi, str.Microsoft_Win32s
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
mov edi, ebp
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push ebp
mov ecx, 0x4805ec
call fcn.0043f823
push ebp
call fcn.0043fd94
add esp, 4
mov eax, 1
mov ecx, dword [esp + 0x104]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x100
ret