Jump to content

Pointers in more than once processes


Recommended Posts

Hi,

Ive got problem, I try to read the value of a pointer in a few processes that are the same.

But I can't do it for some reason here is the script:

#include <NomadMemory.au3>
HotKeySet("+x","Terminate")
Func Terminate ()
    Exit 0      
EndFunc

Global $WMKEYDOWN = 0x100
Global $key = 0x33
Global $nottouse = InputBox("Handle","Input the Handle of your application that you don't want to be used (in this format 0x00000000)")
Global $hwnd = WinList("Battles for Glory")
Global $pids = ProcessList("Battles for Glory")
Global $offset [6]
Global $baseaddr
$offset [0] = 0
$offset [1] = 0x328
$offset [2] = 0x14C
$offset [3] = 0x54
$offset [4] = 0x34
$offset [5] = 0x224

For $i=1 To $pids [0][0]
    $prohwnd = _MemoryOpen($pids [$i][1])
    $baseaddr [$i] = _MemoryGetBaseAddress($prohwnd,0)
Next
    While 1
        For $i=1 To $hwnd [0][0]
            If $hwnd [$i][1] <> $nottouse Then
                DllCall("BypassedPostmessage.dll","int","myPostMessageA","hwnd",$hwnd [$i][1],"long",$WMKEYDOWN,"long",$key,"long",0)
                $hp = _MemoryPointerRead ($baseaddr [$i],$hwnd,$offset)
                MsgBox(0,"message",""&$hp [1]&"")
                Sleep(10)
            EndIf
        Next
    WEnd

And here is the error that I get:

(32) : ==> Subscript used with non-Array variable.:

$hp = _MemoryPointerRead ($baseaddr [$i],$hwnd,$offset)

$hp = _MemoryPointerRead ($baseaddr ^ ERROR

>Exit code: 1 Time: 1.346

Link to comment
Share on other sites

Hi,

Ive got problem, I try to read the value of a pointer in a few processes that are the same.

But I can't do it for some reason here is the script:

#include <NomadMemory.au3>
HotKeySet("+x","Terminate")
Func Terminate ()
    Exit 0      
EndFunc

Global $WMKEYDOWN = 0x100
Global $key = 0x33
Global $nottouse = InputBox("Handle","Input the Handle of your application that you don't want to be used (in this format 0x00000000)")
Global $hwnd = WinList("Battles for Glory")
Global $pids = ProcessList("Battles for Glory")
Global $offset [6]
Global $baseaddr
$offset [0] = 0
$offset [1] = 0x328
$offset [2] = 0x14C
$offset [3] = 0x54
$offset [4] = 0x34
$offset [5] = 0x224

For $i=1 To $pids [0][0]
    $prohwnd = _MemoryOpen($pids [$i][1])
    $baseaddr [$i] = _MemoryGetBaseAddress($prohwnd,0)
Next
    While 1
        For $i=1 To $hwnd [0][0]
            If $hwnd [$i][1] <> $nottouse Then
                DllCall("BypassedPostmessage.dll","int","myPostMessageA","hwnd",$hwnd [$i][1],"long",$WMKEYDOWN,"long",$key,"long",0)
                $hp = _MemoryPointerRead ($baseaddr [$i],$hwnd,$offset)
                MsgBox(0,"message",""&$hp [1]&"")
                Sleep(10)
            EndIf
        Next
    WEnd

And here is the error that I get:

(32) : ==> Subscript used with non-Array variable.:

$hp = _MemoryPointerRead ($baseaddr [$i],$hwnd,$offset)

$hp = _MemoryPointerRead ($baseaddr ^ ERROR

>Exit code: 1 Time: 1.346

First you need to declare $baseaddrcorrectly, eg

Global $baseaddr[$pids [0][0]]

Then you need to use

$prohwnd[$i] = _MemoryOpen($pids [$i][1])

etc

Then

_MemoryPointerRead ($baseaddr [$i],$hwnd,$offset);you need to pass the handle returned by _MemoryOpen not a window handle.

should be

_MemoryPointerRead ($baseaddr [$i],$prohwnd[$i],$offset[0]); ? I don't have this function so I don't know what the offset parameter should be.

and maybe some other things need correcting.

Maybe you need to study the function definitions more carefully, looking critically at your own code, and search for examples to compare with what you have written. I suspect you need more practice using arrays.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...