Pointer issue

Posts 1–8 of 8 · Page 1 of 1
Pointer issue
Why would you need to dereference an address when making hacks. I just don't get it. For example:

Code:
int* 0x12345678 //what does this mean when used as a parameter for a function?


*(int*) 0x12345678 //why would i ever do this?

Some of you may be laughing at how stupid I am since i have been coding for a year and some and still don't get this, but this is a serious question and i am really having trouble with this. Thanks in advance.
First is pointer to an int.
Second is pointer to a pointer
why would you ever want to point to a pointer?

and what about this:

Code:
*(int**) 0x12345678
What does that mean? A pointer to a deference int?
Quote Originally Posted by 258456 View Post
why would you ever want to point to a pointer?
if you look at the params of lets say memcpy(), the types are void*.

by doing *(int*)0x12345678, a pointer without a type is created, but it points to an int, so we can access the data.
Oh, I get it, thanks.


And now how about this:

*(int**)*(DWORD*) 0x12345678
Quote Originally Posted by 258456 View Post
Oh, I get it, thanks.


And now how about this:

*(int**)*(DWORD*) 0x12345678
a pointer without a type to a pointer to an int[] to a pointer to a dword!
wow that's ridiculous, thanks.
i doubt in hacking you ever will need more then *(type**). you would use *(type*) to get the value contained inside of the following address, and *(type**) to get the value contained inside the pointer at the address (my wording might be off).
for example:
say you find address 0x12345 in cheat engine or w/e, and it's a float type variable.
if you wanted to change the value in cheat engine, you just double click on value, and click change, right?
well in c++, you would do
Code:
*(float*)(0x12345) = 5; // only if you have direct memory access (using a dll)
the way i think of it is that you are "opening" the address, and telling the compiler that it's a floating point variable, because you didn't make it, so you have to manually tell the compiler. that's probobly not how it actually is, but it's how i think about it.

check out my assualtcube aimbot i posted here today to see examples of this.
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us