add miscelaneous items
This commit is contained in:
parent
9fe2652448
commit
42698cc8d7
3 changed files with 60 additions and 0 deletions
|
|
@ -1,7 +1,63 @@
|
|||
//! The items structures.
|
||||
|
||||
use crate as androscalpel_serializer;
|
||||
use crate::Serializable;
|
||||
|
||||
pub mod header;
|
||||
pub mod map;
|
||||
|
||||
pub use header::*;
|
||||
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