AutoHotkey Community

It is currently May 27th, 2012, 10:47 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Question.
PostPosted: December 8th, 2007, 10:04 am 
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 :P


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2007, 5:12 pm 
Offline

Joined: November 9th, 2007, 7:48 pm
Posts: 16
If we could writeprocessmemory we will get hackers to ahk


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2007, 5:44 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
stekkie wrote:
If we could writeprocessmemory we will get hackers to ahk
They're already here... ;)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2007, 11:41 am 
Offline

Joined: July 12th, 2005, 1:21 pm
Posts: 633
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 ;)
Writing to foreign memory with AHK is really simple and does work like a charm ;)

@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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3

All times are UTC [ DST ]


Who is online

Users browsing this forum: sks and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group