I found some example on Google that would explain how it should be done, but then I discovered that they had done something similar to what I did, yet they claimed that their code works.
Anyway, so let me explain this ...
I will use an easy example, now, this is not what I am trying to do, but I feel that more people will understand if I tell it like this.
You know those "trainers" for games that you can download? You start the game and then you start the trainer, and you click like "unlimited health", and the trainer either sets your health to 99999 or freezes it in the game.
This "trainer" writes to an address in the processes (the games) own address space. I have been playing around with two applications to accomplish this, but I can't seem to figure out how to get the processes own address space.
I created one application, "var" and one application "read_mem". The var application would simply declare and define a variable and print it in a loop with a pause between (so that I could change the value and see it happening), the "read_mem" would simply read the value and output it.
Now the idea was that the "read_mem" was to use the address of the variable in the "var" application, read it, and simply output it every time the two applications started. But I can't seem to find or use that address.
I can find the value in the memory using tsearch and then use that address in my "read_mem", and that works like a charm, no problem at all. But the issue is that when I restart the application, the address has changed.
Which confuses me ...
As far as I know, the address that I am using IS an address from the processes own address space, but yet it changes? It's a statically initialized variable, and as far as I know it should stay on the same address in the processes own address space.
I am using
Code: Select all
http://msdn.microsoft.com/en-us/library/ms680553%28VS.85%29.aspx
Now, my code is messy since I have been experimenting all day, so I wont paste it (getting flamed for bad coding just doesn't float my boat). But the code shouldn't be needed since everything works .. kinda.
Anyway, if anyone has any kind of useful knowledge on this, then I would be really happy if you could share it
PS: Go easy on me ... long day, and it's late ^^