Jump to content

AIDA64 - read shared memory data

Recommended Posts

Below is a function w/ a working example showing how to access the AIDA64 shared memory.

First enable shared memory here: Preferences > Hardware Monitoring > External Applications > Enable Shared Memory

The length of the data depends on the number of active sensors and their content. As AIDA64 does not provide a buffer size value, we use _WinAPI_GetSystemInfo() <WinAPISys.au3> to get dwPageSize ($aArray[1]). This value is the used as an address offset, and we continue reading chunks of data until we encounter a 0x00 NUL character.

Based on the Delphi example found in the AIDA64 documentation: https://www.aida64.co.uk/user-manual/external-applications

Feedback appreciated, especially as all this shared memory stuff is not my ordinary cup of... cake. And regarding this whole ordeal of reading data without knowing the exact length; I'm suspecting my solution to read chunks of data like done below is not by the book, and I'm concerned what might happen if the final chunk is exactly 4096 bytes in length. Will there still be a NUL terminator there? Hmm.


#include <WinAPIFiles.au3>
#include <WinAPISys.au3>

; #INDEX# ===========================================================================================================================
; Title .........: AIDA64 Shared Memory access for AutoIt3
; Author(s) .....: demux4555
; Reference .....: https://www.aida64.co.uk/user-manual/external-applications
; ===================================================================================================================================

Global $vSharedmem_data                                                             ; The variable used to store the data we read from the shared memory
Global $return = ExtApp_SharedMem_ReadBuffer_v2($vSharedmem_data)                   ; Now, let's see what happens when we run the function...
If @error Then _Echo("! ExtApp_SharedMem_ReadBuffer_v2(): @errror = " & @error)

If IsBinary($vSharedmem_data) Then                                                  ; Convert type Binary to actual human readable text. We also remove the excess of trailing 0x00 characters.
    $vSharedmem_data = StringStripWS(BinaryToString($vSharedmem_data), $STR_STRIPLEADING+$STR_STRIPTRAILING)

_Echo("> return   = " & $return)                                                    ; The return value. Will be True if everything went ok.
_Echo("> length   = " & StringLen($vSharedmem_data))                                ; The number of characters read from shared memory.
_Echo("> data     = " & $vSharedmem_data)                                           ; The actual data.
_Echo("> data(40) = " & "..." & StringRight($vSharedmem_data, 40))                  ; shows the 40 right-most characters, and _should_ show the very end of the data at this point.


; #FUNCTION# ====================================================================================================================
; Name ..........: ExtApp_SharedMem_ReadBuffer_v2
; Description ...: AIDA64 Shared Memory Example for AutoIt3
; Syntax ........: ExtApp_SharedMem_ReadBuffer_v2(Byref $_dOutput[, $_sSharedmemName = "AIDA64_SensorValues"])
; Parameters ....: $_dOutput            - [in/out] Variable to store the read data.
;                  $_sSharedmemName     - [optional] Name of the AIDA64 shared memory. Default is "AIDA64_SensorValues".
; Return values .: Success: True. $_dOutput will be type Binary, containing a string of the XML values of the active sensors.
;                  Failure: False.
; Author ........: demux4555
; Reference .....: https://www.aida64.co.uk/user-manual/external-applications
; ===============================================================================================================================
Func ExtApp_SharedMem_ReadBuffer_v2(ByRef $_dOutput, $_sSharedmemName = "AIDA64_SensorValues")
    Local $_bReturn     = False
    Local $_aGSI        = _WinAPI_GetSystemInfo()                                   ; Retrieves information about the current system...                                                                     Ref: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsysteminfo
    Local $_iPageSize   = $_aGSI[1]                                                 ; ... the page size and the granularity of page protection and commitment. Usually it is 4096, but we read it anyway.   Ref: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info

    Local $_hMapping    = _WinAPI_OpenFileMapping($_sSharedmemName, $FILE_MAP_READ) ; Opens a named file mapping object.                                                                                    Ref: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-openfilemappingw
    If Not IsPtr($_hMapping) Then Return SetError(-2, 0, $_bReturn)

    Local $_pMappedData = _WinAPI_MapViewOfFile($_hMapping, 0, 0, $FILE_MAP_READ)   ; Pointer to the start address. Maps a view of a file mapping into the address space of a calling process.              Ref: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-mapviewoffile
    If @error Or Not IsPtr($_pMappedData) Then Return SetError(-2, 0, $_bReturn)

    ; Now we loop until we reach the end of the data.
    Local $_tData, $_dBuffer
    While 1
        $_tData     = DllStructCreate("BYTE[" & $_iPageSize & "]", $_pMappedData)   ; Note: we use type BYTE[] (AutoIt type Binary) instead of CHAR[] (AutoIt type String). This allows us to look for value 0x00 (NUL termination of the data).
        If @error Then ExitLoop

        $_dBuffer   = DllStructGetData($_tData, 1)                                  ; The returned value is type Binary.
        If @error Or ($_dBuffer==0) Or (BinaryLen($_dBuffer)=0) Then ExitLoop       ; Pretty sure $_dBuffer==0 can not happen, so just in case.

        $_dOutput   = Binary($_dOutput & $_dBuffer)                                 ; Add the read data to the end of the output variable.
        If StringRight($_dBuffer, 2)=="00" Then ExitLoop                            ; Look for NUL termination of the string data.
        $_pMappedData += $_iPageSize                                                ; We change the address by using the page granularity value (i.e. 4096) as the offset.

    ; Quick cleanup
    $_bReturn       = _WinAPI_UnmapViewOfFile($_pMappedData)=1                      ; Unmaps a mapped view of a file from the calling process's address space.                                              Ref: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-unmapviewoffile

    Return $_bReturn


