LMSDev / W_D-Hook

A script hook for Watch Dogs which exposes the lua API functions to users to allow them to create their own scripts. Please note that project is discontinued and doesn't work with the latest version and should be considered an educational project.
GNU General Public License v2.0
16 stars 5 forks source link

How to use it? #2

Open Polly44 opened 1 year ago

Polly44 commented 1 year ago

I saw that 'LuaFunctions' holds the offset for these respective lua functions. Asked a friend to compile the VS_sln, but it produces several dlls. So my simple question is: a. what needs to be installed to hook the script ? b. while ingame, how to invoke any lua script/function ?

I can test this with the original v1.0, to see it's working. If so, I can then update the offsets to its latest version and test accordingly.

LMSDev commented 1 year ago

There is only one dll that matters which is the main project (WatchDogsScriptHook). You need to inject that into the game process. You can choose to use the proxy dll project provided or use any other means of dll injection. Pressing F10 will load your lua scripts.

https://github.com/LMSDev/W_D-Hook/blob/aaeb8f47fd49304b4b861bf8adaaf5a0c6490f94/WatchDogsScriptHook/WatchDogsScriptHook.cpp#L93

Polly44 commented 1 year ago

thx for replying back; much appreciated. AND: before you take any further steps, I've already made the CT table; this is just a nice-to-have for some of the gamers out there (and far less important to me atm ~ not really my thing). Iow if you do not want to take out more time for this, just say so... no probs here.

That said: (keep in mind i'm not a programmer ~ did some minor C++ like 10+ years ago). But i'm pretty good in building CT (cheat engine) tables though. So:

  1. placed both [WatchDogsScriptHook.dll] and (renamed) [DInput8.dll] in the bin_folder; and launched the game (also tried unrenamed btw)
  2. loaded up CE's [Memory Viewer ~ Tools ~ Enumerate dlls], expecting to find your dll in that list
  3. since it was not there, tried [Memory Viewer ~ Tools ~ Inject dll] (never used this before), which returns me an error (refering msvcp140.dll)

I did some code_reading as well:

Anywho: any chance that I can get my hands on a compiled dll_pair somewhere ? p

ps: there is another lua_hook out there; which i could make work (with the original v1 exe). but no code available there (as far as i know) like i mentioned before: based on your code_files, i can (have collected) the new/latest offsets already... On Wednesday, 8 February 2023, 01:28:00 CET, LMS @.***> wrote:

There is only one dll that matters which is the main project (WatchDogsScriptHook). You need to inject that into the game process. You can choose to use the proxy dll project provided or use any other means of dll injection. Pressing F10 will load your lua scripts.

https://github.com/LMSDev/W_D-Hook/blob/aaeb8f47fd49304b4b861bf8adaaf5a0c6490f94/WatchDogsScriptHook/WatchDogsScriptHook.cpp#L93

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

LMSDev commented 1 year ago

If injecting the DLL with CE gives you an error, then the same error most likely also happens when the loader (dinput8.dll) tried to inject it. It is a bit weird that you can build it with the C++ SDK but then it misses the dependencies when trying to actually inject. You could try something like https://github.com/lucasg/Dependencies to look at the dependencies your compiled DLL has and which ones fail to resolve.

Polly44 commented 1 year ago

hi,

this is well out of my comfortzone; and my friend "got better things to do" (if you catch my drift). I'll put this aside, and pick it up again in due time...

much appreciated for taking out the time. cheers, p

 On Wednesday, 15 February 2023, 18:27:48 CET, LMS ***@***.***> wrote:  

If injecting the DLL with CE gives you an error, then the same error most likely also happens when the loader (dinput8.dll) tried to inject it. It is a bit weird that you can build it with the C++ SDK but then it misses the dependencies when trying to actually inject. You could try something like https://github.com/lucasg/Dependencies to look at the dependencies your compiled DLL has and which ones fail to resolve.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>