add method handle
This really needs more checks
This commit is contained in:
parent
77be653786
commit
feff847310
6 changed files with 351 additions and 36 deletions
|
|
@ -184,6 +184,16 @@ impl<'a> DexFileReader<'a> {
|
|||
)))
|
||||
}
|
||||
|
||||
/// Return a [`MethodHandleItem`] reference from its idx.
|
||||
pub fn get_method_handle(&self, idx: usize) -> Result<&MethodHandleItem> {
|
||||
self.method_handles
|
||||
.get(idx)
|
||||
.ok_or(Error::InconsistantStruct(format!(
|
||||
"method handle {idx} is out of bound (|method_handles|={})",
|
||||
self.method_handles.len()
|
||||
)))
|
||||
}
|
||||
|
||||
fn sanity_check(&self) -> Result<()> {
|
||||
if self.header.magic.version != [0x30, 0x33, 0x39] {
|
||||
warn!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue