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