コード例 #1
0
ファイル: test_elf.py プロジェクト: ty60/qiling
        def test_syscall_openat(ql, openat_fd, openat_path, openat_flags, openat_mode, *args):
            target = False
            pathname = ql_read_string(ql, openat_path)

            if pathname == "test_syscall_open.txt":
                print("test => openat(%d, %s, 0x%x, 0%o)" % (openat_fd, pathname, openat_flags, openat_mode))
                target = True

            syscall.ql_syscall_openat(ql, openat_fd, openat_path, openat_flags, openat_mode, *args)

            if target:
                real_path = ql_transform_to_real_path(ql, pathname)
                assert os.path.isfile(real_path) == True
                os.remove(real_path)
コード例 #2
0
ファイル: test_elf.py プロジェクト: yzz127/qiling
        def test_syscall_openat(ql, openat_fd, openat_path, openat_flags,
                                openat_mode, *args):
            target = False
            pathname = ql.mem.string(openat_path)

            if pathname == "test_syscall_open.txt":
                print("test => openat(%d, %s, 0x%x, 0%o)" %
                      (openat_fd, pathname, openat_flags, openat_mode))
                target = True

            syscall.ql_syscall_openat(ql, openat_fd, openat_path, openat_flags,
                                      openat_mode, *args)

            if target:
                real_path = ql.os.transform_to_real_path(pathname)
                assert os.path.isfile(real_path) == True
                if ql.platform == QL_OS.WINDOWS:
                    return
                else:
                    os.remove(real_path)
コード例 #3
0
ファイル: test_elf.py プロジェクト: profiles/qiling
        def test_syscall_openat(ql, openat_fd, openat_path, openat_flags, openat_mode, *args):
            target = False
            pathname = ql.os.utils.read_cstring(openat_path)

            if pathname == "test_syscall_open.txt":
                print("test => openat(%d, %s, 0x%x, 0%o)" % (openat_fd, pathname, openat_flags, openat_mode))
                target = True

            regreturn = syscall.ql_syscall_openat(ql, openat_fd, openat_path, openat_flags, openat_mode, *args)

            if target:
                real_path = ql.os.path.transform_to_real_path(pathname)
                assert os.path.isfile(real_path) == True
                if ql.host.os != QL_OS.WINDOWS:
                    os.remove(real_path)

            return regreturn