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 


[RLS][C++] Direct Memory Handling Class

 
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: Sat Jan 31, 2009 10:39 am    Post subject: [RLS][C++] Direct Memory Handling Class Reply with quote

I havn't added much, but the things on the top of my head.
It's basically a class you can use to handle memory directly.

Functions :

Code:
int GetIntValue( DWORD dwAddress );
   double GetDblValue( DWORD dwAddress );
   float GetFloatValue( DWORD dwAddress );
   int GetPtrIntValue( DWORD dwAddress, INT Offset );
   double GetPtrDblValue( DWORD dwAddress, INT Offset );
   float GetPtrFloatValue( DWORD dwAddress, INT Offset );
   void SetIntValue( DWORD dwAddress, int Val );
   void SetDblValue( DWORD dwAddress, double Val );
   void SetFloatValue( DWORD dwAddress, float Val );
   void SetPtrIntValue( DWORD dwAddress, INT Offset, int Val );
   void SetPtrDblValue( DWORD dwAddress, INT Offset, double Val );
   void SetPtrFloatValue( DWORD dwAddress, INT Offset, float Val );
   BYTE* GetBytes( DWORD dwAddress, int Size );
   void SetBytes( DWORD dwAddress, BYTE* bBytes, int Size );
   void Free();


They are self explanatory.



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 AIM Address MSN Messenger
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Sat Jan 31, 2009 10:45 am    Post subject: Reply with quote

You could just use template functions :\
Back to top
View user's profile Send private message MSN Messenger
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sat Jan 31, 2009 10:45 am    Post subject: Reply with quote

This isnt a Binary, it's a class. And wat do you mean Template Functions?
Back to top
View user's profile Send private message AIM Address MSN Messenger
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Sat Jan 31, 2009 10:48 am    Post subject: Reply with quote

http://www.cplusplus.com/doc/tutorial/templates.html
Back to top
View user's profile Send private message MSN Messenger
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sat Jan 31, 2009 11:06 am    Post subject: Reply with quote

What i meant to say is, This class is already coded for you. Unless you want to waste your time and probably fuck up on coding your own class, be my guest.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Sat Jan 31, 2009 11:15 am    Post subject: Reply with quote

I am saying, you just made like 15 functions when you could make 10 or less.
Back to top
View user's profile Send private message MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Jan 31, 2009 11:19 am    Post subject: Reply with quote

Well if someone did the exact one using Templates it would probably be like 10 functions shorter.. Anyways, memory allocation, memory protections, you only included reading and writing...

Code:
template <class Size>
Size GetValue(__in DWORD dwAddress)
{
    return ((Size)*dwAddress);
}


That alone gets rid of 3 functions.

_________________
Back to top
View user's profile Send private message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sat Jan 31, 2009 11:24 am    Post subject: Reply with quote

Rolling Eyes Well, i didnt want to add Protections because you can just call it in one line, and you'll need to be able to change the Protection, size, address, old protection, so i dont think i can make a function for that
Back to top
View user's profile Send private message AIM Address MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Jan 31, 2009 11:31 am    Post subject: Reply with quote

You can read/write memory directly in one line too Wink
_________________
Back to top
View user's profile Send private message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sat Jan 31, 2009 11:32 am    Post subject: Reply with quote

but it's nicer when you can just call it like
GetIntValue( address );
instead of
int val = *((INT*)address);

Razz
Back to top
View user's profile Send private message AIM Address MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sat Jan 31, 2009 11:35 am    Post subject: Reply with quote

Lmfao, well then you should make __inline functions since it's pointless for your code flow to be directed somewhere else for a couple lines of ASM... __inline would allow the function to be directly placed where the user calls it.

In this case it would probably be smarter to make a namespace instead of a class.

_________________
Back to top
View user's profile Send private message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sat Jan 31, 2009 11:38 am    Post subject: Reply with quote

lurc, just agree with me, so i can be happy and get on with me life Sad
Back to top
View user's profile Send private message AIM Address MSN Messenger
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Sat Jan 31, 2009 12:31 pm    Post subject: Reply with quote

Does this offer exception handling? As in, I can call GetIntValue(NULL) and not crash? If not, then this is useless.
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

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

PostPosted: Sat Jan 31, 2009 6:23 pm    Post subject: Reply with quote

#define GetIntValue(a) *((INT*)a)
_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Jan 31, 2009 6:38 pm    Post subject: Reply with quote

Did really feel that a few lines is too complicated?

Chances are the compiler will just inline all this shit if you have it enabled.
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