asm:调用 DLL

发布于 2024-11-15 05:49:51 字数 174 浏览 4 评论 0原文

我反汇编了游戏的 DLL 并想插入一些代码。 我需要asm代码来调用当前目录中的另一个DLL(我在Windows上)。 背景是,我希望能够在我的 DLL 中执行自定义代码, 但我无法加载DLL。所以我的想法是通过修改游戏DLL来加载DLL。

游戏中可能有一个函数可以为我提供 DLL 的当前目录路径,但我想我找不到它。

I disassemled a game's DLL and want to insert some code.
I need asm code to call another DLL in the current directory(I'm on Windows).
The background is, that I want to be able to execute custom code in my DLL,
but I can't load the DLL. So my idea was to load the DLL via modified game DLL.

There may be a function in the game which gives me the current directory path the DLL's are but I think I won't find it.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眉黛浅 2024-11-22 05:49:51

您要查找的调用是 LoadLibrary,它将在 选择位置,包括当前目录 DLL,然后加载它,然后 GetProcAddress

如果 DLL 进行任何其他 Win32 调用,它可能已经链接到 kernel32.dll,因此这就是您需要做的全部事情。

修改 DLL 或使用 DLL 注入 是否更快是有争议的编写代码需要多长时间,因为无论如何您都必须进行逆向工程,但是,纯 DLL 注入的一个优点是,所有现有代码在安装方面都保持不变,使得这些修改更容易撤消用户希望“解除”你正在做的任何事情。

The calls you are looking for are LoadLibrary, which will search in a selection of places including the current directory for the DLL and then load it, then GetProcAddress.

If the DLL makes any other Win32 calls it is probably already linked against kernel32.dll, so that's all you need to do.

It is arguable as to whether modifying the DLL or using DLL injection is faster in terms of how long it takes to write the code since you're going to have to reverse engineer anyway, however, one advantage of pure DLL injection is that all existing code remains unmodified in terms of the installation, making these modifications easier to undo should the user wish to "unpatch" whatever you are doing.

自由如风 2024-11-22 05:49:51

Microsoft Detours 附带 setdll.exe 和 < code>withdll.exe,这些实用程序将允许您使用自定义 dll 文件启动 exe。

Microsoft Detours comes with setdll.exe and withdll.exe, those utilities will let you start an exe with a custom dll file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文