Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ARCHITECTURE/modules/cli-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ examples/tests belongs to its runtime owner.

Use the [root baseline](../../ARCHITECTURE.md#code-conventions).
`argparse` actions convert enum/environment inputs and build `Qiling` keyword
arguments. Preserve option names and exit status. TUI uses questionary/fx/
termcolor; testing its import is not testing its prompts. Keep build metadata
arguments. Preserve option names and exit status. TUI uses questionary/termcolor; its
interactive report viewer imports `fx` lazily and ships in the `tui`
extra; testing its import is not testing its prompts. Keep build metadata
in the manifest, resolve its lock with Poetry, and retain package license
and resource attribution. Documentation here contains coding context only.

Expand Down
2 changes: 1 addition & 1 deletion ARCHITECTURE/modules/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ paths are explicitly owned by hardware/bare-metal modules.
## Local Conventions

Use [root conventions](../../ARCHITECTURE.md#code-conventions); optional
packages use manifest extras `fuzz` and `RE`. Format classes expose
packages use manifest extras `fuzz` and `RE` (the TUI report viewer uses `tui`). Format classes expose
`FORMAT_NAME` and activate/deactivate/dump methods; imports register subclasses
with factories. No common C standard is declared for fuzz harnesses; inspect
the local `fuzz.c`/build instructions. Generated SDK stubs require review;
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ Qiling also provides a friendly tool named `qltool` to quickly emulate shellcode
Installing Qiling with pip also installs the `qltool` command, including
`qltool qltui` for the terminal UI. In a source checkout, use `./qltool` as
shown below. Example binaries and rootfs files must be downloaded separately.
The interactive JSON report viewer offered by `qltool qltui` is an optional
extra: install it with `pip install qiling[tui]`.

With qltool, easy execution can be performed:

Expand Down
67 changes: 42 additions & 25 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ gevent = ">=24.10"
multiprocess = ">=0.70.12.2"
windows-curses = { version = "^2.1.0", markers = "platform_system == 'Windows'" }
pyyaml = "^6.0.1"
python-fx = "*"
questionary = "*"
termcolor = "*"

Expand All @@ -54,9 +53,12 @@ fuzzercorn = { version = "^0.0.1", markers = "platform_system == 'Linux'", optio

r2libr = { version = "^5.7.4", optional = true }

python-fx = { version = "*", optional = true }

[tool.poetry.extras]
fuzz = ["unicornafl", "fuzzercorn"]
RE = ["r2libr"]
tui = ["python-fx"]

[build-system]
requires = ["poetry-core>=2.0,<3.0"]
Expand Down
8 changes: 6 additions & 2 deletions qltui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import argparse
import json

from pyfx import PyfxApp
from pprint import pprint
from datetime import datetime

Expand Down Expand Up @@ -473,7 +472,12 @@ def show_report(ql: Qiling, report, hook_dictionary):
if command == 'report':
pprint(report)
elif command == 'interactive report':
PyfxApp(data=report).run()
try:
from pyfx import PyfxApp
except ImportError:
print('the interactive report viewer is not installed; get it with: pip install qiling[tui]')
else:
PyfxApp(data=report).run()
elif command == 'save to json':
time = datetime.now().strftime("%Y_%m_%d_%H-%M-%S")
report_name = f"report_{ql.targetname.replace('.', '_')}_{os_name}_{arch_name}_{time}.json"
Expand Down
3 changes: 2 additions & 1 deletion tests/test_qltool.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def test_qltool_shellcode_exit_status(self):

def test_qltui_import(self):
result = subprocess.run(
[sys.executable, '-I', '-c', 'import qltui; assert callable(qltui.get_data)'],
[sys.executable, '-I', '-c',
'import sys, qltui; assert callable(qltui.get_data); assert "pyfx" not in sys.modules'],
cwd=self.cwd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
text=True, timeout=30
)
Expand Down