diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtAnalyzer.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtAnalyzer.java index c82da005b4..f2a000a3fa 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtAnalyzer.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtAnalyzer.java @@ -72,7 +72,7 @@ public class ArtAnalyzer extends FileFormatAnalyzer { BinaryReader reader = new BinaryReader(provider, !program.getLanguage().isBigEndian()); try { - ArtHeader header = ArtFactory.newArtHeader(reader); + ArtHeader header = ArtHeaderFactory.newArtHeader(reader); DataType headerDataType = header.toDataType(); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtConstants.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtConstants.java index 6054c7a6d4..f953524089 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtConstants.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtConstants.java @@ -30,54 +30,54 @@ public final class ArtConstants { public final static int VERSION_LENGTH = 4; - /** kitkat-release/runtime/image.c */ - public final static String VERSION_KITKAT_RELEASE = "005"; - /** lollipop-release/runtime/image.c */ - public final static String VERSION_LOLLIPOP_RELEASE = "009"; - /** lollipop-mr1-wfc-release/runtime/image.c */ - public final static String VERSION_LOLLIPOP_MR1_WFC_RELEASE = "012"; - /** marshmallow-release/runtime/image.c */ - public final static String VERSION_MARSHMALLOW_RELEASE = "017"; - /** nougat-release/runtime/image.c */ - public final static String VERSION_NOUGAT_RELEASE = "029"; - /** nougat-mr2-pixel-release/runtime/image.c */ - public final static String VERSION_NOUGAT_MR2_PIXEL_RELEASE = "030"; - /** oreo-release/runtime/image.c */ - public final static String VERSION_OREO_RELEASE = "043"; - /** oreo-dr1-release/runtime/image.c */ - public final static String VERSION_OREO_DR1_RELEASE = "044"; - /** oreo-mr1-release/runtime/image.c */ - public final static String VERSION_OREO_MR1_RELEASE = "046"; - /** pie-release/runtime/image.c */ - public final static String VERSION_PIE_RELEASE = "056"; - /** android10-release/runtime/image.c */ - public final static String VERSION_10_RELEASE = "074";//Q - /** android11-release/runtime/image.c */ - public final static String VERSION_11_RELEASE = "085";//R - /** android12-release/runtime/image.c */ - public final static String VERSION_12_RELEASE = "099";//S - /** android13-release/runtime/image.c */ - public final static String VERSION_13_RELEASE = "106";//S v2, 13 + /** kitkat-release/runtime/image.c */ + public final static String ART_VERSION_005 = "005"; + /** lollipop-release/runtime/image.c */ + public final static String ART_VERSION_009 = "009"; + /** lollipop-mr1-wfc-release/runtime/image.c */ + public final static String ART_VERSION_012 = "012"; + /** marshmallow-release/runtime/image.c */ + public final static String ART_VERSION_017 = "017"; + /** nougat-release/runtime/image.c */ + public final static String ART_VERSION_029 = "029"; + /** nougat-mr2-pixel-release/runtime/image.c */ + public final static String ART_VERSION_030 = "030"; + /** oreo-release/runtime/image.c */ + public final static String ART_VERSION_043 = "043"; + /** oreo-dr1-release/runtime/image.c */ + public final static String ART_VERSION_044 = "044"; + /** oreo-mr1-release/runtime/image.c */ + public final static String ART_VERSION_046 = "046"; + /** pie-release/runtime/image.c */ + public final static String ART_VERSION_056 = "056"; + /** android10-release/runtime/image.c */ + public final static String ART_VERSION_074 = "074";//Q + /** android11-release/runtime/image.c */ + public final static String ART_VERSION_085 = "085";//R + /** android12-release/runtime/image.c */ + public final static String ART_VERSION_099 = "099";//S + /** android13-release/runtime/image.c */ + public final static String ART_VERSION_106 = "106";//S v2, 13 /** * NOTE: only going to support RELEASE versions */ public final static String[] SUPPORTED_VERSIONS = new String[] { //@formatter:off - VERSION_KITKAT_RELEASE, - VERSION_LOLLIPOP_RELEASE, - VERSION_LOLLIPOP_MR1_WFC_RELEASE, - VERSION_MARSHMALLOW_RELEASE, - VERSION_NOUGAT_RELEASE, - VERSION_NOUGAT_MR2_PIXEL_RELEASE, - VERSION_OREO_RELEASE, - VERSION_OREO_DR1_RELEASE, - VERSION_OREO_MR1_RELEASE, - VERSION_PIE_RELEASE, - VERSION_10_RELEASE, - VERSION_11_RELEASE, - VERSION_12_RELEASE, - VERSION_13_RELEASE, + ART_VERSION_005, + ART_VERSION_009, + ART_VERSION_012, + ART_VERSION_017, + ART_VERSION_029, + ART_VERSION_030, + ART_VERSION_043, + ART_VERSION_044, + ART_VERSION_046, + ART_VERSION_056, + ART_VERSION_074, + ART_VERSION_085, + ART_VERSION_099, + ART_VERSION_106, //@formatter:on }; diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtFactory.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtFactory.java deleted file mode 100644 index 49f537ef34..0000000000 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtFactory.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.file.formats.android.art; - -import java.io.IOException; - -import ghidra.app.util.bin.BinaryReader; -import ghidra.file.formats.android.art.android10.ArtHeader_10; -import ghidra.file.formats.android.art.android11.ArtHeader_11; -import ghidra.file.formats.android.art.android12.ArtHeader_12; -import ghidra.file.formats.android.art.kitkat.ArtHeader_KitKat; -import ghidra.file.formats.android.art.lollipop.ArtHeader_Lollipop; -import ghidra.file.formats.android.art.lollipop.ArtHeader_LollipopMR1WFC; -import ghidra.file.formats.android.art.marshmallow.ArtHeader_Marshmallow; -import ghidra.file.formats.android.art.nougat.ArtHeader_Nougat; -import ghidra.file.formats.android.art.nougat.ArtHeader_NougatMR2Pixel; -import ghidra.file.formats.android.art.oreo.ArtHeader_Oreo; -import ghidra.file.formats.android.art.oreo.ArtHeader_OreoMR1; -import ghidra.file.formats.android.art.pie.ArtHeader_Pie; - -public final class ArtFactory { - - /** - * Returns an ArtHeader of the correct version. - * @param reader the BinaryReader to the ART header - * @return the specific version of the ART header - * @throws IOException should an error occur during reading or parsing - * @throws UnsupportedArtVersionException when the provided version is invalid or not yet implemented. - */ - public final static ArtHeader newArtHeader(BinaryReader reader) - throws IOException, UnsupportedArtVersionException { - String magic = new String(reader.readByteArray(0, ArtConstants.MAGIC.length())); - String version = reader.readAsciiString(4, 4); - if (magic.equals(ArtConstants.MAGIC)) { - if (ArtConstants.isSupportedVersion(version)) { - switch (version) { - case ArtConstants.VERSION_KITKAT_RELEASE: - return new ArtHeader_KitKat(reader); - case ArtConstants.VERSION_LOLLIPOP_RELEASE: - return new ArtHeader_Lollipop(reader); - case ArtConstants.VERSION_LOLLIPOP_MR1_WFC_RELEASE: - return new ArtHeader_LollipopMR1WFC(reader); - case ArtConstants.VERSION_MARSHMALLOW_RELEASE: - return new ArtHeader_Marshmallow(reader); - case ArtConstants.VERSION_NOUGAT_RELEASE: - return new ArtHeader_Nougat(reader); - case ArtConstants.VERSION_NOUGAT_MR2_PIXEL_RELEASE: - return new ArtHeader_NougatMR2Pixel(reader); - case ArtConstants.VERSION_OREO_RELEASE: - return new ArtHeader_Oreo(reader); - case ArtConstants.VERSION_OREO_DR1_RELEASE: - return new ArtHeader_Oreo(reader);//v043 and v044 are same format - case ArtConstants.VERSION_OREO_MR1_RELEASE: - return new ArtHeader_OreoMR1(reader); - case ArtConstants.VERSION_PIE_RELEASE: - return new ArtHeader_Pie(reader); - case ArtConstants.VERSION_10_RELEASE: - return new ArtHeader_10(reader); - case ArtConstants.VERSION_11_RELEASE: - return new ArtHeader_11(reader); - case ArtConstants.VERSION_12_RELEASE: - case ArtConstants.VERSION_13_RELEASE: - return new ArtHeader_12(reader); - } - } - } - throw new UnsupportedArtVersionException(magic, version); - } - -} diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtHeader.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtHeader.java index a79f8df095..8d17ea400d 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtHeader.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtHeader.java @@ -138,7 +138,8 @@ public abstract class ArtHeader implements StructConverter { @Override public DataType toDataType() throws DuplicateNameException, IOException { - Structure structure = new StructureDataType(ArtHeader.class.getSimpleName(), 0); + Structure structure = + new StructureDataType(ArtHeader.class.getSimpleName() + "_" + version_, 0); structure.add(STRING, 4, "magic_", null); structure.add(STRING, 4, "version_", null); structure.setCategoryPath(new CategoryPath("/art")); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtHeaderFactory.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtHeaderFactory.java new file mode 100644 index 0000000000..16aaaf66b2 --- /dev/null +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtHeaderFactory.java @@ -0,0 +1,73 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.file.formats.android.art; + +import java.io.IOException; + +import ghidra.app.util.bin.BinaryReader; +import ghidra.file.formats.android.art.headers.*; + +public final class ArtHeaderFactory { + + /** + * Returns an ArtHeader of the correct version. + * @param reader the BinaryReader to the ART header + * @return the specific version of the ART header + * @throws IOException should an error occur during reading or parsing + * @throws UnsupportedArtVersionException when the provided version is invalid or not yet implemented. + */ + public final static ArtHeader newArtHeader(BinaryReader reader) + throws IOException, UnsupportedArtVersionException { + String magic = new String(reader.readByteArray(0, ArtConstants.MAGIC.length())); + String version = reader.readAsciiString(4, 4); + if (magic.equals(ArtConstants.MAGIC)) { + if (ArtConstants.isSupportedVersion(version)) { + switch (version) { + case ArtConstants.ART_VERSION_005: + return new ArtHeader_005(reader); + case ArtConstants.ART_VERSION_009: + return new ArtHeader_009(reader); + case ArtConstants.ART_VERSION_012: + return new ArtHeader_012(reader); + case ArtConstants.ART_VERSION_017: + return new ArtHeader_017(reader); + case ArtConstants.ART_VERSION_029: + return new ArtHeader_029(reader); + case ArtConstants.ART_VERSION_030: + return new ArtHeader_030(reader); + case ArtConstants.ART_VERSION_043: + return new ArtHeader_043(reader); + case ArtConstants.ART_VERSION_044: + return new ArtHeader_044(reader); + case ArtConstants.ART_VERSION_046: + return new ArtHeader_046(reader); + case ArtConstants.ART_VERSION_056: + return new ArtHeader_056(reader); + case ArtConstants.ART_VERSION_074: + return new ArtHeader_074(reader); + case ArtConstants.ART_VERSION_085: + return new ArtHeader_085(reader); + case ArtConstants.ART_VERSION_099: + return new ArtHeader_099(reader); + case ArtConstants.ART_VERSION_106: + return new ArtHeader_106(reader); + } + } + } + throw new UnsupportedArtVersionException(magic, version); + } + +} diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtImageSections.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtImageSections.java index 34afc91c56..eb79f6d6ce 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtImageSections.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtImageSections.java @@ -115,7 +115,7 @@ public abstract class ArtImageSections { reader.setPointerIndex(kSectionArtFields.getOffset()); while (reader.getPointerIndex() < Integer .toUnsignedLong(kSectionArtFields.getEnd())) { - if (ArtConstants.VERSION_MARSHMALLOW_RELEASE.equals(header.getVersion())) { + if (ArtConstants.ART_VERSION_017.equals(header.getVersion())) { ArtField field = new ArtField(reader); fieldList.add(field); } @@ -135,7 +135,7 @@ public abstract class ArtImageSections { reader.setPointerIndex(kSectionArtMethods.getOffset()); while (reader.getPointerIndex() < Integer .toUnsignedLong(kSectionArtMethods.getEnd())) { - if (ArtConstants.VERSION_MARSHMALLOW_RELEASE.equals(header.getVersion())) { + if (ArtConstants.ART_VERSION_017.equals(header.getVersion())) { ArtMethod method = new ArtMethod(reader, header.getPointerSize(), header.getVersion()); methodList.add(method); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtImageSectionsFactory.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtImageSectionsFactory.java index 22eca50fcf..710fa6fa2d 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtImageSectionsFactory.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtImageSectionsFactory.java @@ -18,14 +18,7 @@ package ghidra.file.formats.android.art; import java.io.IOException; import ghidra.app.util.bin.BinaryReader; -import ghidra.file.formats.android.art.android10.ImageSections_10; -import ghidra.file.formats.android.art.android12.ImageSections_12; -import ghidra.file.formats.android.art.marshmallow.ImageSections_Marshmallow; -import ghidra.file.formats.android.art.nougat.ImageSections_Nougat; -import ghidra.file.formats.android.art.nougat.ImageSections_NougatMR2Pixel; -import ghidra.file.formats.android.art.oreo.ImageSections_Oreo; -import ghidra.file.formats.android.art.oreo.ImageSections_OreoMR1; -import ghidra.file.formats.android.art.pie.ImageSections_Pie; +import ghidra.file.formats.android.art.image_sections.*; public final class ArtImageSectionsFactory { @@ -39,25 +32,25 @@ public final class ArtImageSectionsFactory { public static ArtImageSections getArtImageSections(BinaryReader reader, ArtHeader artHeader) throws IOException { switch (artHeader.getVersion()) { - case ArtConstants.VERSION_MARSHMALLOW_RELEASE: + case ArtConstants.ART_VERSION_017: return new ImageSections_Marshmallow(reader, artHeader); - case ArtConstants.VERSION_NOUGAT_RELEASE: + case ArtConstants.ART_VERSION_029: return new ImageSections_Nougat(reader, artHeader); - case ArtConstants.VERSION_NOUGAT_MR2_PIXEL_RELEASE: + case ArtConstants.ART_VERSION_030: return new ImageSections_NougatMR2Pixel(reader, artHeader); - case ArtConstants.VERSION_OREO_RELEASE: - case ArtConstants.VERSION_OREO_DR1_RELEASE: + case ArtConstants.ART_VERSION_043: + case ArtConstants.ART_VERSION_044: return new ImageSections_Oreo(reader, artHeader); - case ArtConstants.VERSION_OREO_MR1_RELEASE: + case ArtConstants.ART_VERSION_046: return new ImageSections_OreoMR1(reader, artHeader); - case ArtConstants.VERSION_PIE_RELEASE: + case ArtConstants.ART_VERSION_056: return new ImageSections_Pie(reader, artHeader); - case ArtConstants.VERSION_10_RELEASE: - case ArtConstants.VERSION_11_RELEASE: - return new ImageSections_10(reader, artHeader); - case ArtConstants.VERSION_12_RELEASE: - case ArtConstants.VERSION_13_RELEASE: - return new ImageSections_12(reader, artHeader); + case ArtConstants.ART_VERSION_074: + case ArtConstants.ART_VERSION_085: + return new ImageSections_Q_R(reader, artHeader); + case ArtConstants.ART_VERSION_099: + case ArtConstants.ART_VERSION_106: + return new ImageSections_S_T(reader, artHeader); } throw new IOException( "Unsupported ART version for ImageSections: " + artHeader.getVersion()); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtMethod.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtMethod.java index 74ab7cb760..bd9682cf48 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtMethod.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/ArtMethod.java @@ -51,7 +51,7 @@ public class ArtMethod implements StructConverter { this.pointerSize = pointerSize; this.artVersion = artVersion; - if (ArtConstants.VERSION_MARSHMALLOW_RELEASE.equals(artVersion)) { + if (ArtConstants.ART_VERSION_017.equals(artVersion)) { if (pointerSize == 4) { declaring_class_ = reader.readNextInt(); dex_cache_resolved_methods_ = Integer.toUnsignedLong(reader.readNextInt()); @@ -70,8 +70,8 @@ public class ArtMethod implements StructConverter { throw new IOException("Unsupported 64-bit ART method format: " + artVersion); } } - else if (ArtConstants.VERSION_NOUGAT_RELEASE.equals(artVersion) || - ArtConstants.VERSION_NOUGAT_MR2_PIXEL_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_029.equals(artVersion) || + ArtConstants.ART_VERSION_030.equals(artVersion)) { if (pointerSize == 4) { declaring_class_ = reader.readNextInt(); @@ -101,9 +101,9 @@ public class ArtMethod implements StructConverter { entry_point_from_quick_compiled_code_ = reader.readNextLong(); } } - else if (ArtConstants.VERSION_OREO_RELEASE.equals(artVersion) || - ArtConstants.VERSION_OREO_DR1_RELEASE.equals(artVersion) || - ArtConstants.VERSION_OREO_MR1_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_043.equals(artVersion) || + ArtConstants.ART_VERSION_044.equals(artVersion) || + ArtConstants.ART_VERSION_046.equals(artVersion)) { if (pointerSize == 4) { declaring_class_ = reader.readNextInt(); @@ -130,7 +130,7 @@ public class ArtMethod implements StructConverter { entry_point_from_quick_compiled_code_ = reader.readNextLong(); } } - else if (ArtConstants.VERSION_PIE_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_056.equals(artVersion)) { declaring_class_ = reader.readNextInt(); access_flags_ = reader.readNextInt(); dex_code_item_offset_ = reader.readNextInt(); @@ -149,7 +149,7 @@ public class ArtMethod implements StructConverter { } } /** https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/art_method.h#741 */ - else if (ArtConstants.VERSION_10_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_074.equals(artVersion)) { declaring_class_ = reader.readNextInt(); access_flags_ = reader.readNextInt(); dex_code_item_offset_ = reader.readNextInt(); @@ -168,7 +168,7 @@ public class ArtMethod implements StructConverter { } } /** https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/art_method.h#798 */ - else if (ArtConstants.VERSION_11_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_085.equals(artVersion)) { declaring_class_ = reader.readNextInt(); access_flags_ = reader.readNextInt(); dex_code_item_offset_ = reader.readNextInt(); @@ -187,7 +187,7 @@ public class ArtMethod implements StructConverter { } } /** https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/art_method.h#787 */ - else if (ArtConstants.VERSION_12_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_099.equals(artVersion)) { declaring_class_ = reader.readNextInt(); access_flags_ = reader.readNextInt(); dex_method_index_ = reader.readNextInt(); @@ -206,7 +206,7 @@ public class ArtMethod implements StructConverter { } } /** https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/art_method.h#787 */ - else if (ArtConstants.VERSION_13_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_106.equals(artVersion)) { declaring_class_ = reader.readNextInt(); access_flags_ = reader.readNextInt(); dex_method_index_ = reader.readNextInt(); @@ -300,7 +300,7 @@ public class ArtMethod implements StructConverter { Structure struct = new StructureDataType(ArtMethod.class.getSimpleName(), 0); struct.setCategoryPath(new CategoryPath("/art")); - if (ArtConstants.VERSION_MARSHMALLOW_RELEASE.equals(artVersion)) { + if (ArtConstants.ART_VERSION_017.equals(artVersion)) { if (pointerSize == 4) { struct.add(DWORD, "declaring_class_", null); struct.add(DWORD, "dex_cache_resolved_methods_", null); @@ -318,8 +318,8 @@ public class ArtMethod implements StructConverter { throw new IOException("Unsupported 64-bit ART method format: " + artVersion); } } - else if (ArtConstants.VERSION_NOUGAT_RELEASE.equals(artVersion) || - ArtConstants.VERSION_NOUGAT_MR2_PIXEL_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_029.equals(artVersion) || + ArtConstants.ART_VERSION_030.equals(artVersion)) { if (pointerSize == 4) { struct.add(ptr32, "declaring_class_", null); @@ -348,9 +348,9 @@ public class ArtMethod implements StructConverter { struct.add(ptr64, "entry_point_from_quick_compiled_code_", null); } } - else if (ArtConstants.VERSION_OREO_RELEASE.equals(artVersion) || - ArtConstants.VERSION_OREO_DR1_RELEASE.equals(artVersion) || - ArtConstants.VERSION_OREO_MR1_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_043.equals(artVersion) || + ArtConstants.ART_VERSION_044.equals(artVersion) || + ArtConstants.ART_VERSION_046.equals(artVersion)) { if (pointerSize == 4) { struct.add(ptr32, "declaring_class_", null); @@ -376,7 +376,7 @@ public class ArtMethod implements StructConverter { struct.add(ptr64, "entry_point_from_quick_compiled_code_", null); } } - else if (ArtConstants.VERSION_PIE_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_056.equals(artVersion)) { struct.add(ptr32, "declaring_class_", null); struct.add(DWORD, "access_flags_", null); struct.add(DWORD, "dex_code_item_offset_", null); @@ -394,7 +394,7 @@ public class ArtMethod implements StructConverter { struct.add(QWORD, "entry_point_from_quick_compiled_code_", null); } } - else if (ArtConstants.VERSION_10_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_074.equals(artVersion)) { struct.add(ptr32, "declaring_class_", null); struct.add(DWORD, "access_flags_", null); struct.add(DWORD, "dex_code_item_offset_", null); @@ -412,7 +412,7 @@ public class ArtMethod implements StructConverter { struct.add(ptr64, "entry_point_from_quick_compiled_code_", null); } } - else if (ArtConstants.VERSION_11_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_085.equals(artVersion)) { struct.add(ptr32, "declaring_class_", null); struct.add(DWORD, "access_flags_", null); struct.add(DWORD, "dex_code_item_offset_", null); @@ -430,7 +430,7 @@ public class ArtMethod implements StructConverter { struct.add(QWORD, "entry_point_from_quick_compiled_code_", null); } } - else if (ArtConstants.VERSION_12_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_099.equals(artVersion)) { struct.add(ptr32, "declaring_class_", null); struct.add(DWORD, "access_flags_", null); struct.add(DWORD, "dex_method_index_", null); @@ -448,7 +448,7 @@ public class ArtMethod implements StructConverter { struct.add(QWORD, "entry_point_from_quick_compiled_code_", null); } } - else if (ArtConstants.VERSION_13_RELEASE.equals(artVersion)) { + else if (ArtConstants.ART_VERSION_106.equals(artVersion)) { struct.add(ptr32, "declaring_class_", null); struct.add(DWORD, "access_flags_", null); struct.add(DWORD, "dex_method_index_", null); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android11/BootImageLiveObjects.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android11/BootImageLiveObjects.java deleted file mode 100644 index 525912411b..0000000000 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android11/BootImageLiveObjects.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.file.formats.android.art.android11; - -/** - * https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/image.h - */ -public enum BootImageLiveObjects { - - /** Pre-allocated OOME when throwing exception. */ - kOomeWhenThrowingException, - /** Pre-allocated OOME when throwing OOME. */ - kOomeWhenThrowingOome, - /** Pre-allocated OOME when handling StackOverflowError. */ - kOomeWhenHandlingStackOverflow, - /** Pre-allocated NoClassDefFoundError. */ - kNoClassDefFoundError, - /** Pre-allocated sentinel for cleared weak JNI references. */ - kClearedJniWeakSentinel, - kIntrinsicObjectsStart; -} diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android12/ArtHeader_12.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android12/ArtHeader_12.java deleted file mode 100644 index 5a683deaa8..0000000000 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android12/ArtHeader_12.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.file.formats.android.art.android12; - -import java.io.IOException; - -import ghidra.app.util.bin.BinaryReader; -import ghidra.file.formats.android.art.android11.ArtHeader_11; -import ghidra.program.model.data.DataType; -import ghidra.program.model.data.Structure; -import ghidra.util.InvalidNameException; -import ghidra.util.exception.DuplicateNameException; - -/** - * https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/image.h#418 - * https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/image.cc#33 - * - * https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/image.h#418 - * https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/image.cc#33 - * - * https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/image.h#418 - * https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/image.cc#33 - */ -public class ArtHeader_12 extends ArtHeader_11 { - - public ArtHeader_12(BinaryReader reader) throws IOException { - super(reader); - } - - @Override - public DataType toDataType() throws DuplicateNameException, IOException { - Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_12.class.getSimpleName()); - } - catch (InvalidNameException e) { - // ignore - } - return structure; - } -} diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/kitkat/ArtHeader_KitKat.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_005.java similarity index 90% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/kitkat/ArtHeader_KitKat.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_005.java index f297992fd1..f57bd52964 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/kitkat/ArtHeader_KitKat.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_005.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.kitkat; +package ghidra.file.formats.android.art.headers; import java.io.IOException; @@ -22,14 +22,13 @@ import ghidra.file.formats.android.art.ArtHeader; import ghidra.program.model.data.DataType; import ghidra.program.model.data.Structure; import ghidra.program.model.listing.Program; -import ghidra.util.InvalidNameException; import ghidra.util.exception.DuplicateNameException; import ghidra.util.task.TaskMonitor; /** - * @see https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/image.cc + * kitkat-release/runtime/image.c */ -public class ArtHeader_KitKat extends ArtHeader { +public class ArtHeader_005 extends ArtHeader { protected int image_begin_; protected int image_size_; @@ -42,7 +41,7 @@ public class ArtHeader_KitKat extends ArtHeader { protected int oat_file_end_; protected int image_roots_; - public ArtHeader_KitKat(BinaryReader reader) throws IOException { + public ArtHeader_005(BinaryReader reader) throws IOException { super(reader); parse(reader); } @@ -151,13 +150,6 @@ public class ArtHeader_KitKat extends ArtHeader { public DataType toDataType() throws DuplicateNameException, IOException { Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_KitKat.class.getSimpleName()); - } - catch (InvalidNameException e) { - //ignore - } - structure.add(DWORD, "image_begin_", null); structure.add(DWORD, "image_size_", null); structure.add(DWORD, "image_bitmap_offset_", null); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ArtHeader_Lollipop.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_009.java similarity index 88% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ArtHeader_Lollipop.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_009.java index e472c815f0..bfda54426a 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ArtHeader_Lollipop.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_009.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.lollipop; +package ghidra.file.formats.android.art.headers; import java.io.IOException; @@ -22,14 +22,13 @@ import ghidra.file.formats.android.art.ArtHeader; import ghidra.program.model.data.DataType; import ghidra.program.model.data.Structure; import ghidra.program.model.listing.Program; -import ghidra.util.InvalidNameException; import ghidra.util.exception.DuplicateNameException; import ghidra.util.task.TaskMonitor; /** - * @see https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/image.cc + * lollipop-release/runtime/image.c */ -public class ArtHeader_Lollipop extends ArtHeader { +public class ArtHeader_009 extends ArtHeader { protected int image_begin_; protected int image_size_; @@ -43,7 +42,7 @@ public class ArtHeader_Lollipop extends ArtHeader { protected int patch_delta_; protected int image_roots_; - public ArtHeader_Lollipop(BinaryReader reader) throws IOException { + public ArtHeader_009(BinaryReader reader) throws IOException { super(reader); parse(reader); } @@ -127,13 +126,6 @@ public class ArtHeader_Lollipop extends ArtHeader { public DataType toDataType() throws DuplicateNameException, IOException { Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_Lollipop.class.getSimpleName()); - } - catch (InvalidNameException e) { - //ignore - } - structure.add(DWORD, "image_begin_", null); structure.add(DWORD, "image_size_", null); structure.add(DWORD, "image_bitmap_offset_", null); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ArtHeader_LollipopMR1WFC.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_012.java similarity index 88% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ArtHeader_LollipopMR1WFC.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_012.java index 53a053aa89..9e46e03b50 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ArtHeader_LollipopMR1WFC.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_012.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.lollipop; +package ghidra.file.formats.android.art.headers; import java.io.IOException; @@ -22,14 +22,13 @@ import ghidra.file.formats.android.art.ArtHeader; import ghidra.program.model.data.DataType; import ghidra.program.model.data.Structure; import ghidra.program.model.listing.Program; -import ghidra.util.InvalidNameException; import ghidra.util.exception.DuplicateNameException; import ghidra.util.task.TaskMonitor; /** - * @see https://android.googlesource.com/platform/art/+/lollipop-mr1-wfc-release/runtime/image.h + * lollipop-mr1-wfc-release/runtime/image.c */ -public class ArtHeader_LollipopMR1WFC extends ArtHeader { +public class ArtHeader_012 extends ArtHeader { protected int image_begin_; protected int image_size_; @@ -44,7 +43,7 @@ public class ArtHeader_LollipopMR1WFC extends ArtHeader { protected int image_roots_; protected int compile_pic_; - public ArtHeader_LollipopMR1WFC(BinaryReader reader) throws IOException { + public ArtHeader_012(BinaryReader reader) throws IOException { super(reader); parse(reader); } @@ -126,13 +125,6 @@ public class ArtHeader_LollipopMR1WFC extends ArtHeader { public DataType toDataType() throws DuplicateNameException, IOException { Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_LollipopMR1WFC.class.getSimpleName()); - } - catch (InvalidNameException e) { - //ignore - } - structure.add(DWORD, "image_begin_", null); structure.add(DWORD, "image_size_", null); structure.add(DWORD, "image_bitmap_offset_", null); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ArtHeader_Marshmallow.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_017.java similarity index 90% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ArtHeader_Marshmallow.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_017.java index f143c1fbc9..2f15473c98 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ArtHeader_Marshmallow.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_017.java @@ -13,23 +13,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.marshmallow; +package ghidra.file.formats.android.art.headers; import java.io.IOException; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.*; +import ghidra.file.formats.android.art.image_method.ImageMethod_Marshmallow; import ghidra.program.model.data.DataType; import ghidra.program.model.data.Structure; import ghidra.program.model.listing.Program; -import ghidra.util.InvalidNameException; import ghidra.util.exception.DuplicateNameException; import ghidra.util.task.TaskMonitor; /** - * @see https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/image.h + * marshmallow-release/runtime/image.c */ -public class ArtHeader_Marshmallow extends ArtHeader { +public class ArtHeader_017 extends ArtHeader { protected int image_begin_; protected int image_size_; @@ -48,7 +48,7 @@ public class ArtHeader_Marshmallow extends ArtHeader { protected ArtImageSections sections; - public ArtHeader_Marshmallow(BinaryReader reader) throws IOException { + public ArtHeader_017(BinaryReader reader) throws IOException { super(reader); parse(reader); } @@ -142,12 +142,6 @@ public class ArtHeader_Marshmallow extends ArtHeader { public DataType toDataType() throws DuplicateNameException, IOException { Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_Marshmallow.class.getSimpleName()); - } - catch (InvalidNameException e) { - } - structure.add(DWORD, "image_begin_", null); structure.add(DWORD, "image_size_", null); structure.add(DWORD, "oat_checksum_", null); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ArtHeader_Nougat.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_029.java similarity index 91% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ArtHeader_Nougat.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_029.java index d66cee0e1e..ad47c25ee7 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ArtHeader_Nougat.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_029.java @@ -13,25 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.nougat; +package ghidra.file.formats.android.art.headers; import java.io.IOException; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.*; +import ghidra.file.formats.android.art.image_method.ImageMethod_Nougat; import ghidra.file.formats.android.util.DecompressionManager; import ghidra.program.model.data.DataType; import ghidra.program.model.data.Structure; import ghidra.program.model.listing.Program; -import ghidra.util.InvalidNameException; import ghidra.util.exception.DuplicateNameException; import ghidra.util.task.TaskMonitor; /** - * https://android.googlesource.com/platform/art/+/nougat-release/runtime/image.h - * https://android.googlesource.com/platform/art/+/nougat-release/runtime/image.cc + * nougat-release/runtime/image.c */ -public class ArtHeader_Nougat extends ArtHeader implements ArtCompression { +public class ArtHeader_029 extends ArtHeader implements ArtCompression { protected int image_begin_; protected int image_size_; @@ -56,7 +55,7 @@ public class ArtHeader_Nougat extends ArtHeader implements ArtCompression { private long _compressedOffset; - public ArtHeader_Nougat(BinaryReader reader) throws IOException { + public ArtHeader_029(BinaryReader reader) throws IOException { super(reader); parse(reader); } @@ -207,13 +206,6 @@ public class ArtHeader_Nougat extends ArtHeader implements ArtCompression { public DataType toDataType() throws DuplicateNameException, IOException { Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_Nougat.class.getSimpleName()); - } - catch (InvalidNameException e) { - //ignore, just use original name should this fail - } - structure.add(DWORD, "image_begin_", null); structure.add(DWORD, "image_size_", null); structure.add(DWORD, "oat_checksum_", null); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ArtHeader_NougatMR2Pixel.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_030.java similarity index 51% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ArtHeader_NougatMR2Pixel.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_030.java index a4580ad827..cc7fa6a8fd 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ArtHeader_NougatMR2Pixel.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_030.java @@ -13,22 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.nougat; +package ghidra.file.formats.android.art.headers; import java.io.IOException; import ghidra.app.util.bin.BinaryReader; -import ghidra.program.model.data.DataType; -import ghidra.program.model.data.Structure; -import ghidra.util.InvalidNameException; -import ghidra.util.exception.DuplicateNameException; +import ghidra.file.formats.android.art.image_method.ImageMethod_Nougat; /** - * https://android.googlesource.com/platform/art/+/nougat-mr2-pixel-release/runtime/image.h + * nougat-mr2-pixel-release/runtime/image.c */ -public class ArtHeader_NougatMR2Pixel extends ArtHeader_Nougat { +public class ArtHeader_030 extends ArtHeader_029 { - public ArtHeader_NougatMR2Pixel(BinaryReader reader) throws IOException { + public ArtHeader_030(BinaryReader reader) throws IOException { super(reader); } @@ -37,16 +34,4 @@ public class ArtHeader_NougatMR2Pixel extends ArtHeader_Nougat { return ImageMethod_Nougat.kImageMethodsCount.ordinal(); } - @Override - public DataType toDataType() throws DuplicateNameException, IOException { - Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_NougatMR2Pixel.class.getSimpleName()); - } - catch (InvalidNameException e) { - //ignore - } - return structure; - } - } diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ArtHeader_OreoMR1.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_043.java similarity index 52% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ArtHeader_OreoMR1.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_043.java index bdd85ba7aa..5460b00411 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ArtHeader_OreoMR1.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_043.java @@ -13,22 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.oreo; +package ghidra.file.formats.android.art.headers; import java.io.IOException; import ghidra.app.util.bin.BinaryReader; -import ghidra.program.model.data.DataType; -import ghidra.program.model.data.Structure; -import ghidra.util.InvalidNameException; -import ghidra.util.exception.DuplicateNameException; +import ghidra.file.formats.android.art.image_method.ImageMethod_Oreo; /** - * https://android.googlesource.com/platform/art/+/oreo-mr1-release/runtime/image.h + * oreo-release/runtime/image.c */ -public class ArtHeader_OreoMR1 extends ArtHeader_Oreo { +public class ArtHeader_043 extends ArtHeader_030 { - public ArtHeader_OreoMR1(BinaryReader reader) throws IOException { + public ArtHeader_043(BinaryReader reader) throws IOException { super(reader); } @@ -37,16 +34,4 @@ public class ArtHeader_OreoMR1 extends ArtHeader_Oreo { return ImageMethod_Oreo.kImageMethodsCount.ordinal(); } - @Override - public DataType toDataType() throws DuplicateNameException, IOException { - Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_OreoMR1.class.getSimpleName()); - } - catch (InvalidNameException e) { - //ignore - } - return structure; - } - } diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_044.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_044.java new file mode 100644 index 0000000000..1760738aa0 --- /dev/null +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_044.java @@ -0,0 +1,29 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.file.formats.android.art.headers; + +import java.io.IOException; + +import ghidra.app.util.bin.BinaryReader; + +/** + * oreo-dr1-release/runtime/image.c + */ +public class ArtHeader_044 extends ArtHeader_043 { + public ArtHeader_044(BinaryReader reader) throws IOException { + super(reader); + } +} diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_046.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_046.java new file mode 100644 index 0000000000..1b782a2afb --- /dev/null +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_046.java @@ -0,0 +1,37 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.file.formats.android.art.headers; + +import java.io.IOException; + +import ghidra.app.util.bin.BinaryReader; +import ghidra.file.formats.android.art.image_method.ImageMethod_Oreo; + +/** + * oreo-mr1-release/runtime/image.c + */ +public class ArtHeader_046 extends ArtHeader_044 { + + public ArtHeader_046(BinaryReader reader) throws IOException { + super(reader); + } + + @Override + public int getArtMethodCountForVersion() { + return ImageMethod_Oreo.kImageMethodsCount.ordinal(); + } + +} diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ArtHeader_Pie.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_056.java similarity index 93% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ArtHeader_Pie.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_056.java index d4351141d6..7f1e72570f 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ArtHeader_Pie.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_056.java @@ -13,24 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.pie; +package ghidra.file.formats.android.art.headers; import java.io.IOException; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.*; +import ghidra.file.formats.android.art.image_method.ImageMethod_Pie; import ghidra.file.formats.android.util.DecompressionManager; import ghidra.program.model.data.DataType; import ghidra.program.model.data.Structure; import ghidra.program.model.listing.Program; -import ghidra.util.InvalidNameException; import ghidra.util.exception.DuplicateNameException; import ghidra.util.task.TaskMonitor; /** - * https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/image.h + * pie-release/runtime/image.c */ -public class ArtHeader_Pie extends ArtHeader implements ArtCompression { +public class ArtHeader_056 extends ArtHeader implements ArtCompression { protected int image_begin_; protected int image_size_; @@ -57,7 +57,7 @@ public class ArtHeader_Pie extends ArtHeader implements ArtCompression { private long _compressedOffset; - public ArtHeader_Pie(BinaryReader reader) throws IOException { + public ArtHeader_056(BinaryReader reader) throws IOException { super(reader); parse(reader); } @@ -204,13 +204,6 @@ public class ArtHeader_Pie extends ArtHeader implements ArtCompression { public DataType toDataType() throws DuplicateNameException, IOException { Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_Pie.class.getSimpleName()); - } - catch (InvalidNameException e) { - //ignore - } - structure.add(DWORD, "image_begin_", null); structure.add(DWORD, "image_size_", null); structure.add(DWORD, "oat_checksum_", null); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ArtHeader_10.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_074.java similarity index 90% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ArtHeader_10.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_074.java index df5f55a938..6aa796878f 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ArtHeader_10.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_074.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.android10; +package ghidra.file.formats.android.art.headers; import java.io.IOException; import java.util.ArrayList; @@ -21,18 +21,18 @@ import java.util.List; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.*; +import ghidra.file.formats.android.art.image_method.ImageMethod_Q; import ghidra.file.formats.android.util.DecompressionManager; import ghidra.program.model.data.DataType; import ghidra.program.model.data.Structure; import ghidra.program.model.listing.Program; -import ghidra.util.InvalidNameException; import ghidra.util.exception.DuplicateNameException; import ghidra.util.task.TaskMonitor; /** - * https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/image.h + * android10-release/runtime/image.c */ -public class ArtHeader_10 extends ArtHeader { +public class ArtHeader_074 extends ArtHeader { private int image_reservation_size_; private int component_count_; @@ -48,7 +48,7 @@ public class ArtHeader_10 extends ArtHeader { private int boot_image_size_; private int image_roots_; private int pointer_size_; - private long[] image_methods_ = new long[ImageMethod_10.kImageMethodsCount.ordinal()]; + private long[] image_methods_ = new long[ImageMethod_Q.kImageMethodsCount.ordinal()]; private int data_size_; private int blocks_offset_; private int blocks_count_; @@ -56,7 +56,7 @@ public class ArtHeader_10 extends ArtHeader { private ArtImageSections sections; - public ArtHeader_10(BinaryReader reader) throws IOException { + public ArtHeader_074(BinaryReader reader) throws IOException { super(reader); parse(reader); } @@ -104,7 +104,7 @@ public class ArtHeader_10 extends ArtHeader { @Override public int getArtMethodCountForVersion() { - return ImageMethod_10.kImageMethodsCount.ordinal(); + return ImageMethod_Q.kImageMethodsCount.ordinal(); } @Override @@ -196,13 +196,6 @@ public class ArtHeader_10 extends ArtHeader { public DataType toDataType() throws DuplicateNameException, IOException { Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_10.class.getSimpleName()); - } - catch (InvalidNameException e) { - // ignore, just use original name should this fail - } - structure.add(DWORD, "image_reservation_size_", null); structure.add(DWORD, "component_count_", null); structure.add(DWORD, "image_begin_", null); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android11/ArtHeader_11.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_085.java similarity index 90% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android11/ArtHeader_11.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_085.java index f2b1d3c5ed..31a2c992d8 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android11/ArtHeader_11.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_085.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.android11; +package ghidra.file.formats.android.art.headers; import java.io.IOException; import java.util.ArrayList; @@ -21,19 +21,18 @@ import java.util.List; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.*; -import ghidra.file.formats.android.art.android10.ImageMethod_10; +import ghidra.file.formats.android.art.image_method.ImageMethod_Q; import ghidra.file.formats.android.util.DecompressionManager; import ghidra.program.model.data.DataType; import ghidra.program.model.data.Structure; import ghidra.program.model.listing.Program; -import ghidra.util.InvalidNameException; import ghidra.util.exception.DuplicateNameException; import ghidra.util.task.TaskMonitor; /** - * https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/image.h + * android11-release/runtime/image.c */ -public class ArtHeader_11 extends ArtHeader { +public class ArtHeader_085 extends ArtHeader { private int image_reservation_size_; private int component_count_; @@ -51,7 +50,7 @@ public class ArtHeader_11 extends ArtHeader { private int boot_image_checksum_; private int image_roots_; private int pointer_size_; - private long[] image_methods_ = new long[ImageMethod_10.kImageMethodsCount.ordinal()]; + private long[] image_methods_ = new long[ImageMethod_Q.kImageMethodsCount.ordinal()]; private int data_size_; private int blocks_offset_; private int blocks_count_; @@ -59,7 +58,7 @@ public class ArtHeader_11 extends ArtHeader { private ArtImageSections sections; - public ArtHeader_11(BinaryReader reader) throws IOException { + public ArtHeader_085(BinaryReader reader) throws IOException { super(reader); parse(reader); } @@ -109,7 +108,7 @@ public class ArtHeader_11 extends ArtHeader { @Override public int getArtMethodCountForVersion() { - return ImageMethod_10.kImageMethodsCount.ordinal(); + return ImageMethod_Q.kImageMethodsCount.ordinal(); } @Override @@ -208,13 +207,6 @@ public class ArtHeader_11 extends ArtHeader { public DataType toDataType() throws DuplicateNameException, IOException { Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_11.class.getSimpleName()); - } - catch (InvalidNameException e) { - //ignore - } - structure.add(DWORD, "image_reservation_size_", null); structure.add(DWORD, "component_count_", null); structure.add(DWORD, "image_begin_", null); diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_099.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_099.java new file mode 100644 index 0000000000..28c757ff6f --- /dev/null +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_099.java @@ -0,0 +1,29 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.file.formats.android.art.headers; + +import java.io.IOException; + +import ghidra.app.util.bin.BinaryReader; + +/** + * android12-release/runtime/image.c + */ +public class ArtHeader_099 extends ArtHeader_085 { + public ArtHeader_099(BinaryReader reader) throws IOException { + super(reader); + } +} diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_106.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_106.java new file mode 100644 index 0000000000..0b91ccdba7 --- /dev/null +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/headers/ArtHeader_106.java @@ -0,0 +1,29 @@ +/* ### + * IP: GHIDRA + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package ghidra.file.formats.android.art.headers; + +import java.io.IOException; + +import ghidra.app.util.bin.BinaryReader; + +/** + * android13-release/runtime/image.c + */ +public class ArtHeader_106 extends ArtHeader_099 { + public ArtHeader_106(BinaryReader reader) throws IOException { + super(reader); + } +} diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ImageMethod_Marshmallow.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Marshmallow.java similarity index 79% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ImageMethod_Marshmallow.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Marshmallow.java index 698e0c8908..3a328b77f3 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ImageMethod_Marshmallow.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Marshmallow.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.marshmallow; +package ghidra.file.formats.android.art.image_method; /** - * https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/image.h + * marshmallow-release/runtime/image.h */ public enum ImageMethod_Marshmallow { kResolutionMethod, diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageMethod_Nougat.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Nougat.java similarity index 80% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageMethod_Nougat.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Nougat.java index fa635f90ef..8fb68b9591 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageMethod_Nougat.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Nougat.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.nougat; +package ghidra.file.formats.android.art.image_method; /** - * https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/image.h + * nougat-release/runtime/image.h */ public enum ImageMethod_Nougat { kResolutionMethod, diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageMethod_Oreo.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Oreo.java similarity index 81% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageMethod_Oreo.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Oreo.java index 34b84ca9de..a252c04d93 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageMethod_Oreo.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Oreo.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.oreo; +package ghidra.file.formats.android.art.image_method; /** - * https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/image.h + * oreo-release/runtime/image.h */ public enum ImageMethod_Oreo { kResolutionMethod, diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ImageMethod_Pie.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Pie.java similarity index 82% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ImageMethod_Pie.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Pie.java index dc6103b4c7..ea9394a971 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ImageMethod_Pie.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Pie.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.pie; +package ghidra.file.formats.android.art.image_method; /** - * https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/image.h + * pie-release/runtime/image.h */ public enum ImageMethod_Pie { kResolutionMethod, diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ImageMethod_10.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Q.java similarity index 79% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ImageMethod_10.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Q.java index 793c3ffb59..7430ea053f 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ImageMethod_10.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_method/ImageMethod_Q.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.android10; +package ghidra.file.formats.android.art.image_method; /** - * https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/image.h + * android10-release/runtime/image.h */ -public enum ImageMethod_10 { +public enum ImageMethod_Q { kResolutionMethod, kImtConflictMethod, kImtUnimplementedMethod, diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/kitkat/ImageRoot_KitKat.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_KitKat.java similarity index 80% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/kitkat/ImageRoot_KitKat.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_KitKat.java index cf871d2ae1..c608bab6eb 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/kitkat/ImageRoot_KitKat.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_KitKat.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.kitkat; +package ghidra.file.formats.android.art.image_root; /** - * @see https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/image.h + * kitkat-release/runtime/image.h */ public enum ImageRoot_KitKat { kResolutionMethod, diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ImageRoot_Lollipop.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Lollipop.java similarity index 80% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ImageRoot_Lollipop.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Lollipop.java index c979bf59c1..ebbd782c23 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ImageRoot_Lollipop.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Lollipop.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.lollipop; +package ghidra.file.formats.android.art.image_root; /** - * @see https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/image.h + * lollipop-release/runtime/image.h */ public enum ImageRoot_Lollipop { kResolutionMethod, diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ImageRoot_LollipopMR1WRC.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_LollipopMR1WRC.java similarity index 79% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ImageRoot_LollipopMR1WRC.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_LollipopMR1WRC.java index 28d713e5ad..45eff05bed 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/lollipop/ImageRoot_LollipopMR1WRC.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_LollipopMR1WRC.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.lollipop; +package ghidra.file.formats.android.art.image_root; /** - * @see https://android.googlesource.com/platform/art/+/lollipop-mr1-wfc-release/runtime/image.h + * lollipop-mr1-wfc-release/runtime/image.h */ public enum ImageRoot_LollipopMR1WRC { kResolutionMethod, diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ImageRoot_Marshmallow.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Marshmallow.java similarity index 79% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ImageRoot_Marshmallow.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Marshmallow.java index 4cc6b89304..0bb75b4a7a 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ImageRoot_Marshmallow.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Marshmallow.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.marshmallow; +package ghidra.file.formats.android.art.image_root; /** - * @see https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/image.h + * marshmallow-release/runtime/image.h */ public enum ImageRoot_Marshmallow { kResolutionMethod, diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageRoot_Nougat.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Nougat.java similarity index 72% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageRoot_Nougat.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Nougat.java index 0a362685c0..5c23806153 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageRoot_Nougat.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Nougat.java @@ -13,11 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.nougat; +package ghidra.file.formats.android.art.image_root; /** - * @see https://android.googlesource.com/platform/art/+/nougat-release/runtime/image.h + * nougat-release/runtime/image.h */ public enum ImageRoot_Nougat { - kDexCaches, kClassRoots, kImageRootsMax, + kDexCaches, + kClassRoots, + kImageRootsMax, } diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageRoot_Oreo.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Oreo.java similarity index 78% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageRoot_Oreo.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Oreo.java index fee0334063..a6a61d5d60 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageRoot_Oreo.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Oreo.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.oreo; +package ghidra.file.formats.android.art.image_root; /** - * https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/image.h + * oreo-release/runtime/image.h */ public enum ImageRoot_Oreo { kDexCaches, diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ImageRoot_Pie.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Pie.java similarity index 78% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ImageRoot_Pie.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Pie.java index 9cfca767e5..ba6fd8476e 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ImageRoot_Pie.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Pie.java @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.pie; +package ghidra.file.formats.android.art.image_root; /** - * https://android.googlesource.com/platform/art/+/nougat-release/runtime/image.h + * pie-release/runtime/image.h */ public enum ImageRoot_Pie { kDexCaches, diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ImageRoot_10.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Q.java similarity index 76% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ImageRoot_10.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Q.java index 315fa68b4e..561bf462d8 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ImageRoot_10.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_Q.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.android10; +package ghidra.file.formats.android.art.image_root; /** - * https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/image.h + * android10-release/runtime/image.h */ -public enum ImageRoot_10 { +public enum ImageRoot_Q { kDexCaches, kClassRoots, /** Pre-allocated OOME when throwing exception.*/ @@ -36,8 +36,8 @@ public enum ImageRoot_10 { //Aliases /** The class loader used to build the app image.*/ - public final static ImageRoot_10 kAppImageClassLoader = kSpecialRoots; + public final static ImageRoot_Q kAppImageClassLoader = kSpecialRoots; /** Array of boot image objects that must be kept live. */ - public final static ImageRoot_10 kBootImageLiveObjects = kSpecialRoots; + public final static ImageRoot_Q kBootImageLiveObjects = kSpecialRoots; } diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android11/ImageRoot_11.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_R.java similarity index 68% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android11/ImageRoot_11.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_R.java index c91c821b59..2a13f471cc 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android11/ImageRoot_11.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_root/ImageRoot_R.java @@ -13,19 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.android11; +package ghidra.file.formats.android.art.image_root; /** - * https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/image.h + * android11-release/runtime/image.h */ -public enum ImageRoot_11 { +public enum ImageRoot_R { kDexCaches, kClassRoots, kSpecialRoots, kImageRootsMax; //Aliases /** The class loader used to build the app image.*/ - public final static ImageRoot_11 kAppImageClassLoader = kSpecialRoots; + public final static ImageRoot_R kAppImageClassLoader = kSpecialRoots; /** Array of boot image objects that must be kept live. */ - public final static ImageRoot_11 kBootImageLiveObjects = kSpecialRoots; + public final static ImageRoot_R kBootImageLiveObjects = kSpecialRoots; } diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ImageSections_Marshmallow.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Marshmallow.java similarity index 91% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ImageSections_Marshmallow.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Marshmallow.java index 3bf5606ff0..8e9eeacfd0 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/marshmallow/ImageSections_Marshmallow.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Marshmallow.java @@ -13,12 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.marshmallow; +package ghidra.file.formats.android.art.image_sections; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.ArtHeader; import ghidra.file.formats.android.art.ArtImageSections; +/** + * marshmallow-release/runtime/image.h + */ public class ImageSections_Marshmallow extends ArtImageSections { public final static int kSectionObjects = 0; public final static int kSectionArtFields = 1; diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageSections_Nougat.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Nougat.java similarity index 92% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageSections_Nougat.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Nougat.java index 3452f4ff8a..866d07f3e7 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageSections_Nougat.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Nougat.java @@ -13,12 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.nougat; +package ghidra.file.formats.android.art.image_sections; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.ArtHeader; import ghidra.file.formats.android.art.ArtImageSections; +/** + * nougat-release/runtime/image.h + */ public class ImageSections_Nougat extends ArtImageSections { public final static int kSectionObjects = 0; public final static int kSectionArtFields = 1; diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageSections_NougatMR2Pixel.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_NougatMR2Pixel.java similarity index 92% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageSections_NougatMR2Pixel.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_NougatMR2Pixel.java index 8886244da8..9e87a380b2 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/nougat/ImageSections_NougatMR2Pixel.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_NougatMR2Pixel.java @@ -13,12 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.nougat; +package ghidra.file.formats.android.art.image_sections; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.ArtHeader; import ghidra.file.formats.android.art.ArtImageSections; +/** + * nougat-mr2-pixel-release/runtime/image.h + */ public class ImageSections_NougatMR2Pixel extends ArtImageSections { public final static int kSectionObjects = 0; public final static int kSectionArtFields = 1; diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageSections_Oreo.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Oreo.java similarity index 93% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageSections_Oreo.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Oreo.java index c046b0050e..3f5f025a1d 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageSections_Oreo.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Oreo.java @@ -13,12 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.oreo; +package ghidra.file.formats.android.art.image_sections; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.ArtHeader; import ghidra.file.formats.android.art.ArtImageSections; +/** + * oreo-release/runtime/image.h + */ public class ImageSections_Oreo extends ArtImageSections { public final static int kSectionObjects = 0; public final static int kSectionArtFields = 1; diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageSections_OreoMR1.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_OreoMR1.java similarity index 92% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageSections_OreoMR1.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_OreoMR1.java index 657de24612..52f3dcc6fb 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ImageSections_OreoMR1.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_OreoMR1.java @@ -13,12 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.oreo; +package ghidra.file.formats.android.art.image_sections; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.ArtHeader; import ghidra.file.formats.android.art.ArtImageSections; +/** + * oreo-mr1-release/runtime/image.h + */ public class ImageSections_OreoMR1 extends ArtImageSections { public final static int kSectionObjects = 0; public final static int kSectionArtFields = 1; diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ImageSections_Pie.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Pie.java similarity index 92% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ImageSections_Pie.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Pie.java index 3cf9f8beb0..50911c82c7 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/pie/ImageSections_Pie.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Pie.java @@ -13,12 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.pie; +package ghidra.file.formats.android.art.image_sections; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.ArtHeader; import ghidra.file.formats.android.art.ArtImageSections; +/** + * pie-release/runtime/image.h + */ public class ImageSections_Pie extends ArtImageSections { public final static int kSectionObjects = 0; public final static int kSectionArtFields = 1; diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ImageSections_10.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Q_R.java similarity index 84% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ImageSections_10.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Q_R.java index b61d930d14..eae2fcf75e 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android10/ImageSections_10.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_Q_R.java @@ -13,16 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.android10; +package ghidra.file.formats.android.art.image_sections; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.ArtHeader; import ghidra.file.formats.android.art.ArtImageSections; /** - * https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/image.h + * android10-release/runtime/image.h + * + * android11-release/runtime/image.h */ -public class ImageSections_10 extends ArtImageSections { +public class ImageSections_Q_R extends ArtImageSections { public final static int kSectionObjects = 0; public final static int kSectionArtFields = 1; public final static int kSectionArtMethods = 2; @@ -37,7 +39,7 @@ public class ImageSections_10 extends ArtImageSections { public final static int kSectionImageBitmap = 11; public final static int kSectionCount = 12; // Number of elements in enum. - public ImageSections_10(BinaryReader reader, ArtHeader header) { + public ImageSections_Q_R(BinaryReader reader, ArtHeader header) { super(reader, header); } diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android12/ImageSections_12.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_S_T.java similarity index 84% rename from Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android12/ImageSections_12.java rename to Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_S_T.java index 5ceeee22ce..8be949b56b 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/android12/ImageSections_12.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/image_sections/ImageSections_S_T.java @@ -13,18 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package ghidra.file.formats.android.art.android12; +package ghidra.file.formats.android.art.image_sections; import ghidra.app.util.bin.BinaryReader; import ghidra.file.formats.android.art.ArtHeader; import ghidra.file.formats.android.art.ArtImageSections; /** - * https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/image.h#254 + * android12-release/runtime/image.h * - * https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/image.h#254 + * android13-release/runtime/image.h */ -public class ImageSections_12 extends ArtImageSections { +public class ImageSections_S_T extends ArtImageSections { public final static int kSectionObjects = 0; public final static int kSectionArtFields = 1; public final static int kSectionArtMethods = 2; @@ -38,7 +38,7 @@ public class ImageSections_12 extends ArtImageSections { public final static int kSectionImageBitmap = 10; public final static int kSectionCount = 11; // Number of elements in enum. - public ImageSections_12(BinaryReader reader, ArtHeader header) { + public ImageSections_S_T(BinaryReader reader, ArtHeader header) { super(reader, header); } diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ArtHeader_Oreo.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ArtHeader_Oreo.java deleted file mode 100644 index dca9f0c7ce..0000000000 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/art/oreo/ArtHeader_Oreo.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.file.formats.android.art.oreo; - -import java.io.IOException; - -import ghidra.app.util.bin.BinaryReader; -import ghidra.file.formats.android.art.nougat.ArtHeader_NougatMR2Pixel; -import ghidra.program.model.data.DataType; -import ghidra.program.model.data.Structure; -import ghidra.util.InvalidNameException; -import ghidra.util.exception.DuplicateNameException; - -/** - * https://android.googlesource.com/platform/art/+/oreo-release/runtime/image.h - */ -public class ArtHeader_Oreo extends ArtHeader_NougatMR2Pixel { - - public ArtHeader_Oreo(BinaryReader reader) throws IOException { - super(reader); - } - - @Override - public int getArtMethodCountForVersion() { - return ImageMethod_Oreo.kImageMethodsCount.ordinal(); - } - - @Override - public DataType toDataType() throws DuplicateNameException, IOException { - Structure structure = (Structure) super.toDataType(); - try { - structure.setName(ArtHeader_Oreo.class.getSimpleName()); - } - catch (InvalidNameException e) { - //ignore - } - return structure; - } - -} diff --git a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/oat/bundle/FullOatBundle.java b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/oat/bundle/FullOatBundle.java index cb31d3073e..52e89f8895 100644 --- a/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/oat/bundle/FullOatBundle.java +++ b/Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/android/oat/bundle/FullOatBundle.java @@ -294,7 +294,7 @@ public class FullOatBundle implements OatBundle { BinaryReader reader = new BinaryReader(provider, isLittleEndian); switch (type) { case ART: { - ArtHeader artHeader = ArtFactory.newArtHeader(reader); + ArtHeader artHeader = ArtHeaderFactory.newArtHeader(reader); this.artHeader = artHeader; return true; }