convert instruction to an editable format WIP

This commit is contained in:
Jean-Marie Mineau 2023-12-16 02:09:52 +01:00
parent 2d164362a7
commit 29c43a68b2
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
5 changed files with 2631 additions and 45 deletions

View file

@ -194,6 +194,16 @@ impl<'a> DexFileReader<'a> {
)))
}
/// Return a [`CallSiteIdItem`] reference from its idx.
pub fn get_call_site_id(&self, idx: usize) -> Result<&CallSiteIdItem> {
self.call_site_ids
.get(idx)
.ok_or(Error::InconsistantStruct(format!(
"call site {idx} is out of bound (|call_site_ids|={})",
self.call_site_ids.len()
)))
}
fn sanity_check(&self) -> Result<()> {
if self.header.magic.version != [0x30, 0x33, 0x39] {
warn!(