def test_elf_linux_x8664_path_traversion(self): ql = Qiling(["../examples/rootfs/x8664_linux/bin/path_traverse_static"], "../examples/rootfs/x8664_linux", verbose=QL_VERBOSE.DEBUG) ql.os.stdout = pipe.SimpleOutStream(sys.stdout.fileno()) ql.run() self.assertTrue("root\n" not in ql.os.stdout.read().decode("utf-8")) del ql
def test_x8664_getcwd(self): ql = Qiling(["../examples/rootfs/x8664_linux/bin/testcwd"], "../examples/rootfs/x8664_linux", verbose=QL_VERBOSE.DEBUG) ql.os.stdout = pipe.SimpleOutStream(sys.stdout.fileno()) ql.run() self.assertEqual(ql.os.stdout.read(), b'/\n/lib\n/bin\n/\n') del ql
def test_elf_linux_x86_getdents64(self): ql = Qiling(["../examples/rootfs/x86_linux/bin/x86_getdents64"], "../examples/rootfs/x86_linux", verbose=QL_VERBOSE.DEBUG) ql.os.stdout = pipe.SimpleOutStream(sys.stdout.fileno()) ql.run() self.assertTrue("bin\n" in ql.os.stdout.read().decode("utf-8")) del ql
def test_x8664_absolute_path(self): ql = Qiling(["../examples/rootfs/x8664_linux/bin/absolutepath"], "../examples/rootfs/x8664_linux", verbose=QL_VERBOSE.DEBUG) ql.os.stdout = pipe.SimpleOutStream(sys.stdout.fileno()) ql.run() self.assertEqual(ql.os.stdout.read(), b'test_complete\n\ntest_complete\n\n') del ql