radareorg / iaito

Official QT frontend of radare2
GNU General Public License v3.0
968 stars 83 forks source link

On arch, have to hit ^C 4 times or the GUI never opens #171

Closed MightyPork closed 3 weeks ago

MightyPork commented 4 weeks ago

Environment

So 22. června 2024, 12:39:30 CEST
radare2 5.9.2 0 @ linux-x86-64
birth: git.5.9.2 2024-05-25__21:41:23
options: gpl release -O1 cs:5 cl:2 meson
iaito 5.9.2
Linux x86_64

iaito is installed from arch repos

Description

When I open an elf, it stays stuck with no CPU activity or output, no windows open, seemingly forever (I lost patience, maybe it proceeds after some minutes).

It is 100% replicable for me.

% iaito sample.elf 
Plugins are loaded from "/home/ondra/.local/share/radareorg/iaito/plugins"
Loaded 0 plugin(s).
Plugins are loaded from "/usr/local/share/radareorg/iaito/plugins"
Plugins are loaded from "/usr/share/radareorg/iaito/plugins"
^C^C^C^CWARN: Relocs has not been applied. Please use `-e bin.relocs.apply=true` or `-e bin.cache=true` next time
INFO: Analyze all flags starting with sym. and entry0 (aa)
INFO: Analyze imports (af@@@i)
INFO: Analyze entrypoint (af@ entry0)
INFO: Analyze symbols (af@@@s)
INFO: Recovering variables
INFO: Analyze all functions arguments/locals (afva@@@F)
INFO: Analyze function calls (aac)
INFO: Analyze len bytes of instructions for references (aar)
INFO: Finding and parsing C++ vtables (avrr)
INFO: Analyzing methods
INFO: Finding xrefs in noncode sections (e anal.in=io.maps.x; aav)
INFO: Emulate functions to find computed references (aaef)
INFO: Recovering local variables (afva)
INFO: Type matching analysis for all functions (aaft)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)
INFO: Execution stopped on unaligned instruction (see e?esil.breakoninvalid)

(this continues for several screens)

Test

sample file I tried to open, zipped because github hates elf

sample.elf.zip

trufae commented 4 weeks ago

You can lower the analysis depth level.

thanks for sharing the binary ive never find a sample that shows this error before and i will fix it properly

MightyPork commented 4 weeks ago

Yes with aa it opens instantly, I didn't think it'd be useful to lower it, I remember using aaaa before and it worked fine.

The binary is a firmware for a stm32 microcontroller

trufae commented 4 weeks ago

its once again the same dbginfo bottleneck passing this flag -e bin.dbginfo=false makes the analysis finish quickly.

trufae commented 4 weeks ago

i dont get the 'Execution stopped on unaligned instruction' in r2 from git :?

trufae commented 4 weeks ago

nvm i can repro. the dbginfo bug was macos-only, on linux i get the error message

trufae commented 4 weeks ago

There are several issues some of them fixed:

Need to investigate in the qt bug but thats outside my scope rn

trufae commented 3 weeks ago

i think the qt6 bug should be workarounded with the latest changes in r2 and iaito, can you give it a try? i don't have plans to make a release on both tools yet. but if its a blocker i can tag 5.9.4

MightyPork commented 3 weeks ago

I built iaito from git now and the sample file opens just fine almost immediately, even with aaaa :+1:

trufae commented 3 weeks ago

Cool thanks for testing!