This page acts as a "quick start" guide for getting Hookshot set up and running as an end user. It assumes the user is already in possession of any hook modules and DLLs and have one or more target applications in mind. Its target audience is end users.
System Requirements
-
Windows 10 or 11. Older versions of Windows are not supported.
-
Visual C++ Runtime for Visual Studio 2022. If running a 64-bit operating system, install both the x86 and the x64 versions of this runtime, otherwise install just the x86 version.
Obtaining Binaries
Hookshot binaries are available on its Releases page. Be sure to download the latest available version.
Running an Application
-
Download the latest release of Hookshot and place all of the Hookshot executables and DLLs into any directory. Unless running a 32-bit operating system, it is recommended that both 32-bit and 64-bit versions of HookshotExe and HookshotDll be placed into this directory.
- In general it is a good idea to place HookshotExe and HookshotDll into the same directory as the desired target applications. This is actually required if using the launcher.
-
Place any desired hook modules into the same directory as the Hookshot binaries or the application's executable file. If there are any DLLs to be injected, which are not themselves hook modules, they can be located anywhere.
- If both 32-bit and 64-bit versions of a hook module is available, Hookshot will automatically load the correct version to match the target application.
- If the correct version to match the target application is not available, Hookshot will be unable to load the hook module.
-
Optionally create or place a configuration file" into the same directory as the application's executable file.
- If Hookshot's default behavior is acceptable, then a configuration file is not necessary. Hookshot's default behavior is to load all hook modules it finds in the same directory as the application's executable file.
-
Run the application with Hookshot. There are two ways to do this. The more convenient option is to use the launcher, but it is also possible to use HookshotExe directly.
- If the target application requires administrator permission, HookshotExe will request administrator permission before running it.
Option 1: Using HookshotLauncher
-
Place HookshotLauncher into the same directory as the application's executable file.
- HookshotLauncher requires that HookshotExe and HookshotDll also be located in this directory. This is not necessary when using HookshotExe directly.
-
Rename the application's executable file by adding the text
_HookshotLauncher_to the beginning.- For example,
Application.exewould be renamed_HookshotLauncher_Application.exe.
- For example,
-
Rename HookshotLauncher's executable file so that it exactly matches the original name of the application's executable file.
- Continuing with the preceding example,
HookshotLauncher.32.exewould be renamedApplication.exe.
- Continuing with the preceding example,
-
Run HookshotLauncher in the same way as the original application would normally be run.
- Continuing with the preceding example, launch
Application.exehowever it is normally launched: by Start Menu shortcut, double-click in File Explorer, and so on. - HookshotLauncher will automatically create an application-specific authorization file for the executable it is launching. If creating this file requires administrator permission, HookshotLauncher will display a prompt for approval before requesting it.
- Continuing with the preceding example, launch
Option 2: Using HookshotExe
-
Authorize Hookshot to act on the target application.
-
Use HookshotExe to run the application.
- If both the 32-bit and 64-bit versions of HookshotExe and HookshotDll are present, then it does not matter which version is used to launch the application. Hookshot will automatically switch to the correct version.
- For example, to run the application
C:\Directory\Application.exe, do one of these two things:- In File Explorer, drag and drop
C:\Directory\Application.exeontoHookshot.32.exeorHookshot.64.exe. - Execute or create a shortcut that runs
Hookshot.32.exe C:\Directory\Application.exeorHookshot.64.exe C:\Directory\Application.exe.
- In File Explorer, drag and drop
- If the application's path contains spaces, enclose it in quotes. Example:
Hookshot.64.exe "C:\Directory with Spaces\Application with Spaces.exe" - Command line arguments can be passed to the application. Example:
Hookshot.32.exe C:\Directory\Application.exe --arg=val1 "--arg2=value with spaces"
Files and Directories
HookshotExe and HookshotDll exist in both 32-bit (Hookshot.32.exe and Hookshot.32.dll) and 64-bit (Hookshot.64.exe and Hookshot.64.dll) forms. These files can be placed into any directory as long as they remain together in the same directory. This is because HookshotExe looks for HookshotDll in the same directory as itself, and when injecting itself into child processes spawned by a target process, HookshotDll likewise looks for HookshotExe in the same directory as itself.
HookshotLauncher is similarly available in both 32-bit (HookshotLauncher.32.exe) and 64-bit (HookshotLauncher.64.exe) forms. It exists purely as a convenience to users: the only things it does is automates some of the bootstrapping steps and runs HookshotExe with some predetermined arguments. In other words, it is fancy wrapper around HookshotExe. HookshotLauncher requires that it be located in the same directory as both the target executable and HookshotExe. The 32-bit version of HookshotLauncher looks for the 32-bit version of HookshotExe, and similarly the 64-bit version of HookshotLauncher looks for the 64-bit version of HookshotExe.
Configuration files, if supplied, must be named Hookshot.ini and placed into the same directory as either the target application's executable file or the directory in which Hookshot itself is located. If HookshotDll is unable to locate a configuration file it will silently apply default behaviors and settings.
Hook modules are generally expected to exist in both 32-bit and 64-bit form, which respectively have file names that follow the convention [Name].HookModule.32.dll and [Name].HookModule.64.dll, where [Name] is the name of the hook module. Hook modules should be placed in the same directory as the Hookshot binaries or the target application's executable. This is because hook modules are identified to HookshotDll by name (i.e. using only the [Name] part of the filename), and HookshotDll looks for hook modules in paths relative to these two locations.
Injected DLLs can be located anywhere. HookshotDll relies on the system's built in mechanism for locating DLLs, and full absolute path names can be specified.
To see how this all fits together, consider an example:
C:\Hookshotcontains HookshotExe and HookshotDll.C:\Directory\Application.exeis the target application.SomeRandomHooks.HookModule.32.dllandSomeRandomHooks.HookModule.64.dllare the hook module files.LibraryToInject.dllis a DLL to be injected.
In this scenario, Hookshot.ini would be located in C:\Directory, and both SomeRandomHooks.HookModule.32.dll and SomeRandomHooks.HookModule.64.dll should be placed into C:\Directory. LibraryToInject.dll can be located anywhere.
Following the same scenario, if C:\Directory\Application.exe spawns a child process C:\SomeOtherDirectory\SomeOtherApplication.exe, then HookshotDll will look for another configuration file in C:\SomeOtherDirectory and will expect to find hook modules to be loaded into the child process in C:\SomeOtherDirectory. The key takeaway is that, from a configuration standpoint, HookshotDll treats being injected into a target process the same way irrespective of how that target process was spawned.
Authorizing Hookshot
Because the modifications that Hookshot performs on a target application can be invasive, Hookshot requires explicit permission from the end user before it will act on any application.
There are two ways to give Hookshot the permission it needs, both illustrated by way of example:
- Application-Specific Authorizaztion: To authorize Hookshot to act on
C:\Directory\Application.exe, create the fileApplication.exe.hookshotand place it inC:\Directory. The contents of the file do not matter. Hookshot only checks that the file exists. - Directory-Wide Authorization: To authorize Hookshot to act on all executables located in
C:\Directory, create the file.hookshotand place it inC:\Directory. The contents of the file do not matter. Hookshot only checks that the file exists.
Hookshot can additionally act on any programs spawned as children of the target application. It will do so automatically, but only if authorized. For example, while C:\Directory\Application.exe is running it might launch another program, C:\Dir2\App2.exe. If Hookshot is already acting on C:\Directory\Application.exe, it will automatically also act on C:\Dir2\App2.exe, but only if either C:\Dir2\App2.exe.hookshot or C:\Dir2\.hookshot exists.