Zer0Velocity Posted January 18, 2009 Share Posted January 18, 2009 Hey all, I have a little problem with reading from the memory of a program. The actual data I want from this app changes the address every time new data occurs within the program which means a new address ID. So I was wondering if there was a way to use just part of the Hex code from 2220613D22 -> 2220793D22 which is always the same. So returns anything in between those numbers? Thanks for any help. Link to comment Share on other sites More sharing options...
Zer0Velocity Posted January 18, 2009 Author Share Posted January 18, 2009 Please someone help me with this Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 18, 2009 Moderators Share Posted January 18, 2009 Please someone help me with this Have a little respect for the forum and don't bump your thread within 24 hours of your last post. You're using 10 char Hex? Since your question is in pseudo, I'll do the same with code: For $i = 61 To 79 _MemRead(.... Dec("20" & $i & "3D22")) Next 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 More sharing options...
Zer0Velocity Posted January 18, 2009 Author Share Posted January 18, 2009 I have used the following code but seem to have another slight problem, hopefully someone can help. What I want to do is search all addresses as the addresses always changing so need to search the whole memory. Here is the code currently not working with $id var. For $id = Dec("00000000") to ("99999999") Next For $i = 61 To 79 _MemoryRead($id Dec("20" & $i & "3D22")) Next If @Error Then MsgBox(4096, "ERROR", "Failed to read memory.") Exit EndIf Next Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 18, 2009 Moderators Share Posted January 18, 2009 (edited) I have used the following code but seem to have another slight problem, hopefully someone can help. What I want to do is search all addresses as the addresses always changing so need to search the whole memory. Here is the code currently not working with $id var. For $id = Dec("00000000") to ("99999999") Next For $i = 61 To 79 _MemoryRead($id Dec("20" & $i & "3D22")) Next If @Error Then MsgBox(4096, "ERROR", "Failed to read memory.") Exit EndIf NextThat cannot be the code you're using? It would hard crash! Edit: And now you're changing things, first it was a specific address (or was that the value?) ... now you want to search the entire memory? I am actually working on something similar in another (lower) language. It takes a bit of time in that to search a processes entire memory there, I can't imagine what it would take in Autoit. Edited January 18, 2009 by SmOke_N 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 More sharing options...
Zer0Velocity Posted January 18, 2009 Author Share Posted January 18, 2009 That cannot be the code you're using? It would hard crash!Edit:And now you're changing things, first it was a specific address (or was that the value?) ... now you want to search the entire memory? I am actually working on something similar in another (lower) language. It takes a bit of time in that to search a processes entire memory there, I can't imagine what it would take in Autoit.Yeah I need to search the whole memory for a specific value so 2220613D22 -> 2220793D22 would return whats in between those 2 codes. like for this it would start at " a=" and end at " y=" and return " a=Zer0Velocity" " y="Hopefully this is a bit more understandable Link to comment Share on other sites More sharing options...
Zer0Velocity Posted January 19, 2009 Author Share Posted January 19, 2009 expandcollapse popup;====================================================================== ; AutoIt Version: 3.1.127 (beta) ; Language: English ; Platform: Win9x/NT or newer ; Author: Nomad ; Requirements: ; This function will only work with beta and my _Mem() functions. ;====================================================================== ; Purpose: ; A demonstration of how to use my Mem() functions. ; This script returns a Diablo II player's name. ;====================================================================== ; Additional: ; Please remember to credit accordingly for any use of this script. ;====================================================================== ;################################## ;Include my Mem() functions ;################################## #include <MadMemory.au3> ;################################## ;Get the process ID. ;If you get an incorrect reading, ;then you may need administrative ;rights enabled. ;################################## Opt("WinTitleMatchMode", 4) Global $ProcessID = WinGetProcess("ClassName=GFX_INT_DLG_WINDOW_MAIN_PrimaPokerNetwork","") If $ProcessID = -1 Then MsgBox(4096, "ERROR", "Failed to detect process.") Exit EndIf #cs run this to check if you have administrative rights. If Not IsAdmin() Then Msgbox(4096, "Administrative Rights", "You do not have administrative rights.") EndIf #ce ;################################## ;Call the function for reading ;your current strength. ;################################## $PlayerName = Read_Diablo_Memory () MsgBox(4096, "Name", $PlayerName) Exit ;################################## ;Function ;################################## Func Read_Diablo_Memory () ;################################## ;Define Local Variables ;################################## Local $Value ;################################## ;Open the Diablo II process using ;the Process ID retrieved from ;ProcessExists above. ;################################## Local $DllInformation = _MemoryOpen($ProcessID) If @Error Then MsgBox(4096, "ERROR", "Failed to open memory.") Exit EndIf ;################################## ;Read the process and get the ;players name. ;################################## While 1 For $id2 = Dec("16F7D31D") To Dec("16F7D525") $memread = _MemoryRead($id2, $DllInformation, 'char[18]') MsgBox(4096, "Char", $memread) Next WEnd ;########################################## ; Working Example. ;While 1 ;For $id2 = Dec("06425900") To Dec("06425918") ; $memread = _MemoryRead($id2, $DllInformation, 'char[8]') ; MsgBox(4096, "Got1", $memread) ;Next ;WEnd ;########################################## If @Error Then MsgBox(4096, "ERROR", "Failed to read memory.") Exit EndIf ;################################## ;Close the process. ;################################## _MemoryClose($DllInformation) If @Error Then MsgBox(4096, "ERROR", "Failed to close memory.") Exit EndIf ;################################## ;Return the name value. ;################################## Return $Value EndFunc Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now