Function at 0x10016508
Capabilities:
Check os version
Get system information on windows
Query or enumerate registry value

Disassembly:
push ebp
lea ebp, [esp - 0x45c]
sub esp, 0x4dc
mov eax, dword [0x10206870]
xor eax, ebp
mov dword [ebp + 0x458], eax
push ebx
push esi
push edi
lea eax, [ebp - 0x80]
push eax
mov edi, ecx
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov esi, 0x9c
push esi
lea eax, [ebp - 0x44]
push 0
push eax
call fcn.1003f7d0
add esp, 0xc
lea eax, [ebp - 0x44]
mov dword [ebp - 0x44], esi
mov esi, dword [sym.imp.KERNEL32.dll_GetVersionExA]
push eax
call esi
test eax, eax
jne 0x1001657d
mov ebx, 0x94
push ebx
push eax
lea eax, [ebp - 0x44]
push eax
call fcn.1003f7d0
add esp, 0xc
lea eax, [ebp - 0x44]
push eax
mov dword [ebp - 0x44], ebx
call esi
test eax, eax
je 0x10016b09
call fcn.1013c470
mov eax, dword [eax + 0x20]
lea ecx, [ebp - 0x50]
push ecx
lea ecx, [ebp - 0x54]
push ecx
lea ecx, [ebp - 0x58]
push ecx
mov ecx, eax
call fcn.100193e3
test eax, eax
je 0x100165b5
mov eax, dword [ebp - 0x58]
cmp eax, dword [ebp - 0x40]
jbe 0x100165b5
mov ecx, dword [ebp - 0x50]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], ecx
jmp 0x100165b8
mov eax, dword [ebp - 0x3c]
movzx esi, word [ebp + 0x50]
mov ecx, dword [ebp - 0x34]
mov edx, dword [ebp - 0x40]
mov dword [edi + 0x18], esi
movzx esi, word [ebp + 0x52]
mov dword [edi + 0xc], ecx
sub ecx, 0
mov dword [edi + 0x10], edx
mov dword [edi + 0x14], eax
mov dword [edi + 0x1c], esi
je 0x10016af1
dec ecx
je 0x10016a7b
dec ecx
jne 0x10016b06
push eax
push edx
mov ebx, str.Microsoft_Windows_NT_d._d
push ebx
mov esi, 0x400
push esi
push dword [edi + 0x20]
call fcn.1013b440
mov ecx, dword [ebp - 0x40]
add esp, 0x14
cmp ecx, 4
ja 0x10016623
push str.Microsoft_Windows_NT
push esi
push dword [edi + 0x20]
call fcn.1003dc98
add esp, 0xc
jmp 0x100167c5
cmp ecx, 5
jne 0x100166c3
mov eax, dword [ebp - 0x3c]
test eax, eax
jne 0x1001663a
push str.Microsoft_Windows_2000
jmp 0x10016612
cmp eax, 1
jne 0x1001668b
push str.Microsoft_Windows_XP
push esi
push dword [edi + 0x20]
call fcn.1003dc98
mov ebx, dword [sym.imp.USER32.dll_GetSystemMetrics]
add esp, 0xc
push 0x57
call ebx
test eax, eax
je 0x1001666f
push str.Media_Center_Edition
push esi
push dword [edi + 0x20]
call fcn.1013b3b0
add esp, 0xc
push 0x56
call ebx
test eax, eax
je 0x100167c5
push str.Tablet_PC_Edition
push esi
push dword [edi + 0x20]
call fcn.1013b3b0
jmp 0x1001661b
cmp eax, 2
jne 0x100166bb
cmp byte [ebp + 0x56], 1
jne 0x100166b1
cmp word [ebp - 0x80], 6
jne 0x100166a7
push str.Microsoft_Windows_XP_IA64
jmp 0x10016612
push str.Microsoft_Windows_XP_x64
jmp 0x10016612
push str.Microsoft_Windows_Server_2003
jmp 0x10016612
push eax
push 5
jmp 0x100167b8
push 6
pop eax
cmp ecx, eax
jne 0x10016757
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
jne 0x100166ee
cmp byte [ebp + 0x56], 1
jne 0x100166e7
push ecx
push eax
push str.Microsoft_Windows_Vista___d._d_
jmp 0x1001678f
push str.Microsoft_Windows_Server_2008
jmp 0x10016738
cmp ecx, 1
jne 0x1001670b
cmp byte [ebp + 0x56], cl
jne 0x10016704
push ecx
push eax
push str.Microsoft_Windows_7___d._d_
jmp 0x1001678f
push str.Microsoft_Windows_Server_2008_R2
jmp 0x10016738
cmp ecx, 2
jne 0x1001671f
cmp byte [ebp + 0x56], 1
jne 0x10016733
push ecx
push eax
push str.Microsoft_Windows_8___d._d_
jmp 0x1001678f
cmp ecx, 3
jne 0x10016743
cmp byte [ebp + 0x56], 1
jne 0x10016733
push ecx
push eax
push str.Microsoft_Windows_8.1___d._d_
jmp 0x1001678f
push str.Microsoft_Windows_Server_2012_R2
push esi
push dword [edi + 0x20]
call fcn.1003dc98
jmp 0x10016780
cmp ecx, 4
jne 0x1001679b
cmp byte [ebp + 0x56], 1
push ecx
push eax
jne 0x1001678a
push str.Microsoft_Windows_10___d._d_
jmp 0x1001678f
cmp ecx, 0xa
jne 0x100167b4
cmp byte [ebp + 0x56], 1
jne 0x10016785
cmp dword [ebp - 0x38], 0x55ec
jb 0x10016772
push str.Microsoft_Windows_11
jmp 0x10016777
push str.Microsoft_Windows_10
push esi
push dword [edi + 0x20]
call fcn.1013b440
add esp, 0xc
jmp 0x1001679b
push dword [ebp - 0x3c]
push 0xa
push str.Microsoft_Windows_Server___d._d_
push esi
push dword [edi + 0x20]
call fcn.1013b440
add esp, 0x14
movzx eax, word [ebp + 0x52]
push eax
movzx eax, word [ebp + 0x50]
push eax
push dword [ebp - 0x3c]
mov ecx, edi
push dword [ebp - 0x40]
call fcn.100160bb
jmp 0x100167c5
push dword [ebp - 0x3c]
push ecx
push ebx
push esi
push dword [edi + 0x20]
call fcn.1013b440
add esp, 0x14
cmp byte [ebp + 0x56], 1
mov ebx, 0x200
jne 0x10016803
cmp dword [ebp - 0x40], 4
jne 0x100167e0
push str.Workstation_4.0
jmp 0x100168a1
cmp dword [ebp - 0x40], 5
jne 0x100168ad
test dword [ebp + 0x54], ebx
je 0x100167f9
push str.Home_Edition
jmp 0x100168a1
push str.Professional
jmp 0x100168a1
cmp byte [ebp + 0x56], 3
je 0x10016813
cmp byte [ebp + 0x56], 2
jne 0x100168ad
cmp dword [ebp - 0x40], 5
jne 0x10016885
cmp dword [ebp - 0x3c], 2
jne 0x1001685a
mov eax, dword [ebp + 0x54]
test al, al
jns 0x1001682d
push str.Datacenter_Edition
jmp 0x100168a1
test al, 2
je 0x10016838
push str.Enterprise_Edition
jmp 0x100168a1
mov ecx, esi
cmp ax, cx
jne 0x10016846
push str.Web_Edition
jmp 0x100168a1
cmp ax, 1
jne 0x10016853
push str.Small_Business_Edition
jmp 0x100168a1
push str.Standard_Edition
jmp 0x100168a1
cmp dword [ebp - 0x3c], 0
jne 0x10016955
test byte [ebp + 0x54], 0x80
je 0x10016871
push str.Datacenter_Server
jmp 0x100168a1
test byte [ebp + 0x54], 2
je 0x1001687e
push str.Advanced_Server
jmp 0x100168a1
push str.Server
jmp 0x100168a1
cmp dword [ebp - 0x40], 4
ja 0x10016955
test byte [ebp + 0x54], 2
je 0x1001689c
push str.Server_4.0__Enterprise_Edition
jmp 0x100168a1
push str.Server_4.0
push esi
push dword [edi + 0x20]
call fcn.1013b3b0
add esp, 0xc
cmp dword [ebp - 0x40], 4
jne 0x10016955
push str.Service_Pack_6
lea eax, [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x10016955
lea eax, [ebp - 0x48]
push eax
push 1
push 0
push str.SOFTWAREMicrosoftWindows_NTCurrentVersionHotfixQ246009
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
movzx eax, word [ebp - 0x38]
push eax
jne 0x1001691a
push str.Service_Pack_6a__Build__d_
lea eax, [ebp + 0x258]
push 0x100
push eax
call fcn.1013b440
lea eax, [ebp + 0x258]
push eax
push ebx
push dword [edi + 0x24]
call fcn.1013b440
add esp, 0x1c
jmp 0x10016947
lea eax, [ebp - 0x30]
push eax
push str._s__Build__d_
lea eax, [ebp + 0x258]
push 0x100
push eax
call fcn.1013b440
lea eax, [ebp + 0x258]
push eax
push ebx
push dword [edi + 0x24]
call fcn.1013b440
add esp, 0x20
push dword [ebp - 0x48]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x10016b06
cmp byte [ebp - 0x30], 0
movzx eax, word [ebp - 0x38]
push eax
je 0x10016992
lea eax, [ebp - 0x30]
push eax
push str._s__Build__d_
lea eax, [ebp + 0x258]
push 0x100
push eax
call fcn.1013b440
lea eax, [ebp + 0x258]
push eax
push ebx
push dword [edi + 0x24]
call fcn.1013b440
add esp, 0x20
jmp 0x10016b06
push str.Build__d
mov ebx, 0x100
lea eax, [ebp + 0x258]
push ebx
push eax
call fcn.1013b440
add esp, 0x10
lea eax, [ebp - 0x48]
push eax
push 1
push 0
push str.SOFTWAREMicrosoftWindows_NTCurrentVersion
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x10016a62
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp + 0x58]
push eax
push 0
push 0
push str.DisplayVersion
push dword [ebp - 0x48]
mov dword [ebp - 0x4c], 0x200
call esi
test eax, eax
jne 0x10016a24
lea eax, [ebp + 0x58]
push eax
push str.Version__s
lea eax, [ebp + 0x258]
push 0x200
push eax
call fcn.1013b440
lea eax, [ebp + 0x258]
push eax
push 0x200
push dword [edi + 0x28]
call fcn.1013b440
add esp, 0x1c
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x5c]
push eax
push 0
push 0
push 0x10178898
push dword [ebp - 0x48]
mov dword [ebp - 0x4c], 4
call esi
test eax, eax
jne 0x10016a62
push dword [ebp - 0x5c]
movzx eax, word [ebp - 0x38]
push eax
push str.Build__d._d
lea eax, [ebp + 0x258]
push ebx
push eax
call fcn.1013b440
add esp, 0x14
lea eax, [ebp + 0x258]
push eax
push 0x200
push dword [edi + 0x24]
call fcn.1013b440
jmp 0x10016b03
cmp edx, 4
jne 0x10016aea
test eax, eax
jne 0x10016ab6
push str.Microsoft_Windows_95
mov esi, 0x400
push esi
push dword [edi + 0x20]
call fcn.1003dc98
add esp, 0xc
cmp byte [ebp - 0x2f], 0x43
je 0x10016aa6
cmp byte [ebp - 0x2f], 0x42
jne 0x10016b06
push str._OSR2
push esi
push dword [edi + 0x20]
call fcn.1013b3b0
jmp 0x10016b03
cmp eax, 0xa
jne 0x10016ade
push str.Microsoft_Windows_98
mov esi, 0x400
push esi
push dword [edi + 0x20]
call fcn.1003dc98
add esp, 0xc
cmp byte [ebp - 0x2f], 0x41
jne 0x10016b06
push 0x10178850
jmp 0x10016aab
cmp eax, 0x5a
jne 0x10016b06
push str.Microsoft_Windows_Millennium_Edition
jmp 0x10016af6
push str.Microsoft_Windows_9x
jmp 0x10016af6
push str.Microsoft_Win32s
push 0x400
push dword [edi + 0x20]
call fcn.1003dc98
add esp, 0xc
xor eax, eax
inc eax
mov ecx, dword [ebp + 0x458]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1003dc89
add ebp, 0x45c
leave
ret