Revive icon indicating copy to clipboard operation
Revive copied to clipboard

Injecting games that use shortcut/commandlines

Open optimumbox opened this issue 9 years ago • 12 comments

I'm currently having trouble injecting into a game that is using command lines to run a modded version of said game.

When trying to hook, the log shows:

Launched injector with: "C:\Program Files\Revive\Revive\x86\ReviveInjector_x86.exe" "E:\SteamLibrary\steamapps\common\Half-Life 2\hl2 - Shortcut.lnk" Creating process: E:\SteamLibrary\steamapps\common\Half-Life 2\hl2 - Shortcut.lnk Failed to create process

The problem is I need to use that short cut in order to enforce the command line for the base game to access the sourcemod. Any suggestions to get this to hook to right process rather than the shortcut? I can't inject it on the base exe since that just runs without commands.

optimumbox avatar Mar 20 '17 04:03 optimumbox

HL2 has native Vive support though, here's a guide: https://www.reddit.com/r/Vive/comments/4m4o7k/you_can_still_play_half_life_2_in_native_vr_mode/

CrossVR avatar Mar 20 '17 09:03 CrossVR

Have you read the wiki? https://github.com/LibreVR/Revive/wiki#steam-games

CrossVR avatar Mar 20 '17 13:03 CrossVR

Yes and sorry about the duplicate. The problem is whether or not I patch it or try manual injection, the revive log is trying to attach to the shortcut of the mod rather than the base exe.

-full -w 1200 -h 684 -game "C:\Program Files (x86)\Steam\steamapps\sourcemods\hlvr" -includepath "E:\SteamLibrary\steamapps\common" These are the commands I'm trying to enforce on the game itself. They're need for the mod to run.

I'll send you an invite to the development slack channel where you can grab a copy for yourself and see what I'm trying to do. I'd drop the mod here, but I've been asked to not publicly distribute it yet.

optimumbox avatar Mar 20 '17 13:03 optimumbox

I'm pretty sure I already have access to the slack channel. Anyway, when you have patched the executable you don't need to use the injector anymore. But I can see why that might fail on the source engine, I'm not sure they attempt to load XInput, which I use as a proxy to get it to load Revive.

Anyway, if you're a developer on the mod, why don't you just implement OpenVR support? It's not very difficult.

CrossVR avatar Mar 20 '17 13:03 CrossVR

I'm not a dev, just someone helping to test. I'm the only vive user on the channel that has been trying to get it running. They claimed a lot of the code needs to be rewritten for openvr.

optimumbox avatar Mar 20 '17 13:03 optimumbox

Also, just to be clear, the injector already accepts command-line argument, but what you're trying to do won't work even if I change the injector to resolve the shortcut. Because Steam will get in the way of the injector, so patching or native support is your only option.

CrossVR avatar Mar 20 '17 13:03 CrossVR

Well, even if they're not willing to implement OpenVR support, if they can just simply add one line in the source code that says LoadLibrary("LibRevive64_1.dll"); then you can simply put these DLLs next to hl2.exe and Revive will take care of the rest: LibRevive.zip

CrossVR avatar Mar 20 '17 13:03 CrossVR

Thank you for the help. I'll let them know that. Until then, I'm trying the old source method of merging the mod and base game into a new folder, which will hopefully resolve the need of the shortcut.

optimumbox avatar Mar 20 '17 13:03 optimumbox

As long as Steam pops up saying it's starting HL2 it won't work.

CrossVR avatar Mar 20 '17 13:03 CrossVR

It's not, when running it from the the folder, it runs normally. Merging the files got it to inject, but not send anything to the headset. So I'm going to see if I can get them to add the call for your dll.

optimumbox avatar Mar 20 '17 13:03 optimumbox

Well, if Steam isn't launching the application, then it should be enough to simply edit your shortcut and put "C:\Program Files\Revive\Revive\x86\ReviveInjector_x86.exe" in front of the target.

CrossVR avatar Mar 20 '17 13:03 CrossVR

Just wanted to give you an update. I merged the mod files within the base hl2 directory to bypass the need of command lines and got revive to inject successfully. Unfortunately within the game itself it's still giving "failed to communicate with OVR" errors within the console. To quote one of the devs on the matter. "the rotation and gun controllers is all that uses vr code the rest is not related to any vr api, so revive does not work." So the problem is definitely not on revive's end. If you have any free time available, I'm sure your input would be valued in the slack channel. We have a limited amount of testers available at the current moment and they seem to be having some trouble getting steamvr to work with source, though I'm confident they'll eventually get it working. Thanks for your time.

optimumbox avatar Mar 21 '17 17:03 optimumbox