question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some mips64 binaries have ELFCLASS32

See original GitHub issue

irsb = pyvex.IRSB('\xdf\xbf\x00\x18\xdf\xbc\x00\x10\xdf\xb1\x00\x08\xdf\xb0\x00\x00', 0x5193c, archinfo.ArchMIPS32('Iend_BE'), opt_level=0)

gives:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/workspace/angr-dev/pyvex/pyvex/block.py", line 64, in __init__
    lift(self, data, max_bytes, max_inst, bytes_offset, opt_level, traceflags)
  File "/home/user/workspace/angr-dev/pyvex/pyvex/lift/__init__.py", line 100, in lift
    raise PyVEXError('\n\n'.join(errors))
pyvex.errors.PyVEXError: 
vex: priv/guest_mips_toIR.c:1219 (putIReg): Assertion `typeOfIRExpr(irsb->tyenv, e) == ty' failed.

The bytes should be:

0x5193c ld      $ra, 0x20+var_8($sp)
0x51940 ld      $gp, 0x20+var_10($sp)
0x51944 ld      $s1, 0x20+var_18($sp)
0x51948 ld      $s0, 0x20+var_20($sp)

(ODA confirms)

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rhelmotcommented, Jul 16, 2017

ok that one was weird. there were actually two bugs, one in pyvex, one in vex, intersecting very weirdly. The bug in pyvex was that we were claiming that our emulated mips cpu was baseline, which was causing MIPS to mark your cins32 instruction as undecodable. The second bug was that vex will assert out if it hits an undecodable instruction found in the branch delay slot. I’ve fixed both of these, you’ll need to pull the newest pyvex and vex.

0reactions
github-actions[bot]commented, May 24, 2022

This issue has been marked as stale because it has no recent activity. Please comment or add the pinned tag to prevent this issue from being closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Describing Mips architectures in ELF header flags
I have been bemoaning some use of the ELF header flags for new architectures because of ... Note only that, you can have...
Read more >
Wrong ELF class with both 32 and 64bits lib - Stack Overflow
If you have a single 64-bit library, you get that warning when you run 32-binaries. We need your system to have both 32-...
Read more >
arch/mips/kernel/binfmt_elfo32.c - kernel/msm - Git at Google
Support for o32 Linux/MIPS ELF binaries. ... #define ELF_CLASS ELFCLASS32 ... to execute any binary which has bits specified by the following macro...
Read more >
SYSTEM V APPLICATION BINARY INTERFACE
Some processors might support the MIPS I ISA as a subset, providing additional instructions or capabilities, e.g., the R6000 processor.
Read more >
dump_syms crashes when used on a binary compiled for ...
#0 0x0807302b in FindElfClassSegment<google_breakpad::ElfClass32> ... I don't have any need for things to work on MIPS, so I'm not likely to do all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found