MCPcopy Create free account
hub / github.com/qilingframework/qiling / get_count

Function get_count

tests/test_windows_stdio.py:20–34  ·  view source on GitHub ↗
(flag: Sequence[str])

Source from the content-addressed store, hash-verified

18
19
20def get_count(flag: Sequence[str]):
21 ql = Qiling(["../examples/rootfs/x86_windows/bin/crackme.exe"], "../examples/rootfs/x86_windows", verbose=QL_VERBOSE.OFF, libcache = True)
22 ql.os.stdin = pipe.SimpleStringBuffer()
23 ql.os.stdout = pipe.SimpleStringBuffer()
24
25 count = [0]
26 ql.hook_code(instruction_count, count)
27
28 ql.os.stdin.write(bytes("".join(flag) + "\n", 'utf-8'))
29 ql.run()
30
31 print(ql.os.stdout.read().decode('utf-8'), end='')
32 print(f' ============ count: {count[0]:d} ============ ')
33
34 return count[0]
35
36
37def solve():

Callers 1

solveFunction · 0.85

Calls 5

runMethod · 0.95
QilingClass · 0.90
hook_codeMethod · 0.80
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected