@Icesythe7 you will need to use the native exports directly instead of the managed helper, otherwise it will assume a managed assembly
Ie RhInstallLibrary/Ex in NativeAPI namespace - check docs
@fmiceli24 and are you using RhCreateAndInject?
@spazzarama I looked at them yes but the way it is setup it is hard to find stuff as it is just function names and no descriptions...I'm assuming ex frome here http://easyhook.github.io/api/html/M_EasyHook_NativeAPI_RhInjectLibraryEx.htm stands for external? also what do the params expect since I dont need x86 can it be null? whats inpassthrubuffer? can I load it as a byte array? 'm not sure what In wakeuptid is either
@Icesythe7 take a look at the native remote hooking tutorial, yes just use null for 32-bit if not needed
@spazzarama ah thank you, is there currently a way (in c# using easyhook) to inject dll as byte array? trying to store dll as byte array and just read url and inject it
this way user doesn't have to download a physical dll and have it in correct folder plus will be simple to push updates etc
ok clearly im too dumb to figure this out can someone just post a c# example of how to simply inject a c++ dll because i cant figure it out
NativeAPI.RhInjectLibraryEx(proc.Id, 0, 0, null, "path to dll", IntPtr.Zero, 0);
0 errors just does nothing
@spazzarama Hi. I tried both RhCreateAndInject, and CreateProcess(CREATE_SUSPENDED) -> RhInjectLibrary() -> ResumeThread() and also with RhCreateAndInject() -> RhWakeUpProcess(). None worked. I ended up changing the behavior of the program via alteration to the environment variables and registry keys at the moment of creation. Reverting back as soon as the alteration was successful.
@spazzarama Something that is happening now is that on Windows server 2019, some programs that were correctly injected on Windows 8 give the error 5 on RhInjectLibrary(). Any ideas what this error means?
@Icesythe7 that code looks correct, do you have an EasyHook entrypoint defined in your native dll?
@fmiceli24 code 5 is usually access denied
@fmiceli24 someone posted recently in a github issue how they used WaitForIdle and then injected/resumed, perhaps that can help in your situation.
@spazzarama idk what that is i can use any injector like extreme injector ant it works fine i just wanna use c# to call load library basically
the dll is c++ and just creates a thread on process attach i dont need the injector to call any functions the dll handles itself just litterally simply need to inject it
@spazzarama I am not familiar with WaitForIdle on C++. I will investigate and check it out.
@spazzarama What does access denied error code means? Is it related to user's permissions or not being able to access the injection DLL?
@fmiceli24 usually the access denied it from trying to allocate memory in the target process (some processes run in limited security context etc).
@Icesythe7 EasyHook is designed to run the exported entry point, it does try to free the library once the easyhook entry point returns. If you don't provide it then it cannot block the freeing logic (i.e. you add a while loop with whatever exit logic you need). The remove native hooking example shows you an example. It sounds like you might be better served with one of the other libraries you mentioned that are specifically for injection (just create your own managed wrapper to call the native methods if you want to use from .NET).
@spazzarama, I understand. The same process does not present this problem if run on Windows 8.1. It only happens on Windows 10 or Server 2019. Is there a way to specify the security context for a process at the moment of Creating it?
hay i just downloaded the easy hook stuff but im not quite sure how to use it anyone mind explaining how to bring the program up in the first place xD
@MrCat32214 take a look at the tutorials on easyhook.github.io
@fmiceli24 not sure sorry.
Anybody ever use JNI to call EasyHook functions from within a Java app?
Hi, Is it possible to allow only trusted application to install hook? For example, I just want to allow my written program/application to be able to install hook (given that my application admin privilege). but other application won't be able to install hook. I want to prevent other applications to be able to install hook.
I'm getting "The given trace handle seems to already be associated with a hook." Is there a way to override the method anyway?
Method signature is "VR_INTERFACE bool VR_CALLTYPE VR_IsInterfaceVersionValid( const char *pchInterfaceVersion );" Where
VR_INTERFACE extern "C" __declspec( dllimport )
Joel Van Eenwyk
@spazzarama , I may have some "spare" time in the coming months and was looking to do a bit of minor improvements/cleanup to EasyHook e.g. EasyHook/EasyHook#287, unify tabs/whitespace, add additional unit tests, fix VS2019 support, etc. If I were to do that, would you have time to review pull requests and such? Rather not invest in this if it's not going to get merged back.
hi guys, is there any way to get module base address without winapi such as getmodulehandle ?
for x64, i looktup some walking peb codes but there are not so many sources..
can someone explain to me dword ptr and byte ptr and how to use easyhook to hook the sub function for this?
Is there any way to set up an exclusive ACL so that all graphics drivers (for example AMD's amdxc32.dll) are excluded from hooks?
Right now, I'm getting C0000005 ACCESS_VIOLATION crashes as soon as I hook GetSystemInfo on amdxc32.dll and attempt to run a DirectX game
Hi, I'm trying to inject into an application which I start with CreateProcessW in a suspended state. Now when I call RemoteHooking.Inject I get a Code: 5 in return (I guess C0000005?) When I start it in an unsuspended state the hook works, but I need to catch something that's called pretty much immediately in the main function
(I'm using C#)
it actually does work... sometimes, seems sometimes the main module is loaded, sometimes it's not
@darktohka I don't know of one
@Qibbi are you using the easyhook's RemoteHooking.CreateAndInject ? If not, try that instead.
It's the same result, seems Win10's lazy loading is at work, I currently do a loop... start, inject, if it worked break if not terminate and try again