update rust edition of androscalpel

This commit is contained in:
Jean-Marie Mineau 2025-04-18 11:12:11 +02:00
parent d4ccc73362
commit 218d6bf6fc
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
20 changed files with 223 additions and 167 deletions

View file

@ -270,7 +270,7 @@ impl<'a> DexFileReader<'a> {
MapItemType::HeaderItem if item.offset != 0 || item.size != 1 => {
return Err(Error::InconsistantStruct(format!(
"Inconsistant Header Mapping info found in map_list: {item:x?}"
)))
)));
}
MapItemType::StringIdItem
if item.offset != self.header.string_ids_off
@ -280,7 +280,7 @@ impl<'a> DexFileReader<'a> {
"Inconsistant MapList Mapping info found in map_list: {item:x?}, \
header.string_ids_off: 0x{:x}, header.string_ids_size: {}",
self.header.string_ids_off, self.header.string_ids_size
)))
)));
}
MapItemType::TypeIdItem
if item.offset != self.header.type_ids_off
@ -290,7 +290,7 @@ impl<'a> DexFileReader<'a> {
"Inconsistant MapList Mapping info found in map_list: {item:x?}, \
header.type_ids_off: 0x{:x}, header.type_ids_size: {}",
self.header.type_ids_off, self.header.type_ids_size
)))
)));
}
MapItemType::ProtoIdItem
if item.offset != self.header.proto_ids_off
@ -300,7 +300,7 @@ impl<'a> DexFileReader<'a> {
"Inconsistant MapList Mapping info found in map_list: {item:x?}, \
header.proto_ids_off: 0x{:x}, header.proto_ids_size: {}",
self.header.proto_ids_off, self.header.proto_ids_size
)))
)));
}
MapItemType::FieldIdItem
if item.offset != self.header.field_ids_off
@ -310,7 +310,7 @@ impl<'a> DexFileReader<'a> {
"Inconsistant MapList Mapping info found in map_list: {item:x?}, \
header.field_ids_off: 0x{:x}, header.field_ids_size: {}",
self.header.field_ids_off, self.header.field_ids_size
)))
)));
}
MapItemType::MethodIdItem
if item.offset != self.header.method_ids_off
@ -320,7 +320,7 @@ impl<'a> DexFileReader<'a> {
"Inconsistant MapList Mapping info found in map_list: {item:x?}, \
header.method_ids_off: 0x{:x}, header.method_ids_size: {}",
self.header.method_ids_off, self.header.method_ids_size
)))
)));
}
MapItemType::ClassDefItem
if item.offset != self.header.class_defs_off
@ -330,14 +330,14 @@ impl<'a> DexFileReader<'a> {
"Inconsistant MapList Mapping info found in map_list: {item:x?}, \
header.class_defs_off: 0x{:x}, header.class_defs_size: {}",
self.header.class_defs_off, self.header.class_defs_size
)))
)));
}
MapItemType::MapList if item.offset != self.header.map_off || item.size != 1 => {
return Err(Error::InconsistantStruct(format!(
"Inconsistant MapList Mapping info found in map_list: {item:x?}, \
header.map_list_off: 0x{:x}",
self.header.map_off
)))
)));
}
/*
MapItemType::CallSiteIdItem => todo!(),