两个进程之间共享内存(C,Windows中) [英] Sharing memory between two processes (C, Windows)
问题描述
由于我还没有找到一个答案的问题问previously这里我尝试了不同的方法。
Since I haven't found an answer to the question asked previously here I'm trying a different approach.
有什么办法两个进程之间共享内存?
Is there any way to share memory between two processes?
第二个进程会从注入的信息,因为它是一个传统的程序,它不再被支持。
The second process gets the information from an injection since it's a legacy program that it's not being supported anymore.
我的想法是注入一些code那里,在我传递给注入程序通过地址(或其他)的地方,我需要运行数据所在的共享内存的结构。一旦我得到了我的数据将填充注射的线程中我自己的变量。
My idea is to inject some code there, in the struct that I am passing to the injected program pass the address (or whatever) to the share memory where the data I need to run is located. Once I get the data I will populate my own variables inside the injected thread.
这可能吗?
怎么样?
Is this possible? How?
code是AP preciated。
Code is appreciated.
编辑:
我认为这是不明确的,所以我会澄清。我知道如何注入。我已经在做了。这里的问题是将动态数据传递给注射。
I think it's not clear so I'll clarify. I do know how to inject. I am doing it already. The issue here is to pass dynamic data to the injection.
推荐答案
您可以尝试内存映射文件。
这给多一点一步一步的细节。
This gives a bit more step-by-step detail.
这篇关于两个进程之间共享内存(C,Windows中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!