RiCK_420_333 Posted August 15, 2008 Posted August 15, 2008 (edited) Here's some code i'm working with, trying to get it to read some text from memory. It should read any memory, but I am specifically trying to retrieve the Artist and Song name from Virtual DJ. These are the memory addresses I found the info in: A510F0, A51170, AC7568, AC75E8 I think they need to be in hex format like below: Const $MemoryAddressLeftDeckArtist = 0x00A510F0 Const $MemoryAddressLeftDeckSong = 0x00A51170 Const $MemoryAddressRightDeckArtist = 0x00AC7568 Const $MemoryAddressRightDeckSong = 0x00AC75E8 Here's my script: expandcollapse popup;; ---------------------------------------------------------------------------- ; ; Author: ; RiCK ; Script Function: ; Memory Tool ; ; ---------------------------------------------------------------------------- #include <array.au3> #include <string.au3> #include <file.au3> #include <NomadMemory.au3> #NoTrayIcon $g_szVersion = "Memory Tool 0.1" If WinExists($g_szVersion) Then Exit ; It's already running AutoItWinSetTitle($g_szVersion) AutoItSetOption( "GUIOnEventMode", 1 ) SetPrivilege("SeDebugPrivilege", 1) ; ^ Ctrl ! Alt + Shift # Win Global $CloseGUI $Form1 = GUICreate($g_szVersion, 200, 200, 800, 500, -1, -1) $LabelPID = GUICtrlCreateLabel ("Running Process Name: ", 5, 5) $InputPID = GUICtrlCreateInput("", 5, 20, 100) GUICtrlSetData($InputPID, "VirtualDJ") $Check = GUICtrlCreateButton("Check", 33, 60, 100) GUICtrlSetOnEvent($Check, "Check") $Exit = GUICtrlCreateButton("Exit", 125, 18, 50) GUICtrlSetOnEvent($Exit, "MyExit") $Label1 = GUICtrlCreateLabel ("Memory Address (HEX): ", 50, 100) $Input1 = GUICtrlCreateInput("", 5, 125, 150) GUICtrlSetData($Input1, "0x00A510F0") $Label2 = GUICtrlCreateLabel ("Data Type: ", 50, 150) $Input2 = GUICtrlCreateInput("", 5, 175, 150) GUICtrlSetData($Input2, "'Char[16]'") GUISetState(@SW_SHOW) ; Run the GUI until the dialog is closed While 1 If $CloseGUI = "CLOSE" Then ExitLoop sleep(10) Wend Func Check() ;Const $MemoryAddressLeftDeckArtist = 0x00A510F0 ;Const $MemoryAddressLeftDeckSong = 0x00A51170 ;Const $MemoryAddressRightDeckArtist = 0x00AC7568 ;Const $MemoryAddressRightDeckSong = 0x00AC75E8 $TheInput = GUICtrlRead($InputPID) $pid = WinGetProcess($TheInput) MsgBox(0, "PID: ", $pid) $OpenProcess = _MemoryOpen($pid) If @error = 0 Then $error = 'No error.' ElseIf @error = 1 Then $error = 'Invalid $iv_Pid.' ElseIf @error = 2 Then $error = 'Failed to open Kernel32.dll.' ElseIf @error = 3 Then $error = 'Failed to open the specified process.' EndIf If $error <> 'No error.' Then MsgBox(0, "@error: ", $error) ;MsgBox(0, "Open Process: ", $OpenProcess[0]) ;MsgBox(0, "Open Process: ", $OpenProcess[1]) ;MsgBox(0, "Open Process: ", $OpenProcess) $TheInput1 = GUICtrlRead($Input1) $TheInput2 = GUICtrlRead($Input2) $Read = _MemoryRead($TheInput1, $OpenProcess, $TheInput2) _MemoryClose($OpenProcess) MsgBox(0, "Contents: ", $Read) EndFunc Func MyExit() Exit EndFunc For some reason, everything I try, _MemoryRead will only Return "0" and not any actual data text. Can anyone see an error I have made, or is this some error in Nomad's _Memory.au3 ? I have also tried this with the lastest beta and several stable versions, all with the same outcome. Edited August 15, 2008 by RiCK_420_333
Andreik Posted August 15, 2008 Posted August 15, 2008 Anyone got any suggestions for me PLEASE!???Wait and if somebody know surely will post the answer.
Dampe Posted August 15, 2008 Posted August 15, 2008 You need to set the privilege to a debug level so you can read from the process memory.
RiCK_420_333 Posted August 15, 2008 Author Posted August 15, 2008 You need to set the privilege to a debug level so you can read from the process memory.Did that w/ SetPrivilege("SeDebugPrivilege", 1)Also used PermEdit to do it manually, same result
RiCK_420_333 Posted August 15, 2008 Author Posted August 15, 2008 I Updated my code in the first post, I c\found a couple errors and got the script a lil further along, so now it at least gets the right PID, however the _MemoryRead still give me only a "0". Still would like someone to review my code and offer suggestions, thanks very much!
RiCK_420_333 Posted August 15, 2008 Author Posted August 15, 2008 Aww, still no one has offered me any helpful advice? I know working with memory may be a complex thing, but someone must have some experience with it? If anyone can, please help. Thank you!!
RiCK_420_333 Posted August 15, 2008 Author Posted August 15, 2008 If anyone knows anything about how to successfully use _MemoryRead please see my post below. Sorry I dont know how to get my post back to the current new posts, and its no longer showing up.http://www.autoitscript.com/forum/index.ph...mp;#entry566247
Developers Jos Posted August 15, 2008 Developers Posted August 15, 2008 (edited) Please stop making these "impatient" posts. If people can and want to help they will... Threads merged and lets stick to this one now. Jos Edited August 15, 2008 by Jos SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past.Â
RiCK_420_333 Posted August 15, 2008 Author Posted August 15, 2008 Please stop making these "impatient" posts.If people can and want to help they will...Threads merged and lets stick to this one now.JosI didnt make impatient post, The first post was from early morning, and I went to sleep since then and woke back up, how is that being impatient?
dbzfanatic Posted August 15, 2008 Posted August 15, 2008 Between the two most recent posts (not counting the one above this) there was a five minute gap. That seems very impatient to ALL of us. Double and triple posting are frowned upon as well. You simply need to wait for someone with the interest and knowledge to see your thread and help. If you're that worried simply make sure you get email alerts when a new reply is posted. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
Developers Jos Posted August 15, 2008 Developers Posted August 15, 2008 I didnt make impatient post, The first post was from early morning, and I went to sleep since then and woke back up, how is that being impatient?How do you call creating a new thread to seek attention for a just bumped thread?I call that impatient and is not appreciated here. SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past.Â
RiCK_420_333 Posted August 15, 2008 Author Posted August 15, 2008 Between the two most recent posts (not counting the one above this) there was a five minute gap. That seems very impatient to ALL of us. Double and triple posting are frowned upon as well. You simply need to wait for someone with the interest and knowledge to see your thread and help. If you're that worried simply make sure you get email alerts when a new reply is posted.Yes but it was posted to 2 seperate topics, the only reason they are in the same one now is cuz that mod guy merged them. Also I explained why, because I didnt know how to get my question back on the list, and still dont know how, so if someone could explain that?
RiCK_420_333 Posted August 15, 2008 Author Posted August 15, 2008 How do you call creating a new thread to seek attention for a just bumped thread?I call that impatient and is not appreciated here.Well I refreshed and it didn't seem to bump it for me, so I thought it was not on the list. No need to get mean about it, not everyone has as much experience on this forum as you do.
Developers Jos Posted August 15, 2008 Developers Posted August 15, 2008 Yes but it was posted to 2 seperate topics, the only reason they are in the same one now is cuz that mod guy merged them. Also I explained why, because I didnt know how to get my question back on the list, and still dont know how, so if someone could explain that?Keep going like this and you will get some time off from these forums as you are getting to be pretty annoying.Why do you think THIS MOD GUY merged your posts? Because you are creating multiple threads on the same subject just because you are impatient. SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past.Â
dbzfanatic Posted August 15, 2008 Posted August 15, 2008 I don't mean to sound rude but if you can't figure out something like being able to see your question which is clearly visible in the forum then perhaps scripting and programming aren't for you. Yes, reading memory is a bit of a tricky thing to do but when asking for help you simply need to be patient. Have you tried going to the author's thread and reading the posts there? Perhaps you could find an answer or some documentation as to why it would return a 0. There is also a good chance that the memory is dynamic so keep that in mind as well. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
RiCK_420_333 Posted August 15, 2008 Author Posted August 15, 2008 Keep going like this and you will get some time off from these forums as you are getting to be pretty annoying.Why do you think THIS MOD GUY merged your posts? Because you are creating multiple threads on the same subject just because you are impatient.OK point taken, I'm sorry you see me annoying, same could be said about you, however I'm just trying to be friendly, and get a lil help with some code. Not trying to cause a fight.
RiCK_420_333 Posted August 15, 2008 Author Posted August 15, 2008 Can someone tell me how to delete my Post, cuz it's gone way off topic now, and maybe I should start it over from scratch? Anyone agree or disagree with that? I don't want to get in trouble for making a mistake again.
Developers Jos Posted August 15, 2008 Developers Posted August 15, 2008 (edited) OK point taken, I'm sorry you see me annoying, same could be said about you, however I'm just trying to be friendly, and get a lil help with some code. Not trying to cause a fight.So you think I am annoying because you seems to have an issue understand a clear message given.Whatever . Edited August 15, 2008 by Jos SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past.Â
RiCK_420_333 Posted August 15, 2008 Author Posted August 15, 2008 (edited) I don't mean to sound rude but if you can't figure out something like being able to see your question which is clearly visible in the forum then perhaps scripting and programming aren't for you. Yes, reading memory is a bit of a tricky thing to do but when asking for help you simply need to be patient. Have you tried going to the author's thread and reading the posts there? Perhaps you could find an answer or some documentation as to why it would return a 0. There is also a good chance that the memory is dynamic so keep that in mind as well.Yes i have read that authors post many times, however he doesn't ever tell you how to use his script, he only says: "If you don't know how to use it, it's not for you" lol which is not very helpful at all!!!However I have already written 8 other programs with Autoit, so I'm not a complete imbecile.I have just never used the _MemoryRead function before.Also the memory i am trying to read IS NOT dynamic, i have closed the program, and rebooted, and reloaded it, and the memory is still using the same location, so i'm sure its a static location. But thanks for that suggestion. Edited August 15, 2008 by RiCK_420_333
dbzfanatic Posted August 15, 2008 Posted August 15, 2008 Then simply go through his code yourself. That is usually the best way to understand something, reverse engineering. Take the code apart mentally and figure out what each bit does then you'll understand its usage. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
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