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

Metahook doesn't work at all. #10

Closed
MapMappening opened this issue Jun 26, 2019 · 14 comments
Closed

Metahook doesn't work at all. #10

MapMappening opened this issue Jun 26, 2019 · 14 comments

Comments

@MapMappening
Copy link

I dragged and dropped my files into the appropriate directories and used the shortcut (Modified to point to my Half-Life location), and it doesn't seem to have done anything. No console commands that were associated with Meta Hook appear, so I assume it didn't innitialize.

Obviously I'm using the latest downloadable version, and am using the Steam version.

@LAGonauta
Copy link
Owner

No error showed up? Strange, I set it to annoy the user if anything bad happens. Can you describe the file tree? For example, something like that:

・Half-Life
      |
      +- valve
      |    |
      |    +- metahook
      +- cstrike
      |    |
      |    +- metahook

I need to know where metahook.exe, alure2.dll, libsndfile-1.dll, audio.dll, plugins.lst, and OpenAL.dll (optional) are located.

@MapMappening
Copy link
Author

Half-Life
    |
    -MetaHook.exe
    -alure2.dll
    -libsndfile-1.dll
    -OpenAL.dll
    +- valve
    |    |
    |    +- metahook
    |	 |     |
    |	 |     +- configs
    |	 |     |     |
    |	 |     |     -plugins.lst
    |	 |     +- plugins
    |	 |     |     |
    |	 |     |     -Audio.dll

I have this similarly set up for Blue Shift and Opposing Force

@LAGonauta
Copy link
Owner

Your folder structure seems to be correct. Can you confirm that there is just a single line in your "plugins.lst"? (no new line character at the end)

@MapMappening
Copy link
Author

Yes, only 1 line.
I don't recall any point where I added new files like dll's or replaced certain files, although my half-life folder is really old, so I'm going to do a fresh install just to see if that works.

@MapMappening
Copy link
Author

Nope, still not working.
However I now notice something in the console that I thought was just something from my other mods that carried over to the fresh install

Unknown command: VModEnable

I should note that my entire file path for Half Life is F:\SteamLibrary\steamapps\common\Half-Life, and it was different for the shortcut.

@LAGonauta
Copy link
Owner

debug_loading.zip

Can you test the attached "MetaHook.exe" and "audio.dll"?
It now uses C++ functions (instead of C) to search for plugins, a lot better than the previous code. I also added annoying messages to help debug where the plugin/module is failing to load.

@MapMappening
Copy link
Author

MapMappening commented Jul 2, 2019

About time something started to happen. Unfortunetly it still fails to innitialize, but I do get error messages.
Trying to load plugin "audio.dll" from "valve/metahook/plugins/audio.dll"
When I click OK I get this
Module name: valve/metahook/plugins/audio.dll
Then Half-Life launches as normal, this time without VModEnable stuff, so it's just a blank console.

@LAGonauta
Copy link
Owner

LAGonauta commented Jul 2, 2019

debug_loading.zip

It should now display what was the problem. I will probably integrate the error message in MetaHook later, a silent failure is not useful here.

@MapMappening
Copy link
Author

We got something specific! It's the same as last time, but the last error message has this tacked on:
Error code: 193. Message: %1 is not a valid Win32 application

@LAGonauta
Copy link
Owner

I am at a loss, no idea why that is happening. Maybe you do not have the C++ runtime installed?
You can install it through Microsoft:
https://aka.ms/vs/16/release/vc_redist.x86.exe

I also statically-compiled an "audio.dll" for you, please test:
Audio.zip

@MapMappening
Copy link
Author

Nope. I'm already on the latest version, but I re-installed anyway. I tested both my audio.dll and the one your just provided and I get the same error.
Luck isn't on my side apparently.

@LAGonauta
Copy link
Owner

Strange, it is like your system is trying to load 64-bit DLLs while MetaHook (and Half-Life) is 32-bit. I can only think the DLLs are somehow corrupted, or there are rogue DLLs in your SysWOW64 folder.

Did you trying validating all your game files through Steam? Maybe this is it?

Can you look for a "libsndfile-1.dll", "alure2.dll", "audio.dll", and "OpenAL32.dll" in your SysWOW64 and System32 (which are inside C:\Windows) folder?
It shouldn't be a thing, as those files are also in the executable folder, however who knows? You can check if it is 32-bit or 64-bit by following the selected answer here:
https://superuser.com/questions/358434/how-to-check-if-a-binary-is-32-or-64-bit-on-windows

@MapMappening
Copy link
Author

Good news, it finally worked
I have 2 versions of OpenAl (Particularly OpenAl Soft). A 32-bit version for System32, and a 64-bit version for SysWOW64. They are the only files that are similar to Metahook's. When I removed the 64-bit version from SysWOW64 and started Metahook again, it gave me a different error.
Error code: 126. Message: The specified module could not be found
It seems that no matter what, it's trying to load the file from SysWOW64. Even if I remove the OpenAL that came with Metahook it will always load from there.
So out of curiosity I replaced the 64-bit version with the 32-bit one.
Loaded "audio.dll" succesfully

@LAGonauta
Copy link
Owner

LAGonauta commented Jul 3, 2019

Great, I am closing this issue now :D
I agree that the names are confusing, one should put 32-bit DLLs in SysWOW64 and 64-bit DLLs in System32 ;)

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