Jump to content

Memory editing


Recommended Posts

I searched the forums over and over and wasnt able to find information on this topic... if there is allredy info plz leave a link for me to follow.... i was wondering if AutoIt is able to read/write memory address into a running exe. i seearched the help file and couldnt find anything useful. plz reply ... ty

Link to comment
Share on other sites

W0uter's memory funtions may help you.

http://www.autoitscript.com/forum/index.php?showtopic=19329

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Link to comment
Share on other sites

sry i do not beleive this is what im looking for, what im looking for is for example: i use Tsearch to locate a memory address in an exe, lets say the value of the address im looking for changes to below a targt number like 500, i would like autoit to be able to detect that the value of this address has decreased and then have autoit perform a function after that.

Link to comment
Share on other sites

I'm not an expert in using memory stuff

But seems to me that what you want to do is like:

#include <_Mem.au3>

$Process = ProcessExists("PROCESSNAME.EXE")
If $Process = 0 Then
     MsgBox(16, "Error", "The process doesn't exists!")
     Exit
EndIf

$Address = 0x00000000
$Handle = _MemOpen($Process)
$Value = _MemRead($Handle, $Address)

While 1
     If _MemRead($Handle, $Address) < $Value Then
          YourFunctionHere()
     EndIf
WEnd

Func YourFucntionHere()
     _MemWrite($Handle, $Address, $Value)
EndFunc

I just wrote this, i didn't test it.

Hope it helps.

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Link to comment
Share on other sites

sorry for bringing this old topic back up, but ive been gone for a couple days. I noticed at the top u have an include for a file named _Mem.au3...... i do not have this file in my "C:\Program Files\AutoIt3\Include" directory, do i need to download some extras from somewhere, sorry fo rbeing so n00b.

Link to comment
Share on other sites

  • Moderators

sorry for bringing this old topic back up, but ive been gone for a couple days. I noticed at the top u have an include for a file named _Mem.au3...... i do not have this file in my "C:\Program Files\AutoIt3\Include" directory, do i need to download some extras from somewhere, sorry fo rbeing so n00b.

He gave you the link to it in post 2, look at the function calls and look at the 1st post.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

ok.... am i i sopposed to be editing the _Mem.au3 in any way because when i run the program i get this list of errors:

C:\Program Files\AutoIt3\Include\_Mem.au3(18,52) : ERROR: DllStructCreate(): undefined function.

Local $v_Struct = DllStructCreate('byte[1]')

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

C:\Program Files\AutoIt3\Include\_Mem.au3(22,140) : ERROR: DllStructGetPtr(): undefined function.

$v_Ret = DllCall($ah_Mem[0], 'int', 'ReadProcessMemory', 'int', $ah_Mem[1], 'int', $i_Address, 'ptr', DllStructGetPtr($v_Struct)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

C:\Program Files\AutoIt3\Include\_Mem.au3(23,51) : ERROR: DllStructGetData(): undefined function.

$v_Ret = DllStructGetData($v_Struct, 1)

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

C:\Program Files\AutoIt3\Include\_Mem.au3(41,177) : ERROR: DllStructGetSize(): undefined function.

Local $av_Call = DllCall($ah_Mem[0], 'int', 'WriteProcessMemory', 'int', $ah_Mem[1], 'int', $i_Address, 'ptr', DllStructGetPtr($v_Inject), 'int', DllStructGetSize($v_Inject)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

C:\Program Files\AutoIt3\Include\_Mem.au3(62,59) : ERROR: DllStructSetData(): undefined function.

DllStructSetData($v_Helper, 1, Asc($1[$i]), $i)

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

Link to comment
Share on other sites

You must have AutoIt Beta or the new stable 3.2 release.

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Link to comment
Share on other sites

ah im n00b, i shudnt have posted so soon, because righ tafter i posted i searched for the commands in my error and found that i had to download the beta, thanks for repling so quikly tho.

now the code is working.. with one small problem

#include <_Mem.au3>

$Process = ProcessExists("knightonline.exe")
If $Process = 0 Then
     MsgBox(16, "Error", "The process doesn't exists!")
     Exit
EndIf

$Address = 0x1D0CC00
$Handle = _MemOpen($Process)
$Value = _MemRead($Handle, $Address)

While 1
     If _MemRead($Handle, $Address) < 250 Then
          Call("Pot")
     EndIf
WEnd

Func Pot()
     Send("{5 down}")
     Sleep(100)
     Send("{5 up}")
     Sleep(1500)
EndFunc

i want the func Pot to be called when the Value of the address goes down below 250.

problem is ... the $value variable isnt returning a number, but its returning a "True".

how do i make autoit Read the Address's value?

Edited by ragnarok775
Link to comment
Share on other sites

_MemRead should do this. I don't see any problem. You may want to PM w0uter and ask him.

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

Link to comment
Share on other sites

_MemRead should do this. I don't see any problem. You may want to PM w0uter and ask him.

the problem is, my original post said i need autoit to detect if the value of an address has gone below a set number, and the code given to me does not do that.

i appreciate the help VERRY much and i will pm w0uter to see if he has suggestions.

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