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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4bb1dd
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x388
mov eax, dword [0x51eea4]
xor eax, dword [ebp + 4]
push ebx
xor ebx, ebx
mov dword [esp + 4], ebx
push esi
mov dword [esp + 0x388], eax
push edi
mov dword [esp + 0x28], 0xf
mov dword [esp + 0x24], ebx
mov byte [esp + 0x14], bl
mov esi, dword [sym.imp.kernel32.dll_GetVersionExA]
xor eax, eax
mov ecx, 0x27
lea edi, [esp + 0x30]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x30]
push eax
mov dword [esp + 0x3a0], ebx
mov dword [esp + 0x34], 0x9c
call esi
mov edi, eax
cmp edi, ebx
jne 0x405c3e
lea ecx, [esp + 0x30]
push ecx
mov dword [esp + 0x34], 0x94
call esi
test eax, eax
jne 0x405c3e
mov esi, dword [ebp + 8]
mov dword [esi + 0x18], 0xf
mov dword [esi + 0x14], ebx
mov byte [esi + 4], al
mov eax, str.Unknown
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405c23
sub eax, edx
push eax
push str.Unknown
mov ecx, esi
call fcn.00402cd0
jmp 0x40641e
mov eax, dword [esp + 0x40]
sub eax, ebx
je 0x4063de
dec eax
je 0x406352
dec eax
jne 0x4063fe
cmp dword [esp + 0x34], 6
jb 0x405c7f
mov eax, str.Microsoft_Vista_family.
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405c67
sub eax, edx
push eax
push str.Microsoft_Vista_family.
lea ecx, [esp + 0x18]
call fcn.00402620
mov eax, dword [esp + 0x34]
mov esi, 5
cmp eax, esi
jne 0x405cd6
cmp dword [esp + 0x38], 2
jne 0x405ca7
push str.Microsoft_Windows_Server_2003_family.
lea ecx, [esp + 0x14]
call fcn.00402ca0
cmp dword [esp + 0x34], esi
jne 0x405cd6
cmp dword [esp + 0x38], 1
jne 0x405cc2
push str.Microsoft_Windows_XP
lea ecx, [esp + 0x14]
call fcn.00402ca0
cmp dword [esp + 0x34], esi
jne 0x405cd6
cmp dword [esp + 0x38], ebx
jne 0x405cfd
push str.Microsoft_Windows_2000
lea ecx, [esp + 0x14]
call fcn.00402ca0
cmp dword [esp + 0x34], 4
ja 0x405cfd
mov eax, str.Microsoft_Windows_NT
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405ce5
sub eax, edx
push eax
push str.Microsoft_Windows_NT
lea ecx, [esp + 0x18]
call fcn.00402620
cmp edi, ebx
mov edi, dword [sym.imp.advapi32.dll_RegOpenKeyExA]
je 0x405e3a
mov al, byte [esp + 0xca]
cmp al, 1
jne 0x405d5a
cmp dword [esp + 0x34], 4
lea ecx, [esp + 0x10]
jne 0x405d30
push str.Workstation_4.0
call fcn.00402ca0
jmp 0x40606b
mov eax, dword [esp + 0xc8]
test ah, 2
je 0x405d4b
push str.Home_Edition
call fcn.00402ca0
jmp 0x40606b
push str.Professional
call fcn.00402ca0
jmp 0x40606b
cmp al, 3
jne 0x40606b
cmp dword [esp + 0x34], esi
jne 0x405e0e
mov eax, dword [esp + 0x38]
cmp eax, 2
jne 0x405dca
mov eax, dword [esp + 0xc8]
test al, al
lea ecx, [esp + 0x10]
jns 0x405d93
push str.Datacenter_Edition
call fcn.00402ca0
jmp 0x40606b
test al, 2
je 0x405da6
push str.Enterprise_Edition
call fcn.00402ca0
jmp 0x40606b
cmp ax, 0x400
jne 0x405dbb
push str.Web_Edition
call fcn.00402ca0
jmp 0x40606b
push str.Standard_Edition
call fcn.00402ca0
jmp 0x40606b
cmp eax, ebx
jne 0x405e0e
mov al, byte [esp + 0xc8]
test al, al
lea ecx, [esp + 0x10]
jns 0x405dec
push str.Datacenter_Server
call fcn.00402ca0
jmp 0x40606b
test al, 2
je 0x405dff
push str.Advanced_Server
call fcn.00402ca0
jmp 0x40606b
push str.Server
call fcn.00402ca0
jmp 0x40606b
test byte [esp + 0xc8], 2
lea ecx, [esp + 0x10]
je 0x405e2b
push str.Server_4.0__Enterprise_Edition
call fcn.00402ca0
jmp 0x40606b
push str.Server_4.0
call fcn.00402ca0
jmp 0x40606b
lea eax, [esp + 0xc]
push eax
push 1
push ebx
push str.SYSTEMCurrentControlSetControlProductOptions
mov esi, 0x50
push 0x80000002
mov dword [esp + 0x40], esi
call edi
test eax, eax
jne 0x406335
mov eax, dword [esp + 0xc]
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0x33c]
push edx
push ebx
push ebx
push str.ProductType
push eax
call dword [sym.imp.advapi32.dll_RegQueryValueExA]
cmp eax, ebx
jne 0x406335
cmp dword [esp + 0x2c], esi
ja 0x406335
mov ecx, dword [esp + 0xc]
push ecx
call dword [sym.imp.advapi32.dll_RegCloseKey]
push str.WINNT
lea ecx, [esp + 0x2e8]
call fcn.004033c0
lea edx, [esp + 0x338]
push edx
push eax
mov byte [esp + 0x3a4], 1
call fcn.00401dc0
add esp, 8
lea ecx, [esp + 0x2e4]
mov bl, al
mov byte [esp + 0x39c], 0
call fcn.00401b90
test bl, bl
je 0x405eed
push str.Workstation
lea ecx, [esp + 0x14]
call fcn.00402ca0
push str.LANMANNT
lea ecx, [esp + 0x304]
call fcn.004033c0
lea ecx, [esp + 0x338]
push ecx
push eax
mov byte [esp + 0x3a4], 2
call fcn.00401dc0
add esp, 8
lea ecx, [esp + 0x300]
mov bl, al
mov byte [esp + 0x39c], 0
call fcn.00401b90
test bl, bl
je 0x405f3f
push str.Server
lea ecx, [esp + 0x14]
call fcn.00402ca0
push str.SERVERNT
lea ecx, [esp + 0x2b0]
call fcn.004033c0
lea edx, [esp + 0x338]
push edx
push eax
mov byte [esp + 0x3a4], 3
call fcn.00401dc0
add esp, 8
lea ecx, [esp + 0x2ac]
mov bl, al
mov byte [esp + 0x39c], 0
call fcn.00401b90
test bl, bl
je 0x405f91
push str.Advanced_Server
lea ecx, [esp + 0x14]
call fcn.00402ca0
mov eax, dword [esp + 0x38]
push eax
lea ecx, [esp + 0x198]
push ecx
call fcn.00405900
mov esi, eax
mov edx, dword [esp + 0x3c]
push edx
lea eax, [esp + 0x328]
push eax
mov byte [esp + 0x3ac], 4
call fcn.00405900
push 0x4f16dc
push eax
lea ecx, [esp + 0x174]
push ecx
mov byte [esp + 0x3b8], 5
call fcn.00402f70
push esi
push eax
lea edx, [esp + 0x260]
push edx
mov byte [esp + 0x3c4], 6
call fcn.00403020
push 0x4f14b4
push eax
lea eax, [esp + 0x154]
push eax
mov byte [esp + 0x3d0], 7
call fcn.00402f70
add esp, 0x34
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x3a8], 8
call fcn.00402530
lea ecx, [esp + 0x124]
call fcn.00401b90
lea ecx, [esp + 0x23c]
call fcn.00401b90
lea ecx, [esp + 0x15c]
call fcn.00401b90
lea ecx, [esp + 0x31c]
call fcn.00401b90
lea ecx, [esp + 0x194]
mov byte [esp + 0x39c], 0
call fcn.00401b90
xor ebx, ebx
cmp dword [esp + 0x34], 4
jne 0x406254
lea ecx, [esp + 0x44]
push ecx
lea ecx, [esp + 0x278]
call fcn.004033c0
push str.Service_Pack_6
push eax
mov byte [esp + 0x3a4], 9
call fcn.00401dc0
add esp, 8
lea ecx, [esp + 0x274]
mov bl, al
mov byte [esp + 0x39c], 0
call fcn.00401b90
test bl, bl
je 0x406252
lea edx, [esp + 0xc]
push edx
push 1
push 0
push str.SOFTWAREMicrosoftWindows_NTCurrentVersionHotfixQ246009
push 0x80000002
call edi
test eax, eax
jne 0x406162
mov eax, dword [esp + 0x3c]
and eax, 0xffff
push eax
lea ecx, [esp + 0x208]
push ecx
call fcn.00405900
push eax
lea edx, [esp + 0xdc]
push str.Service_Pack_6a__Build
push edx
mov byte [esp + 0x3b0], 0xa
call fcn.00403a40
push 0x4f1674
push eax
lea eax, [esp + 0x1e8]
push eax
mov byte [esp + 0x3bc], 0xb
call fcn.00402f70
add esp, 0x20
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x3a8], 0xc
call fcn.00402530
lea ecx, [esp + 0x1cc]
call fcn.00401b90
lea ecx, [esp + 0xd0]
call fcn.00401b90
lea ecx, [esp + 0x204]
jmp 0x406233
mov ecx, dword [esp + 0x3c]
and ecx, 0xffff
push ecx
lea edx, [esp + 0x1b4]
push edx
call fcn.00405900
mov esi, eax
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x184]
push ecx
mov byte [esp + 0x3ac], 0xd
call fcn.00405930
push str.__Build
push eax
lea edx, [esp + 0x158]
push edx
mov byte [esp + 0x3b8], 0xe
call fcn.00402f70
push esi
push eax
lea eax, [esp + 0x12c]
push eax
mov byte [esp + 0x3c4], 0xf
call fcn.00403020
push 0x4f1664
push eax
lea ecx, [esp + 0x11c]
push ecx
mov byte [esp + 0x3d0], 0x10
call fcn.00402f70
add esp, 0x34
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x3a8], 0x11
call fcn.00402530
lea ecx, [esp + 0xec]
call fcn.00401b90
lea ecx, [esp + 0x108]
call fcn.00401b90
lea ecx, [esp + 0x140]
call fcn.00401b90
lea ecx, [esp + 0x178]
call fcn.00401b90
lea ecx, [esp + 0x1b0]
mov byte [esp + 0x39c], 0
call fcn.00401b90
mov edx, dword [esp + 0xc]
push edx
call dword [sym.imp.advapi32.dll_RegCloseKey]
xor ebx, ebx
jmp 0x4063fe
xor ebx, ebx
mov eax, dword [esp + 0x3c]
and eax, 0xffff
push eax
lea ecx, [esp + 0x2cc]
push ecx
call fcn.00405900
mov esi, eax
lea edx, [esp + 0x4c]
push edx
lea eax, [esp + 0x29c]
push eax
mov byte [esp + 0x3ac], 0x12
call fcn.00405930
push str.__Build
push eax
lea ecx, [esp + 0x270]
push ecx
mov byte [esp + 0x3b8], 0x13
call fcn.00402f70
push esi
push eax
lea edx, [esp + 0x244]
push edx
mov byte [esp + 0x3c4], 0x14
call fcn.00403020
push 0x4f1664
push eax
lea eax, [esp + 0x218]
push eax
mov byte [esp + 0x3d0], 0x15
call fcn.00402f70
add esp, 0x34
push 0xffffffffffffffff
push ebx
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x3a8], 0x16
call fcn.00402530
lea ecx, [esp + 0x1e8]
call fcn.00401b90
lea ecx, [esp + 0x220]
call fcn.00401b90
lea ecx, [esp + 0x258]
call fcn.00401b90
lea ecx, [esp + 0x290]
call fcn.00401b90
lea ecx, [esp + 0x2c8]
mov byte [esp + 0x39c], 0
call fcn.00401b90
jmp 0x4063fe
mov esi, dword [ebp + 8]
push str.Unknown
mov ecx, esi
call fcn.004033c0
lea ecx, [esp + 0x10]
call fcn.00401b90
jmp 0x406432
mov eax, dword [esp + 0x34]
mov esi, 4
cmp eax, esi
jne 0x4063fe
cmp dword [esp + 0x38], ebx
jne 0x406397
push str.Microsoft_Windows_95
lea ecx, [esp + 0x14]
call fcn.00402ca0
mov al, byte [esp + 0x45]
cmp al, 0x43
je 0x406383
cmp al, 0x42
jne 0x406391
push str.OSR2
lea ecx, [esp + 0x14]
call fcn.00402ca0
cmp dword [esp + 0x34], esi
jne 0x4063fe
cmp dword [esp + 0x38], 0xa
jne 0x4063c7
push str.Microsoft_Windows_98
lea ecx, [esp + 0x14]
call fcn.00402ca0
cmp byte [esp + 0x45], 0x41
jne 0x4063c1
push 0x4f1628
lea ecx, [esp + 0x14]
call fcn.00402ca0
cmp dword [esp + 0x34], esi
jne 0x4063fe
cmp dword [esp + 0x38], 0x5a
jne 0x4063fe
push str.Microsoft_Windows_Millennium_Edition
lea ecx, [esp + 0x14]
call fcn.00402ca0
jmp 0x4063fe
mov eax, str.Microsoft_Win32s
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4063e6
sub eax, edx
push eax
push str.Microsoft_Win32s
lea ecx, [esp + 0x18]
call fcn.00402620
mov esi, dword [ebp + 8]
push 0xffffffffffffffff
push ebx
lea ecx, [esp + 0x18]
push ecx
mov dword [esi + 0x18], 0xf
mov dword [esi + 0x14], ebx
mov ecx, esi
mov byte [esi + 4], 0
call fcn.00402aa0
cmp dword [esp + 0x28], 0x10
jb 0x406432
mov edx, dword [esp + 0x14]
push edx
call fcn.004ade5d
add esp, 4
mov ecx, dword [esp + 0x394]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x38c]
xor ecx, dword [ebp + 4]
mov eax, esi
call fcn.004ae650
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4