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

Disassembly:
sub esp, 0x118
push ebx
push ebp
push esi
mov ebx, ecx
push edi
mov ecx, 9
xor eax, eax
lea edi, [esp + 0xb4]
mov esi, dword [sym.imp.KERNEL32.dll_GetVersionExA]
mov dword [esp + 0x10], ebx
rep stosd dword es:[edi], eax
mov ecx, 0x27
lea edi, [esp + 0x18]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x18]
mov dword [esp + 0x18], 0x9c
push eax
call esi
mov edi, eax
test edi, edi
jne 0x4048a4
lea ecx, [esp + 0x18]
mov dword [esp + 0x18], 0x94
push ecx
call esi
test eax, eax
jne 0x4048a4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x118
ret
push str.GetNativeSystemInfo
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x4048cb
lea edx, [esp + 0xb4]
push edx
call eax
jmp 0x4048d9
lea eax, [esp + 0xb4]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov eax, dword [esp + 0x28]
sub eax, 0
je 0x404e0a
dec eax
je 0x404d84
dec eax
jne 0x404e17
mov eax, dword [esp + 0x1c]
mov esi, 2
cmp eax, 6
jne 0x404957
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x4049e9
cmp byte [esp + 0xb2], 1
jne 0x40491f
push str.Windows_Vista
jmp 0x404924
push str.Windows_Server__Longhorn_
call fcn.00411340
mov al, byte [esp + 0xb6]
add esp, 4
cmp al, 1
jne 0x404957
mov ax, word [esp + 0xb4]
cmp ax, 9
jne 0x40494a
mov dword [ebx + 0x14], esi
jmp 0x404957
cmp ax, 6
jne 0x404957
mov dword [ebx + 0x14], 3
mov eax, dword [esp + 0x1c]
mov ebp, 5
cmp eax, ebp
jne 0x4049d5
cmp dword [esp + 0x20], esi
jne 0x4049a4
cmp byte [esp + 0xb2], 1
jne 0x404991
cmp word [esp + 0xb4], 9
jne 0x404991
push str.Microsoft_Windows_XP_Professional_x64_Edition
call fcn.00411340
add esp, 4
mov dword [ebx + 0x14], esi
jmp 0x40499e
push str.Microsoft_Windows_Server_2003_
call fcn.00411340
add esp, 4
cmp dword [esp + 0x1c], ebp
jne 0x4049d5
cmp dword [esp + 0x20], 1
jne 0x4049c0
push str.Microsoft_Windows_XP
call fcn.00411340
mov eax, dword [esp + 0x20]
add esp, 4
cmp eax, ebp
jne 0x4049d5
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x4049e9
push str.Microsoft_Windows_2000
call fcn.00411340
add esp, 4
cmp dword [esp + 0x1c], 4
ja 0x4049e9
push str.Microsoft_Windows_NT
call fcn.00411340
add esp, 4
mov ebp, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test edi, edi
je 0x404bd8
mov al, byte [esp + 0xb2]
cmp al, 1
jne 0x404a60
cmp word [esp + 0xb4], 9
je 0x404cb6
cmp dword [esp + 0x1c], 4
jne 0x404a30
push str.Workstation_4.0
call fcn.00411340
add esp, 4
jmp 0x404cb6
mov eax, dword [esp + 0xb0]
test ah, 2
je 0x404a4e
push str.Home_Edition
call fcn.00411340
add esp, 4
jmp 0x404cb6
push str.Professional
call fcn.00411340
add esp, 4
jmp 0x404cb6
cmp al, 3
je 0x404a6c
cmp al, 2
jne 0x404cb6
cmp dword [esp + 0x1c], 5
jne 0x404baa
mov eax, dword [esp + 0x20]
cmp eax, 2
jne 0x404b61
mov ax, word [esp + 0xb4]
cmp ax, 6
jne 0x404ac5
mov al, byte [esp + 0xb0]
test al, 0x80
je 0x404aa4
push str.Datacenter_Edition_for_Itanium_based_Systems
jmp 0x404aad
test al, 2
je 0x404ab5
push str.Enterprise_Edition_for_Itanium_based_Systems
call fcn.00411340
add esp, 4
mov ecx, dword [esp + 0x10]
mov dword [ecx + 0x14], 3
jmp 0x404cb6
cmp ax, 9
jne 0x404b05
mov al, byte [esp + 0xb0]
test al, 0x80
je 0x404add
push str.Datacenter_x64_Edition
jmp 0x404aed
test al, 2
je 0x404ae8
push str.Enterprise_x64_Edition
jmp 0x404aed
push str.Standard_x64_Edition
call fcn.00411340
mov edx, dword [esp + 0x14]
add esp, 4
mov dword [edx + 0x14], 2
jmp 0x404cb6
mov eax, dword [esp + 0xb0]
test al, 0x80
je 0x404b22
push str.Datacenter_Edition
call fcn.00411340
add esp, 4
jmp 0x404cb6
test al, 2
je 0x404b38
push str.Enterprise_Edition
call fcn.00411340
add esp, 4
jmp 0x404cb6
test ah, 4
je 0x404b4f
push str.Web_Edition
call fcn.00411340
add esp, 4
jmp 0x404cb6
push str.Standard_Edition
call fcn.00411340
add esp, 4
jmp 0x404cb6
test eax, eax
jne 0x404baa
mov al, byte [esp + 0xb0]
test al, 0x80
je 0x404b82
push str.Datacenter_Server
call fcn.00411340
add esp, 4
jmp 0x404cb6
test al, 2
je 0x404b98
push str.Advanced_Server
call fcn.00411340
add esp, 4
jmp 0x404cb6
push str.Server
call fcn.00411340
add esp, 4
jmp 0x404cb6
test byte [esp + 0xb0], 2
je 0x404bc6
push str.Server_4.0__Enterprise_Edition
call fcn.00411340
add esp, 4
jmp 0x404cb6
push str.Server_4.0
call fcn.00411340
add esp, 4
jmp 0x404cb6
lea eax, [esp + 0x10]
mov edi, 0x50
push eax
push 1
push 0
push str.SYSTEMCurrentControlSetControlProductOptions
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [esp + 0x28], edi
call ebp
test eax, eax
je 0x404c07
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x118
ret
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x14]
lea edx, [esp + 0xd8]
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]
mov esi, eax
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
jne 0x404bfa
cmp dword [esp + 0x14], edi
ja 0x404bfa
lea edx, [esp + 0xd8]
push edx
push str.WINNT
call ebx
test eax, eax
jne 0x404c5f
push str.Workstation
call fcn.00411340
add esp, 4
lea eax, [esp + 0xd8]
push eax
push str.LANMANNT
call ebx
test eax, eax
jne 0x404c7f
push str.Server
call fcn.00411340
add esp, 4
lea ecx, [esp + 0xd8]
push ecx
push str.SERVERNT
call ebx
test eax, eax
jne 0x404c9f
push str.Advanced_Server
call fcn.00411340
add esp, 4
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
push edx
push eax
push str._d._d
call fcn.00411340
add esp, 0xc
cmp dword [esp + 0x1c], 4
jne 0x404d57
lea ecx, [esp + 0x2c]
push str.Service_Pack_6
push ecx
call ebx
test eax, eax
jne 0x404d57
lea edx, [esp + 0x14]
push edx
push 1
push eax
push str.SOFTWAREMicrosoftWindows_NTCurrentVersionHotfixQ246009
push reloc.OLEAUT32.dll_SysReAllocString
call ebp
test eax, eax
jne 0x404d1f
mov eax, dword [esp + 0x24]
and eax, 0xffff
push eax
push str.Service_Pack_6a__Build__d__n
call fcn.00411340
mov eax, dword [esp + 0x1c]
add esp, 8
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x118
ret
mov ecx, dword [esp + 0x24]
lea edx, [esp + 0x2c]
and ecx, 0xffff
push ecx
push edx
push str._s__Build__d__n
call fcn.00411340
mov eax, dword [esp + 0x20]
add esp, 0xc
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x118
ret
mov ecx, dword [esp + 0x24]
lea edx, [esp + 0x2c]
and ecx, 0xffff
push ecx
push edx
push str._s__Build__d__n
call fcn.00411340
add esp, 0xc
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x118
ret
mov eax, dword [esp + 0x1c]
mov esi, 4
cmp eax, esi
jne 0x404e17
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x404dc9
push str.Microsoft_Windows_95
call fcn.00411340
mov al, byte [esp + 0x31]
add esp, 4
cmp al, 0x43
je 0x404db6
cmp al, 0x42
jne 0x404dc3
push str.OSR2
call fcn.00411340
add esp, 4
cmp dword [esp + 0x1c], esi
jne 0x404e17
cmp dword [esp + 0x20], 0xa
jne 0x404dfc
push str.Microsoft_Windows_98
call fcn.00411340
mov al, byte [esp + 0x31]
add esp, 4
cmp al, 0x41
je 0x404de9
cmp al, 0x42
jne 0x404df6
push 0x43764c
call fcn.00411340
add esp, 4
cmp dword [esp + 0x1c], esi
jne 0x404e17
cmp dword [esp + 0x20], 0x5a
jne 0x404e17
push str.Microsoft_Windows_Millennium_Edition_n
jmp 0x404e0f
push str.Microsoft_Win32s_n
call fcn.00411340
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x118
ret