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 


[help]RPM array of bytes

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

Joined: 09 Jan 2008
Posts: 84

PostPosted: Fri May 09, 2008 9:12 am    Post subject: [help]RPM array of bytes Reply with quote

*sighs i've been doing this for long and i couldn't get it to work.
Code:

BYTE Bmamo = { 0xBA, 0xD4, 0x59, 0x6F, 0x75 };
BYTE BTest[sizeof(Bmamo)];
ReadProcessMemory( hTarget, (void*)0x00B411D4, (void*)&BTest[0], sizeof(BTest), NULL );
if( BTest == Bmamo ) // check if they are equal
   {
        //SUCCESS!!! i want to get in here but still no LUCK!!!
   }

_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Fri May 09, 2008 9:27 am    Post subject: Reply with quote

What value did ReadProcessMemory return? (Or GetLastError for that matter)
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Fri May 09, 2008 10:12 am    Post subject: Reply with quote

you need to initialize the array BTest with a real number and dont use []'s in the API because that only sets the 1st BYTE.
Back to top
View user's profile Send private message MSN Messenger
haha01haha01
Grandmaster Cheater Supreme
Reputation: 0

Joined: 15 Jun 2007
Posts: 1233
Location: http://www.SaviourFagFails.com/

PostPosted: Fri May 09, 2008 10:17 am    Post subject: Reply with quote

noz3001 wrote:
you need to initialize the array BTest with a real number and dont use []'s in the API because that only sets the 1st BYTE.

i hate the intialize variable thingy, it fucked my programs so many times...
y cant it just init itself -_-
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Fri May 09, 2008 10:41 am    Post subject: Reply with quote

noz3001 wrote:
you need to initialize the array BTest with a real number and dont use []'s in the API because that only sets the 1st BYTE.

Using []'s won't only set the first byte I think, it doesn't matter. It will just set the amount of bytes it has read. So also initializing it shouldn't matter.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Fri May 09, 2008 11:09 am    Post subject: Reply with quote

tombana wrote:
noz3001 wrote:
you need to initialize the array BTest with a real number and dont use []'s in the API because that only sets the 1st BYTE.

Using []'s won't only set the first byte I think, it doesn't matter. It will just set the amount of bytes it has read. So also initializing it shouldn't matter.


I mean passing it as a param with [0].
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 474

Joined: 09 May 2003
Posts: 25969
Location: The netherlands

PostPosted: Fri May 09, 2008 1:22 pm    Post subject: Reply with quote

you can not compare arrays with ==
it'll just return false because the address of the first array is not the address of the 2nd array
use memcmp to check it's the same (or a for loop that checks it for each byte, but I prefer memcmp)

also, "BYTE BTest[sizeof(Bmamo)]; " is valid. nothing wrong with that

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Fri May 09, 2008 1:24 pm    Post subject: Reply with quote

That seems like kind of a funky comparison statement. You sure it's comparing the right stuff?

Quote:
I mean passing it as a param with [0].

The address of Btest and Btest[0] is the same, so it wouldn't matter because you provide the amount of bytes it should read.

_________________
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Sat May 10, 2008 2:48 am    Post subject: Reply with quote

HalfPrime wrote:
Quote:
I mean passing it as a param with [0].

The address of Btest and Btest[0] is the same, so it wouldn't matter because you provide the amount of bytes it should read.

Yes that's what I meant to say.
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