Locating dynamic pointer

I know this isn't strictly related to C++ programming but I could not think of anywhere else, if anyone knows of a better place then please provide a link.

For reference sake I'm using a custom tool for hacking into PCSX2 SVN while running the game Star Ocean: Till the End of Time.

The problem is that while I can locate variables (such as the map percentage), I cannot locate the pointer to them. I tried searching for the address as a value but got no results, I then tried a ranged search with max/min values being the address +/- 200 and still did not get any results.

I cannot think of any other way and I know for certain that they are not static because I watched the memory change whenever I zoned out to another map (including battles).

Any ideas are welcome.
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>

int main()
{
  int x = 15;
  int *xp = &x;
  std::cout << "The address of x is               : " << std::hex << &x << std::endl;
  std::cout << "The value of x is                 : " << std::dec << x << std::endl;
  std::cout << "The address of xp is              : " << std::hex << &xp << std::endl;
  std::cout << "The value of xp is                : " << std::hex << xp << std::endl;
  std::cout << "The value at the address of xp is : " << std::dec << *xp << std::endl;
  return 0;
}
Thanks but that doesn't entirely help in this case because PCSX2 is an external process I don't know how to grab unknown pointers that I only have the value's address of. I'm also using wxWidgets on my custom tool so using iostream at the same time may cause problems (haven't actually tried that yet).

Edit: This is the code of my function:
1
2
3
4
5
6
7
8
9
10
11
12
13
#define ReadWriteApp HANDLE appHandle, u64 xAddress, u64 size
#define FlipAddress BLANK(0) \
	DWORD address; \
	if (endian == 1) { \
		switch (size) { \
		case 1: address = xAddress^3; break; \
		case 2: address = xAddress^2; break; \
		default: address = xAddress; } \
	} else { address = xAddress; }
void ME::HCReadM8(ReadWriteApp, u8* buff) {
	FlipAddress;
	ReadProcessMemory(appHandle, (void*)address, (void*)buff, size, NULL);
}
Last edited on
Getting the address of an external variable (especially if it could be stack-allocated) is way above my pay grade, sorry.
Well thanks for trying anyway, do you know of any sites where I might be able to get this info?
Topic archived. No new replies allowed.