Pointer Problem
Basically, I'm trying to get the address a pointer points to, then add a hex. value to it and write from there.
Here's what I have now,
It isn't working correctly, and I've also tried,
Which should logically work, but doesn't.
Here's what I have now,
Code:
BOOL WriteMultiPtr(DWORD dwBase, DWORD OFF_1 = 0, DWORD OFF_2 = 0, INT Value = 0)
{
__try {
DWORD_PTR ptrLoc = (DWORD_PTR)((int*)dwBase + OFF_1); //STORE_POINTED_ADDRESS
DWORD BUFF = ptrLoc + OFF_2; //GET_POINTED_ADDY + HEXDECIMAL
*( int *)( *( int *) BUFF) = Value; //WRITE_TO_ADDRESS
return TRUE;
}
__except (EXCEPTION_EXECUTE_HANDLER) { return FALSE; }
}
Code:
BOOL WriteMultiPtr(DWORD dwBase, DWORD OFF_1 = 0, DWORD OFF_2 = 0, INT Value = 0)
{
__try {
DWORD BUFF = *(int*)(dwBase + OFF_1);
BUFF += OFF_2;
*( int *)( *( int *) BUFF) = Value;
return TRUE;
}
__except (EXCEPTION_EXECUTE_HANDLER) { return FALSE; }
}


maybe now u can help explain it to me? sry & thnx. Is "*( int *)( *( int *) BUFF) = Value;" doing 2 dereferences or simply 1 ??