I have a function like this:
int __stdcall sub_57BBD0(int a1, int a2, int a3, char a4)
{
*(_BYTE *)a3 = *(_BYTE *)a1;
}
*(BYTE*)(a1 + 0) is a pointer to a BYTE*
from the pointer of a1, how can I get the BYTES data that this that pointer points to? or is it impossible?, Because a1 points to a BYTE* in memory, I can ReadProcessMemory to get the data, but can I do it another way?
I’ve tried doing:
BYTE *data = *(BYTE*)&a1;
but it’s not working,
Am I missing something here?
Mmmm, this code looks pretty dirty. Is it a disassembly or something?
Anyway, the value
a1seems to be a pointer that is used as anint. You have this:That is taking the first
_BYTEvalue from the memory location thata1points to and storing it in the memory location thata3points to.If you want to get the pointer itself, then just don’t dereference it:
All you are doing here is type-casting from an integer to a
BYTE*(which I assume is the same as_BYTE).Now you can reference
BYTEvalues fromdataas if it was an array (assuming that the memory is actually allocated to your process):And so on…