问题描述
我正在尝试学习 dll 注入的基础知识,因此我创建了一个非常简单的 hello-world 类型 DLL 和一个基于我在网上找到的代码的注入器.我找不到任何开箱即用的东西,所以我不得不进行一些调整.
I'm trying to learn the basics of dll injection, so I created a really simple hello-world type DLL and an injector based off of code I found online. I wasn't able to find anything that works out of the box, so I had to make a few adjustments.
我在 64 位 Windows 上运行这些.我正在使用 Visual Studio 2010 进行编译.注入器是一个 win32 控制台应用程序,dll 也是 win32.我正在尝试将我的代码注入现有的记事本进程(也是 32 位).所有这些都在 Windows 7 x64 上运行.
I'm running these on 64-bit windows. I'm compiling with Visual Studio 2010. The injector is a win32 console app, and the dll is win32 as well. I'm trying to inject my code into an existing notepad process (also 32-bit). All of this is running on Windows 7 x64.
当我运行注入器时,它每次在 CreateRemoteThread
处失败,GetLastError
返回 5(即 ERROR_ACCESS_DENIED
).我已确认 dll 路径是正确的(尽管将其更改为虚假路径会产生相同的行为),并且我已确认该路径已使用 作弊引擎.我在这方面遇到了困难,因为我不确定如何进一步调试问题.
When I run the injector, it fails every time at CreateRemoteThread
, with GetLastError
returning 5 (i.e. ERROR_ACCESS_DENIED
). I've confirmed that the dll path is correct (although changing it to a bogus path gives the same behavior), and I've confirmed that the path is getting written to notepad's memory at the correct address using Cheat Engine. I'm having a difficult time with this because I'm not sure how to debug the problem further.
什么可能导致 CreateRemoteThread 失败?
What could be causing CreateRemoteThread to fail?
推荐答案
问题是 notepad.exe 在 64 位 Windows 中是 64 位进程,而我试图用 32 位进程注入.
The problem is that notepad.exe is a 64-bit process in 64-bit windows, and I was trying to inject with a 32-bit process.
这篇关于CreateRemoteThread 因 ERROR_ACCESS_DENIED 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!