gpt4 book ai didi

c# - EasyHook - CRT 调试断言失败 - "Buffer too small"

转载 作者:太空宇宙 更新时间:2023-11-03 15:08:55 25 4
gpt4 key购买 nike

我有一个调用以下(删节)代码的注入(inject)器:

var processes = Process.GetProcessesByName("target");
/* ... */
var process = processes[0];
/* ... */
process.Kill();
RemoteHooking.CreateAndInject(process.MainModule.FileName, string.Empty, 0,
InjectionOptions.NoService | InjectionOptions.DoNotRequireStrongName,
typeof(EntryPoint).Assembly.Location, typeof(EntryPoint).Assembly.Location,
out injectedProcessId, null);

应该注入(inject)的DLL只有下面的代码:

public class EntryPoint : IEntryPoint {
public EntryPoint(RemoteHooking.IContext InContext) {}

public void Run(RemoteHooking.IContext InContext) {
RemoteHooking.WakeUpProcess();
Thread.Sleep(5000);
}
}

不幸的是,注入(inject)器崩溃了,典型的 Windows 错误报告工具出现了,根本没有视觉异常消息,甚至没有进入 DLL。事件 View 的错误是这样的:

Faulting application name: TestInjector.vshost.exe, version: 14.0.23107.0, time stamp: 0x559b788a
Faulting module name: EasyHook64.dll, version: 2.7.0.0, time stamp: 0x589704aa
Exception code: 0xc0000409
Fault offset: 0x0000000000091a9b

在 Debug模式下运行时,我无法逐步通过 EasyHook 代码找到关键位置,但我至少遇到一个异常:

enter image description here

对于如何进一步调试此问题并找出导致它的原因,您有什么建议吗?我什至尝试关闭各种应用程序以减少干扰,但无济于事。

最佳答案

我可以解决这个错误——我调用的应用程序也获得了一个命令行参数(不幸的是它不在我的示例代码中),这对于库来说太长了。因此我增加了缓冲区大小 right here以及对它的引用调用right here现在可以正常使用了。

关于c# - EasyHook - CRT 调试断言失败 - "Buffer too small",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42053685/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com