开发者

C# Pointers to other application's memory [duplicate]

开发者 https://www.devze.com 2023-02-11 18:26 出处:网络
This question already has answers here: 开发者_如何学编程Closed 11 years ago. Possible Duplicate:
This question already has answers here: 开发者_如何学编程 Closed 11 years ago.

Possible Duplicate:

How to access structure in other program's memory?

Hello. I want to access another application memory. I'm writing game hack (Don't worry, it's only for single-player mode). I have found pointer to player structure in game's memory.

I don't want to use pInvoked ReadProcessMemory because I want to be able to read individual structure's field. I know address in game's memory where is array of player structs.

Using pInvoked ReadProcessMemory is not very practical in this case.

How can I use C#'s unsafe pointers to map other processes memory as struct? Or if it's not possibe to use direct pointers, what would be the way of using readPrcessMemory?

I want in the end to be able to so sth like that.

player is some kind of class representing struct in memory. Players is some kind Collection of players.

foreach(player guy in Players)
{ 
    DrawESP(guy.X, guy.Y, guy.Z);
}


You cannot simply recompile from memory like that.

Create the object's structure in your own application (class/struct/etc) and use ReadProcessMemory to read in the appropriate bytes, then intepret those bytes in such a way as to fill your structure.

If you're not familiar with using pointers in such a manner, I would politely suggest writing trainers is not for you and you need to do some reading first.

I'd suggest learning to write trainers in C++, it's significantly easier to think in terms of 'unsafe' code that way.


Two options:

  • ReadProcessMemory
  • Load a DLL into the remote process, that DLL can then access memory directly using unsafe pointers.
0

精彩评论

暂无评论...
验证码 换一张
取 消