To get memory from another process.

Quantium qchessv2 at gmail.com
Wed Apr 8 21:04:42 UTC 2020


On Wednesday, 8 April 2020 at 20:46:48 UTC, H. S. Teoh wrote:
> On Wed, Apr 08, 2020 at 08:16:27PM +0000, Quantium via 
> Digitalmars-d-learn wrote:
>> On Wednesday, 8 April 2020 at 16:25:01 UTC, Net wrote:
> [...]
>> > As far I know, you can't access other's program memory in 
>> > any modern operating system.  That's managed and protected 
>> > by the OS through virtual addressing.
>
> On Linux, you can access process memory using the virtual file 
> /proc/$pid/mem, where $pid is the process ID.  But you need 
> root access for this to work, and you also need to know how the 
> memory is mapped in the process (reading from an unmapped 
> offset will return I/O error).
>
>
>> > What are you trying to do?
>> 
>> Now I know that programm even at Administrator mode cannot do 
>> this. Only system permission can do that. Or a driver on a 
>> kernel-level (zero level).  So now the question is how to code 
>> driver, which gets other process' memory on D.
>
> This question has nothing to do with D.  You need to know how 
> your OS works, and whether it has an interface that provides 
> the access you want.  The programming language cannot give you 
> this, and is also irrelevant as far as performing this 
> operation is concerned; if you have an API that can do this, 
> you can do it in any language.
>
>
>> Also, I know antiviruses will try to block this driver so I'll 
>> test it with no antiviruses and Microsoft Defender off. Or if 
>> I'm mistaking anywhere and this is impossible on Windows, is 
>> it possible on Linux?
>
> You didn't answer the question.  Why are you trying to access 
> another process's memory?  Without knowing what you're trying 
> to do, it's hard to give you a more specific answer.
>
>
> T

I'm trying to do this because I have very special programm that 
makes some calculations and on every calculation there is a hash 
in RAM. I need to get a one of hash values from a .bin file, and 
replace them. I mean hash in RAM of the programm is added to end 
of .bin file, and one of hashes from that file (I set up sorting 
algorithm by myself) is in RAM of programm.



More information about the Digitalmars-d-learn mailing list