add miscelaneous items
This commit is contained in:
parent
9fe2652448
commit
42698cc8d7
3 changed files with 60 additions and 0 deletions
|
|
@ -3,6 +3,8 @@
|
||||||
use crate::{DexFileMagic, EndianConstant};
|
use crate::{DexFileMagic, EndianConstant};
|
||||||
|
|
||||||
/// The header item: https://source.android.com/docs/core/runtime/dex-format#header-item
|
/// The header item: https://source.android.com/docs/core/runtime/dex-format#header-item
|
||||||
|
///
|
||||||
|
/// alignment: 4 bytes
|
||||||
#[derive(Serializable, PartialEq, Eq, Debug)]
|
#[derive(Serializable, PartialEq, Eq, Debug)]
|
||||||
pub struct UserItem {
|
pub struct UserItem {
|
||||||
pub magic: DexFileMagic,
|
pub magic: DexFileMagic,
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ use crate as androscalpel_serializer;
|
||||||
use crate::core::{ReadSeek, Result, Serializable};
|
use crate::core::{ReadSeek, Result, Serializable};
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
|
/// The map item: https://source.android.com/docs/core/runtime/dex-format#map-list
|
||||||
|
/// alignment: 4 bytes
|
||||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||||
pub struct MapList {
|
pub struct MapList {
|
||||||
// pub size: u32,
|
// pub size: u32,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,63 @@
|
||||||
//! The items structures.
|
//! The items structures.
|
||||||
|
|
||||||
|
use crate as androscalpel_serializer;
|
||||||
|
use crate::Serializable;
|
||||||
|
|
||||||
pub mod header;
|
pub mod header;
|
||||||
pub mod map;
|
pub mod map;
|
||||||
|
|
||||||
pub use header::*;
|
pub use header::*;
|
||||||
pub use map::*;
|
pub use map::*;
|
||||||
|
|
||||||
|
/// https://source.android.com/docs/core/runtime/dex-format#string-item
|
||||||
|
/// alignment: 4 bytes
|
||||||
|
#[derive(Serializable, Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
|
pub struct StringIdItem {
|
||||||
|
pub string_data_off: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub use crate::StringDataItem;
|
||||||
|
|
||||||
|
/// https://source.android.com/docs/core/runtime/dex-format#type-id-item
|
||||||
|
/// alignment: 4 bytes
|
||||||
|
#[derive(Serializable, Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
|
pub struct TypeIdItem {
|
||||||
|
/// Index of a [`StringIdItem`] in `string_ids`.
|
||||||
|
pub descriptor_idx: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// https://source.android.com/docs/core/runtime/dex-format#proto-id-item
|
||||||
|
/// alignment: 4 bytes
|
||||||
|
#[derive(Serializable, Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
|
pub struct ProtoIdItem {
|
||||||
|
/// Index of a [`StringIdItem`] in `string_ids`.
|
||||||
|
pub shorty_idx: u32,
|
||||||
|
/// Index of a [`TypeIdItem`] in `type_ids`.
|
||||||
|
pub return_type_idx: u32,
|
||||||
|
/// 0 if no parameter, else offset to a [`TypeList`.
|
||||||
|
pub parameters_off: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// https://source.android.com/docs/core/runtime/dex-format#field-id-item
|
||||||
|
/// alignment: 4 bytes
|
||||||
|
#[derive(Serializable, Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
|
pub struct FieldIdItem {
|
||||||
|
/// Index of a [`TypeIdItem`] in `type_ids`], must be a class.
|
||||||
|
pub class_idx: u16,
|
||||||
|
/// Index of a [`TypeIdItem`] in `type_ids`.
|
||||||
|
pub type_idx: u16,
|
||||||
|
/// Index of a [`StringIdItem`] in `string_ids`.
|
||||||
|
pub name_idx: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// https://source.android.com/docs/core/runtime/dex-format#method-id-item
|
||||||
|
/// alignment: 4 bytes
|
||||||
|
#[derive(Serializable, Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
|
pub struct MethodIdItem {
|
||||||
|
/// Index of a [`TypeIdItem`] in `type_ids`], must be a class.
|
||||||
|
pub class_idx: u16,
|
||||||
|
/// Index of a [`ProtoIdItem`] in `proto_ids`.
|
||||||
|
pub proto_idx: u16,
|
||||||
|
/// Index of a [`StringIdItem`] in [`HeaderItem.string_ids`].
|
||||||
|
pub name_idx: u32,
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue