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

Failed to specify which Dex to parse in a multidex APK #2588

Open
haeter525 opened this issue May 4, 2022 · 7 comments
Open

Failed to specify which Dex to parse in a multidex APK #2588

haeter525 opened this issue May 4, 2022 · 7 comments
Assignees

Comments

@haeter525
Copy link

Hi there!

I currently use Rizin to analyze a multidex APK. I chose this sample (Password: infected) as my target and tried to get data from all its Dex files respectively with command ou. However, an error occurred.

Work environment

Questions Answers
OS/arch/bits (mandatory) Ubuntu 22.04
File format of the file you reverse (mandatory) APK
Architecture/bits of the file (mandatory) Dalvik
rizin -v full output, not truncated (mandatory) rizin 0.4.0-git @ linux-x86-64
commit: d8ed585, build: 2022-05-04__02:27:18

Expected behavior

Successfully switch to the specified Dex by using command ou.

Actual behavior

An error occurred as follows.

$> rizin apk://c02bd4289acacf65d9cb70ce42d0ff27.apk 
WARNING: No calling convention defined for this file, analysis may be inaccurate.
 -- Thanks for using rizin!
[0x100966804]> ol
 3 - r-x 0x000dfd24 classes2.dex
 4 * r-x 0x0091fd3c classes.dex
 5 - r-x 0x00006eda vfile://0/reloc-targets
 6 - r-x 0x0000098e vfile://1/reloc-targets
[0x100966804]> ou 3
ERROR: Could not find any opened file with fd 3
[0x100966804]> 

Steps to reproduce the behavior

  • Open this sample with Rizin. (Password: infected)
  • Run the following commands.
ol
ou 3
@ret2libc
Copy link
Member

ret2libc commented May 4, 2022

cc @wargio

@wargio wargio self-assigned this May 4, 2022
@wargio
Copy link
Member

wargio commented May 6, 2022

I think this is a misusage of rizin.
technically to open just one dex file, you need to call apk://app.apk//classes.dex (be sure to have a // after the extension).

@haeter525
Copy link
Author

@wargio. Thanks for the reply!

I tried the path with both commit d8ed585 and the latest commit. But, they all gave the following error.
Have I missed something? Thanks.

$> rizin apk://c02bd4289acacf65d9cb70ce42d0ff27.apk//classes2.dex
WARNING: No calling convention defined for this file, analysis may be inaccurate.
ERROR: Cannot load bin file apk://c02bd4289acacf65d9cb70ce42d0ff27.apk//classes2.dex.
 -- Control the height of the terminal on serial consoles with e scr.height
[0x100046804]> 

@wargio
Copy link
Member

wargio commented May 7, 2022

that error is weird, why it loads the bin but throws an error?

@wargio
Copy link
Member

wargio commented May 19, 2022

I can confirm is not a real error, essentially tries to reopen the same file but fails, because it was already opened before.

@ret2libc
Copy link
Member

I can confirm is not a real error, essentially tries to reopen the same file but fails, because it was already opened before.

Is it or is it not a real error? I see the message above, but also a PR that says to fix this issue.

@wargio
Copy link
Member

wargio commented May 23, 2022

no, is just missing a check. i will fix this.

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

Successfully merging a pull request may close this issue.

4 participants