-3

I am very new to this and I was wondering how I find the value of a memory address. I am trying to have my program check how much money I have in a game and then, depending on the value, make actions according to the number.

Mr. Infect
  • 15
  • 1
  • My apologies, I mistyped I meant memory address not web. – Mr. Infect Jun 05 '22 at 01:52
  • Why don't you already have the variable in memory? Where is this money variable stored in memory? – Stephen Newell Jun 05 '22 at 01:56
  • My apologies I really don't know much about this. I am trying to build program that will function based off of how much money I have in a game, the only problem is that number is always changing. I used cheat engine to find the memory address and now I need to have the program check that memory address and read the value. As for where it is stored I have no clue. My best guess is with the other game files which would make it on my internal PC storage, but I don't know for sure. – Mr. Infect Jun 05 '22 at 02:51
  • You are probably trying to read the memory address that is in the [virtual address space](https://en.wikipedia.org/wiki/Virtual_address_space) of a different process. Accessing the virtual address space of a different process is not possible in plain ISO C, because ISO C does not have a notion of a process. However, what you want can normally be accomplished using operating-system-specific functionality. For example, on Microsoft Windows, you can use the function [`ReadProcessMemory`](https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-readprocessmemory). – Andreas Wenzel Jun 05 '22 at 07:51
  • @Mr.Infect I recommend using a [good C++ book](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list). Many of the books listed in the above link are available in pdf form also. – Anoop Rana Jun 05 '22 at 10:59
  • @AnoopRana: I strongly doubt that the platform-specific functionality that OP is asking for is covered in books that teach general C++. – Andreas Wenzel Jun 05 '22 at 11:02
  • @AndreasWenzel The OP seems to be a beginner in C++. Unless the basics aren't clear there's not point in going forward. That is why i suggested books. The question itself isn't very clear. So once the OP knows some basics they will be able to better phrase the question they're trying to ask. – Anoop Rana Jun 05 '22 at 11:06

0 Answers0