从加载到葡萄酒过程中的共享对象(.so)调用Winapi函数

发布于 2025-01-29 17:13:03 字数 293 浏览 2 评论 0原文

我有一个在葡萄酒下运行的Windows程序。如果我理解正确的话,可以将PE的映射到葡萄酒过程中。 我使用ld_preload将.so加载到葡萄酒过程中。这是SO钩到Vulkan渲染管道中。这使我能够在Winows程序的主线程中执行代码。 从那里开始,我想将Winapi函数称为Windows程序调用。例如,kernel32.dll的getModulehandle()。但是我不知道如何检索其地址。

是否有可能从葡萄酒或Windows程序加载的DLL访问功能? 如果我使用dl_iterate_phdr,我发现似乎与Windows有关的唯一库是ntdll.so

I have a windows program that is run under wine. If i understand correctly, the pe-executable is mapped into the wine process.
I use LD_PRELOAD to load a .so into the wine process. This .so hooks into the vulkan rendering pipeline. That makes me able to execute code in the winows program´s main thread.
From there i would now like to call a WINAPI function as if it was called by the windows program. For example GetModuleHandle() from kernel32.dll. But i do not know how to retrieve the address of it.

Is there any possibility to access functions from the dlls that got loaded by wine or windows program?
If i use dl_iterate_phdr the only library i find that seems to have to do with windows is ntdll.so

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文