Func _Echo($_data = "")
    ConsoleWrite($_data & @CRLF)



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By JohnWIlling
      I am in the need for a simple synchronous Client/Server communication.  I found several examples and references to various kinds of Inter-Process Communications such as TCP, Named Pipes, Mail Slots, Shared Memory, Memory Mapped Files, and simple Files.  I wanted to see what the best solutions would be.  I began developing a library and slowly began adding each of the IPC methods and ended up with a library with a very simple synchronous “ASCII” API where the application can choose which method to use at startup.
      For the Server side, a Server app must initialize communication by calling:
      Func InitConnection($cType = $cDefaultType, $ResourceName = "", $bBlock = $cDefaultBlocking, $fSleepFunc = "", $iBufSize = $DEFAULT_BUFSIZE)
      The optional arguments allow the app to specify the connection type (such as: $cNamedPipe, $cFile, $cTCP, $cSharedMem, $cMailSlot), a value for the resource name (such as the file, named pipe name, TCP port number, etc.), the communication buffer size, and a callback function for when the “read” is waiting for data.
      A “File Descriptor” is returned and must be used in the future API calls.
      The Server side must then call:
      Func StartConnection($iFD)
      This call waits for a Client to connect.  The Server then calls:
                      Func ReadData($iFD, ByRef $sData)
      To read a Request from the Client and then calls:
                      Func WriteData($iFD, ByRef $sData)
      To send the reply back to the Client.
      When communication with the Client is done, the Server app will call:
      Func StopConnection($iFD)
      When the Server app is done with the communications it will call:
      Func EndConnection($iFD)
      For the Client side, a Client app must open the communication by calling:
      Func OpenConnection($cType = $cDefaultType, $ResourceName = "", $bBlock = $cDefaultBlocking, $fSleepFunc = "", $iBufSize = $DEFAULT_BUFSIZE)
      The optional arguments allow the app to specify the connection type (such as: $cNamedPipe, $cFile, $cTCP, $cSharedMem, $cMailSlot), a value for the resource name (such as the file, named pipe name, TCP port number, etc.), the communication buffer size, and a callback function for when the “read” is waiting for data.
      A “File Descriptor” is returned and must be used in the future API calls.
      The Client side then send a request to the Server app by calling:
                      Func WriteData($iFD, ByRef $sData)
      To read a Response from the Server by calling:
                      Func ReadData($iFD, ByRef $sData)
      To end the connection to the Server by calling:
      Func CloseConnection($iFD)
      Within the IPC_IO.AU3 library, each IPC method is ether:
      ·         “stream” based where data is read/written by calling _WinAPI_ReadFile/TCPRecv or _WinAPI_WriteFile/ TCPSend
      ·         “direct” based for Shared memory where the Client reads the data directly from the Server App’s memory and the Server directly reads the Client App’s memory
      In processing a request, the “ReadData” process starts by checking if data is ready to be read by calling the routine: “ReadStart”, then it reads in the size of the request by calling “ReadSize”, it then reads in the Ascii Request by calling “ReadBuffer”, then the sequence is completed by calling “ReadEnd”. 
      The Write Process follows the same sequence with “WriteData” calling “WriteStart”, “WriteSize”, “WriteBuffer”, “WriteEnd”.
      My testing showed that the performance of sending and receiving of a 10k file took:
      ·         "Shared Memory" was the fastest, at 0.007468 Sec
      ·         “Named Pipes” at 0.015954
      ·         “Mail Slots” at 0.016427
      ·         “File Based” at 0.270287
      ·         “TCP” at 0.994884
    • By francoiste
      in AutoIt we have:
      _WinAPI_IsProcessorFeaturePresent($iFeature) this internally just calls what is provided by microsoft: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724482(v=vs.85).aspx
      unfortunately this is completely outdated as we can only check for features like MMX and up to a maximum of SSE2 or SSE3 - which have been introduced back in 2001 / 2004.
      but nowadays there is stuff like AVX, AVX2, AVX-512 ...
      for example see: https://en.wikipedia.org/wiki/Template:Multimedia_extensions
      well, for CPP we have the FeatureDetector (by Mysticial): https://github.com/Mysticial/FeatureDetector
      it calls __cpuid / __cpuidex from <intrin.h>.
      for additional details see: https://msdn.microsoft.com/en-us/library/hskdteyh.aspx
      has anyone tried to determine such SIMD features and related CPU capabilites with AutoIt?
    • By Durnt
      Is there any way to send variables/values to a script via parameters during runtime?
      My current setup is to have a main script that always runs. This script basically sits in the background. After 1 minute, it reads text files (made via a second script), parses out the values, averages them per sensor, and posts to Thingpseak. The secondary script does not permanently run but instead runs via Eventghost when Eventghost gets GET requests from the sensors.
      I am looking to see if there is a way I could just have Eventghost send the parameter straight to the primary script while it is running, thus removing the need to write to files/have multiple scripts.
      EDIT: I just realized I could have Autoit process GET requests to do this. Doh. Point still stands though, is there a way to send values to a running script without inputboxes or reading from files?
    • By Blinky
      Hi everyone,
      This is my special pet project.
      It is an example of how u can use autoit to control external devices.
      this script is made to comunicate with the MAX335 chip  using the SPI protocol via the LPT(printer) port
      the beauty of the MAX335 chip is that the Clock, Data_In and the Chip_Select pins can be directly connected to the LPT port without any external components, and the 12V and 5V directly from an ATX PC power suply.
      aditionaly i made a custom GUI with CommandFusion instaled on an Android Tablet that sends TCP commands to an Autoit TCP server that controls three dasy chained MAX335 chips that totals 24 independent NO switches
      this script works perfectly for me
      i just finished this project and i think i will make an UDF including more SPI devices
      $DLLFileAndPath = @ScriptDir & "/inpout32.dll" Global $335_device_number=3 ;number of daisy chained chips Global $335_clock_bit=0 ;bit number for LPT pin 1 in the control Register of the LPT port(where i connected the CLK pin on te MAX335) Global $335_cs_bit=4;bit number for LPT pin 6 in the data Register of the LPT port(where i connected the CS pin on te MAX335) Global $335_data_in_bit=7;bit number for LPT pin 9 in the data Register of the LPT port(where i connected the DI pin on te MAX335) Global $clock_delay=1;this limits the clock speed but it works fine with 0 ;the ini file will be created and will keep the MAX335 pins statuses For $i=0 To $335_device_number*8-1 Step 1 IniWrite("355_buffer.ini","present_data",$i,"0") Next set_max335_output(2,3,1) ; this will activate switch 2 on device 3 on the daisy chain Func set_max335_output($output_no,$device_no,$status) $bit_no=($device_no-1)*8+$output_no-1 ; get the exact bit number of the switch IniWrite("355_buffer.ini","present_data",$bit_no,$status); whrite it to the buffer ;this part is where the SPI protocol begins set_control_bit($335_clock_bit,1); drop CLK set_data_bit($335_cs_bit,0) ;activate CS Sleep($clock_delay) For $i=$335_device_number*8-1 To 0 Step -1; start writing from buffer MostSignificantByte first $data=IniRead("355_buffer.ini","present_data",$i,"0") set_data_bit($335_data_in_bit,$data) ; set data bit value set_control_bit($335_clock_bit,0) ;raise CLK Sleep($clock_delay) set_control_bit($335_clock_bit,1); drop CLK Sleep($clock_delay) Next set_data_bit($335_cs_bit,1);deactivate CS EndFunc Func set_data_bit($bit,$stat=-1) ; it will write the value of the bit in the data reg of the LPT port $y= DllCall($DLLFileAndPath, "int", "Inp32", "int", "0x378") $bits=dec_to_bin($y[0]) If $stat = -1 Then If $bits[$bit]=0 Then $bits[$bit]=1 Else $bits[$bit]=0 EndIf $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x378", "int", $bcd) Return 1 Else If $bits[$bit]<>$stat Then $bits[$bit]=$stat $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x378", "int", $bcd) Return 1 Else Return 2 EndIf EndIf EndFunc Func set_control_bit($bit,$stat=-1); it will write the value of the bit in the control reg of the LPT port $y= DllCall($DLLFileAndPath, "int", "Inp32", "int", "0x37a") $bits=dec_to_bin($y[0]) If $stat = -1 Then If $bits[$bit]=0 Then $bits[$bit]=1 Else $bits[$bit]=0 EndIf $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x37a", "int", $bcd) Return 1 Else If $bits[$bit]<>$stat Then $bits[$bit]=$stat $bcd=bin_to_dec($bits) DllCall( $DLLFileAndPath, "int", "Out32", "int", "0x37a", "int", $bcd) Return 1 Else Return 2 EndIf EndIf EndFunc Func dec_to_bin($dec) Local $bit_array[8] If $dec > 255 Then SetError(1,1,-1) If $dec < 0 Then SetError(2,1,-1) For $i=7 To 0 Step -1 If $dec >= 2^$i Then $bit_array[$i] = 1 $dec=$dec-2^$i Else $bit_array[$i] = 0 EndIf Next Return $bit_array EndFunc Func bin_to_dec($bit_array) If IsArray($bit_array) Then If UBound($bit_array) = 8 Then $dec=0 For $i=7 To 0 Step -1 $dec = $bit_array[$i]*(2^$i)+$dec Next Else SetError(2,1,-1) EndIf Else SetError(1,1,-1) EndIf Return $dec EndFunc
    • By islandspapand
      Halo wounderfull Autoit Forum
      I have gotten a new laptop that i am going to have the next few year and i would like to be able to get data from all its sensors like Location & Movement (GPS, Accelometer)
      I have gotten the GPS to work
      I have found the code for the Accelorometer but its in C++
      (and i have no experiance with .dll calls and c++)
      Could some on PLEASE help me / point me in the right direction
      ass i just cant get it to work in autoit / know where to start
      here is the autoit code i have tried so far but keep getting
      @error 1 = unable to use the DLL file,
      ;/* * LoadSensorDLL.cpp * * Created on: Feb 11, 2012 * Author: CONG NGUYEN * */ #include <iostream> #include <windows.h> #include <stdio.h> #include <math.h> struct AccelData { int status; short x; //raw data short y; //raw data short xx; //avg. of 40ms short yy; //avg. of 40ms char temp; //raw value short x0; //used for auto-center short y0; //used for auto-center }; using namespace std; typedef void * (__stdcall *ShockproofGetAccelerometerData)(AccelData* accData); //function prototypes void calibrate(void); void calibrateX(); void calibrateY(); short getAccelX(); short getAccelY(); double getRotationRadiansX(); double getRotationDegreesX(); double getRotationRadiansY(); double getRotationDegreesY(); //declare constants const double PI = 3.141592; //declare global variables HINSTANCE hinstDLL; AccelData accData = {0,0,0,0,0,0,0,0}; ShockproofGetAccelerometerData pfnGetData; bool isSupported; //declare global variables used for calibration and movement short x_hor = 0; short y_hor = 0; short x_max = 0; short y_max = 0; double x_norm = 0.0; double y_norm = 0.0; double test = 0.0; int main(void) { int loop = 1; hinstDLL = LoadLibrary(L"Sensor.dll"); if(hinstDLL == 0) { hinstDLL = LoadLibrary(L"sensor.dll"); } if(hinstDLL == 0) { isSupported = false; } else { isSupported = true; pfnGetData = (ShockproofGetAccelerometerData) GetProcAddress((HINSTANCE) hinstDLL, "ShockproofGetAccelerometerData"); } calibrate(); calibrateX(); calibrateY(); cout << x_hor << ", " << y_hor << endl; cout << x_max << ", " << y_max << endl; cout << endl; cout << "Calibration completed.\n"; getchar(); cout << "TIlt 45 degrees. Press any keys to confirm.\n"; getchar(); cout << getRotationDegreesY(); //end program getchar(); FreeLibrary(hinstDLL); return 0; } short getAccelX() { pfnGetData(&accData); return accData.x; } short getAccelY() { pfnGetData(&accData); return accData.y; } void calibrate(void) { cout << "Lay Thinkpad onto a flat and horizontal ground.\n"; cout << "Press any key to continue.\n"; if(getchar() == '\n') { x_hor = getAccelX(); y_hor = getAccelY(); } } void calibrateX() { cout << "Pitch your Thinkpad a bit backwards.\n"; cout << "Press any key, then rotate your Thinkpad back to normal position.\n"; getchar(); while(getAccelX() != x_hor) { if(getAccelX() > x_max) { x_max = getAccelX(); } } } void calibrateY() { cout << "Roll your Thinkpad to the right a bit.\n"; cout << "Press any key, then rotate your Thinkpad back to normal position.\n"; getchar(); while(getAccelY() != y_hor) { if(getAccelY() > y_max) { y_max = getAccelY(); } } } double getRotationRadiansX() { x_norm = (double)((double)getAccelX() - (double)x_hor) /((double)x_max - (double)x_hor); if(x_norm > 1) { x_norm = 1/x_norm; } return acos(x_norm); } double getRotationDegreesX() { return getRotationRadiansX() * 180 / PI; } double getRotationRadiansY() { y_norm = (double)((double)getAccelY() - (double)y_hor) /((double)y_max - (double)y_hor); if(y_norm > 1) { y_norm = 1/y_norm; } return acos(y_norm); } double getRotationDegreesY() { return getRotationRadiansY() * 180 / PI; } #cs ---------------------------------------------------------------------------- Author: Me Script Function: Get Data from the Different Sensors in the Computer 1. Accelerometer / Gyroscope 2. GPS / Location 3. ? 4. ? ----------SysWOW64---------------- Sensor.dll SensorsApi.dll SensorCpl.dll ----------------------------------- ----------System32--------------- Sensor64.dll SensorsApi.dll SensorsClassExtension.dll SensorCpl.dll ---------------------------------- ================================== How To / Help / Code Convert ========================= http://flashandrc.wordpress.com/2012/02/12/pulling-data-from-thinkpad-aps-sensor-using-c/ ; C++ http://www.xtremevbtalk.com/showthread.php?t=284179 ; Vbs http://www.autoitscript.com/forum/topic/71001-problems-with-dllcall/?hl=sensor#entry519806 ; Autoit3 ========================================================================================= ================================== Credits (UDF/Code Lines/Code Samples) ================ Autoit3 Forum and all its Users whom i have borrowed a line of code or sample script Thanks to all that have helped as well ========================================================================================= #ce ---------------------------------------------------------------------------- #include <Array.au3> #include <WinApi.au3> #region === Global Variables === Global $SensorWOW #endregion ===================== #region ============================================= SysWOW64 Dll ================================================================ $SensorWOW = DllOpen(@WindowsDir&"\SysWOW64\Sensor.dll") If $SensorWOW = -1 Then MsgBox(16,"Error","Dll File didn't open") #cs ============================================= Functions in Sensor64.dll =================================================== ShockproofCallSMAPIBIOS 0x000000018000230c 0x0000230c 1 (0x1) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofControl 0x0000000180001750 0x00001750 2 (0x2) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofEnableDisableSnooze 0x0000000180002230 0x00002230 3 (0x3) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofGetAccelerometerData 0x0000000180001da4 0x00001da4 4 (0x4) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofGetAccelerometerDataEx 0x0000000180001e78 0x00001e78 5 (0x5) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofGetAccelerometerMutex 0x0000000180001c78 0x00001c78 6 (0x6) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofGetAutoDisable 0x00000001800016c0 0x000016c0 7 (0x7) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofGetPenAbility 0x00000001800025e8 0x000025e8 8 (0x8) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofGetPenDelayTime 0x00000001800023e4 0x000023e4 9 (0x9) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofGetPenFeature 0x00000001800024e0 0x000024e0 10 (0xa) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofGetShockStatus 0x0000000180001b4c 0x00001b4c 11 (0xb) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofGetSlaveCPUinfo 0x0000000180001be4 0x00001be4 12 (0xc) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofGetUnloadCnt 0x0000000180001abc 0x00001abc 13 (0xd) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofGetVersion 0x0000000180001800 0x00001800 14 (0xe) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofInformPMevent 0x0000000180001f4c 0x00001f4c 15 (0xf) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofInvokeSnooze 0x00000001800020c8 0x000020c8 16 (0x10) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofManualSensitivitySetting 0x0000000180001fc8 0x00001fc8 17 (0x11) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofReleaseAccelerometerMutex 0x0000000180001d24 0x00001d24 18 (0x12) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofSetAutoDisable 0x0000000180001640 0x00001640 19 (0x13) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofSetPenDelayTime 0x0000000180002470 0x00002470 20 (0x14) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofSetPenFeature 0x0000000180002574 0x00002574 21 (0x15) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofSnoozeSetting 0x0000000180002130 0x00002130 22 (0x16) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function ShockproofTaskComplete 0x0000000180001fbc 0x00001fbc 23 (0x17) Sensor64.DLL C:\Windows\System32\Sensor64.DLL Exported Function #ce ======================================================================================================================== ;~ $SensorsApiWOW = DllOpen(@WindowsDir&"\SysWOW64\SensorsApi.dll") #cs ============================================= Functions in SensorsApi.dll ================================================= ;~ DllCanUnloadNow 0x07658f96 0x00008f96 1 (0x1) SensorsApi.dll C:\Windows\SysWOW64\SensorsApi.dll Exported Function ;~ DllGetClassObject 0x07659bbd 0x00009bbd 2 (0x2) SensorsApi.dll C:\Windows\SysWOW64\SensorsApi.dll Exported Function ;~ DllRegisterServer 0x07659ddb 0x00009ddb 3 (0x3) SensorsApi.dll C:\Windows\SysWOW64\SensorsApi.dll Exported Function ;~ DllUnregisterServer 0x07659ea6 0x00009ea6 4 (0x4) SensorsApi.dll C:\Windows\SysWOW64\SensorsApi.dll Exported Function ;~ SensorPermissionsHandler 0x07666a4c 0x00016a4c 5 (0x5) SensorsApi.dll C:\Windows\SysWOW64\SensorsApi.dll Exported Function ;~ SensorPermissionsHandlerA 0x07666a4c 0x00016a4c 6 (0x6) SensorsApi.dll C:\Windows\SysWOW64\SensorsApi.dll Exported Function ;~ SensorPermissionsHandlerW 0x0766681c 0x0001681c 7 (0x7) SensorsApi.dll C:\Windows\SysWOW64\SensorsApi.dll Exported Function #ce ======================================================================================================================== #endregion ======================================================================================================================== $AccData = DllStructCreate("int;short;short;short;char;short;short") ;~ $res = DllCall("sensor.dll","none","ptr",DllStructGetPtr($AccData)) ;~ For $i=1 To 23 ;~ $status = DllStructGetData($AccData,$i) ;~ ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $status = ' & $status & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console ;~ Next $adll = DllCall($SensorWOW, "none", "ShockproofGetAccelerometerData", $AccData,"handle") If Not @error Then MsgBox(0, "Return", $adll[1] & " " & $adll[1] & " Length " & StringLen($adll[1])) Else MsgBox(0, "Error", @error) EndIf Thanks in advanced
  • Create New...