Skip to content

Commit 15a582f

Browse files
authored
Merge pull request #817 from dark-lbp/fix_ql_syscall_pread64_for_mips
Fix ql_syscall_pread64 for MIPS
2 parents ff89044 + 6fa5f30 commit 15a582f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

qiling/os/posix/syscall/unistd.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ def ql_syscall_close(ql, close_fd, *args, **kw):
205205

206206
def ql_syscall_pread64(ql, read_fd, read_buf, read_len, read_offt, *args, **kw):
207207
data = None
208+
209+
# https://chromium.googlesource.com/linux-syscall-support/+/2c73abf02fd8af961e38024882b9ce0df6b4d19b
210+
# https://chromiumcodereview.appspot.com/10910222
211+
if ql.archtype == QL_ARCH.MIPS:
212+
read_offt = ql.unpack64(ql.mem.read(ql.reg.arch_sp + 0x10, size=0x08))
213+
208214
if read_fd < 256 and ql.os.fd[read_fd] != 0:
209215
try:
210216
pos = ql.os.fd[read_fd].tell()

0 commit comments

Comments
 (0)