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++]Dumping Memory

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

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Sun Dec 21, 2008 6:11 pm    Post subject: [C++]Dumping Memory Reply with quote

I wrote this little program to dump a process's memory. There's a bug. It will screw up when printing out "0xFF". If the memory contains 0xFF, it prints out 0xFFFFFFFF. I'm thinking the problem is with the printf function, but can anyone help me?

Source attached.



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.

Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Sun Dec 21, 2008 7:06 pm    Post subject: Reply with quote

Yes, it is the printf function. I had the same problem a while back..what i did to solve it was just...

Code:

char buf[2];
char tempone[10];
sprintf(tempone,"%02X",something else was here);
         if (strlen(tempone) != 2)
         strcpy(buf,&tempone[6]);
          else
         strcpy(buf,tempone);


Pretty dumb way..but it worked..haha

Also i think the problem occurs when you have any hex values..
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Sun Dec 21, 2008 7:42 pm    Post subject: Reply with quote

Smartz can I be in your sig list plz Razz
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Sun Dec 21, 2008 8:51 pm    Post subject: Reply with quote

My sig list is all for dumb people..but since you dun liek teh vistarr possibly ! Smile
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Mon Dec 22, 2008 3:43 am    Post subject: Reply with quote

Instead of PCHAR try using unsigned char*. (PCHAR is simply char*)

Or you could simply go to settings -> C\C++ -> default char unsigned: Yes, but I suggest you replacing char with unsigned char.
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