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 


C++ Byte Reading

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Thu Jan 15, 2009 6:25 pm    Post subject: C++ Byte Reading Reply with quote

Okay what im trying to do is, read a certain address, and be able to print out it's bytes in String format. For example :
00400000 : F0 65 00
Btw, its direct memory access.
Any help will be appreciated
Back to top
View user's profile Send private message AIM Address MSN Messenger
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Thu Jan 15, 2009 6:30 pm    Post subject: Reply with quote

Store bytes in a buffer, use memcpy.

Then you can...

Code:

char buffer[2];

for(int i = 0; i < NumberOfBytesToDisplay; i++)
{
sprintf(buffer,"%02X ",memorybuffer[address+i]);
strcat(Bytes,buffer);
}


Bytes now has the bytes in char format. (String or char array)(i know that you use BC++, so just use...String.sprintf function)

also, if you are using regular char's and you are strcat'ing and not strcpy'ing before you do so, make sure you zero the memory, or initialize the buffer of Bytes.
Back to top
View user's profile Send private message
crayzbeef
Expert Cheater
Reputation: 0

Joined: 21 Jan 2007
Posts: 101

PostPosted: Sat Jan 17, 2009 3:36 am    Post subject: Reply with quote

smartz993 wrote:
Store bytes in a buffer, use memcpy.

Then you can...

Code:

char buffer[2];

for(int i = 0; i < NumberOfBytesToDisplay; i++)
{
sprintf(buffer,"%02X ",memorybuffer[address+i]);
strcat(Bytes,buffer);
}


Bytes now has the bytes in char format. (String or char array)(i know that you use BC++, so just use...String.sprintf function)

also, if you are using regular char's and you are strcat'ing and not strcpy'ing before you do so, make sure you zero the memory, or initialize the buffer of Bytes.



Why the hell do people write C - C++ code..
C != C++.
Learning programming through game hacking sure does make people retarded.
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