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.

Decompilation of MIPS LWL/LWR/SWL/SWR doesn't work

See original GitHub issue

Describe the bug When LWL/LWR/SWL/SWR instructions are found, the decompilation just ignores the code it should generate for them.

As you can see on the example, the first line of generated code is at 0x80020efc, while all the code before that is ignored (it should be many consecutive assignments to the local_20 array and other places)

Ghidra_Bug

Environment (please complete the following information):

  • OS: macOS 10.14.2
  • Java Version: 11.0
  • Ghidra Version: 9.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
caheckmancommented, Jun 20, 2019

This is not an issue with the LWL/LWR/SWL/SWR instructions but is due to over aggressive dead-code elimination. A fix will be available in master on the next update. I was able to verify that this particular example now shows more initialization code. Thanks for submitting this.

0reactions
hllhllcommented, May 22, 2019

I’m getting similar issues on Atmel AVR32(LD.B LD.W LD.D ST.B ST.W ST.D), and a friend of mine on ARM(ldmia stmia).

In both cases, code is OK at the beginning, but after “Commit locals” or renaming/retyping in decompiler, some of the code vanishes (Stack initialization),

I suspect if the pointer were passed to a function the initialization might show up

In my case function calls to memset on stack are kept; initialization still missing if we define variables at the stack position. In addition, in both cases P-Code looks OK too. ( Note: arrived here via other issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Doesn't IDA Pro 6.95 support decompiling MIPS executable?
No, IDA version 6.95 doesn't support it. ... The original answer was written ~2017, and since then IDA added MIPS decompiler support.
Read more >
MIPS Decompiler [closed] - Stack Overflow
Assuming you have a MIPS object file or executable file, you can use objdump from the free Code Sourcery Gnu toolchain. mips-linux-gnu-objdump -d...
Read more >
JEB 2.3 and MIPS Decompilation - Medium
We recently released our latest decompiler for MIPS 32-bit binary code. ... of operations do not seem to “stand out” in a MIPS...
Read more >
MIPS to C# Decompiler : r/csharp - Reddit
Looking around online I was able to find one MIPS to C# decompiler and ... traditional decompilation techniques aren't really going to work....
Read more >
Comparisons of MIPS disassembly and decompilation
Little-endian MIPS; MicroMIPS; Floating-point operations; Compiler helpers. Simple code. This is a very simple code to decompile and the output is ...
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