Restore Original Value

Posts 1–8 of 8 · Page 1 of 1
Restore Original Value
Code:
int i;
int original;
DWORD cshell;
DWORD editable;
void originalVal(DWORD Pointer, DWORD Offset)
{
for(i=0;i<600;i++)
cshell=(DWORD)(GetModuleHandle("CShell.dll"))
editable=*(DWORD*)(cshell+pointer);
	{
	original[i]=editable+offset;
	}
}

if(something==1)
else
originalVal(0x123456,0x123);
Would this work?
Do u one to know the original value of an Addie?
i think UltraPGNoob can help us here because he created value logger
example

if noreload = 1
float 0x0000269c = 35
else
no reload = orginal value 1.0float

@UltraPGNoob help pls ?
That's easy programming.
You didn't define original as an array / pointer to your allocated memory and you have to read from the address, not to save the address itself. ( original[i]=*(int*)(editable+offset); )

Edit : Do you want to save the original value or to replace the changed value to the original value?
Thanks @derh.acker for pointing that out but this is pretty much pseudo-code. I just wanted to know if that would work?

I want to store a value for each weapon into an array and when the user turns off a feature I want the stored value (original) to replace the modified value.
It looks like it could work.
So is the way I am approaching it wrong? Is it i possible it will just set the value the hack set already?

@derh.acker
@BlackLite

what about that ?

put that in ur defines :
Code:
//  some defines
typedef struct {
     float damage;
} BACKUP;

BACKUP Backup[WeaponCount]; // Weapon Count should be 621
bool init = false;
then put in ur hack loop :

Code:
if(!init)
{
      for(int i=0;i<WeaponCount;i++)
      {
            Backup[i].damage = *(float*)(Weapon+0x7F8);
      }
      init = true;
}
then if you wanna restore the value :

Code:
*(float*)(Weapon+0x7F8) = Backup[i].damage;
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us