letmutx / dex-parser Goto Github PK
View Code? Open in Web Editor NEWRust parser for Android's dex format
Rust parser for Android's dex format
Initial values of a class's static fields are saved in the static_values
field of a Class
. We need to get rid of this field and add the value to the corresponding Field
struct.
A Dex
file consists of different sections.
Add new APIs which return iterators over different sections. For example, the class_defs function returns an iterator over the class_def_item
s defined in this Dex
.
We can start with the following:
is_public
,is_private
,is_static
,is_final
,is_protected
signature(&self) -> String
(after #7 is implemented)This is the tracking issue for v0.3.0:
Option<&Item>
instead of &Option<Item>
.We can start with the following:
is_primitive
is_array
is_reference_type
(arrays and classes)is_class
is_int
is_float
is_double
is_char
is_byte
is_short
is_long
is_boolean
to_java_type
- return the java representation of a type.Ljava/lang/String;
-> java.lang.String
, [B
-> byte[]
etc.const BYTE: &str = "B"
etc.We can start with the following:
is_constructor
is_public
is_private
is_static
is_protected
is_final
is_synchronized
is_native
is_bridge
is_abstract
is_strictfp
is_synthetic
is_declared_synchronized
signature(&self) -> String
: the value of the dalvik.annotation.Signature
annotation. (after #8 is resolved)Annotations are right now present in annotations_directory_item
field in the class containing the method. We need to extract method annotations and parameter annotations from the AnntotationsDirectoryItem
and add them when constructing a Method
.
We can start with the following:
is_public
is_private
is_protected
is_enum
is_interface
is_final
is_abstract
is_native
is_annotation
is_synthetic
signature(&self) -> String
the value of the dalvik.annotation.Signature
annotation.The header section contains an Adler32 checksum of the dex file to detect corruption.
Add an option in DexReader
to calculate the checksum and verify the calculated value against the value in the header section.
Requirements:
cargo clippy
, cargo build
, cargo test
, cargo fmt
on git pushWe can add two ways to search methods:
Method
structure.dalvik.annotation.Signature
annotation. This will be useful if a method's signature contains type parameters. (after #8 is resolved)We should make all the try_from_dex
methods public. Also, we should move all offset == 0
checks into those methods.
Is modifying dex files (or even creating ones from scratch) a feature that is in-scope for this project?
Run the dexparser with rustc(1.50.0), I got a crash in the cache module. I solved this problem with upgrading the cache dependency to v0.2.0.
Goal: To be able to pin-point a location where the malformed input is/error occurs.
Currently the Error
type doesn't contain information on where an error happened. I think it'd be helpful if we have at least these details to start with:
Class
from the input.We can start with the following:
is_array
is_int
is_string
is_array
is_byte
is_char
is_long
is_float
is_double
is_field
is_method
is_method_type
is_method_handle
is_annotation
is_enum
is_null
is_boolean
is_type
is_short
bool
, str
, f32
, f64
, Type
, byte
, short
, long
, int
, DexString
Annotations are right now saved in annotations_directory_item
of the Class containing this field. We need to extract field annotations from the AnntotationsDirectoryItem
and add them when constructing a Field
.
When reading data structures from dex source, there are no checks to verify if the offsets are in the correct section. For example: string_data_off
should be in data
section according to the docs.. Need to go over all such constraints and return errors when the offset is not into the correct section.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.