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.

Ghidra Emulation error on RISC-V (RV32-IMC) to write in memory display "Check out your emulation options, something wrong!"

See original GitHub issue

Ghidra Emulation error on RISC-V (RV32-IMC) to write in memory display “Check out your emulation options, something wrong!”

How to reproduce the issue:

  1. With Ghidra 10.2.2 Load the elf from the archive RISC-V-SecureDuo_Client_Top_Board.zip
  2. At addr 0x00000000 decompile the first instruction (it is the entry it is mandatory to discover other function…)
  3. Analysis->Auto Analyze … => set “Aggressive Instruction Finder” and do the auto analysis
  4. Navigation -> Goto => 0x2488
  5. GhidraEMU Plugin set start to 0x2488
  6. Step with GhidraEMU until 0x24ac where the issue appears with message box “Check out your emulation options, something wrong!” Note: even if we fix gp for all the code with gp=20000c00 where the store in a3 will be at addr 20000514 (which is mapped) we have the same error The fault appear on following asm line (even if a3 = 0x20000514) 000024ac 98 c2 c.sw a4,0x0(a3)

image

image

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Nalen98commented, Dec 15, 2022

I made some fixes for more clear emulation process, now the plugin will find the existing stack space and use it as the main one. I’ve set values of gp=20000c00 and a3=0x20000514 and got the error that referenced to uninitialized memory, which is a nice sign I guess:

image

I think I still need to debug this case

1reaction
bvernouxcommented, Dec 15, 2022

I confirm if I change the memory map of Stack to Initialized data (set to 0x0 by default) that “fix” the issue (Freeze of Ghidra) for the Stack when reading from it What is remaining is the first issue in the 1st comment which cannot be fixed like that

Read more comments on GitHub >

github_iconTop Results From Across the Web

PPC Big-endian VLE instruction emulation error #4392
Describe the bug Error during emulation of code PPC Big-endian VLE, Ghidra can't emulate the instruction after branch "se_mflr r0" ...
Read more >
Errors: Debug rv32 elf program in riscv-ovpsim emulator
Hi, all. After run DEBUG_GDB_dhrystone.bat in riscv-ovpsim/examples/dhrystone directory on cygwin enviroment, I want to test the gdb. So errors coming.
Read more >
RISC-V GNU Compiler Toolchain: Build Error
I am trying to build the "RISC-V GNU Compiler Toolchain" as a step for building the SDK for PULPissimio platform. When I try...
Read more >
Lab2: RISC-V RV32I[MA] emulator with ELF support
Disassemble the ELF files generated by C compiler and compare the assembly listing between handwritten and compiler optimized one. You can modify the...
Read more >
Ghidra support : r/RISCV
I've been looking at adding RISC-V support for Ghidra (recently released/open sourced disassembler/decompiler/reverse engineering suite).
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