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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x204
mov eax, dword [0x422330]
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.DLL_GetVersionExA]
push edi
mov dword [esp + 0x20c], eax
xor eax, eax
mov byte [esp + 0x108], 0
mov ecx, 0x3f
lea edi, [esp + 0x109]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov ecx, 0x27
lea edi, [esp + 0x18]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x18]
push eax
mov dword [esp + 0x1c], 0x9c
call esi
mov ebx, eax
test ebx, ebx
jne 0x4098d4
lea ecx, [esp + 0x18]
push ecx
mov dword [esp + 0x1c], 0x94
call esi
test eax, eax
je 0x409fab
mov eax, dword [esp + 0x28]
sub eax, 0
je 0x40a11e
dec eax
je 0x409fc0
dec eax
jne 0x40a154
mov ecx, dword [esp + 0x1c]
cmp ecx, 5
mov edx, dword [esp + 0x20]
jne 0x4099ae
cmp edx, 2
jne 0x40992d
mov edi, dword [ebp + 8]
dec edi
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409910
mov ecx, 0xb
mov esi, str.Microsoft_Windows_Servernbsp_2003_family_
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x1c]
jmp 0x4099f0
cmp edx, 1
jne 0x40996d
mov edi, dword [ebp + 8]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409936
mov eax, dword [str.Microsoft_Windows_XP]
mov dword [edi], eax
mov eax, dword [0x41cef0]
mov dword [edi + 4], eax
mov eax, dword [0x41cef4]
mov dword [edi + 8], eax
mov eax, dword [0x41cef8]
mov dword [edi + 0xc], eax
mov eax, dword [0x41cefc]
mov dword [edi + 0x10], eax
mov ax, word [0x41cf00]
jmp 0x4099ec
test edx, edx
jne 0x4099f0
mov edi, dword [ebp + 8]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409975
mov eax, dword [str.Microsoft_Windows_2000]
mov dword [edi], eax
mov eax, dword [0x41ced8]
mov dword [edi + 4], eax
mov eax, dword [0x41cedc]
mov dword [edi + 8], eax
mov eax, dword [0x41cee0]
mov dword [edi + 0xc], eax
mov eax, dword [0x41cee4]
mov dword [edi + 0x10], eax
mov eax, dword [0x41cee8]
mov dword [edi + 0x14], eax
jmp 0x4099f0
cmp ecx, 4
ja 0x4099f0
mov edi, dword [ebp + 8]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4099b7
mov eax, dword [str.Microsoft_Windows_NT]
mov dword [edi], eax
mov eax, dword [0x41cec0]
mov dword [edi + 4], eax
mov eax, dword [0x41cec4]
mov dword [edi + 8], eax
mov eax, dword [0x41cec8]
mov dword [edi + 0xc], eax
mov eax, dword [0x41cecc]
mov dword [edi + 0x10], eax
mov ax, word [0x41ced0]
mov word [edi + 0x14], ax
test ebx, ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
je 0x409d46
mov al, byte [esp + 0xb2]
cmp al, 1
jne 0x409ac0
mov edi, dword [ebp + 8]
dec edi
cmp ecx, 4
jne 0x409a4e
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409a16
mov ecx, dword [str.Workstation_4.0]
mov dword [edi], ecx
mov edx, dword [0x41ceac]
mov dword [edi + 4], edx
mov eax, dword [0x41ceb0]
mov dword [edi + 8], eax
mov ecx, dword [0x41ceb4]
mov dword [edi + 0xc], ecx
mov dl, byte [0x41ceb8]
mov byte [edi + 0x10], dl
jmp 0x409ec5
mov eax, dword [esp + 0xb0]
test ah, 2
je 0x409a90
lea ebx, [ebx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409a60
mov eax, dword [str.Home_Edition]
mov dword [edi], eax
mov edx, dword [0x41ce9c]
mov dword [edi + 4], edx
mov eax, dword [0x41cea0]
mov dword [edi + 8], eax
mov dx, word [0x41cea4]
mov word [edi + 0xc], dx
jmp 0x409ebc
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409a90
mov eax, dword [str.Professional]
mov dword [edi], eax
mov edx, dword [0x41ce8c]
mov dword [edi + 4], edx
mov eax, dword [0x41ce90]
mov dword [edi + 8], eax
mov dx, word [0x41ce94]
mov word [edi + 0xc], dx
jmp 0x409ebc
cmp al, 3
jne 0x409ebc
cmp ecx, 5
jne 0x409ced
cmp edx, 2
jne 0x409c39
mov edi, dword [ebp + 8]
mov eax, dword [esp + 0xb0]
dec edi
test al, al
jns 0x409b90
lea ecx, [ecx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409af0
mov eax, dword [str.Datacenter_Edition]
mov dword [edi], eax
mov ecx, dword [0x41ce78]
mov dword [edi + 4], ecx
mov edx, dword [0x41ce7c]
mov dword [edi + 8], edx
mov eax, dword [0x41ce80]
mov dword [edi + 0xc], eax
mov ecx, dword [0x41ce84]
mov dword [edi + 0x10], ecx
mov eax, dword [esp + 0x24]
and eax, 0xffff
push eax
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x110]
push str._s__Build__d_
push edx
call fcn.00411af5
lea eax, [esp + 0x118]
add esp, 0x10
mov edx, eax
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409b50
mov edi, dword [ebp + 8]
sub eax, edx
dec edi
lea ecx, [ecx]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x409b60
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, 1
mov ecx, dword [esp + 0x20c]
call fcn.004118eb
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test al, 2
je 0x409bcb
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409b94
mov edx, dword [str.Enterprise_Edition]
mov dword [edi], edx
mov eax, dword [0x41ce54]
mov dword [edi + 4], eax
mov ecx, dword [0x41ce58]
mov dword [edi + 8], ecx
mov edx, dword [0x41ce5c]
mov dword [edi + 0xc], edx
mov eax, dword [0x41ce60]
mov dword [edi + 0x10], eax
jmp 0x409b22
cmp ax, 0x400
jne 0x409c00
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409bd1
mov ecx, dword [str.Web_Edition]
mov dword [edi], ecx
mov edx, dword [0x41ce44]
mov dword [edi + 4], edx
mov eax, dword [0x41ce48]
mov dword [edi + 8], eax
mov cl, byte [0x41ce4c]
mov byte [edi + 0xc], cl
jmp 0x409b22
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409c00
mov edx, dword [str.Standard_Edition]
mov dword [edi], edx
mov eax, dword [0x41ce30]
mov dword [edi + 4], eax
mov ecx, dword [0x41ce34]
mov dword [edi + 8], ecx
mov edx, dword [0x41ce38]
mov dword [edi + 0xc], edx
mov ax, word [0x41ce3c]
mov word [edi + 0x10], ax
jmp 0x409b22
test edx, edx
jne 0x409ced
mov edi, dword [ebp + 8]
mov al, byte [esp + 0xb0]
dec edi
test al, al
jns 0x409c92
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409c50
mov ecx, dword [str.Datacenter_Server]
mov dword [edi], ecx
mov edx, dword [0x41ce1c]
mov dword [edi + 4], edx
mov eax, dword [0x41ce20]
mov dword [edi + 8], eax
mov ecx, dword [0x41ce24]
mov dword [edi + 0xc], ecx
mov dx, word [0x41ce28]
mov word [edi + 0x10], dx
mov al, byte [0x41ce2a]
mov byte [edi + 0x12], al
jmp 0x409b22
test al, 2
je 0x409cd0
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409c96
mov ecx, dword [str.Advanced_Server]
mov dword [edi], ecx
mov edx, dword [0x41ce08]
mov dword [edi + 4], edx
mov eax, dword [0x41ce0c]
mov dword [edi + 8], eax
mov ecx, dword [0x41ce10]
mov dword [edi + 0xc], ecx
mov dl, byte [0x41ce14]
mov byte [edi + 0x10], dl
jmp 0x409b22
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409cd0
mov eax, dword [str.Server]
mov dword [edi], eax
mov ecx, dword [0x41ce00]
mov dword [edi + 4], ecx
jmp 0x409b22
mov edi, dword [ebp + 8]
mov al, byte [esp + 0xb0]
dec edi
test al, 2
je 0x409d20
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409d00
mov ecx, 8
mov esi, str.Server_4.0__Enterprise_Edition
rep movsd dword es:[edi], dword [esi]
jmp 0x409eb8
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409d20
mov edx, dword [str.Server_4.0]
mov dword [edi], edx
mov eax, dword [0x41cdd4]
mov dword [edi + 4], eax
mov edx, dword [0x41cdd8]
mov dword [edi + 8], edx
jmp 0x409ebc
lea eax, [esp + 0x10]
push eax
push 1
push 0
push str.SYSTEMCurrentControlSetControlProductOptions
mov esi, 0x50
push reloc.WSOCK32.dll_bind
mov dword [esp + 0x28], esi
call ebx
test eax, eax
jne 0x409fab
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0xbc]
push edx
push eax
push eax
mov eax, dword [esp + 0x20]
push str.ProductType
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x409fab
cmp dword [esp + 0x14], esi
ja 0x409fab
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [sym.imp.KERNEL32.DLL_lstrcmpiA]
lea edx, [esp + 0xb8]
push edx
push str.WINNT
call esi
test eax, eax
jne 0x409dee
mov edi, dword [ebp + 8]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409dc5
mov eax, dword [str.Workstation]
mov dword [edi], eax
mov ecx, dword [0x41cd80]
mov dword [edi + 4], ecx
mov edx, dword [0x41cd84]
mov dword [edi + 8], edx
mov al, byte [0x41cd88]
mov byte [edi + 0xc], al
lea ecx, [esp + 0xb8]
push ecx
push str.LANMANNT
call esi
test eax, eax
jne 0x409e1d
mov edi, dword [ebp + 8]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409e05
mov edx, dword [str.Server]
mov dword [edi], edx
mov eax, dword [0x41ce00]
mov dword [edi + 4], eax
lea ecx, [esp + 0xb8]
push ecx
push str.SERVERNT
call esi
test eax, eax
jne 0x409e66
mov edi, dword [ebp + 8]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409e34
mov edx, dword [str.Advanced_Server]
mov dword [edi], edx
mov eax, dword [0x41ce08]
mov dword [edi + 4], eax
mov ecx, dword [0x41ce0c]
mov dword [edi + 8], ecx
mov edx, dword [0x41ce10]
mov dword [edi + 0xc], edx
mov al, byte [0x41ce14]
mov byte [edi + 0x10], al
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
push ecx
push edx
lea eax, [esp + 0x110]
push str._d._d
push eax
call fcn.00411af5
lea eax, [esp + 0x118]
add esp, 0x10
mov edx, eax
mov edi, edi
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409e90
mov edi, dword [ebp + 8]
sub eax, edx
dec edi
lea ecx, [ecx]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x409ea0
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x1c]
cmp ecx, 4
jne 0x409b22
push str.Service_Pack_6
lea ecx, [esp + 0x30]
push ecx
call dword [sym.imp.KERNEL32.DLL_lstrcmpiA]
test eax, eax
jne 0x409b22
lea edx, [esp + 0x10]
push edx
push 1
push eax
push str.SOFTWAREMicrosoftWindows_NTCurrentVersionHotfixQ246009
push reloc.WSOCK32.dll_bind
call ebx
test eax, eax
lea ecx, [esp + 0x108]
jne 0x409f3a
mov eax, dword [esp + 0x24]
and eax, 0xffff
push eax
push str.Service_Pack_6a__Build__d_
push ecx
call fcn.00411af5
lea eax, [esp + 0x114]
add esp, 0xc
mov edx, eax
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409f20
mov edi, dword [ebp + 8]
sub eax, edx
dec edi
lea ecx, [ecx]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x409f30
jmp 0x409f78
mov edx, dword [esp + 0x24]
and edx, 0xffff
push edx
lea eax, [esp + 0x30]
push eax
push str._s__Build__d_
push ecx
call fcn.00411af5
lea eax, [esp + 0x118]
add esp, 0x10
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409f61
mov edi, dword [ebp + 8]
sub eax, edx
dec edi
mov edi, edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x409f70
mov ecx, eax
shr ecx, 2
mov esi, edx
mov edx, dword [esp + 0x10]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
push edx
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, 1
mov ecx, dword [esp + 0x20c]
call fcn.004118eb
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
mov ecx, dword [esp + 0x20c]
call fcn.004118eb
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esp + 0x1c], 4
jne 0x40a154
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x40a062
mov ecx, dword [ebp + 8]
mov edi, ecx
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x409fe0
mov eax, dword [str.Microsoft_Windows_95]
mov dword [edi], eax
mov edx, dword [0x41cce0]
mov dword [edi + 4], edx
mov eax, dword [0x41cce4]
mov dword [edi + 8], eax
mov edx, dword [0x41cce8]
mov dword [edi + 0xc], edx
mov eax, dword [0x41ccec]
mov dword [edi + 0x10], eax
mov al, byte [esp + 0x2d]
cmp al, 0x43
mov dx, word [0x41ccf0]
mov word [edi + 0x14], dx
je 0x40a02c
cmp al, 0x42
jne 0x40a154
dec ecx
mov edi, ecx
nop
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40a030
mov eax, dword [str.OSR2]
mov dword [edi], eax
mov cx, word [0x41ccd8]
mov word [edi + 4], cx
mov eax, 1
mov ecx, dword [esp + 0x20c]
call fcn.004118eb
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 0xa
jne 0x40a0e8
mov ecx, dword [ebp + 8]
mov edi, ecx
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40a071
mov edx, dword [str.Microsoft_Windows_98]
mov dword [edi], edx
mov eax, dword [0x41ccc0]
mov dword [edi + 4], eax
mov edx, dword [0x41ccc4]
mov dword [edi + 8], edx
mov eax, dword [0x41ccc8]
mov dword [edi + 0xc], eax
mov edx, dword [0x41cccc]
mov dword [edi + 0x10], edx
mov ax, word [0x41ccd0]
mov word [edi + 0x14], ax
cmp byte [esp + 0x2d], 0x41
jne 0x40a154
dec ecx
mov edi, ecx
jmp 0x40a0c0
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40a0c0
mov ecx, dword [0x41ccb8]
mov dword [edi], ecx
mov eax, 1
mov ecx, dword [esp + 0x20c]
call fcn.004118eb
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 0x5a
jne 0x40a154
mov edi, dword [ebp + 8]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40a0f1
mov ecx, 9
mov esi, str.Microsoft_Windows_Millennium_Edition
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
mov eax, 1
mov ecx, dword [esp + 0x20c]
call fcn.004118eb
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 8]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40a122
mov edx, dword [str.Microsoft_Win32s]
mov dword [edi], edx
mov eax, dword [0x41cc80]
mov dword [edi + 4], eax
mov ecx, dword [0x41cc84]
mov dword [edi + 8], ecx
mov edx, dword [0x41cc88]
mov dword [edi + 0xc], edx
mov al, byte [0x41cc8c]
mov byte [edi + 0x10], al
mov ecx, dword [esp + 0x20c]
mov eax, 1
call fcn.004118eb
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret