vdexExtractor icon indicating copy to clipboard operation
vdexExtractor copied to clipboard

Add vdex027 support

Open IgorEisberg opened this issue 4 years ago • 5 comments

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

IgorEisberg avatar Oct 22 '21 20:10 IgorEisberg

thanks u so much , u save my rom

buihien224 avatar Feb 18 '22 04:02 buihien224

u are my god, saved my life

floydScript avatar Nov 21 '23 08:11 floydScript

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.

rozhuk-im avatar Dec 24 '23 22:12 rozhuk-im