Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move native libraries to subfolder ? #369

Open
TKGNET opened this issue May 25, 2021 · 5 comments
Open

Move native libraries to subfolder ? #369

TKGNET opened this issue May 25, 2021 · 5 comments

Comments

@TKGNET
Copy link

TKGNET commented May 25, 2021

I have started to use Easyhook in one of my projects and it works flawlessly. My regards to spazzarama for keeping this solution alive over all these years.

Still , I love to keep my solution clean and usually move my external assemblies into a subfolder ( AssemblyResolve ). Native assemblies present a problem though: if I move them to a subfolder the project will fail at runtime.

Can anybody provide a solution for this ?

F.e. cefsharp provides an optional variable which points to the external assembly location.

Pete

@justinstenning
Copy link
Member

Try Config.DependencyPath, I can't remember if it does exactly what you want.

@justinstenning
Copy link
Member

Try Config.DependencyPath, I can't remember if it does exactly what you want.

Hmm this only appears to impact the use of the WOW64Bypass stuff.

@justinstenning
Copy link
Member

You could fudge this by manually calling LoadLibrary(@"....my_native_dll_path\easyhook32/64.dll") before you do anything with easyhook, then the native library will be loaded already before you try to do anything. The Config.DependencyPath will still need to be used to deal with the cross 64 boundary injection stuff still.

@TKGNET
Copy link
Author

TKGNET commented May 25, 2021

TY for the quick replay, I will give it a try ;)

@TKGNET
Copy link
Author

TKGNET commented May 25, 2021

Got it to work, but I'm running into another conflict:
I pass a [serializable] object from the server to the client, instead of a channelName.
I get a runtime error: SerializationException , 'unable to find assembyl ...'
It seems Easyhook doesnt respect the injectionLibrary path, but tries to find the injectionLibrary with the serializable object in the subfolder.
It works, if I copy the assembly to the subfolder at runtime, but it seems a bit unelegant.
A json string would probably work too.

Any other suggestion ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants