-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust Qiling to comply with latest changed in Unicorn 2.1.2 #1499
base: dev
Are you sure you want to change the base?
Conversation
The next release will be 2.1.2 and it seems only |
Ah, no, that's probably my mistake. I'll fix the title accordingly. |
2.1.2 is alive. I will give this PR a shot recently. |
@elicn looks like we need few more fix ? |
@xwings, this is mostly because Qiling is still set to use the older Unicorn release. |
The mips breakage (testing [=] brk(inp = 0x0) = 0x56568000
[=] mmap2(addr = 0x0, length = 0x2000, prot = 0x3, flags = 0x802, fd = 0xffffffff, pgoffset = 0x0) = 0x1000000
[=] uname(buf = 0x7ff3c674) = 0x0
[=] access(path = 0x47dcb04, mode = 0x4) = -0x2 (ENOENT)
E
======================================================================
ERROR: test_mips32eb_fake_urandom (__main__.ELFTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mio/opensource/qiling/tests/test_elf.py", line 462, in test_mips32eb_fake_urandom
ql.run()
File "/home/mio/opensource/qiling/qiling/core.py", line 588, in run
self.os.run()
File "/home/mio/opensource/qiling/qiling/os/linux/linux.py", line 178, in run
self.ql.emu_start(self.ql.loader.entry_point, entry_address, self.ql.timeout)
File "/home/mio/opensource/qiling/qiling/core.py", line 768, in emu_start
raise self.internal_exception
File "/home/mio/opensource/qiling/qiling/core_hooks.py", line 141, in wrapper
return callback(*args, **kwargs)
File "/home/mio/opensource/qiling/qiling/core_hooks.py", line 190, in _hook_intr_cb
raise QlErrorCoreHook("_hook_intr_cb : not handled")
qiling.exception.QlErrorCoreHook: _hook_intr_cb : not handled Is it possible that the breakage was introduced in the Qiling side? |
Additional context:
I think this suggests a breakage on Qiling side? Note |
md = Cs(CS_ARCH_MIPS, CS_MODE_32 | CS_MODE_BIG_ENDIAN)
def instruction_count(ql: Qiling, address: int, size: int):
a0 = ql.arch.regs.a0
code = ql.mem.read(address, size)
insn = list(md.disasm(code, size))[0]
print(f"address={address:x} a0={a0:x} code={insn.mnemonic}")
if insn.mnemonic == "sdc1":
pc = ql.arch.regs.arch_pc
pc += size
ql.arch.regs.arch_pc = pc This hooks fixes mips tests, no idea why |
The left breakages: x86 multithread: Bug of Unicorn side, fixed on master already |
Everything should be OK now, depending on the fixes applied in Unicorn 2.1.3. |
Local test shows Note this include the fix to MIPS delay slot so no longer need to tune the Hooray! |
[Merge only after Unicorn 2.1.2 is officially released]
Highlights:
ql.arch.cpr
)Fixes: #1495, #1329