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

Disassembly:
sub esp, 0x244
push ebx
mov ebx, dword [esp + 0x24c]
push esi
push 0x9c
lea eax, [esp + 0x14]
push 0
push eax
mov byte [ebx], 0
call fcn.004b0a70
mov esi, dword [sym.imp.KERNEL32.dll_GetVersionExA]
add esp, 0xc
lea ecx, [esp + 0x10]
push ecx
mov dword [esp + 0x14], 0x9c
call esi
test eax, eax
jne 0x4185e6
lea edx, [esp + 0x10]
push edx
mov dword [esp + 0x14], 0x94
call esi
test eax, eax
je 0x4187d9
mov eax, dword [esp + 0x20]
sub eax, 0
je 0x418a4c
sub eax, 1
push edi
je 0x41896c
sub eax, 1
jne 0x4187d8
mov eax, dword [esp + 0x18]
cmp eax, 4
ja 0x418629
mov ecx, dword [str.Windows_NT]
mov dword [ebx], ecx
mov edx, dword [0x4dc5a8]
mov dword [ebx + 4], edx
mov ecx, dword [0x4dc5ac]
mov dword [ebx + 8], ecx
cmp eax, 5
jne 0x41865e
mov eax, dword [esp + 0x1c]
test eax, eax
jne 0x4187e2
mov edx, dword [str.Windows_2000]
mov dword [ebx], edx
mov eax, dword [0x4dc598]
mov dword [ebx + 4], eax
mov ecx, dword [0x4dc59c]
mov dword [ebx + 8], ecx
mov dx, word [0x4dc5a0]
mov word [ebx + 0xc], dx
lea edx, [esp + 0xc]
push edx
push 1
push 0
push str.SYSTEMCurrentControlSetControlProductOptions
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov edx, dword [esp + 0xc]
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0xd8]
push ecx
push 0
push 0
push str.ProductType
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov eax, dword [esp + 0xc]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
lea ecx, [esp + 0xd4]
push ecx
push str.WINNT
call esi
test eax, eax
jne 0x4186f0
mov eax, ebx
add eax, 0xffffffff
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x4186c1
mov edx, dword [str.Professional]
mov dword [eax], edx
mov ecx, dword [0x4dc544]
mov dword [eax + 4], ecx
mov edx, dword [0x4dc548]
mov dword [eax + 8], edx
mov cx, word [0x4dc54c]
mov word [eax + 0xc], cx
lea edx, [esp + 0xd4]
push edx
push str.LANMANNT
call esi
test eax, eax
jne 0x418723
mov eax, ebx
add eax, 0xffffffff
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x418708
mov ecx, dword [str.Server]
mov dword [eax], ecx
mov edx, dword [0x4dc530]
mov dword [eax + 4], edx
lea eax, [esp + 0xd4]
push eax
push str.SERVERNT
call esi
test eax, eax
jne 0x418776
mov eax, ebx
add eax, 0xffffffff
jmp 0x418740
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x418740
mov ecx, dword [str.Advanced_Server]
mov dword [eax], ecx
mov edx, dword [0x4dc510]
mov dword [eax + 4], edx
mov ecx, dword [0x4dc514]
mov dword [eax + 8], ecx
mov edx, dword [0x4dc518]
mov dword [eax + 0xc], edx
mov cl, byte [0x4dc51c]
mov byte [eax + 0x10], cl
movzx eax, word [esp + 0x20]
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x28]
push edx
mov edx, dword [esp + 0x1c]
push eax
push ecx
push edx
lea eax, [esp + 0x134]
push str.__d._02d._04d__s_
push eax
call fcn.004b09b2
lea eax, [esp + 0x13c]
add esp, 0x18
mov esi, eax
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x4187b0
sub eax, esi
add ebx, 0xffffffff
mov edi, ebx
mov cl, byte [edi + 1]
add edi, 1
test cl, cl
jne 0x4187c0
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
pop ebx
add esp, 0x244
ret
cmp eax, 1
jne 0x418884
mov eax, dword [str.Windows_XP]
mov dword [ebx], eax
mov ecx, dword [0x4dc4f0]
mov dword [ebx + 4], ecx
mov edx, dword [0x4dc4f4]
mov eax, ebx
add eax, 0xffffffff
test dword [esp + 0xac], 0x200
mov dword [ebx + 8], edx
je 0x418850
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x418816
mov ecx, dword [str.Home_Edition]
mov dword [eax], ecx
mov edx, dword [0x4dc4e0]
mov dword [eax + 4], edx
mov ecx, dword [0x4dc4e4]
mov dword [eax + 8], ecx
mov dx, word [0x4dc4e8]
mov word [eax + 0xc], dx
jmp 0x418776
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x418850
mov ecx, dword [str.Professional]
mov dword [eax], ecx
mov edx, dword [0x4dc544]
mov dword [eax + 4], edx
mov ecx, dword [0x4dc548]
mov dword [eax + 8], ecx
mov dx, word [0x4dc54c]
mov word [eax + 0xc], dx
jmp 0x418776
cmp eax, 2
jne 0x41865e
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
test eax, eax
je 0x4187d8
push str.GetNativeSystemInfo
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x418776
lea ecx, [esp + 0xb0]
push ecx
call eax
push 0x59
call dword [sym.imp.USER32.dll_GetSystemMetrics]
test eax, eax
je 0x418902
mov edx, dword [str.Windows_Server_2003_R2]
mov dword [ebx], edx
mov eax, dword [0x4dc4a4]
mov dword [ebx + 4], eax
mov ecx, dword [0x4dc4a8]
mov dword [ebx + 8], ecx
mov edx, dword [0x4dc4ac]
mov dword [ebx + 0xc], edx
mov eax, dword [0x4dc4b0]
mov dword [ebx + 0x10], eax
mov ecx, dword [0x4dc4b4]
mov dword [ebx + 0x14], ecx
jmp 0x418776
mov ax, word [esp + 0xb0]
cmp ax, 6
je 0x418916
cmp ax, 9
jne 0x418934
cmp byte [esp + 0xae], 1
jne 0x418934
mov ecx, 7
mov esi, str.Windows_XP_Professional_x64
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
jmp 0x418776
mov edx, dword [str.Windows_Server_2003]
mov dword [ebx], edx
mov eax, dword [0x4dc46c]
mov dword [ebx + 4], eax
mov ecx, dword [0x4dc470]
mov dword [ebx + 8], ecx
mov edx, dword [0x4dc474]
mov dword [ebx + 0xc], edx
mov eax, dword [0x4dc478]
mov dword [ebx + 0x10], eax
mov cl, byte [0x4dc47c]
mov byte [ebx + 0x14], cl
jmp 0x418776
cmp dword [esp + 0x18], 4
jne 0x4187d8
mov eax, dword [esp + 0x1c]
test eax, eax
jne 0x4189d7
mov ecx, dword [str.Windows_95]
mov dword [ebx], ecx
mov edx, dword [0x4dc460]
mov dword [ebx + 4], edx
mov eax, dword [0x4dc464]
mov dword [ebx + 8], eax
mov al, byte [esp + 0x29]
cmp al, 0x43
je 0x4189a8
cmp al, 0x42
jne 0x4187d8
add ebx, 0xffffffff
jmp 0x4189b0
mov al, byte [ebx + 1]
add ebx, 1
test al, al
jne 0x4189b0
mov ecx, dword [str.OSR2]
mov dword [ebx], ecx
mov dx, word [0x4dc458]
pop edi
pop esi
mov word [ebx + 4], dx
pop ebx
add esp, 0x244
ret
cmp eax, 0xa
jne 0x418a20
cmp byte [esp + 0x29], 0x41
mov eax, dword [str.Windows_98]
mov dword [ebx], eax
mov ecx, dword [0x4dc44c]
mov dword [ebx + 4], ecx
mov edx, dword [0x4dc450]
mov dword [ebx + 8], edx
jne 0x4187d8
add ebx, 0xffffffff
mov edi, ebx
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x418a05
mov eax, dword [0x4dc444]
mov dword [edi], eax
pop edi
pop esi
pop ebx
add esp, 0x244
ret
cmp eax, 0x5a
jne 0x4187d8
mov ecx, dword [str.Windows_ME]
mov dword [ebx], ecx
mov edx, dword [0x4dc43c]
mov dword [ebx + 4], edx
mov eax, dword [0x4dc440]
pop edi
pop esi
mov dword [ebx + 8], eax
pop ebx
add esp, 0x244
ret
mov ecx, dword [str.Win32s]
mov dword [ebx], ecx
mov edx, dword [0x4dc434]
pop esi
mov dword [ebx + 4], edx
pop ebx
add esp, 0x244
ret