Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 16:01

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Question About Autoit WriteAndRead Memory Data

Discussion on Question About Autoit WriteAndRead Memory Data within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
Chriko2502's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 39
Received Thanks: 1
Question About Autoit WriteAndRead Memory Data

Hi out there,

hope u can help me and also hopefully this is the right section....

I wanted to make an easy to use script/programm for people to display a lot of stuff from GW2, like memory adresses, their values, etc...

i tried to translate my c++ code into Autoit, because i think more people will understand this and i didn't want to make my complete source public...

but i failed @ memory writing and reading
See Source... I dindt know why i will not work -.- patterns and so on are ok...

Hope u can help me at the start with reading and writing memory with Autoit so that i can finish my work. One example (perhaps with attached code) would be nice!

THX Chriko2502
Attached Files
File Type: zip TestAdressScan.zip (4.8 KB, 38 views)
Chriko2502 is offline  
Old 05/23/2013, 00:10   #2
 
elite*gold: 0
Join Date: Apr 2013
Posts: 21
Received Thanks: 2
For memory reading in Autoit - use for example NomadMemory. There are others as well - just try them out.
sitapea1337 is offline  
Old 05/23/2013, 08:25   #3
 
Chriko2502's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 39
Received Thanks: 1
Quote:
Originally Posted by sitapea1337 View Post
For memory reading in Autoit - use for example NomadMemory. There are others as well - just try them out.
Yeah i tried but it didnt work and i dont know why Look @ attached files...
Whats wrong?!

Code:
Global Const $aProcessname = "gw2.exe"

Global Const $BasePattern = "\xD9\x85\x78\xFF\xFF\xFF\xD8\x65\xCC\x8B\x15"
Global Const $BaseMask = "xxxxxxxxxxx"
Global Const $BaseOffset = 0x11

Global $HPID =_MemoryOpen(ProcessExists($aProcessname))
Global $Base = _MemoryScanEx($HPID,$BasePattern,$BaseMask) + 0x104 - 0x400000

Global Const $Offset_PosX[4] = [Dec("44"), Dec("1C"), Dec("5C"), Dec("B4")]
Global Const $Offset_PosY[4] = [Dec("44"), Dec("1C"), Dec("5C"), Dec("B8")]
Global Const $Offset_PosZ[4] = [Dec("44"), Dec("1C"), Dec("88"), Dec("D8")]

Global Const $Offset_Speed[4] = [Dec("44"), Dec("1C"), Dec("5C"), Dec("114")]


MsgBox(0, "Basepointer", StringFormat("%x", $Base))


$ValueCoordX = _MemoryPointerRead ((0x400000 + $Base), $HPID, $Offset_PosX, "float")
MsgBox(0, "$ValueCoordX: ", "$ValueCoordX: " + $ValueCoordX)


$SpeedValue = 100
_MemoryPointerWrite ((0x400000 + $Base), $HPID, $Offset_Speed, $SpeedValue, "float")
Chriko2502 is offline  
Thanks
1 User
Old 05/23/2013, 10:38   #4


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
NomadMemory.au3:

Code:
$ProcessId = ProcessExists("Gw2.exe")
$hProcess = _MemoryOpen($ProcessId)

$val = _MemoryRead($address, $hProcess,  'dword')
_MemoryWrite($address, $hProcess, $val + 1000, 'dword')

_MemoryClose($hProcess)
I wouldn't use the pointer functions. Rather write your own ReadPtrChain

For finding patterns you can use this function.
I'm not the author of this function, thus the credits go to "Luzifer42" !

Code:
Func FindPattern($ah_Handle, $pattern, $after = False, $iv_addrStart = 0x00400000, $iv_addrEnd = 0X00FFFFFF, $step = 51200)
	If Not IsArray($ah_Handle) Then
		SetError(1)
		Return -1
	EndIf
	$pattern = StringRegExpReplace($pattern, "[^0123456789ABCDEFabcdef.]", "")
	If StringLen($pattern) = 0 Then
		SetError(2)
		Return -2
	EndIf
	For $addr = $iv_addrStart To $iv_addrEnd Step $step - (StringLen($pattern) / 2)
		StringRegExp(_MemoryRead($addr, $ah_Handle, "byte[" & $step & "]"), $pattern, 1, 2)
		If Not @error Then
			If $after Then
				Return StringFormat("0x%.8X", $addr + ((@extended - 2) / 2))
			Else
				Return StringFormat("0x%.8X", $addr + ((@extended - StringLen($pattern) - 2) / 2))
			EndIf
		EndIf
	Next
	Return -3
EndFunc   ;==>FindPattern
Heres another thing. Guildwars is devided into classes, obviously. When reading/writing to for example the speed address, you are right now reading the entire pointer chain.

Instead, you should just read it once (ChContext->Character->Agent->World->EntityInWorld->Speed)
and save the Character from it. The next time when attempting to write to the speed address, you want to check whether the Character has changed. If so, just read the entire ptr chain again.

I noticed that you are reading your "Base" + 44h. Your base obviously holds a ptr to your current character, because 44h is for Agent and Agent+1Ch is World.

So, just check whether the value of your Base has changed.

AutoIT is slow as fuck and i really recommend doing that.
Just my 2 cents
buFFy! is offline  
Old 05/23/2013, 11:00   #5


 
elite*gold: 1091
Join Date: Jun 2007
Posts: 19,836
Received Thanks: 7,180
Arrow GW2 Main - Discussions / Questions -> AutoIt

#moved
Mostey is offline  
Reply


Similar Threads Similar Threads
Autoit Memory Region
09/12/2012 - AutoIt - 4 Replies
Hey gibt es eine Udf mit der es möglich ist, die Informationen der Memory Regions eines Prozesses auszulesen? Bei Cheat engine gibt es ja die Funktion. Müsste das in Autoit machen.
AutoIT Memory 2
04/23/2012 - AutoIt - 2 Replies
Kann mir wer die Memory 2 schicken also ihr wisst schon # include Memory 2 das ding =)
[AutoIt] Memory Aimbot.
09/06/2010 - AutoIt - 6 Replies
-
[Question] Autoit Memory
06/04/2008 - Conquer Online 2 - 7 Replies
Hey everyone, I just started learning about how to do memory in AutoIt. I made this simple script but for some reason would not work. ------CODE START---------- #Include<NomadMemory.au3> $ProcessID = WinGetProcess("","") $DllInformation = _MemoryOpen($ProcessID) $CharName=_MemoryOpen(0x56BC64,$DllInformation)



All times are GMT +1. The time now is 16:01.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.