Skip to content

Commit ad04565

Browse files
committed
Remove output in the whole project
Please use verbose instead. See core.py for details
1 parent e18615e commit ad04565

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+218
-241
lines changed

examples/adcache_x86_windows_debug.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99
from zipfile import ZipFile
1010
from qiling import Qiling
11+
from qiling.const import QL_VERBOSE
1112

1213
if __name__ == "__main__":
1314
with ZipFile("shellcodes/win32_https_download.zip") as zip_reader:
1415
with zip_reader.open('win32_https_download.bin', 'r', b'infected') as f:
1516
sc = f.read()
1617

17-
ql = Qiling(code=sc, archtype="x86", ostype="windows", rootfs="rootfs/x86_windows", output="debug")
18+
ql = Qiling(code=sc, archtype="x86", ostype="windows", rootfs="rootfs/x86_windows", verbose=QL_VERBOSE.DEBUG)
1819
ql.run()

examples/cachedlls_x8664_windows.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
sys.path.append("..")
88

99
from qiling import Qiling
10+
from qiling.const import QL_VERBOSE
1011

1112
if __name__ == "__main__":
12-
ql = Qiling(["rootfs/x8664_windows/bin/x8664_hello.exe"], "rootfs/x8664_windows", output="default", libcache=True)
13+
ql = Qiling(["rootfs/x8664_windows/bin/x8664_hello.exe"], "rootfs/x8664_windows", verbose=QL_VERBOSE.DEFAULT, libcache=True)
1314
ql.run()

examples/crackme_x86_windows.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
sys.path.append("..")
88

99
from qiling import Qiling
10+
from qiling.const import QL_VERBOSE
1011

1112
class StringBuffer:
1213
def __init__(self):
@@ -33,7 +34,7 @@ def get_count(flag):
3334
stdin = StringBuffer()
3435
stdout = StringBuffer()
3536

36-
ql = Qiling(["rootfs/x86_windows/bin/crackme.exe"], "rootfs/x86_windows", output="off", stdin=stdin, stdout=stdout)
37+
ql = Qiling(["rootfs/x86_windows/bin/crackme.exe"], "rootfs/x86_windows", verbose=QL_VERBOSE.OFF, stdin=stdin, stdout=stdout)
3738

3839
stdin.write(bytes("".join(flag) + "\n", 'utf-8'))
3940
count = [0]

examples/extensions/report/hello_x86_windows_json.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
sys.path.append("..")
99

1010
from qiling import *
11+
from qiling.const import QL_VERBOSE
1112
from qiling.extensions.report import generate_report
1213

1314

1415
def my_sandbox(path, rootfs):
15-
ql = Qiling(path, rootfs, output="debug")
16+
ql = Qiling(path, rootfs, verbose=QL_VERBOSE.DEBUG)
1617
ql.run()
1718
my_json = generate_report(ql) # do something with the json
1819
print(generate_report(ql, pretty_print=True)) # or just print it to console

examples/fuzzing/dlink_dir815/dir815_mips32el_linux.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
sys.path.append("../../..")
1717
from qiling import *
18-
18+
from qiling.const import QL_VERBOSE
1919

2020
def main(input_file, enable_trace=False):
2121

@@ -29,7 +29,7 @@ def main(input_file, enable_trace=False):
2929
}
3030

3131
ql = Qiling(["./rootfs/htdocs/web/hedwig.cgi"], "./rootfs",
32-
output="debug", env=env_vars,
32+
verbose=QL_VERBOSE.DEBUG, env=env_vars,
3333
console = True if enable_trace else False)
3434

3535
def place_input_callback(uc, input, _, data):

examples/fuzzing/tenda_ac15/fuzz_tendaac15_httpd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
sys.path.append("../../../")
2020
from qiling import *
21-
21+
from qiling.const import QL_VERBOSE
2222

2323
def patcher(ql):
2424
br0_addr = ql.mem.search("br0".encode() + b'\x00')
@@ -27,7 +27,7 @@ def patcher(ql):
2727

2828

