MCPcopy Index your code
hub / github.com/qilingframework/qiling / test_syscall_write

Method test_syscall_write

tests/test_elf.py:260–277  ·  view source on GitHub ↗
(ql: Qiling, fd: int, buf: int, count: int)

Source from the content-addressed store, hash-verified

258 return retval
259
260 def test_syscall_write(ql: Qiling, fd: int, buf: int, count: int):
261 retval = syscall.ql_syscall_write(ql, fd, buf, count)
262
263 hpath = ql.os.fd[fd].name
264
265 if os.path.basename(hpath) == "test_syscall_write.txt":
266 mcontent = ql.mem.read(buf, count)
267
268 with open(hpath, 'rb') as infile:
269 fcontent = infile.read()
270
271 if ql.host.os is not QL_OS.WINDOWS:
272 os.remove(hpath)
273
274 self.assertEqual(mcontent, fcontent)
275 checklist.append('write')
276
277 return retval
278
279 def test_syscall_open(ql: Qiling, path: int, flags: int, mode: int):
280 retval = syscall.ql_syscall_open(ql, path, flags, mode)

Callers

nothing calls this directly

Calls 3

readMethod · 0.45
removeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected