- Files in
/include/
folder are made for export and its content are API headers as LGPLv3 decribes.
The original location of this work is HERE.
Injector is synonim of new syringe.
You can just run injector as Syringe ${filenameOfExecutable}
. In this case it will scans current (working) directory (as original syringe does) for dlls to inject.
Hook order is necessary. You must know that injector put all hooks into lists for each specified addresss of hook. So first processed injectable dll will be placed at beginning of 'hook pocket' and last will be placed at ending. It is really necessary when hook is reached then control flow transfers to hook pocket and some of hooks can move out of 'hook pocket'. You can control order and list of dlls via -dll
.
Dlls that was made for original syringe is supported and all hooks of such dll are generic hook
which described below.
Just use this command line argument: -dll ${filenameOfDll}
as many as you need. Be sure that order of declared dlls with this method is Left-to-Right. If any -dll ${filenameOfDll}
present then directory scanning is disabled.
See defiitions and macroses at Include/Syringe.h
.
Recommendation: always use extended hook instead of generic hook (and do not use nullptr
case for name for extended hooks) to prevent problems with dynamic module base when basic address is different. Also, it should help with ASLR (need testing).
Common original syringe hook. Can be placed only at executable and there is no any conditions for disable it.
Macro: DEFINE_HOOK
& DEFINE_HOOK_AGAIN
Parameters:
- Address
The address where hook will be placed.
This is absolute address for hook placement:
AbsoluteAddress = ModuleBase + Offset
. - Function name Hook related function.
- Overriden bytes (of instrutions) Count of bytes to override at hook placement. Minimal: 5 (injector fix any smaller value). If 'hook pocket' executes all functions and there is no jump out then instruction of this bytes will be executed before jump back.
Extended version of generic hook. It is possible place it againts specific DLL and for specific checksum (CRC32) of target module.
Macro: DEFINE_HOOK_EX
& DEFINE_HOOK_EX_AGAIN
Parameters:
- Address
The address where hook will be placed.
This is relative address (offset) for hook placement:
AbsoluteAddress = ModuleBase + Offset
. If module specified asnullptr
then absolute address placement present like generic hook. - Function name Hook related function.
- Overriden bytes (of instrutions) Count of bytes to override at hook placement. Minimal: 5 (injector fix any smaller value). If 'hook pocket' executes all functions and there is no jump out then instruction of this bytes will be executed before jump back.
- Prefix Just internal identifier to split up hook definitions with same name.
- Name
Name of target module. If File version info (FVI) present then name of it will be used. If FVI is not present then filename will be used.
nullptr
is special value which target module is current executable. - Checksum
CRC32 value. Hook will be placed againts module with specific checksum. Can be used for versioning.
0
is special value which mean any module version.
Original syringe has mechanic for hosts target. It is a list of module names with specific checksums. Syringe and injector check it for each injectable dll.
It can be done with declhost
macro.
This pair should be run with this order: -dll Phobos.dll -dll Ares.dll
. It is necessary.