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

Method test_syscall_read

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

Source from the content-addressed store, hash-verified

239 checklist = []
240
241 def test_syscall_read(ql: Qiling, fd: int, buf: int, count: int):
242 retval = syscall.ql_syscall_read(ql, fd, buf, count)
243
244 hpath = ql.os.fd[fd].name
245
246 if os.path.basename(hpath) == "test_syscall_read.txt":
247 mcontent = ql.mem.read(buf, count)
248
249 with open(hpath, 'rb') as infile:
250 fcontent = infile.read()
251
252 if ql.host.os is not QL_OS.WINDOWS:
253 os.remove(hpath)
254
255 self.assertEqual(mcontent, fcontent)
256 checklist.append('read')
257
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)

Callers

nothing calls this directly

Calls 3

readMethod · 0.45
removeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected