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

Add vdex027 support #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

IgorEisberg
Copy link
Contributor

@IgorEisberg IgorEisberg commented Oct 22, 2021

Basic support for extracting dex/cdex files from vdex027.
Doesn't include support for debugging the new verifier dependencies section, as this is not essential for dex/cdex extraction.

vdex027 introduced many changes, among them: complete removal of QuickeningInfo, BootClassPathChecksumData and ClassLoaderContextData. Structure has been completely changed for extensibility, so all of the methods had to be adapted. As QuickeningInfo is no longer part of the VDEX file, decompilation/unquickening is no longer needed.

Sample files:
https://drive.google.com/file/d/1lJ31Rb7_79j_ZItuYEf74Gym59tGmFkH/view?usp=sharing

Official format documentation:

// VDEX files contain extracted DEX files. The VdexFile class maps the file to
// memory and provides tools for accessing its individual sections.
//
// In the description below, D is the number of dex files.
//
// File format:
//   VdexFileHeader    fixed-length header
//   VdexSectionHeader[kNumberOfSections]
//
//   Checksum section
//     VdexChecksum[D]
//
//   Optionally:
//      DexSection
//          DEX[0]                array of the input DEX files
//          DEX[1]
//          ...
//          DEX[D-1]
//
//   VerifierDeps
//      4-byte alignment
//      uint32[D]                  DexFileDeps offsets for each dex file
//      DexFileDeps[D][]           verification dependencies
//        4-byte alignment
//        uint32[class_def_size]     TypeAssignability offsets (kNotVerifiedMarker for a class
//                                        that isn't verified)
//        uint32                     Offset of end of AssignabilityType sets
//        uint8[]                    AssignabilityType sets
//        4-byte alignment
//        uint32                     Number of strings
//        uint32[]                   String data offsets for each string
//        uint8[]                    String data

@buihien224
Copy link

thanks u so much , u save my rom

@floydScript
Copy link

u are my god, saved my life

@rozhuk-im
Copy link

cc -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fno-delete-null-pointer-checks  -fstack-protector-strong -fno-strict-aliasing  -fdebug-prefix-map=/tmp/ports/usr/ports/misc/vdexextractor/work/vdexExtractor-78f283b60ab6991fa27eeaff7d7be16409401c08/src=. -c -std=c11 -D_GNU_SOURCE -Wall -Wextra  -DVERSION=\"dev-78f283b60ab6991fa27eeaff7d7be16409401c08\" -c vdex/vdex_decompiler_027.c -o vdex/vdex_decompiler_027.o
vdex/vdex_backend_027.c:30:19: warning: unused function 'POPCOUNT' [-Wunused-function]
static inline int POPCOUNT(uintptr_t x) {
                  ^
1 warning generated.

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

Successfully merging this pull request may close these issues.

None yet

4 participants