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

Function graceful_execve

tests/test_shellcode.py:81–87  ·  view source on GitHub ↗
(ql: Qiling, pathname: int, argv: int, envp: int, retval: int)

Source from the content-addressed store, hash-verified

79# string and not valid code. that causes Qiling to raise an exception, and this is
80# why we need a way to thwart those execve failures and end the emulation gracefully
81def graceful_execve(ql: Qiling, pathname: int, argv: int, envp: int, retval: int):
82 assert retval != 0, f'execve is not expected to return on success'
83
84 vpath = ql.os.utils.read_cstring(pathname)
85
86 ql.log.debug(f'failed to call execve("{vpath}"), ending emulation gracefully')
87 ql.stop()
88
89
90class TestShellcode(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

read_cstringMethod · 0.80
stopMethod · 0.45

Tested by

no test coverage detected