Skip to content

Add HookAnalyzer Logic#20

Open
IronHammer-Std wants to merge 6 commits into
Phobos-developers:masterfrom
IronHammer-Std:master
Open

Add HookAnalyzer Logic#20
IronHammer-Std wants to merge 6 commits into
Phobos-developers:masterfrom
IronHammer-Std:master

Conversation

@IronHammer-Std
Copy link
Copy Markdown

Context

See Phobos PR #2201

NOTE

all the flags are temporarily stored in the SyringeDebugger class, and maybe we need to move it to another subclass.
HookAnalyzer class is moved from SyringeIH here as it was except a few translations.
HookAnalyzer::ReportNDJSON is not yet implemented until we import a JSON library,and I place the function here just as Kerbiter's wish.
some of the flags are set to default because the coupled components are not here in SyringeEx, so now every hook are set to be shown in the hook analysis.

New & Enhanced Logic :

Components (1) :
HookAnalyzer

New Flags (8) :

    bool bDryRun{ false };
    bool bGenerateINJ{ false };
    bool bReportLOG{ false };
    bool bReportJSON{ false };
    bool bDetectConflict{ false };
    bool bShowHookConflictPopup{ false };
    bool bReportLogByAddress{ true };
    bool bReportLogByLibrary{ true };

Launch Arguments (8) :

--dryrun : run syringe without launching game.
--generate-inj : generate INJ files and place them in .\INJ folder
--report-log : generate a HookAnalysis.log, as it functions in SyringeIH but in English
--no-by-address : Disable the "By Address" part in HookAnalysis.log.
--no-by-library : Disable the "By Library" part in HookAnalysis.log.
--report-json : generate a HookAnalysis.json TODO
--detect-conflict : Detect hook conflict and output to Syringe.log, as it functions in SyringeIH but in English
--show-hook-conflict-popup : Show a popup when --detect-conflict is enabled and a conflict is detected.

In the dry run mode all other 7 flags are available.

@ZivDero
Copy link
Copy Markdown

ZivDero commented May 14, 2026

Can you elaborate on what this does?
--detect-conflict seems straghtforward and useful for cross-library problems.
But it's unclear what any of the rest is.

@IronHammer-Std
Copy link
Copy Markdown
Author

OK let me explain the rest flags.
the design simply copies SyringeIH and most of the design reserved.

Dry Run Mode --dryrun

The dry-run mode is a new one.
It came from a request of Kerbiter which simply run the analysis without starting the game
It collects hook data from DLLs, performs selected analyses, then output results and exit.

Generate INJ File --generate-inj

This calls GenerateINJ() to export all recognized hooks into standard INJ files (like ares.dll.inj) under the .\INJ folder.
Maybe useful for backing up hook configurations or migrating to other tools that read the INJ format.

Hook Analysis Report --report-log/--no-by-address/--no-by-library

Produces a HookAnalysis.log file (in English, equivalent to SyringeIH's HookAnalysis.log). By default, it includes both "By Address" and "By Library" sections. (See Phobos PR #2201, TaranDahl's SKILL.md depend on this log) You can also use --no-by-address and --no-by-library to selectively disable either section.

Hook Analysis in NDJSON ( TODO ) --report-json

Reserved flag for generating a HookAnalysis.json in the future NDJSON format requested by Kerbiter. Implementation is pending the integration of a JSON library.

--detect-conflict/--show-hook-conflict-popup

When --detect-conflict is active, this flag also shows a message box warning the user about any detected conflicts when enabled.

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

Successfully merging this pull request may close these issues.

2 participants