Windows API interpreter

Is there an interpreter that can output windows api calls like GetVersionEx?

+4
source share
3 answers

Not sure if you need / need it, but I would say that Python is with pywin32 .

+6
source

Ruby may also be an opportunity. The following is an example showing the results of calling GetVersionEx.

require "Win32API" gvex = Win32API.new( 'kernel32', 'GetVersionEx', ['P'], 'I' ) s = [20+128, 0, 0, 0, 0, '' ].pack('LLLLLa128') gvex.call( s ); a = s.unpack( 'LLLLLa128' ) puts "gvex: ", a 

This example simply transfers 148 bytes (the size of the OSVERSION structure), not the entire OSVERSIONEX structure.

+2
source

Information such as version and other data from the operating system can also be obtained using WMI.

Here is an example of VBScript, no need to compile anything:

 strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem") For Each objOS in colOSes Wscript.Echo "Computer Name: " & objOS.CSName Wscript.Echo "Caption: " & objOS.Caption 'Name Wscript.Echo "Version: " & objOS.Version 'Version & build Wscript.Echo "Build Number: " & objOS.BuildNumber 'Build Wscript.Echo "Build Type: " & objOS.BuildType Wscript.Echo "OS Type: " & objOS.OSType Wscript.Echo "Other Type Description: " & objOS.OtherTypeDescription WScript.Echo "Service Pack: " & objOS.ServicePackMajorVersion & "." & _ objOS.ServicePackMinorVersion Next 
+2
source

Source: https://habr.com/ru/post/1338482/


All Articles