Function at 0x509e30
Capabilities:
Check os version
Get system information on windows

Disassembly:
push ebp
lea ebp, [esp - 0x150]
sub esp, 0x1d0
mov eax, dword [0x5706b0]
xor eax, ebp
mov dword [ebp + 0x14c], 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 - 0x50]
push 0
push eax
call fcn.004ef550
add esp, 0xc
lea eax, [ebp - 0x50]
mov dword [ebp - 0x50], esi
mov esi, dword [sym.imp.KERNEL32.dll_GetVersionExA]
push eax
call esi
test eax, eax
jne 0x509ea5
mov ebx, 0x94
push ebx
push eax
lea eax, [ebp - 0x50]
push eax
call fcn.004ef550
add esp, 0xc
lea eax, [ebp - 0x50]
push eax
mov dword [ebp - 0x50], ebx
call esi
test eax, eax
je 0x50a307
movzx esi, word [ebp + 0x44]
mov edx, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x48]
mov dword [edi + 0x14], esi
movzx esi, word [ebp + 0x46]
mov dword [edi + 8], edx
sub edx, 0
mov dword [edi + 0xc], ecx
mov dword [edi + 0x10], eax
mov dword [edi + 0x18], esi
je 0x50a2ef
dec edx
je 0x50a279
dec edx
jne 0x50a304
push eax
push ecx
mov ebx, str.Microsoft_Windows_NT_d._d
push ebx
mov esi, 0x400
push esi
push dword [edi + 0x1c]
call fcn.00450b87
mov eax, dword [ebp - 0x4c]
add esp, 0x14
cmp eax, 4
ja 0x509f13
push str.Microsoft_Windows_NT
push esi
push dword [edi + 0x1c]
call fcn.004ef010
add esp, 0xc
jmp 0x50a0c8
cmp eax, 5
jne 0x509fb3
mov eax, dword [ebp - 0x48]
test eax, eax
jne 0x509f2a
push str.Microsoft_Windows_2000
jmp 0x509f02
cmp eax, 1
jne 0x509f7b
push str.Microsoft_Windows_XP
push esi
push dword [edi + 0x1c]
call fcn.004ef010
mov ebx, dword [sym.imp.USER32.dll_GetSystemMetrics]
add esp, 0xc
push 0x57
call ebx
test eax, eax
je 0x509f5f
push str.Media_Center_Edition
push esi
push dword [edi + 0x1c]
call fcn.00450c1b
add esp, 0xc
push 0x56
call ebx
test eax, eax
je 0x50a0c8
push str.Tablet_PC_Edition
push esi
push dword [edi + 0x1c]
call fcn.00450c1b
jmp 0x509f0b
cmp eax, 2
jne 0x509fab
cmp byte [ebp + 0x4a], 1
jne 0x509fa1
cmp word [ebp - 0x80], 6
jne 0x509f97
push str.Microsoft_Windows_XP_IA64
jmp 0x509f02
push str.Microsoft_Windows_XP_x64
jmp 0x509f02
push str.Microsoft_Windows_Server_2003
jmp 0x509f02
push eax
push 5
jmp 0x50a0bb
cmp eax, 6
jne 0x50a07a
call fcn.00451ca2
cmp dword [eax + 0x18], 0
je 0x509ff2
call fcn.00451ca2
mov eax, dword [eax + 0x18]
lea ecx, [ebp - 0x54]
push ecx
lea ecx, [ebp - 0x58]
push ecx
lea ecx, [ebp - 0x5c]
push ecx
mov ecx, eax
call fcn.00437932
test eax, eax
je 0x509ff2
mov eax, dword [ebp - 0x58]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x48]
test eax, eax
jne 0x50a014
cmp byte [ebp + 0x4a], 1
jne 0x50a00d
push eax
push dword [ebp - 0x4c]
push str.Microsoft_Windows_Vista___d._d_
jmp 0x50a095
push str.Microsoft_Windows_Server_2008
jmp 0x50a061
cmp eax, 1
jne 0x50a030
cmp byte [ebp + 0x4a], al
jne 0x50a029
push eax
push dword [ebp - 0x4c]
push str.Microsoft_Windows_7___d._d_
jmp 0x50a095
push str.Microsoft_Windows_Server_2008_R2
jmp 0x50a061
cmp eax, 2
jne 0x50a046
cmp byte [ebp + 0x4a], 1
jne 0x50a05c
push eax
push dword [ebp - 0x4c]
push str.Microsoft_Windows_8___d._d_
jmp 0x50a095
cmp eax, 3
jne 0x50a06f
cmp byte [ebp + 0x4a], 1
jne 0x50a05c
push eax
push dword [ebp - 0x4c]
push str.Microsoft_Windows_8.1___d._d_
jmp 0x50a095
push str.Microsoft_Windows_Server_2012_R2
push esi
push dword [edi + 0x1c]
call fcn.004ef010
add esp, 0xc
jmp 0x50a0a1
cmp eax, 4
jne 0x50a0a1
push eax
push dword [ebp - 0x4c]
jmp 0x50a083
push dword [ebp - 0x48]
cmp eax, 0xa
jne 0x50a0ba
push eax
cmp byte [ebp + 0x4a], 1
jne 0x50a090
push str.Microsoft_Windows_10___d._d_
jmp 0x50a095
push str.Microsoft_Windows_Server___d._d_
push esi
push dword [edi + 0x1c]
call fcn.00450b87
add esp, 0x14
movzx eax, word [ebp + 0x46]
push eax
movzx eax, word [ebp + 0x44]
push eax
push dword [ebp - 0x48]
mov ecx, edi
push dword [ebp - 0x4c]
call fcn.00509b54
jmp 0x50a0c8
push eax
push ebx
push esi
push dword [edi + 0x1c]
call fcn.00450b87
add esp, 0x14
cmp byte [ebp + 0x4a], 1
mov ebx, 0x200
jne 0x50a106
cmp dword [ebp - 0x4c], 4
jne 0x50a0e3
push str.Workstation_4.0
jmp 0x50a1a4
cmp dword [ebp - 0x4c], 5
jne 0x50a1b0
test dword [ebp + 0x48], ebx
je 0x50a0fc
push str.Home_Edition
jmp 0x50a1a4
push str.Professional
jmp 0x50a1a4
cmp byte [ebp + 0x4a], 3
je 0x50a116
cmp byte [ebp + 0x4a], 2
jne 0x50a1b0
cmp dword [ebp - 0x4c], 5
jne 0x50a188
cmp dword [ebp - 0x48], 2
jne 0x50a15d
mov eax, dword [ebp + 0x48]
test al, al
jns 0x50a130
push str.Datacenter_Edition
jmp 0x50a1a4
test al, 2
je 0x50a13b
push str.Enterprise_Edition
jmp 0x50a1a4
mov ecx, esi
cmp ax, cx
jne 0x50a149
push str.Web_Edition
jmp 0x50a1a4
cmp ax, 1
jne 0x50a156
push str.Small_Business_Edition
jmp 0x50a1a4
push str.Standard_Edition
jmp 0x50a1a4
cmp dword [ebp - 0x48], 0
jne 0x50a248
test byte [ebp + 0x48], 0x80
je 0x50a174
push str.Datacenter_Server
jmp 0x50a1a4
test byte [ebp + 0x48], 2
je 0x50a181
push str.Advanced_Server
jmp 0x50a1a4
push str.Server
jmp 0x50a1a4
cmp dword [ebp - 0x4c], 4
ja 0x50a248
test byte [ebp + 0x48], 2
je 0x50a19f
push str.Server_4.0__Enterprise_Edition
jmp 0x50a1a4
push str.Server_4.0
push esi
push dword [edi + 0x1c]
call fcn.00450c1b
add esp, 0xc
cmp dword [ebp - 0x4c], 4
jne 0x50a248
push str.Service_Pack_6
lea eax, [ebp - 0x3c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x50a248
lea eax, [ebp - 0x54]
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 - 0x44]
push eax
jne 0x50a213
push str.Service_Pack_6a__Build__d_
lea eax, [ebp + 0x4c]
push 0x100
push eax
call fcn.00450b87
lea eax, [ebp + 0x4c]
push eax
push ebx
push dword [edi + 0x20]
call fcn.00450b87
add esp, 0x1c
jmp 0x50a23a
lea eax, [ebp - 0x3c]
push eax
push str._s__Build__d_
lea eax, [ebp + 0x4c]
push 0x100
push eax
call fcn.00450b87
lea eax, [ebp + 0x4c]
push eax
push ebx
push dword [edi + 0x20]
call fcn.00450b87
add esp, 0x20
push dword [ebp - 0x54]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x50a304
movzx eax, word [ebp - 0x44]
push eax
lea eax, [ebp - 0x3c]
push eax
push str._s__Build__d_
lea eax, [ebp + 0x4c]
push 0x100
push eax
call fcn.00450b87
lea eax, [ebp + 0x4c]
push eax
push ebx
push dword [edi + 0x20]
call fcn.00450b87
add esp, 0x20
jmp 0x50a304
cmp ecx, 4
jne 0x50a2e8
test eax, eax
jne 0x50a2b4
push str.Microsoft_Windows_95
mov esi, 0x400
push esi
push dword [edi + 0x1c]
call fcn.004ef010
add esp, 0xc
cmp byte [ebp - 0x3b], 0x43
je 0x50a2a4
cmp byte [ebp - 0x3b], 0x42
jne 0x50a304
push str._OSR2
push esi
push dword [edi + 0x1c]
call fcn.00450c1b
jmp 0x50a301
cmp eax, 0xa
jne 0x50a2dc
push str.Microsoft_Windows_98
mov esi, 0x400
push esi
push dword [edi + 0x1c]
call fcn.004ef010
add esp, 0xc
cmp byte [ebp - 0x3b], 0x41
jne 0x50a304
push 0x532eb4
jmp 0x50a2a9
cmp eax, 0x5a
jne 0x50a304
push str.Microsoft_Windows_Millennium_Edition
jmp 0x50a2f4
push str.Microsoft_Windows_9x
jmp 0x50a2f4
push str.Microsoft_Win32s
push 0x400
push dword [edi + 0x1c]
call fcn.004ef010
add esp, 0xc
xor eax, eax
inc eax
mov ecx, dword [ebp + 0x14c]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004edcb6
add ebp, 0x150
leave
ret