Jump to content

Another Riddle...


Recommended Posts

Hi

My script need to read data from local memory adress, i found these adress with Memory Gutter, and now what? Please help, im stuck... :think:

Hi,

maybe you find something here http://www.autoitscript.com/forum/index.php?showtopic=19329

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Thanks for replays

in Autoit help i found something about DllStructCreate....

;=========================================================
;   Create the struct
;   struct {
;      int           var1;
;      unsigned char   var2;
;      unsigned int var3;
;      char         var4[128];
;   }
;=========================================================
$str        = "int;ubyte;uint;char[128]"
$a        = DllStructCreate($str)
if @error Then
    MsgBox(0,"","Error in DllStructCreate " & @error);
    exit
endif

;=========================================================
;   Set data in the struct
;   struct.var1 = -1;
;   struct.var2 = 255;
;   struct.var3 = INT_MAX; -1 will be typecasted to (unsigned int)
;   strcpy(struct.var4,"Hello");
;   struct.var4[0]  = 'h';
;=========================================================
DllStructSetData($a,1,-1)
DllStructSetData($a,2,255)
DllStructSetData($a,3,-1)
DllStructSetData($a,4,"Hello")
DllStructSetData($a,4,Asc("h"),1)

;=========================================================
;   Display info in the struct
;=========================================================
MsgBox(0,"DllStruct","Struct Size: " & DllStructGetSize($a) & @CRLF & _
        "Struct pointer: " & DllStructGetPtr($a) & @CRLF & _
        "Data:" & @CRLF & _
        DllStructGetData($a,1) & @CRLF & _
        DllStructGetData($a,2) & @CRLF & _
        DllStructGetData($a,3) & @CRLF & _
        DllStructGetData($a,4))

;=========================================================
;   Free the memory allocated for the struct
;=========================================================
$a=0

... but when i compile it i got nice **** errors :think:

D:\Program Files\AutoIt3\beta\Examples\Helpfile\DllStructCreate.au3(11,28) : ERROR: DllStructCreate(): undefined function.

$a = DllStructCreate($str)

~~ ~~~~~~~~~~~~~~~~~~~~~~^

D:\Program Files\AutoIt3\beta\Examples\Helpfile\DllStructCreate.au3(25,25) : ERROR: DllStructSetData(): undefined function.

DllStructSetData($a,1,-1)

~~~~~~~~~~~~~~~~~~~~~~~~^

D:\Program Files\AutoIt3\beta\Examples\Helpfile\DllStructCreate.au3(34,59) : ERROR: DllStructGetSize(): undefined function.

MsgBox(0,"DllStruct","Struct Size: " & DllStructGetSize($a)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

D:\Program Files\AutoIt3\beta\Examples\Helpfile\DllStructCreate.au3(35,42) : ERROR: DllStructGetPtr(): undefined function.

"Struct pointer: " & DllStructGetPtr($a)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

D:\Program Files\AutoIt3\beta\Examples\Helpfile\DllStructCreate.au3(37,24) : ERROR: DllStructGetData(): undefined function.

DllStructGetData($a,1)

~~~~~~~~~~~~~~~~~~~~~^

using autoit-v3.1.1.120 beta and SciTE v.1.68 whats wrong? :(

Edited by jinred
Link to comment
Share on other sites

Thanks for replays

in Autoit help i found something about DllStructCreate....

;=========================================================
;   Create the struct
;   struct {
;      int           var1;
;      unsigned char   var2;
;      unsigned int var3;
;      char         var4[128];
;   }
;=========================================================
$str        = "int;ubyte;uint;char[128]"
$a        = DllStructCreate($str)
if @error Then
    MsgBox(0,"","Error in DllStructCreate " & @error);
    exit
endif

;=========================================================
;   Set data in the struct
;   struct.var1 = -1;
;   struct.var2 = 255;
;   struct.var3 = INT_MAX; -1 will be typecasted to (unsigned int)
;   strcpy(struct.var4,"Hello");
;   struct.var4[0]  = 'h';
;=========================================================
DllStructSetData($a,1,-1)
DllStructSetData($a,2,255)
DllStructSetData($a,3,-1)
DllStructSetData($a,4,"Hello")
DllStructSetData($a,4,Asc("h"),1)

;=========================================================
;   Display info in the struct
;=========================================================
MsgBox(0,"DllStruct","Struct Size: " & DllStructGetSize($a) & @CRLF & _
        "Struct pointer: " & DllStructGetPtr($a) & @CRLF & _
        "Data:" & @CRLF & _
        DllStructGetData($a,1) & @CRLF & _
        DllStructGetData($a,2) & @CRLF & _
        DllStructGetData($a,3) & @CRLF & _
        DllStructGetData($a,4))

;=========================================================
;   Free the memory allocated for the struct
;=========================================================
$a=0

... but when i compile it i got nice **** errors :think:

D:\Program Files\AutoIt3\beta\Examples\Helpfile\DllStructCreate.au3(11,28) : ERROR: DllStructCreate(): undefined function.

$a = DllStructCreate($str)

~~ ~~~~~~~~~~~~~~~~~~~~~~^

D:\Program Files\AutoIt3\beta\Examples\Helpfile\DllStructCreate.au3(25,25) : ERROR: DllStructSetData(): undefined function.

DllStructSetData($a,1,-1)

~~~~~~~~~~~~~~~~~~~~~~~~^

D:\Program Files\AutoIt3\beta\Examples\Helpfile\DllStructCreate.au3(34,59) : ERROR: DllStructGetSize(): undefined function.

MsgBox(0,"DllStruct","Struct Size: " & DllStructGetSize($a)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

D:\Program Files\AutoIt3\beta\Examples\Helpfile\DllStructCreate.au3(35,42) : ERROR: DllStructGetPtr(): undefined function.

"Struct pointer: " & DllStructGetPtr($a)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

D:\Program Files\AutoIt3\beta\Examples\Helpfile\DllStructCreate.au3(37,24) : ERROR: DllStructGetData(): undefined function.

DllStructGetData($a,1)

~~~~~~~~~~~~~~~~~~~~~^

using autoit-v3.1.1.120 beta and SciTE v.1.68 whats wrong? :(

If you run it externally (not through Scite), I'm pretty sure you have to have "toggle beta" on. If you run it through Scite, you have to use Beta Run or Beta Compile (Alt+F5 or Alt+F7 respectively).
Link to comment
Share on other sites

ok now i know how to compile scripts under beta ^^, thx

#include <Mem.au3>
Global $xpos
Global $pid
Global $keys
Global $keymem
Global $keymem1

$pid = WinGetProcess(" ")
$keymem = _MemOpen($pid)
$keymem1 = _MemCreate($keymem)
_MemWrite($keymem, 0x00126e20, chr(guictrlread($keys))
MsgBox(262144, guictrlread($keys), Asc(_MemRead($keymem, 0x00126e20)))
_MemClose($keymem)

I have found on forum, working fine... but it's totaly ussles for me, Asc(_MemRead($keymem, 0x00126e20) returns ASCII, i need something like this (just idea):

$xpos = integer returned from (_MemRead($keymem, 0x00126e20)

under 0x00126e20 are stored only integers from 0 to 255

some conversion asc to int ??? eh..stuck again

Edited by jinred
Link to comment
Share on other sites

HI,

doesn't Int(), Chr(), Asc() help you?

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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...