在两个进程(C、Windows)之间共享内存 [英] Sharing memory between two processes (C, Windows)

查看:24
本文介绍了在两个进程(C、Windows)之间共享内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为我还没有找到之前在这里提出的问题的答案 我正在尝试不同的方法.

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.

我的想法是在那里注入一些代码,在我传递给注入程序的结构中,将地址(或其他)传递给我需要运行的数据所在的共享内存.获得数据后,我将在注入的线程中填充我自己的变量.

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.

这可能吗?怎么样?

感谢代码.

我觉得不清楚,所以我会澄清一下.我知道怎么注射.我已经在做.这里的问题是将动态数据传递给注入.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