AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ReadProcessMemory / WriteProcessMemory
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Purple
Guest





PostPosted: Sat Dec 08, 2007 9:04 am    Post subject: Question. Reply with quote

Alright i have a silly question/problem and I hope 1 of you AHK guru's can help me out.

Im trying to read memory from a game but I came across 1 problem.
This is my code
Code:

;read the address from an ini so you dont have to change the code everytime
IniRead, char, C:/myfile.ini, Test, Address
;feed the Address to the var lpszTitle
lpszTitle = %Address%
;the var that will store the result
teststr =
;the loop to move from eash byte
Loop
{
   ReadProcessMemory, char, %lpszTitle%, ahk_id, [Conquer 2.0]
; the first byte is stored on the variable char
; If the value of the byte read is zero we are at the end of the string.
   ; So quit the loop!   
   if char = 0
   {
      break
   }
   
   ; Transform the obtained byte's value to a character and save it in char again
   Transform, char, Chr, %char%
   
   ; Append the character to our teststr variable that will hold the whole title string
   teststr = %teststr%%char%
   
   ; Increment address by one to obtain next byte
   lpszTitle++
}
;display the value
Msgbox, %teststr%


Now I dont now if theres a problem within the code or anything, it just keeps running in a loop it doesnt quit or anything but no messagebox showed up.

this is what my ini file exists of:
Code:

[Test]
Address=&h4E1CEC


Now i know that is the correct memory address but i dont know if AHK can read it like that.
If someone can help me solve this Id be very thankfull Razz
Back to top
stekkie



Joined: 09 Nov 2007
Posts: 16

PostPosted: Sun Dec 09, 2007 4:12 pm    Post subject: Reply with quote

If we could writeprocessmemory we will get hackers to ahk
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Sun Dec 09, 2007 4:44 pm    Post subject: Reply with quote

stekkie wrote:
If we could writeprocessmemory we will get hackers to ahk
They're already here... Wink
Back to top
View user's profile Send private message Visit poster's website
Thalon



Joined: 12 Jul 2005
Posts: 640

PostPosted: Mon Dec 10, 2007 10:41 am    Post subject: Reply with quote

stekkie wrote:
If we could writeprocessmemory we will get hackers to ahk
@stekkie
WriteProcessMemory is a simple DllCall. If a hacker isn't able to achive this he isn't a hacker Wink
Writing to foreign memory with AHK is really simple and does work like a charm Wink

@Purple
Did you try to strip "&h" of the address?
And why do you feed lpszTitle with an empty variable?
With the IniRead you set the value from ini-file to variable "char", but in next code-line you do use the variable "Address"!

Seems to be some copy-paste error...

For further debugging:
It does help to set messageboxes in the code which will show the content of variables.
This way you can get shure that the correct value is used in the function.

Thalon
_________________
AHK-Icon-Changer
AHK-IRC
deutsches Forum
SacredVault
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group