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 


2 questions, TEXT search Cheatengine --> C++
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Sun Aug 10, 2008 5:56 am    Post subject: Reply with quote

@ slippppppppp
and @ rapion124
ty, both works, but I still get only the number of the word, not the real letters. Sad
Maybe there is a way to "convert" the number into the word?
Back to top
View user's profile Send private message
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Sun Aug 10, 2008 7:59 am    Post subject: Reply with quote

How does it not show a string? Are you using printf()? If you are, use %S or %s (depends on whether your program uses Multi-Byte or Unicode character set).
Back to top
View user's profile Send private message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Sun Aug 10, 2008 8:22 am    Post subject: Reply with quote

I use std::cout to show it.
printf doesnt even work for me:
wchar_t[5] cannot be converted to const char *

my output with cout:
10 bytes read
0012FF54

edit: Ok, I solved my problem.
If some1 is interested, I made it this way:
Code:
WORD buffer[4];
char buf[4];
int i;
ReadProcessMemory (hopen,LPCVOID(0x1EEE65C), LPVOID(&buffer), sizeof(buffer), NULL);
for(i=0;i<5;i++)
{
      buf[i] = buffer[i]
}
std::cout<<buf<<std::endl;
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Aug 10, 2008 11:58 am    Post subject: Reply with quote

redhead wrote:
I use std::cout to show it.
printf doesnt even work for me:
wchar_t[5] cannot be converted to const char *


wprintf_s

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Sun Aug 10, 2008 12:30 pm    Post subject: Reply with quote

redhead wrote:
I use std::cout to show it.
printf doesnt even work for me:
wchar_t[5] cannot be converted to const char *

my output with cout:
10 bytes read
0012FF54

edit: Ok, I solved my problem.
If some1 is interested, I made it this way:
Code:
WORD buffer[4];
char buf[4];
int i;
ReadProcessMemory (hopen,LPCVOID(0x1EEE65C), LPVOID(&buffer), sizeof(buffer), NULL);
for(i=0;i<5;i++)
{
      buf[i] = buffer[i]
}
std::cout<<buf<<std::endl;


You only got the numbers of the word, which is the pointer to the variable not the numbers of the word itself, because you were probably going to output a unicode string with cout. Unicode has it's own methods in the iostream that can be used with unicode variables. For your example you could do:

Code:
wchar_t buffer[5];
ReadProcessMemory( hopen, (BYTE*)0x1EEE65C, &buffer, sizeof(buffer), NULL );

std::wcout << buffer << std::endl;

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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