You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-21Lines changed: 23 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,51 +14,53 @@ To execute a script, just press `ENTER` or double-click it. After running a scri
14
14
15
15
An active script will then be monitored for changes. If you modify the script in your favorite text editor and save it, then QScripts will execute the script for you automatically in IDA.
16
16
17
-
To deactivate a script, just press `Ctrl-D` or right-click and choose `Deactivate script monitor` from the QScripts window. When an active script becomes inactive, it will be shown in *italics*.
17
+
To deactivate the script monitor, just press `Ctrl-D` or right-click and choose `Deactivate script monitor` from the QScripts window. When an active script becomes inactive, it will be shown in *italics*.
18
18
19
19
There are few options that can be configured in QScripts. Just press `Ctrl+E` or right-click and select `Options`:
20
20
21
21
* Clear message window before execution: clear the message log before re-running the script. Very handy if you to have a fresh output log each time.
22
22
* Show file name when execution: display the name of the file that is automatically executed
23
-
* Execute the unload script function: A special function, if defined, called `__quick_unload_script` will be invoked before reloading the script. This gives your script a chance to do some cleanup (for example to unregister some hotkeys)
23
+
* Execute the unload script function: A special function, if defined in the global scope (usually by your active script), called `__quick_unload_script` will be invoked before reloading the script. This gives your script a chance to do some cleanup (for example to unregister some hotkeys)
24
24
* Script monitor interval: controls the refresh rate of the script change monitor. Ideally 500ms is a good amount of time to pick up script changes.
25
-
* Allow QScripts execution to be undo-able: The executed script's side effects can be reverted with IDA's Undo
25
+
* Allow QScripts execution to be undo-able: The executed script's side effects can be reverted with IDA's Undo.
26
26
27
27
## Executing a script without activating it
28
28
29
-
It is possible to execute a script from QScripts without having to activate it. Just press `Shift-ENTER` on a script and it will be executed.
29
+
It is possible to execute a script from QScripts without having to activate it. Just press `Shift-Enter` on a script and it will be executed (disregarding if there's an active script or not).
30
30
31
-
## Working with dependencies
31
+
## Managing Dependencies in QScripts
32
32
33
-
It is possible to instruct QScripts to re-execute the active script if any of its dependent scripts are also modified. To use the automatic dependency system, please create a file named exactly like your active script but with the additional `.deps.qscripts` extension. In that file you put your dependent scripts path.
33
+
QScripts offers a feature that allows automatic re-execution of the active script when any of its dependent scripts, undergo modifications.
34
34
35
-
When using Python, it would be helpful if we can also [reload](https://docs.python.org/3/library/importlib.html#importlib.reload) the changed dependent script from the active script automatically. To do that, simply add the directive line `/reload` along with the desired reload syntax. For example, here's a complete `.deps.qscripts` file with a `reload` directive (for Python 2.x):
35
+
### Setting Up Automatic Dependencies
36
36
37
-
```
38
-
/reload reload($basename$)
39
-
t2.py
40
-
// This is a comment
41
-
t3.py
42
-
```
37
+
To leverage this automatic dependency tracking feature, create a file named identically to your active script, appending `.deps.qscripts` to its name. This file should contain paths to dependent scripts, along with any necessary reload directives.
43
38
44
-
And for Python 3.x:
39
+
Optionally, you can place the `.deps.qscripts` file within a `.qscripts` subfolder, located alongside your active script.
For projects involving Python, QScripts can automatically [reload](https://docs.python.org/3/library/importlib.html#importlib.reload) any changed dependent Python scripts. Include a `/reload` directive in your `.deps.qscripts` file, followed by the appropriate Python reload syntax.
So what happens now if we have an active file `t1.py` with the dependency file above?
54
+
The `t1.py.deps.qscripts` configuration enables the following behavior:
54
55
55
-
1.Any time `t1.py`changes, it will be automatically re-executed in IDA.
56
-
2.If the dependency index file `t1.py.deps.qscripts` is changed, then your new dependencies will be reloaded and the active script will be executed again.
57
-
3.If any dependency script file has changed, then the active script will re-execute. If you had a `reload` directive set up, then the modified dependency files will also be reloaded.
56
+
1.**Script Auto-Execution**: Changes to `t1.py`trigger its automatic re-execution within the IDA environment.
57
+
2.**Dependency Reload**: Modifications to the dependency index file (`t1.py.deps.qscripts`) lead to the reloading of specified dependencies, followed by the re-execution of the active script.
58
+
3.**Dependency Script Changes**: Any alteration in a dependency script file causes the active script to re-execute. If a reload directive is present, the modified dependency files are also reloaded. In our cases, if either or both of `t2.py` and `t3.py` are modified, `t1.py` is re-executed and the modified dependencies are reloaded as well.
58
59
59
-
Please note that if each dependent script file has its own dependency index file, then QScripts will recursively make all the linked dependencies as part of the active script dependencies. In this case, the directives (such as `reload`) are ignored.
60
+
**Note**: If a dependent script possesses its own `.deps.qscripts`file, QScripts recursively integrates all linked dependencies into the active script's dependencies. However, specific directives (e.g., `reload`) within these recursive dependencies are disregarded.
0 commit comments