| View previous topic :: View next topic |
| Author |
Message |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Sat Jan 31, 2009 10:39 am Post subject: [RLS][C++] Direct Memory Handling Class |
|
|
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.
|
|
| Back to top |
|
 |
Zerith Master Cheater
Reputation: 1
Joined: 07 Oct 2007 Posts: 468
|
Posted: Sat Jan 31, 2009 10:45 am Post subject: |
|
|
| You could just use template functions :\
|
|
| Back to top |
|
 |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Sat Jan 31, 2009 10:45 am Post subject: |
|
|
| This isnt a Binary, it's a class. And wat do you mean Template Functions?
|
|
| Back to top |
|
 |
Zerith Master Cheater
Reputation: 1
Joined: 07 Oct 2007 Posts: 468
|
|
| Back to top |
|
 |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Sat Jan 31, 2009 11:06 am Post subject: |
|
|
| 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 |
|
 |
Zerith Master Cheater
Reputation: 1
Joined: 07 Oct 2007 Posts: 468
|
Posted: Sat Jan 31, 2009 11:15 am Post subject: |
|
|
| I am saying, you just made like 15 functions when you could make 10 or less.
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat Jan 31, 2009 11:19 am Post subject: |
|
|
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 |
|
 |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Sat Jan 31, 2009 11:24 am Post subject: |
|
|
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 |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat Jan 31, 2009 11:31 am Post subject: |
|
|
You can read/write memory directly in one line too
_________________
|
|
| Back to top |
|
 |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Sat Jan 31, 2009 11:32 am Post subject: |
|
|
but it's nicer when you can just call it like
GetIntValue( address );
instead of
int val = *((INT*)address);
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat Jan 31, 2009 11:35 am Post subject: |
|
|
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 |
|
 |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Sat Jan 31, 2009 11:38 am Post subject: |
|
|
lurc, just agree with me, so i can be happy and get on with me life
|
|
| Back to top |
|
 |
rapion124 Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Mar 2007 Posts: 1095
|
Posted: Sat Jan 31, 2009 12:31 pm Post subject: |
|
|
| Does this offer exception handling? As in, I can call GetIntValue(NULL) and not crash? If not, then this is useless.
|
|
| Back to top |
|
 |
HalfPrime Grandmaster Cheater
Reputation: 0
Joined: 12 Mar 2008 Posts: 532 Location: Right there...On your monitor
|
Posted: Sat Jan 31, 2009 6:23 pm Post subject: |
|
|
#define GetIntValue(a) *((INT*)a)
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sat Jan 31, 2009 6:38 pm Post subject: |
|
|
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 |
|
 |
|