2929
def main(input_file, enable_trace=False):
30-
ql = Qiling(["rootfs/bin/httpd"], "rootfs", output = "debug", console = True if enable_trace else False)
30+
ql = Qiling(["rootfs/bin/httpd"], "rootfs", verbose=QL_VERBOSE.DEBUG, console = True if enable_trace else False)
3131

3232
# save current emulated status
3333
ql.restore(snapshot="snapshot.bin")

examples/fuzzing/tenda_ac15/saver_tendaac15_httpd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import ctypes, os, pickle, socket, sys, threading
1717
sys.path.append("..")
1818
from qiling import *
19+
from qiling.const import QL_VERBOSE
1920

2021
def nvram_listener():
2122
server_address = 'rootfs/var/cfm_socket'
@@ -64,7 +65,7 @@ def check_pc(ql):
6465

6566

6667
def my_sandbox(path, rootfs):
67-
ql = Qiling(path, rootfs, output="debug", verbose=5)
68+
ql = Qiling(path, rootfs, verbose=QL_VERBOSE.DEBUG)
6869
ql.add_fs_mapper("/dev/urandom","/dev/urandom")
6970
ql.hook_address(save_context ,0x10930)
7071
ql.hook_address(patcher, ql.loader.elf_entry)

examples/hello_8086_dos.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
sys.path.append("..")
88

99
from qiling import Qiling
10+
from qiling.const import QL_VERBOSE
1011

1112
if __name__ == "__main__":
12-
ql = Qiling(["rootfs/8086/dos/HI.DOS_COM"], "rootfs/8086/dos", output="disasm")
13+
ql = Qiling(["rootfs/8086/dos/HI.DOS_COM"], "rootfs/8086/dos", verbose=QL_VERBOSE.DEFAULT)
1314
ql.run()

examples/hello_arm_linux_custom_syscall.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
sys.path.append("..")
88

99
from qiling import Qiling
10-
from qiling.const import QL_OUTPUT
10+
from qiling.const import QL_VERBOSE
1111

1212
def my_syscall_write(ql: Qiling, write_fd, write_buf, write_count, *args, **kw):
1313
regreturn = 0
@@ -20,14 +20,12 @@ def my_syscall_write(ql: Qiling, write_fd, write_buf, write_count, *args, **kw):
2020
except:
2121
regreturn = -1
2222
ql.log.info("\n+++++++++\nmy write(%d,%x,%i) = %d\n+++++++++" % (write_fd, write_buf, write_count, regreturn))
23-
if ql.output in (QL_OUTPUT.DEBUG, QL_OUTPUT.DUMP):
24-
raise
2523

2624
return regreturn
2725

2826

2927
if __name__ == "__main__":
30-
ql = Qiling(["rootfs/arm_linux/bin/arm_hello"], "rootfs/arm_linux", output = "debug")
28+
ql = Qiling(["rootfs/arm_linux/bin/arm_hello"], "rootfs/arm_linux", verbose=QL_VERBOSE.DEBUG)
3129
# Custom syscall handler by syscall name or syscall number.
3230
# Known issue: If the syscall func is not be implemented in qiling, qiling does
3331
# not know which func should be replaced.

examples/hello_arm_linux_debug.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
sys.path.append("..")
88

99
from qiling import Qiling
10+
from qiling.const import QL_VERBOSE
1011

11-
def run_sandbox(path, rootfs, output):
12-
ql = Qiling(path, rootfs, output = output)
12+
def run_sandbox(path, rootfs, verbose):
13+
ql = Qiling(path, rootfs, verbose = verbose)
1314
ql.debugger = "qdb" # enable qdb without options
1415
# ql.debugger = "qdb::rr" # switch on record and replay with rr
1516
# ql.debugger = "qdb:0x1030c" # enable qdb and setup breakpoin at 0x1030c
1617
ql.run()
1718

1819
if __name__ == "__main__":
19-
run_sandbox(["rootfs/arm_linux/bin/arm_hello"], "rootfs/arm_linux", "debug")
20+
run_sandbox(["rootfs/arm_linux/bin/arm_hello"], "rootfs/arm_linux", QL_VERBOSE.DEBUG)

0 commit comments

Comments
 (0)