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

Disassembly:
sub esp, 0xf8
mov eax, dword [0x432d44]
xor eax, esp
mov dword [esp + 0xf4], eax
push ebx
mov ebx, dword [esp + 0x100]
push ebp
push esi
push 0x9c
lea eax, [esp + 0x18]
push 0
push eax
mov byte [ebx], 0
call fcn.0040de00
mov esi, dword [sym.imp.KERNEL32.dll_GetVersionExA]
add esp, 0xc
lea ecx, [esp + 0x14]
push ecx
mov dword [esp + 0x18], 0x9c
call esi
mov ebp, eax
test ebp, ebp
jne 0x409f9b
lea edx, [esp + 0x14]
push edx
mov dword [esp + 0x18], 0x94
call esi
test eax, eax
jne 0x409f9b
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0xf4]
xor ecx, esp
call fcn.0040dd94
add esp, 0xf8
ret
mov eax, dword [esp + 0x24]
sub eax, 0
push edi
je 0x40a718
sub eax, 1
je 0x40a5fe
sub eax, 1
jne 0x40a754
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
cmp eax, 6
jne 0x40a00c
mov edi, ebx
dec edi
test edx, edx
jne 0x409ff0
nop
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409fd0
mov ecx, 8
mov esi, str.Microsoft_Windows_Vista_family_
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
jmp 0x40a116
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409ff0
mov ecx, 0xa
mov esi, str.Microsoft_Windows_Vista_family___Unknown_
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
jmp 0x40a116
cmp eax, 5
jne 0x40a0cf
cmp edx, 2
jne 0x40a03c
mov edi, ebx
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40a020
mov ecx, 9
mov esi, str.Microsoft_Windows_Server_2003_family_
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
jmp 0x40a116
cmp edx, 1
jne 0x40a084
mov eax, ebx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a044
mov ecx, dword [str.Microsoft_Windows_XP]
mov dword [eax], ecx
mov ecx, dword [0x42c25c]
mov dword [eax + 4], ecx
mov ecx, dword [0x42c260]
mov dword [eax + 8], ecx
mov ecx, dword [0x42c264]
mov dword [eax + 0xc], ecx
mov ecx, dword [0x42c268]
mov dword [eax + 0x10], ecx
mov cx, word [0x42c26c]
jmp 0x40a112
test edx, edx
jne 0x40a116
mov eax, ebx
dec eax
nop
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a090
mov ecx, dword [str.Microsoft_Windows_2000]
mov dword [eax], ecx
mov ecx, dword [0x42c244]
mov dword [eax + 4], ecx
mov ecx, dword [0x42c248]
mov dword [eax + 8], ecx
mov ecx, dword [0x42c24c]
mov dword [eax + 0xc], ecx
mov ecx, dword [0x42c250]
mov dword [eax + 0x10], ecx
mov ecx, dword [0x42c254]
mov dword [eax + 0x14], ecx
jmp 0x40a116
cmp eax, 4
ja 0x40a116
mov eax, ebx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a0d7
mov ecx, dword [str.Microsoft_Windows_NT]
mov dword [eax], ecx
mov ecx, dword [0x42c22c]
mov dword [eax + 4], ecx
mov ecx, dword [0x42c230]
mov dword [eax + 8], ecx
mov ecx, dword [0x42c234]
mov dword [eax + 0xc], ecx
mov ecx, dword [0x42c238]
mov dword [eax + 0x10], ecx
mov cx, word [0x42c23c]
mov word [eax + 0x14], cx
test ebp, ebp
mov ebp, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
je 0x40a407
mov al, byte [esp + 0xb2]
cmp al, 1
jne 0x40a1ea
mov eax, ebx
dec eax
cmp dword [esp + 0x1c], 4
jne 0x40a179
lea ecx, [ecx]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a140
mov edx, dword [str.Workstation_4.0]
mov dword [eax], edx
mov ecx, dword [0x42c218]
mov dword [eax + 4], ecx
mov edx, dword [0x42c21c]
mov dword [eax + 8], edx
mov ecx, dword [0x42c220]
mov dword [eax + 0xc], ecx
mov dl, byte [0x42c224]
mov byte [eax + 0x10], dl
jmp 0x40a55e
test dword [esp + 0xb0], 0x200
je 0x40a1b8
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a186
mov ecx, dword [str.Home_Edition]
mov dword [eax], ecx
mov edx, dword [0x42c208]
mov dword [eax + 4], edx
mov ecx, dword [0x42c20c]
mov dword [eax + 8], ecx
mov dx, word [0x42c210]
mov word [eax + 0xc], dx
jmp 0x40a553
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a1b8
mov ecx, dword [str.Professional]
mov dword [eax], ecx
mov edx, dword [0x42c1f8]
mov dword [eax + 4], edx
mov ecx, dword [0x42c1fc]
mov dword [eax + 8], ecx
mov dx, word [0x42c200]
mov word [eax + 0xc], dx
jmp 0x40a553
cmp al, 3
jne 0x40a553
cmp dword [esp + 0x1c], 5
jne 0x40a3ae
cmp edx, 2
jne 0x40a2f2
mov al, byte [esp + 0xb0]
test al, al
jns 0x40a279
mov eax, ebx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a214
mov ecx, dword [str.Datacenter_Edition]
mov dword [eax], ecx
mov edx, dword [0x42c1e4]
mov dword [eax + 4], edx
mov ecx, dword [0x42c1e8]
mov dword [eax + 8], ecx
mov edx, dword [0x42c1ec]
mov dword [eax + 0xc], edx
mov ecx, dword [0x42c1f0]
mov dword [eax + 0x10], ecx
mov eax, ebx
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a250
movzx ecx, word [esp + 0x24]
sub eax, edx
push ecx
lea edx, [esp + 0x30]
push edx
add eax, ebx
push str._s__Build__d_
push eax
call fcn.0040ea23
add esp, 0x10
jmp 0x40a754
test al, 2
mov eax, ebx
je 0x40a2b6
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a280
mov edx, dword [str.Enterprise_Edition]
mov dword [eax], edx
mov ecx, dword [0x42c1c0]
mov dword [eax + 4], ecx
mov edx, dword [0x42c1c4]
mov dword [eax + 8], edx
mov ecx, dword [0x42c1c8]
mov dword [eax + 0xc], ecx
mov edx, dword [0x42c1cc]
mov dword [eax + 0x10], edx
jmp 0x40a248
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a2b7
mov ecx, dword [str.Standard_Edition]
mov dword [eax], ecx
mov edx, dword [0x42c1ac]
mov dword [eax + 4], edx
mov ecx, dword [0x42c1b0]
mov dword [eax + 8], ecx
mov edx, dword [0x42c1b4]
mov dword [eax + 0xc], edx
mov cx, word [0x42c1b8]
mov word [eax + 0x10], cx
jmp 0x40a248
test edx, edx
jne 0x40a3ae
mov al, byte [esp + 0xb0]
test al, al
jns 0x40a34c
mov eax, ebx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a308
mov edx, dword [str.Datacenter_Server]
mov dword [eax], edx
mov ecx, dword [0x42c198]
mov dword [eax + 4], ecx
mov edx, dword [0x42c19c]
mov dword [eax + 8], edx
mov ecx, dword [0x42c1a0]
mov dword [eax + 0xc], ecx
mov dx, word [0x42c1a4]
mov word [eax + 0x10], dx
mov cl, byte [0x42c1a6]
mov byte [eax + 0x12], cl
jmp 0x40a248
test al, 2
mov eax, ebx
je 0x40a38c
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a353
mov edx, dword [str.Advanced_Server]
mov dword [eax], edx
mov ecx, dword [0x42c184]
mov dword [eax + 4], ecx
mov edx, dword [0x42c188]
mov dword [eax + 8], edx
mov ecx, dword [0x42c18c]
mov dword [eax + 0xc], ecx
mov dl, byte [0x42c190]
mov byte [eax + 0x10], dl
jmp 0x40a248
dec eax
lea ecx, [ecx]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a390
mov ecx, dword [str.Server]
mov dword [eax], ecx
mov edx, dword [0x42c17c]
mov dword [eax + 4], edx
jmp 0x40a248
test byte [esp + 0xb0], 2
je 0x40a3d9
mov edi, ebx
dec edi
jmp 0x40a3c0
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40a3c0
mov ecx, 8
mov esi, str.Server_4.0__Enterprise_Edition
rep movsd dword es:[edi], dword [esi]
jmp 0x40a553
mov eax, ebx
dec eax
lea esp, [esp]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a3e0
mov ecx, dword [str.Server_4.0]
mov dword [eax], ecx
mov edx, dword [0x42c150]
mov dword [eax + 4], edx
mov ecx, dword [0x42c154]
mov dword [eax + 8], ecx
jmp 0x40a553
lea edx, [esp + 0x10]
push edx
push 1
push 0
push str.SYSTEMCurrentControlSetControlProductOptions
mov esi, 0x50
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [esp + 0x28], esi
call ebp
test eax, eax
jne 0x40a5f7
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0xb8]
push ecx
push 0
push 0
push str.ProductType
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x40a5f7
cmp dword [esp + 0x14], esi
ja 0x40a5f7
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
lea ecx, [esp + 0xb4]
push ecx
push str.WINNT
call esi
test eax, eax
jne 0x40a4b2
mov eax, ebx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a487
mov edx, dword [str.Workstation]
mov dword [eax], edx
mov ecx, dword [0x42c0fc]
mov dword [eax + 4], ecx
mov edx, dword [0x42c100]
mov dword [eax + 8], edx
mov cl, byte [0x42c104]
mov byte [eax + 0xc], cl
lea edx, [esp + 0xb4]
push edx
push str.LANMANNT
call esi
test eax, eax
jne 0x40a4e1
mov eax, ebx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a4c8
mov ecx, dword [str.Server]
mov dword [eax], ecx
mov edx, dword [0x42c17c]
mov dword [eax + 4], edx
lea eax, [esp + 0xb4]
push eax
push str.SERVERNT
call esi
test eax, eax
jne 0x40a52b
mov eax, ebx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a4f7
mov ecx, dword [str.Advanced_Server]
mov dword [eax], ecx
mov edx, dword [0x42c184]
mov dword [eax + 4], edx
mov ecx, dword [0x42c188]
mov dword [eax + 8], ecx
mov edx, dword [0x42c18c]
mov dword [eax + 0xc], edx
mov cl, byte [0x42c190]
mov byte [eax + 0x10], cl
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a530
mov ecx, dword [esp + 0x1c]
sub eax, edx
mov edx, dword [esp + 0x20]
push edx
push ecx
add eax, ebx
push str._d._d
push eax
call fcn.0040ea23
add esp, 0x10
cmp dword [esp + 0x1c], 4
jne 0x40a248
push str.Service_Pack_6
lea edx, [esp + 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40a248
lea eax, [esp + 0x10]
push eax
push 1
push 0
push str.SOFTWAREMicrosoftWindows_NTCurrentVersionHotfixQ246009
push reloc.OLEAUT32.dll_SysReAllocString
call ebp
test eax, eax
mov eax, ebx
lea edx, [eax + 1]
jne 0x40a5c3
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a594
movzx ecx, word [esp + 0x24]
push ecx
sub eax, edx
add eax, ebx
push str.Service_Pack_6a__Build__d_
push eax
call fcn.0040ea23
mov edx, dword [esp + 0x1c]
add esp, 0xc
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40a754
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a5c3
sub eax, edx
movzx edx, word [esp + 0x24]
push edx
lea ecx, [esp + 0x30]
push ecx
add eax, ebx
push str._s__Build__d_
push eax
call fcn.0040ea23
mov edx, dword [esp + 0x20]
add esp, 0x10
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x40a754
xor eax, eax
jmp 0x40a759
cmp dword [esp + 0x1c], 4
jne 0x40a754
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x40a690
mov eax, ebx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a618
mov ecx, dword [str.Microsoft_Windows_95]
mov dword [eax], ecx
mov edx, dword [0x42c05c]
mov dword [eax + 4], edx
mov ecx, dword [0x42c060]
mov dword [eax + 8], ecx
mov edx, dword [0x42c064]
mov dword [eax + 0xc], edx
mov ecx, dword [0x42c068]
mov dword [eax + 0x10], ecx
mov dx, word [0x42c06c]
mov word [eax + 0x14], dx
mov al, byte [esp + 0x2d]
cmp al, 0x43
je 0x40a667
cmp al, 0x42
jne 0x40a754
dec ebx
mov eax, ebx
lea ebx, [ebx]
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a670
mov ecx, dword [str.OSR2]
mov dword [eax], ecx
mov dx, word [0x42c054]
mov word [eax + 4], dx
jmp 0x40a754
cmp eax, 0xa
jne 0x40a6f9
mov eax, ebx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a698
cmp byte [esp + 0x2d], 0x41
mov ecx, dword [str.Microsoft_Windows_98]
mov dword [eax], ecx
mov edx, dword [0x42c03c]
mov dword [eax + 4], edx
mov ecx, dword [0x42c040]
mov dword [eax + 8], ecx
mov edx, dword [0x42c044]
mov dword [eax + 0xc], edx
mov ecx, dword [0x42c048]
mov dword [eax + 0x10], ecx
mov dx, word [0x42c04c]
mov word [eax + 0x14], dx
jne 0x40a754
dec ebx
mov edi, ebx
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40a6e5
mov eax, dword [0x42c034]
mov dword [edi], eax
jmp 0x40a754
cmp eax, 0x5a
jne 0x40a754
dec ebx
mov edi, ebx
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40a701
mov ecx, 9
mov esi, str.Microsoft_Windows_Millennium_Edition
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
jmp 0x40a754
dec ebx
mov eax, ebx
jmp 0x40a720
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40a720
mov ecx, dword [str.Microsoft_Win32s]
mov dword [eax], ecx
mov edx, dword [0x42bffc]
mov dword [eax + 4], edx
mov ecx, dword [0x42c000]
mov dword [eax + 8], ecx
mov edx, dword [0x42c004]
mov dword [eax + 0xc], edx
mov cl, byte [0x42c008]
mov byte [eax + 0x10], cl
mov eax, 1
mov ecx, dword [esp + 0x104]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040dd94
add esp, 0xf8
ret