Skip to content
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

IAITO not showing imports #51

Closed
randsec opened this issue Aug 3, 2021 · 4 comments
Closed

IAITO not showing imports #51

randsec opened this issue Aug 3, 2021 · 4 comments
Assignees
Milestone

Comments

@randsec
Copy link

randsec commented Aug 3, 2021

Environment Details

iaito 5.2.2
mar 03 ago 2021 14:12:03 CEST
radare2 5.4.0-git 26609 @ linux-x86-64 git.5.4.0-git
commit: 305145d37fd8ba00a5ae2c9a5c5ffcae379d9733 build: 2021-08-03__13:58:31
Linux x86_64

Description

IAITO is not showing PE imports, while r2 do.
image
image

@radare
Copy link
Collaborator

radare commented Aug 3, 2021

I can repro, the core->getAllImports() returns all the imports as expected, so its taking the data properly from r2, but failing somehow to render it in the qt widget. thanks for reporting! will try to find some time for it, if you want to fix the related code lives in ./src/widgets/ImportsWidget.cpp

btw this getAllImports method name is pretty misleading, as long as its just getting the imports of the selected bin, not "all" of them, and actually makes not much sense to go for all. so this can be also fixed along the way.

@radare
Copy link
Collaborator

radare commented Aug 3, 2021

thanks for reporting!

@radare radare added this to the 5.4.0 milestone Aug 3, 2021
@TheJeon
Copy link

TheJeon commented Dec 11, 2021

The problem seems to originate in ImportsModel::rowCount. Since the argument parent seems always to be invalid, the function always returns 0 instead of imports->count(). I saw that by comparing the (broken) ImportsWidget.cpp with the (working) ExportsWidgets.cpp. The latter has no such check in ExportsModel::rowCount. Debugging confirmed that this is the problem.
Just letting ImportsModel::rowCount return imports->count() fixes it for me.
Yet I have little idea about Qt, so I don't dare to touch it and create a PR. The check is probably serving a purpose, but I'd have guessed that it should be consistent for ImportsModel and ExportsModel.
Hope, that was somewhat helpful.
With best regards.

@trufae
Copy link
Collaborator

trufae commented Dec 11, 2021

Thanks for taking the time to investigate the issue! I’ll find some time this weekend to test your patch, im not an expert in qt either but if it works it works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants