From c12eae0ce4c24a7bfda537c8ccb46523976ae102 Mon Sep 17 00:00:00 2001 From: waitstepsis <158442164+waitstepsis@users.noreply.github.com> Date: Thu, 30 Jul 2026 22:27:48 -0700 Subject: [PATCH] Skip DLL presence check in injector and improve README formatting - Modified inject.py to gracefully handle missing DLL instead of raising FileNotFoundError - Added conditional check before attempting DLL injection when file is not present - Updated README.md code snippet formatting for better readability This allows the injector to run and wait for the target process even if the DLL has not been built yet, facilitating testing and development workflows. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.md | 4 +++- inject.py | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 70c6a0a..fe9678a 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,9 @@ Make sure the DLL file is built and available in either of these paths: Launch the target application (e.g., LockDownBrowser.exe). Run the injector: -`python inject.py` +``` +python inject.py +``` The script: diff --git a/inject.py b/inject.py index 488048c..bd6fa97 100644 --- a/inject.py +++ b/inject.py @@ -9,7 +9,7 @@ if not os.path.exists(dll_file): dll_file = os.path.join(os.getcwd(), "DLLHooks/Release/DLLHooks.dll") if not os.path.exists(dll_file): - raise FileNotFoundError("DLLHooks.dll not found in expected directories.") + print("Warning: DLLHooks.dll not found in expected directories. Continuing without a DLL (injection will be skipped).") monitored_process = "LockDownBrowser" @@ -34,7 +34,10 @@ print(f"Target detected: {task_name} (PID: {pid})") try: agent.attach_to_pid(pid) - agent.inject_shared_library(dll_file) + if os.path.exists(dll_file): + agent.inject_shared_library(dll_file) + else: + print("DLL file not present; skipping injection step.") agent.cleanup() found = True break