Easier/Neater memory editing
I got bored and made this class for the lolz (I haven't tested, but I'm nearly positive that it works):
Edit: just realized I forgot to add the reset function - added it in, btw the class is the complicated part, using it is simple
Definitions:
and here is one way to use it: (Using a shotty spread addy for m16 only(not sure if it still works))
And as far as the function easyPoint goes, it's really quite simple:
levels is the number offsets
if the pointer ends in an offset then it's true, if it ends in a pointer it's false.
value is what you're changing it to, it is a dword by default. (if you want a single byte or something of the sort just do 0xw/e)
first address is where you start from, if you first address is a static pointer, then for your first offset just put 0
everything else are offsets (in order from first to last)
oh and if it isn't obvious reset turns the feature off
edit: I just added the function restart ( didn't put in compiler just typed from the edit prompt so there might be a misspelling or something) it optimized it by lowering the calls to the function easyPoint which is much more intense than restart
edit: Changed void to bool for efficiency (made it four lines shorter)
edit: Switched true and false values for "offset" because I realized it didn't make sense to have it the way I did, now it makes sense (though it worked the other way)
EDIT:Super epic upgrade - I don't know why I didn't think of this in the first place, but now the on and off is automatic you only have to do 3 things to create an infinite (if you want) on/off loop. All you have to do is:
Make an object of my class and set first time to true
call the function easy point and use the instructions above
call checks and put in the name of your object
my class does the rest for you
this can take up to five levels (I'd appreciate if someone tested this for me rotfl)
Edit: just realized I forgot to add the reset function - added it in, btw the class is the complicated part, using it is simple

Code:
class memEdit // unsigned long int = dword I just put it like that to point out the obvious
{
public:
bool firstTime;
void easyPoint(memEdit feature, int levels, bool offset,DWORD value, DWORD firstAdress, DWORD = 0, DWORD = 0, DWORD = 0, DWORD = 0, DWORD = 0);
void reset(memEdit feature);
void checks(memEdit feature);
private:
DWORD finalAdress;
DWORD originalValue;
DWORD value;
bool activated;
void restart(memEdit feature, DWORD value);
};
Code:
#include "memEdit.h"
void memEdit::easyPoint(memEdit feature, int levels, bool offset, DWORD value, DWORD firstAdress, DWORD a, DWORD b, DWORD c, DWORD d, DWORD e)
{
DWORD offsets[6] = {a, b, c, d, e};
int * i = new int;
if(offset == false) levels ++;
DWORD & rFirstAdress = firstAdress;
for(; *i < levels - 1; i++)
{
rFirstAdress = *(DWORD*)(rFirstAdress + offsets[*i]); //Aderess + offset = pointer. Value of pointer = next adress.
}
if(offset == true)firstAdress = firstAdress + offsets[*i+1];
feature.originalValue = *(DWORD*)firstAdress;
finalAdress = firstAdress;
*(DWORD*)firstAdress = value;
delete i;
feature.activated = true;
}
void memEdit::reset(memEdit feature)
{
*(DWORD*)finalAdress = originalValue;
feature.activated = false;
}
void memEdit::restart(memEdit feature, DWORD value)
{
*(DWORD*)finalAdress = value;
feature.activated = true;
}
void memEdit::checks(memEdit feature)
{
if(feature.activated == true)feature.reset(feature);
else feature.restart(feature, feature.value);
}
Code:
memEdit shotgunSpread;
shotgunSpread.firstTime = true;
if(GetAsyncKeyState(VK_F6))
{
if(shotgunSpread.firstTime == true)shotgunSpread.easyPoint(shotgunSpread, 3, true, 5, cshell, 0x00A287A8, 0x64, 834);
else shotgunSpread.checks(shotgunSpread);
}
levels is the number offsets
if the pointer ends in an offset then it's true, if it ends in a pointer it's false.
value is what you're changing it to, it is a dword by default. (if you want a single byte or something of the sort just do 0xw/e)
first address is where you start from, if you first address is a static pointer, then for your first offset just put 0
everything else are offsets (in order from first to last)
oh and if it isn't obvious reset turns the feature off
edit: I just added the function restart ( didn't put in compiler just typed from the edit prompt so there might be a misspelling or something) it optimized it by lowering the calls to the function easyPoint which is much more intense than restart
edit: Changed void to bool for efficiency (made it four lines shorter)
edit: Switched true and false values for "offset" because I realized it didn't make sense to have it the way I did, now it makes sense (though it worked the other way)
EDIT:Super epic upgrade - I don't know why I didn't think of this in the first place, but now the on and off is automatic you only have to do 3 things to create an infinite (if you want) on/off loop. All you have to do is:
Make an object of my class and set first time to true
call the function easy point and use the instructions above
call checks and put in the name of your object
my class does the rest for you

this can take up to five levels (I'd appreciate if someone tested this for me rotfl)




) /Try this in my hack..
