Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


how can i read text from process with readprocessmemory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
elshabory
Newbie cheater
Reputation: 0

Joined: 02 Mar 2011
Posts: 20

PostPosted: Sun May 29, 2011 10:39 pm    Post subject: how can i read text from process with readprocessmemory Reply with quote

hi all
how can i read text from running game process with readprocessmemory ??
just read it
i want an example in vb6 or in delphi please
say i want to display the sentence " you are good "
and say that value is a green address 40124C
of my process that named test

i read so many tuts in writeprocessmemory
but readprocessmemory are rare specialy in showing text value
so in few words

i want an example for readprocessmemory to get text value in known address

game name = test
text length is 12 char
address 40124c static



please help me if you can
Back to top
View user's profile Send private message
reload01
Advanced Cheater
Reputation: 0

Joined: 22 Oct 2006
Posts: 96

PostPosted: Mon May 30, 2011 2:27 am    Post subject: Reply with quote

Hello, you want to do is very simple. Basically, you have to do is call and specify the size ReadProcessMemory address and data recovery. In your case, the text of the address in your location, and placing 12 + 1 (NUL termination character) in size. You should know that the field size may vary, so you want to find the maximum length of string can becomes call ReadProcessMemory with maximum length and iterate until found NUL character. Good Luck and excellent problem Exclamation
Back to top
View user's profile Send private message
elshabory
Newbie cheater
Reputation: 0

Joined: 02 Mar 2011
Posts: 20

PostPosted: Tue May 31, 2011 7:12 am    Post subject: Reply with quote

OK
THANKS FOR REPLAY

THE CHEAT ENGINE FOLDER CONTAINS A FILE NAMED Tutorial.EXE
IN THE GREAN ADDRESS 4727AC IT HAVE A WORD
THAT WORD IS "WELCOME"

CAN YOU OR ANY ONE GIVE ME AN EXAMPLE FOR DISPLAY THIS WORD
IN TEXTBOX OR IN LABEL OR IN WHATEVER CONTROL ??

BY USING READPROCESSMEMORY
IN VB OR DELPHI PLEASE



Tutorial.CT
 Description:

Download
 Filename:  Tutorial.CT
 Filesize:  93 Bytes
 Downloaded:  804 Time(s)

Back to top
View user's profile Send private message
Krähne
Expert Cheater
Reputation: 0

Joined: 06 Jun 2010
Posts: 108
Location: Inside of my Kernel

PostPosted: Tue May 31, 2011 1:18 pm    Post subject: Reply with quote

elshabory wrote:
OK
THANKS FOR REPLAY

THE CHEAT ENGINE FOLDER CONTAINS A FILE NAMED Tutorial.EXE
IN THE GREAN ADDRESS 4727AC IT HAVE A WORD
THAT WORD IS "WELCOME"

CAN YOU OR ANY ONE GIVE ME AN EXAMPLE FOR DISPLAY THIS WORD
IN TEXTBOX OR IN LABEL OR IN WHATEVER CONTROL ??

BY USING READPROCESSMEMORY
IN VB OR DELPHI PLEASE


VB6 or .NET?

_________________
Excuse me if you don't understand what I just said, but "english" isn't my native language.
Back to top
View user's profile Send private message MSN Messenger
elshabory
Newbie cheater
Reputation: 0

Joined: 02 Mar 2011
Posts: 20

PostPosted: Tue May 31, 2011 2:24 pm    Post subject: Reply with quote

vb6 or delphi please
Back to top
View user's profile Send private message
Krähne
Expert Cheater
Reputation: 0

Joined: 06 Jun 2010
Posts: 108
Location: Inside of my Kernel

PostPosted: Tue May 31, 2011 6:21 pm    Post subject: Reply with quote

elshabory wrote:
vb6 or delphi please


VB6:

Well, declare the API ReadProcessMemory, blah blah... and convert the buffer that returns ReadProcessMemory.

Code:
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)

Function ByteArrayToString(bytes As String, Length As Long) As String
    Dim retValStr As String
    retValStr = String(Length - 1, Chr$(0))
    CopyMemory ByVal StrPtr(retValStr), ByVal bytes, Length * 2
    ByteArrayToString = retValStr
End Function


Hope it help you.

_________________
Excuse me if you don't understand what I just said, but "english" isn't my native language.
Back to top
View user's profile Send private message MSN Messenger
extra
Newbie cheater
Reputation: 0

Joined: 29 May 2011
Posts: 10

PostPosted: Tue May 31, 2011 10:23 pm    Post subject: Reply with quote

Krähne wrote:
elshabory wrote:
vb6 or delphi please


VB6:

Well, declare the API ReadProcessMemory, blah blah... and convert the buffer that returns ReadProcessMemory.

Code:
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)

Function ByteArrayToString(bytes As String, Length As Long) As String
    Dim retValStr As String
    retValStr = String(Length - 1, Chr$(0))
    CopyMemory ByVal StrPtr(retValStr), ByVal bytes, Length * 2
    ByteArrayToString = retValStr
End Function


Hope it help you.


you know ?? in most cases the problem is in the decleration blah blah Very Happy
this function failes at most cases with the wrong decleration
so please give us full stuf master
Back to top
View user's profile Send private message
elshabory
Newbie cheater
Reputation: 0

Joined: 02 Mar 2011
Posts: 20

PostPosted: Fri Jun 03, 2011 11:58 pm    Post subject: Reply with quote

any idea ??
this function alwayes fail when reading text

i need a working example
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Tue Jun 07, 2011 5:38 am    Post subject: Reply with quote

Heres a simple code you can try to convert. Not complete so you can convert it easier. It'l still work though.
Code:
        public string ReadAscii(string ProcName, int pAddress, int pSize)
        {
            System.Diagnostics.Process[] P = System.Diagnostics.Process.GetProcessesByName(ProcName);
            byte[] buffer = new byte[pSize * 2];
            try
            {
                if (ReadProcessMemory((int)P[0].Handle, pAddress, buffer, pSize * 2, 0))
                    return System.Text.Encoding.ASCII.GetString(buffer);
            }
            catch { return ""; }
            return "";
        }

And for Unicode string
change
Code:
return System.Text.Encoding.ASCII.GetString(buffer);

to
Code:
return System.Text.Encoding.Unicode.GetString(buffer);

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites