add DexWriter squeleton
This commit is contained in:
parent
80968c9bcf
commit
e194072981
4 changed files with 6 additions and 4 deletions
|
|
@ -8,6 +8,7 @@ pub mod class;
|
||||||
pub mod code;
|
pub mod code;
|
||||||
pub mod dex_id;
|
pub mod dex_id;
|
||||||
pub mod dex_string;
|
pub mod dex_string;
|
||||||
|
pub mod dex_writer;
|
||||||
pub mod field;
|
pub mod field;
|
||||||
pub mod method;
|
pub mod method;
|
||||||
pub mod method_handle;
|
pub mod method_handle;
|
||||||
|
|
@ -20,6 +21,7 @@ pub use class::*;
|
||||||
pub use code::*;
|
pub use code::*;
|
||||||
pub use dex_id::*;
|
pub use dex_id::*;
|
||||||
pub use dex_string::*;
|
pub use dex_string::*;
|
||||||
|
pub use dex_writer::*;
|
||||||
pub use field::*;
|
pub use field::*;
|
||||||
pub use method::*;
|
pub use method::*;
|
||||||
pub use method_handle::*;
|
pub use method_handle::*;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ pub use androscalpel_serializer_derive::*;
|
||||||
|
|
||||||
/// [dex-file-magic](https://source.android.com/docs/core/runtime/dex-format#dex-file-magic)
|
/// [dex-file-magic](https://source.android.com/docs/core/runtime/dex-format#dex-file-magic)
|
||||||
/// `version` is the Dex version of this file (encoded decimal digit).
|
/// `version` is the Dex version of this file (encoded decimal digit).
|
||||||
#[derive(Serializable, PartialEq, Eq, Debug)]
|
#[derive(Serializable, PartialEq, Eq, Debug, Clone)]
|
||||||
pub struct DexFileMagic {
|
pub struct DexFileMagic {
|
||||||
#[prefix([0x64, 0x65, 0x78, 0x0a])]
|
#[prefix([0x64, 0x65, 0x78, 0x0a])]
|
||||||
#[suffix([0x00])]
|
#[suffix([0x00])]
|
||||||
|
|
@ -17,7 +17,7 @@ pub struct DexFileMagic {
|
||||||
///
|
///
|
||||||
/// The only supported value as of 2023 is [`EndianConstant`]
|
/// The only supported value as of 2023 is [`EndianConstant`]
|
||||||
/// ([because](https://cs.android.com/android/platform/superproject/main/+/main:art/libdexfile/dex/dex_file_verifier.cc;l=597;drc=397dd78fcdcfed36ee62302e2b90712e2d784364))
|
/// ([because](https://cs.android.com/android/platform/superproject/main/+/main:art/libdexfile/dex/dex_file_verifier.cc;l=597;drc=397dd78fcdcfed36ee62302e2b90712e2d784364))
|
||||||
#[derive(Serializable, PartialEq, Eq, Debug)]
|
#[derive(Serializable, PartialEq, Eq, Debug, Clone)]
|
||||||
#[prefix_type(u32)]
|
#[prefix_type(u32)]
|
||||||
pub enum EndianConstant {
|
pub enum EndianConstant {
|
||||||
#[prefix(0x12345678)]
|
#[prefix(0x12345678)]
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ use crate::{DexFileMagic, EndianConstant, Serializable};
|
||||||
|
|
||||||
/// <https://source.android.com/docs/core/runtime/dex-format#header-item>
|
/// <https://source.android.com/docs/core/runtime/dex-format#header-item>
|
||||||
/// alignment: 4 bytes
|
/// alignment: 4 bytes
|
||||||
#[derive(Serializable, PartialEq, Eq, Debug)]
|
#[derive(Serializable, Clone, PartialEq, Eq, Debug)]
|
||||||
pub struct HeaderItem {
|
pub struct HeaderItem {
|
||||||
pub magic: DexFileMagic,
|
pub magic: DexFileMagic,
|
||||||
pub checksum: u32,
|
pub checksum: u32,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use std::io::Write;
|
||||||
|
|
||||||
/// <https://source.android.com/docs/core/runtime/dex-format#map-list>
|
/// <https://source.android.com/docs/core/runtime/dex-format#map-list>
|
||||||
/// alignment: 4 bytes
|
/// alignment: 4 bytes
|
||||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
#[derive(Clone, PartialEq, Eq, Debug, Default)]
|
||||||
pub struct MapList {
|
pub struct MapList {
|
||||||
// pub size: u32,
|
// pub size: u32,
|
||||||
pub list: Vec<MapItem>,
|
pub list: Vec<MapItem>,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue