easyhook报错The given 64-Bit library does not exist

在调用 RemoteHooking.Inject 时,报错

 

 

查看easyhook源代码,出错位置如下

if(!RtlFileExists(UserLibrary))
    {
    #ifdef _M_X64
        THROW(STATUS_INVALID_PARAMETER_5, L"The given 64-Bit library does not exist!");
    #else
        THROW(STATUS_INVALID_PARAMETER_4, L"The given 32-Bit library does not exist!");
    #endif
    }

 

BOOL RtlFileExists(WCHAR* InPath)
{
    HANDLE          hFile;

    if((hFile = CreateFileW(InPath, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
        return FALSE;

    CloseHandle(hFile);

    return TRUE;
}

 

 

问题源头是 CreateFileW 这里失败,但是我手动调用CreateFileW传入dllPath也没有失败啊,很奇怪

 

 

 

 

 

 

 

 

https://stackoverflow.com/questions/31762879/easyhook-the-given-32-bit-library-does-not-exist-user-library-does-not-export

 

I've had same issue but with 64 bit.

Removing my assemblies and EasyHook from GAC solved the issue.

gacutil /uf EasyHook
gacutil /uf EasyLoad64
gacutil /uf MyAssembly




I don't know exactly why it wasn't working before. Clearly the problem was that couldn't find some assemblies. After reading on the Internet I saw an example without the Config.Register function. Seems with the latest version (2.7) you don't need to register assemblies in the GAC. I just commented this function and it worked.

 

 

 

 

 

以下不靠谱

 

 

 

转载于:https://www.cnblogs.com/code1992/p/11583232.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值