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

Disassembly:
sub esp, 0x220
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetVersionExA]
push edi
mov ecx, 0x27
xor eax, eax
lea edi, [esp + 0x10]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x10]
mov byte [esp + 0xac], 0
push eax
mov dword [esp + 0x14], 0x9c
call esi
test eax, eax
jne 0x402662
lea ecx, [esp + 0x10]
mov dword [esp + 0x10], 0x94
push ecx
call esi
test eax, eax
jne 0x402662
pop edi
pop esi
add esp, 0x220
ret
mov edx, dword [esp + 0x14]
push ebx
mov ebx, dword [esp + 0x1c]
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea ecx, [ebx + eax*4]
mov eax, dword [esp + 0x24]
sub eax, 0
mov dword [0x41aa04], ecx
je 0x40298b
dec eax
je 0x4028be
dec eax
jne 0x4029bc
cmp edx, 4
push ebp
ja 0x4026cc
mov edi, str.Microsoft_Windows_NT
or ecx, 0xffffffff
xor eax, eax
lea ebp, [esp + 0xb4]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, ebp
mov ebp, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp edx, 5
jne 0x40272c
test ebx, ebx
jne 0x4026e3
lea edx, [esp + 0xb4]
mov edi, str.Microsoft_Windows_2000
jmp 0x402707
cmp ebx, 1
jne 0x4026f6
lea edx, [esp + 0xb4]
mov edi, str.Microsoft_Windows_XP
jmp 0x402707
cmp ebx, 2
jne 0x40272c
lea edx, [esp + 0xb4]
mov edi, str.Microsoft_Windows_Server_2003
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, edx
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]
lea eax, [esp + 0x10]
push eax
push 1
push 0
push str.SYSTEMCurrentControlSetControlProductOptions
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x14]
lea edx, [esp + 0x17c]
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 + 0x17c]
push edx
push str.WINNT
call ebx
test eax, eax
jne 0x4027b9
mov edi, str.Professional
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0xb4]
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [esp + 0x17c]
push eax
push str.LANMANNT
call ebx
test eax, eax
jne 0x4027fb
mov edi, str.Server
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0xb4]
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [esp + 0x17c]
push eax
push str.SERVERNT
call ebx
test eax, eax
pop ebp
jne 0x40283e
mov edi, str.Advanced_Server
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0xb0]
mov esi, edi
mov ebx, ecx
mov edi, edx
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 eax, dword [esp + 0x18]
cmp eax, 4
ja 0x402886
mov ecx, dword [esp + 0x20]
lea edx, [esp + 0x28]
and ecx, 0xffff
push ecx
mov ecx, dword [esp + 0x20]
push edx
push ecx
push eax
lea edx, [esp + 0x1d8]
push str.version__d._d__s__Build__d_
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x18
lea edi, [esp + 0x1c8]
lea edx, [esp + 0xb0]
jmp 0x402997
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0x28]
and eax, 0xffff
lea edx, [esp + 0x1c8]
push eax
push ecx
push str._s__Build__d_
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea edi, [esp + 0x1c8]
lea edx, [esp + 0xb0]
jmp 0x402997
mov ecx, dword [0x41aa04]
add ecx, 0x3e8
cmp edx, 4
mov dword [0x41aa04], ecx
jne 0x4029bc
test ebx, ebx
jne 0x40292c
mov edi, str.Microsoft_Windows_95
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0xb0]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
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 al, byte [esp + 0x29]
mov ecx, ebx
and ecx, 3
cmp al, 0x43
rep movsb byte es:[edi], byte [esi]
je 0x40291e
cmp al, 0x42
jne 0x4029bc
lea edx, [esp + 0xb0]
mov edi, str.OSR2
jmp 0x402997
cmp ebx, 0xa
jne 0x402978
mov edi, str.Microsoft_Windows_98
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0xb0]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
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 al, byte [esp + 0x29]
mov ecx, ebx
and ecx, 3
cmp al, 0x41
rep movsb byte es:[edi], byte [esi]
jne 0x4029bc
lea edx, [esp + 0xb0]
mov edi, 0x415478
jmp 0x402997
cmp ebx, 0x5a
jne 0x4029bc
lea edx, [esp + 0xb0]
mov edi, str.Microsoft_Windows_Me
jmp 0x402997
lea edx, [esp + 0xb0]
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 ebx, ecx
mov edi, edx
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]
push str._____Operating_system__:
call fcn.004029f0
lea eax, [esp + 0xb4]
push eax
call fcn.004029f0
push 0x41a4ec
call fcn.004029f0
add esp, 0xc
mov eax, 1
pop ebx
pop edi
pop esi
add esp, 0x220
ret