mirror of
https://github.com/NationalSecurityAgency/ghidra
synced 2024-08-28 05:20:21 +00:00
Merge remote-tracking branch 'origin/GP-0_lazybinding-dev_android_refactor'
This commit is contained in:
commit
deaf9b481f
|
@ -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();
|
||||
|
||||
|
|
|
@ -30,54 +30,54 @@ public final class ArtConstants {
|
|||
|
||||
public final static int VERSION_LENGTH = 4;
|
||||
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/image.cc#26">kitkat-release/runtime/image.c */
|
||||
public final static String VERSION_KITKAT_RELEASE = "005";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/image.cc#26">lollipop-release/runtime/image.c */
|
||||
public final static String VERSION_LOLLIPOP_RELEASE = "009";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-wfc-release/runtime/image.cc#26">lollipop-mr1-wfc-release/runtime/image.c */
|
||||
public final static String VERSION_LOLLIPOP_MR1_WFC_RELEASE = "012";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/image.cc#26">marshmallow-release/runtime/image.c */
|
||||
public final static String VERSION_MARSHMALLOW_RELEASE = "017";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/nougat-release/runtime/image.cc#26">nougat-release/runtime/image.c */
|
||||
public final static String VERSION_NOUGAT_RELEASE = "029";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/nougat-mr2-pixel-release/runtime/image.cc#26">nougat-mr2-pixel-release/runtime/image.c */
|
||||
public final static String VERSION_NOUGAT_MR2_PIXEL_RELEASE = "030";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/oreo-release/runtime/image.cc#28">oreo-release/runtime/image.c */
|
||||
public final static String VERSION_OREO_RELEASE = "043";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/oreo-dr1-release/runtime/image.cc#28">oreo-dr1-release/runtime/image.c */
|
||||
public final static String VERSION_OREO_DR1_RELEASE = "044";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/oreo-mr1-release/runtime/image.cc#28">oreo-mr1-release/runtime/image.c */
|
||||
public final static String VERSION_OREO_MR1_RELEASE = "046";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/pie-release/runtime/image.cc#28">pie-release/runtime/image.c */
|
||||
public final static String VERSION_PIE_RELEASE = "056";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/android10-release/runtime/image.cc#31">android10-release/runtime/image.c */
|
||||
public final static String VERSION_10_RELEASE = "074";//Q
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/android11-release/runtime/image.cc#31">android11-release/runtime/image.c */
|
||||
public final static String VERSION_11_RELEASE = "085";//R
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/android12-release/runtime/image.cc#31">android12-release/runtime/image.c */
|
||||
public final static String VERSION_12_RELEASE = "099";//S
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/android13-release/runtime/image.cc#31">android13-release/runtime/image.c */
|
||||
public final static String VERSION_13_RELEASE = "106";//S v2, 13
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/image.cc#26">kitkat-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_005 = "005";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/image.cc#26">lollipop-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_009 = "009";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-wfc-release/runtime/image.cc#26">lollipop-mr1-wfc-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_012 = "012";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/image.cc#26">marshmallow-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_017 = "017";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/nougat-release/runtime/image.cc#26">nougat-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_029 = "029";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/nougat-mr2-pixel-release/runtime/image.cc#26">nougat-mr2-pixel-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_030 = "030";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/oreo-release/runtime/image.cc#28">oreo-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_043 = "043";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/oreo-dr1-release/runtime/image.cc#28">oreo-dr1-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_044 = "044";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/oreo-mr1-release/runtime/image.cc#28">oreo-mr1-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_046 = "046";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/pie-release/runtime/image.cc#28">pie-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_056 = "056";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/android10-release/runtime/image.cc#31">android10-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_074 = "074";//Q
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/android11-release/runtime/image.cc#31">android11-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_085 = "085";//R
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/android12-release/runtime/image.cc#31">android12-release/runtime/image.c</a> */
|
||||
public final static String ART_VERSION_099 = "099";//S
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/android13-release/runtime/image.cc#31">android13-release/runtime/image.c</a> */
|
||||
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
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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"));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/image.cc#26">kitkat-release/runtime/image.c</a>
|
||||
*/
|
||||
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);
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/image.cc#26">lollipop-release/runtime/image.c</a>
|
||||
*/
|
||||
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);
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-wfc-release/runtime/image.cc#26">lollipop-mr1-wfc-release/runtime/image.c</a>
|
||||
*/
|
||||
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);
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/image.cc#26">marshmallow-release/runtime/image.c</a>
|
||||
*/
|
||||
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);
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/nougat-release/runtime/image.cc#26">nougat-release/runtime/image.c</a>
|
||||
*/
|
||||
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);
|
|
@ -13,29 +13,25 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
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.util.exception.DuplicateNameException;
|
||||
import ghidra.file.formats.android.art.image_method.ImageMethod_Nougat;
|
||||
|
||||
public class OatHeader_Oreo extends OatHeader_Marshmallow {
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/nougat-mr2-pixel-release/runtime/image.cc#26">nougat-mr2-pixel-release/runtime/image.c</a>
|
||||
*/
|
||||
public class ArtHeader_030 extends ArtHeader_029 {
|
||||
|
||||
OatHeader_Oreo(BinaryReader reader) throws IOException {
|
||||
public ArtHeader_030(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
dataType.setName(OatHeader_Oreo.class.getSimpleName());
|
||||
}
|
||||
catch (Exception e) {
|
||||
//ignore
|
||||
}
|
||||
return dataType;
|
||||
public int getArtMethodCountForVersion() {
|
||||
return ImageMethod_Nougat.kImageMethodsCount.ordinal();
|
||||
}
|
||||
|
||||
}
|
|
@ -13,29 +13,25 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
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.util.exception.DuplicateNameException;
|
||||
import ghidra.file.formats.android.art.image_method.ImageMethod_Oreo;
|
||||
|
||||
public class OatHeader_Nougat extends OatHeader_Marshmallow {
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/oreo-release/runtime/image.cc#28">oreo-release/runtime/image.c</a>
|
||||
*/
|
||||
public class ArtHeader_043 extends ArtHeader_030 {
|
||||
|
||||
OatHeader_Nougat(BinaryReader reader) throws IOException {
|
||||
public ArtHeader_043(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
dataType.setName(OatHeader_Nougat.class.getSimpleName());
|
||||
}
|
||||
catch (Exception e) {
|
||||
//ignore
|
||||
}
|
||||
return dataType;
|
||||
public int getArtMethodCountForVersion() {
|
||||
return ImageMethod_Oreo.kImageMethodsCount.ordinal();
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/oreo-dr1-release/runtime/image.cc#28">oreo-dr1-release/runtime/image.c</a>
|
||||
*/
|
||||
public class ArtHeader_044 extends ArtHeader_043 {
|
||||
public ArtHeader_044(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -13,29 +13,25 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.vdex;
|
||||
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.util.exception.DuplicateNameException;
|
||||
import ghidra.file.formats.android.art.image_method.ImageMethod_Oreo;
|
||||
|
||||
public class VdexHeader_11 extends VdexHeader_10 {
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/oreo-mr1-release/runtime/image.cc#28">oreo-mr1-release/runtime/image.c</a>
|
||||
*/
|
||||
public class ArtHeader_046 extends ArtHeader_044 {
|
||||
|
||||
public VdexHeader_11(BinaryReader reader) throws IOException, UnsupportedVdexVersionException {
|
||||
public ArtHeader_046(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
dataType.setName(VdexHeader_11.class.getSimpleName());
|
||||
}
|
||||
catch (Exception e) {
|
||||
//ignore...
|
||||
}
|
||||
return dataType;
|
||||
public int getArtMethodCountForVersion() {
|
||||
return ImageMethod_Oreo.kImageMethodsCount.ordinal();
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/pie-release/runtime/image.cc#28">pie-release/runtime/image.c</a>
|
||||
*/
|
||||
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);
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/android10-release/runtime/image.cc#31">android10-release/runtime/image.c</a>
|
||||
*/
|
||||
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);
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/android11-release/runtime/image.cc#31">android11-release/runtime/image.c</a>
|
||||
*/
|
||||
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);
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/android12-release/runtime/image.cc#31">android12-release/runtime/image.c</a>
|
||||
*/
|
||||
public class ArtHeader_099 extends ArtHeader_085 {
|
||||
public ArtHeader_099(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/android13-release/runtime/image.cc#31">android13-release/runtime/image.c</a>
|
||||
*/
|
||||
public class ArtHeader_106 extends ArtHeader_099 {
|
||||
public ArtHeader_106(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/image.h#125">marshmallow-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageMethod_Marshmallow {
|
||||
kResolutionMethod,
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/image.h#177">nougat-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageMethod_Nougat {
|
||||
kResolutionMethod,
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/image.h#178">oreo-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageMethod_Oreo {
|
||||
kResolutionMethod,
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/image.h#194">pie-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageMethod_Pie {
|
||||
kResolutionMethod,
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/image.h#209">android10-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageMethod_10 {
|
||||
public enum ImageMethod_Q {
|
||||
kResolutionMethod,
|
||||
kImtConflictMethod,
|
||||
kImtUnimplementedMethod,
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/image.h#91">kitkat-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageRoot_KitKat {
|
||||
kResolutionMethod,
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/image.h#105">lollipop-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageRoot_Lollipop {
|
||||
kResolutionMethod,
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-wfc-release/runtime/image.h#106">lollipop-mr1-wfc-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageRoot_LollipopMR1WRC {
|
||||
kResolutionMethod,
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/image.h#125">marshmallow-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageRoot_Marshmallow {
|
||||
kResolutionMethod,
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/image.h#187">nougat-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageRoot_Nougat {
|
||||
kDexCaches, kClassRoots, kImageRootsMax,
|
||||
kDexCaches,
|
||||
kClassRoots,
|
||||
kImageRootsMax,
|
||||
}
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/image.h#189">oreo-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageRoot_Oreo {
|
||||
kDexCaches,
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/image.h#207">pie-release/runtime/image.h</a>
|
||||
*/
|
||||
public enum ImageRoot_Pie {
|
||||
kDexCaches,
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/image.h#222">android10-release/runtime/image.h</a>
|
||||
*/
|
||||
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;
|
||||
}
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/image.h#224">android11-release/runtime/image.h</a>
|
||||
*/
|
||||
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;
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/image.h#141">marshmallow-release/runtime/image.h</a>
|
||||
*/
|
||||
public class ImageSections_Marshmallow extends ArtImageSections {
|
||||
public final static int kSectionObjects = 0;
|
||||
public final static int kSectionArtFields = 1;
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/image.h#193">nougat-release/runtime/image.h</a>
|
||||
*/
|
||||
public class ImageSections_Nougat extends ArtImageSections {
|
||||
public final static int kSectionObjects = 0;
|
||||
public final static int kSectionArtFields = 1;
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr2-pixel-release/runtime/image.h#193">nougat-mr2-pixel-release/runtime/image.h</a>
|
||||
*/
|
||||
public class ImageSections_NougatMR2Pixel extends ArtImageSections {
|
||||
public final static int kSectionObjects = 0;
|
||||
public final static int kSectionArtFields = 1;
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/image.h#196">oreo-release/runtime/image.h</a>
|
||||
*/
|
||||
public class ImageSections_Oreo extends ArtImageSections {
|
||||
public final static int kSectionObjects = 0;
|
||||
public final static int kSectionArtFields = 1;
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-mr1-release/runtime/image.h#203">oreo-mr1-release/runtime/image.h</a>
|
||||
*/
|
||||
public class ImageSections_OreoMR1 extends ArtImageSections {
|
||||
public final static int kSectionObjects = 0;
|
||||
public final static int kSectionArtFields = 1;
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/image.h#214">pie-release/runtime/image.h</a>
|
||||
*/
|
||||
public class ImageSections_Pie extends ArtImageSections {
|
||||
public final static int kSectionObjects = 0;
|
||||
public final static int kSectionArtFields = 1;
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/image.h#254">android10-release/runtime/image.h</a>
|
||||
*
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/image.h#254">android11-release/runtime/image.h</a>
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
|
@ -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
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/image.h#254">android12-release/runtime/image.h</a>
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/image.h#254
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/image.h#254">android13-release/runtime/image.h</a>
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
|
@ -1,52 +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.nougat;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/nougat-mr2-pixel-release/runtime/image.h
|
||||
*/
|
||||
public class ArtHeader_NougatMR2Pixel extends ArtHeader_Nougat {
|
||||
|
||||
public ArtHeader_NougatMR2Pixel(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArtMethodCountForVersion() {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,52 +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.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-mr1-release/runtime/image.h
|
||||
*/
|
||||
public class ArtHeader_OreoMR1 extends ArtHeader_Oreo {
|
||||
|
||||
public ArtHeader_OreoMR1(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_OreoMR1.class.getSimpleName());
|
||||
}
|
||||
catch (InvalidNameException e) {
|
||||
//ignore
|
||||
}
|
||||
return structure;
|
||||
}
|
||||
|
||||
}
|
|
@ -67,94 +67,94 @@ public final class OatConstants {
|
|||
// NOTE: we plan to only support RELEASE versions...
|
||||
// Upper case indicates supported version.
|
||||
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat.cc#24 */
|
||||
public final static String VERSION_KITKAT_RELEASE = "007";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/kitkat-dev/runtime/oat.cc#24 */
|
||||
public final static String version_kitkat_dev = "008";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat.cc#25 */
|
||||
public final static String VERSION_LOLLIPOP_RELEASE = "039";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-release/runtime/oat.cc#25 */
|
||||
public final static String VERSION_LOLLIPOP_MR1_FI_RELEASE = "045";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.cc#27 */
|
||||
public final static String VERSION_LOLLIPOP_WEAR_RELEASE = "051";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_MARSHMALLOW_RELEASE = "064";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_NOUGAT_RELEASE = "079";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/n-iot-preview-2/runtime/oat.h#34 */
|
||||
public final static String version_n_iot_preview_2 = "083";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr1-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_NOUGAT_MR1_RELEASE = "088";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/o-preview/runtime/oat.h#34 */
|
||||
public final static String version_o_preview = "114";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_OREO_RELEASE = "124";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/n-iot-preview-4/runtime/oat.h#34 */
|
||||
public final static String version_n_iot_preview_4 = "125";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_OREO_DR3_RELEASE = "126";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_OREO_M2_RELEASE = "131";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/o-iot-preview-5/runtime/oat.h#34 */
|
||||
public final static String version_o_iot_preview_5 = "132";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-6/runtime/oat.h#34 */
|
||||
public final static String version_o_mr1_iot_preview_6 = "135";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_PIE_RELEASE = "138";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-7/runtime/oat.h#34 */
|
||||
public final static String version_o_mr1_iot_preview_7 = "139";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-8/runtime/oat.h#34 */
|
||||
public final static String version_o_mr1_iot_preview_8 = "140";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/tags/android-o-mr1-iot-release-1.0.0/runtime/oat.h#34 */
|
||||
public final static String version_o_mr1_iot_release_1_0_0 = "141";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/tags/android-o-mr1-iot-release-1.0.1/runtime/oat.h#34 */
|
||||
public final static String version_o_mr1_iot_release_1_0_1 = "146";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/tags/android-n-iot-release-polk-at1/runtime/oat.h#34 */
|
||||
public final static String version_n_iot_release_polk_at1 = "147";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/tags/android-q-preview-1/runtime/oat.h#33 */
|
||||
public final static String version_q_preview_1 = "166";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_10_RELEASE = "170";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_11_RELEASE = "183";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat.h#36 */
|
||||
public final static String VERSION_12_RELEASE = "195";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/oat.h#36 */
|
||||
public final static String VERSION_S_BETA4 = "197";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-preview-1/runtime/oat.h#36 */
|
||||
public final static String VERSION_S_V2_PREVIEW = "199";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android-t-preview-1/runtime/oat.h#36 */
|
||||
public final static String VERSION_T_PREVIEW_1 = "220";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-beta-3/runtime/oat.h#36 */
|
||||
public final static String VERSION_S_V2_BETA2 = "223";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat.h#36 */
|
||||
public final static String VERSION_13_RELEASE = "225";
|
||||
/** https://android.googlesource.com/platform/art/+/master/runtime/oat.h#36 */
|
||||
public final static String VERSION_227 = "227";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat.cc#24">kitkat-release/runtime/oat.cc</a> */
|
||||
public final static String OAT_VERSION_007 = "007";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-dev/runtime/oat.cc#24">kitkat-dev/runtime/oat.cc</a> */
|
||||
public final static String oat_version_008 = "008";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat.cc#25">lollipop-release/runtime/oat.cc</a> */
|
||||
public final static String OAT_VERSION_039 = "039";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-release/runtime/oat.cc#25">lollipop-mr1-release/runtime/oat.cc</a> */
|
||||
public final static String OAT_VERSION_045 = "045";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.cc#27">lollipop-wear-release/runtime/oat.cc</a> */
|
||||
public final static String OAT_VERSION_051 = "051";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat.h#34">marshmallow-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_064 = "064";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat.h#34">nougat-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_079 = "079";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/n-iot-preview-2/runtime/oat.h#34">n-iot-preview-2/runtime/oat.h</a> */
|
||||
public final static String oat_version_083 = "083";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr1-release/runtime/oat.h#34">nougat-mr1-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_088 = "088";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/o-preview/runtime/oat.h#34">o-preview/runtime/oat.h</a> */
|
||||
public final static String oat_version_114 = "114";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat.h#34">oreo-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_124 = "124";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/n-iot-preview-4/runtime/oat.h#34">n-iot-preview-4/runtime/oat.h</a> */
|
||||
public final static String oat_version_125 = "125";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat.h#34">oreo-dr3-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_126 = "126";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat.h#34">oreo-m2-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_131 = "131";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/o-iot-preview-5/runtime/oat.h#34">o-iot-preview-5/runtime/oat.h</a> */
|
||||
public final static String oat_version_132 = "132";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-6/runtime/oat.h#34">o-mr1-iot-preview-6/runtime/oat.h</a> */
|
||||
public final static String oat_version_135 = "135";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h#34">pie-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_138 = "138";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-7/runtime/oat.h#34">o-mr1-iot-preview-7/runtime/oat.h</a> */
|
||||
public final static String oat_version_139 = "139";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-8/runtime/oat.h#34">o-mr1-iot-preview-8/runtime/oat.h</a> */
|
||||
public final static String oat_version_140 = "140";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/tags/android-o-mr1-iot-release-1.0.0/runtime/oat.h#34">android-o-mr1-iot-release-1.0.0/runtime/oat.h</a> */
|
||||
public final static String oat_version_141 = "141";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/tags/android-o-mr1-iot-release-1.0.1/runtime/oat.h#34">android-o-mr1-iot-release-1.0.1/runtime/oat.h</a> */
|
||||
public final static String oat_version_146 = "146";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/tags/android-n-iot-release-polk-at1/runtime/oat.h#34">android-n-iot-release-polk-at1/runtime/oat.h</a> */
|
||||
public final static String oat_version_147 = "147";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/tags/android-q-preview-1/runtime/oat.h#33">android-q-preview-1/runtime/oat.h</a> */
|
||||
public final static String oat_version_166 = "166";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat.h#3"4>android10-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_170 = "170";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat.h#34">android11-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_183 = "183";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat.h#3"6>android12-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_195 = "195";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/oat.h#36">android-s-beta-4/runtime/oat.h</a> */
|
||||
public final static String oat_version_197 = "197";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-preview-1/runtime/oat.h#36">android-s-v2-preview-1/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_199 = "199";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-t-preview-1/runtime/oat.h#36">android-t-preview-1/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_220 = "220";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-beta-3/runtime/oat.h#36">android-s-v2-beta-3/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_223 = "223";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat.h#36">android13-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_225 = "225";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/master/runtime/oat.h#36">master/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_227 = "227";
|
||||
|
||||
/**
|
||||
* This array contains versions that have been actively tested and verified.
|
||||
* All other versions will be considered unsupported until tested on exemplar firmware.
|
||||
*/
|
||||
public final static String [] SUPPORTED_VERSIONS = new String [] {
|
||||
VERSION_KITKAT_RELEASE,
|
||||
VERSION_LOLLIPOP_RELEASE,
|
||||
VERSION_LOLLIPOP_MR1_FI_RELEASE,
|
||||
VERSION_LOLLIPOP_WEAR_RELEASE,
|
||||
VERSION_MARSHMALLOW_RELEASE,
|
||||
VERSION_NOUGAT_RELEASE,
|
||||
VERSION_NOUGAT_MR1_RELEASE,
|
||||
VERSION_OREO_RELEASE,
|
||||
VERSION_OREO_DR3_RELEASE,
|
||||
VERSION_OREO_M2_RELEASE,
|
||||
VERSION_PIE_RELEASE,
|
||||
VERSION_10_RELEASE,
|
||||
VERSION_11_RELEASE,
|
||||
VERSION_12_RELEASE,
|
||||
VERSION_S_V2_PREVIEW,
|
||||
VERSION_T_PREVIEW_1,
|
||||
VERSION_S_V2_BETA2,
|
||||
VERSION_13_RELEASE,
|
||||
OAT_VERSION_007,
|
||||
OAT_VERSION_039,
|
||||
OAT_VERSION_045,
|
||||
OAT_VERSION_051,
|
||||
OAT_VERSION_064,
|
||||
OAT_VERSION_079,
|
||||
OAT_VERSION_088,
|
||||
OAT_VERSION_124,
|
||||
OAT_VERSION_126,
|
||||
OAT_VERSION_131,
|
||||
OAT_VERSION_138,
|
||||
OAT_VERSION_170,
|
||||
OAT_VERSION_183,
|
||||
OAT_VERSION_195,
|
||||
OAT_VERSION_199,
|
||||
OAT_VERSION_220,
|
||||
OAT_VERSION_223,
|
||||
OAT_VERSION_225,
|
||||
};
|
||||
|
||||
//@formatter:on
|
||||
|
|
|
@ -23,6 +23,8 @@ import ghidra.app.util.bin.StructConverter;
|
|||
import ghidra.file.formats.android.oat.bundle.OatBundle;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFileFactory;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* Base OatHeader implementations
|
||||
|
@ -142,4 +144,13 @@ public abstract class OatHeader implements StructConverter {
|
|||
*/
|
||||
abstract public int getChecksum();
|
||||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure =
|
||||
new StructureDataType(OatHeader.class.getSimpleName() + "_" + version, 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
structure.setCategoryPath(new CategoryPath("/oat"));
|
||||
return structure;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ public class OatHeaderAnalyzer extends FileFormatAnalyzer {
|
|||
monitor.setMessage("Annotating OAT Patches...");
|
||||
Memory memory = program.getMemory();
|
||||
|
||||
if (oatHeader.getVersion().equals(OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE)) {
|
||||
if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_045)) {
|
||||
MemoryBlock oatBlock = memory.getBlock(OatConstants.DOT_OAT_PATCHES_SECTION_NAME);
|
||||
MemoryBlock destinationBlock = findOatPatchesDestinationBlock(program, oatBlock);
|
||||
if (oatBlock == null || destinationBlock == null) {
|
||||
|
@ -207,16 +207,16 @@ public class OatHeaderAnalyzer extends FileFormatAnalyzer {
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (oatHeader.getVersion().equals(OatConstants.VERSION_MARSHMALLOW_RELEASE)) {
|
||||
else if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_064)) {
|
||||
//TODO
|
||||
}
|
||||
else if (oatHeader.getVersion().equals(OatConstants.VERSION_NOUGAT_MR1_RELEASE)) {
|
||||
else if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_088)) {
|
||||
//TODO
|
||||
}
|
||||
else if (oatHeader.getVersion().equals(OatConstants.VERSION_OREO_RELEASE)) {
|
||||
else if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_124)) {
|
||||
//TODO
|
||||
}
|
||||
else if (oatHeader.getVersion().equals(OatConstants.VERSION_OREO_M2_RELEASE)) {
|
||||
else if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_131)) {
|
||||
//TODO
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import ghidra.app.util.bin.BinaryReader;
|
|||
import ghidra.app.util.importer.MessageLog;
|
||||
import ghidra.file.formats.android.oat.bundle.OatBundle;
|
||||
import ghidra.file.formats.android.oat.bundle.OatBundleFactory;
|
||||
import ghidra.file.formats.android.oat.headers.*;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
|
@ -40,35 +41,42 @@ public final class OatHeaderFactory {
|
|||
if (magic.equals(OatConstants.MAGIC)) {
|
||||
if (OatConstants.isSupportedVersion(version)) {
|
||||
switch (version) {
|
||||
case OatConstants.VERSION_KITKAT_RELEASE:
|
||||
return new OatHeader_KitKat(reader);
|
||||
case OatConstants.VERSION_LOLLIPOP_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE:
|
||||
return new OatHeader_Lollipop(reader);
|
||||
case OatConstants.VERSION_MARSHMALLOW_RELEASE:
|
||||
return new OatHeader_Marshmallow(reader);
|
||||
case OatConstants.VERSION_NOUGAT_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_MR1_RELEASE:
|
||||
return new OatHeader_Nougat(reader);
|
||||
case OatConstants.VERSION_OREO_RELEASE:
|
||||
case OatConstants.VERSION_OREO_DR3_RELEASE:
|
||||
return new OatHeader_Oreo(reader);//v124 and v126 are same format
|
||||
case OatConstants.VERSION_OREO_M2_RELEASE:
|
||||
return new OatHeader_Oreo_M2(reader);
|
||||
case OatConstants.VERSION_PIE_RELEASE:
|
||||
return new OatHeader_Pie(reader);
|
||||
case OatConstants.VERSION_10_RELEASE:
|
||||
return new OatHeader_10(reader);
|
||||
case OatConstants.VERSION_11_RELEASE:
|
||||
return new OatHeader_11(reader);
|
||||
case OatConstants.VERSION_12_RELEASE:
|
||||
case OatConstants.VERSION_S_V2_PREVIEW:
|
||||
case OatConstants.VERSION_T_PREVIEW_1:
|
||||
case OatConstants.VERSION_S_V2_BETA2:
|
||||
return new OatHeader_12(reader);
|
||||
case OatConstants.VERSION_13_RELEASE:
|
||||
return new OatHeader_13(reader);
|
||||
case OatConstants.OAT_VERSION_007:
|
||||
return new OatHeader_007(reader);
|
||||
case OatConstants.OAT_VERSION_039:
|
||||
return new OatHeader_039(reader);
|
||||
case OatConstants.OAT_VERSION_045:
|
||||
return new OatHeader_045(reader);
|
||||
case OatConstants.OAT_VERSION_051:
|
||||
return new OatHeader_051(reader);
|
||||
case OatConstants.OAT_VERSION_064:
|
||||
return new OatHeader_064(reader);
|
||||
case OatConstants.OAT_VERSION_079:
|
||||
return new OatHeader_079(reader);
|
||||
case OatConstants.OAT_VERSION_088:
|
||||
return new OatHeader_088(reader);
|
||||
case OatConstants.OAT_VERSION_124:
|
||||
return new OatHeader_124(reader);
|
||||
case OatConstants.OAT_VERSION_126:
|
||||
return new OatHeader_126(reader);
|
||||
case OatConstants.OAT_VERSION_131:
|
||||
return new OatHeader_131(reader);
|
||||
case OatConstants.OAT_VERSION_138:
|
||||
return new OatHeader_138(reader);
|
||||
case OatConstants.OAT_VERSION_170:
|
||||
return new OatHeader_170(reader);
|
||||
case OatConstants.OAT_VERSION_183:
|
||||
return new OatHeader_183(reader);
|
||||
case OatConstants.OAT_VERSION_195:
|
||||
return new OatHeader_195(reader);
|
||||
case OatConstants.OAT_VERSION_199:
|
||||
return new OatHeader_199(reader);
|
||||
case OatConstants.OAT_VERSION_220:
|
||||
return new OatHeader_220(reader);
|
||||
case OatConstants.OAT_VERSION_223:
|
||||
return new OatHeader_223(reader);
|
||||
case OatConstants.OAT_VERSION_225:
|
||||
return new OatHeader_225(reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -298,7 +298,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;
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ public class FullOatBundle implements OatBundle {
|
|||
return true;
|
||||
}
|
||||
case VDEX: {
|
||||
VdexHeader vdexHeader = VdexFactory.getVdexHeader(reader);
|
||||
VdexHeader vdexHeader = VdexHeaderFactory.getVdexHeader(reader);
|
||||
vdexHeader.parse(reader, monitor);
|
||||
this.vdexHeader = vdexHeader;
|
||||
return true;
|
||||
|
|
|
@ -13,19 +13,24 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.bundle.OatBundle;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public class OatHeader_KitKat extends OatHeader {
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat.cc#24">kitkat-release/runtime/oat.cc</a>
|
||||
*/
|
||||
public class OatHeader_007 extends OatHeader {
|
||||
|
||||
protected int adler32_checksum_;
|
||||
protected int instruction_set_;
|
||||
|
@ -41,7 +46,7 @@ public class OatHeader_KitKat extends OatHeader {
|
|||
protected int image_file_location_size_;
|
||||
protected byte[] image_file_location_data_; // note variable width data at end
|
||||
|
||||
OatHeader_KitKat(BinaryReader reader) throws IOException {
|
||||
public OatHeader_007(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
adler32_checksum_ = reader.readNextInt();
|
||||
instruction_set_ = reader.readNextInt();
|
||||
|
@ -134,9 +139,8 @@ public class OatHeader_KitKat extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_KitKat.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "adler32_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "dex_file_count_", null);
|
|
@ -13,20 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/oat.h
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat.cc#25">lollipop-release/runtime/oat.cc</a>
|
||||
*/
|
||||
public class OatHeader_Lollipop extends OatHeader {
|
||||
public class OatHeader_039 extends OatHeader {
|
||||
|
||||
protected int adler32_checksum_;
|
||||
protected int instruction_set_;
|
||||
|
@ -48,7 +50,7 @@ public class OatHeader_Lollipop extends OatHeader {
|
|||
protected int image_file_location_oat_data_begin_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_Lollipop(BinaryReader reader) throws IOException {
|
||||
public OatHeader_039(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
adler32_checksum_ = reader.readNextInt();
|
||||
instruction_set_ = reader.readNextInt();
|
||||
|
@ -109,9 +111,8 @@ public class OatHeader_Lollipop extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_Lollipop.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "adler32_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_", null);
|
|
@ -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.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-release/runtime/oat.cc#25">lollipop-mr1-release/runtime/oat.cc</a>
|
||||
*/
|
||||
public class OatHeader_045 extends OatHeader_039 {
|
||||
public OatHeader_045(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -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.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.cc#27">lollipop-wear-release/runtime/oat.cc</a>
|
||||
*/
|
||||
public class OatHeader_051 extends OatHeader_039 {
|
||||
public OatHeader_051(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -13,20 +13,23 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat.h#34">marshmallow-release/runtime/oat.h</a>
|
||||
*/
|
||||
class OatHeader_Marshmallow extends OatHeader {
|
||||
public class OatHeader_064 extends OatHeader {
|
||||
|
||||
protected int adler32_checksum_;
|
||||
protected int instruction_set_;
|
||||
|
@ -45,7 +48,7 @@ class OatHeader_Marshmallow extends OatHeader {
|
|||
protected int image_file_location_oat_data_begin_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_Marshmallow(BinaryReader reader) throws IOException {
|
||||
public OatHeader_064(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
adler32_checksum_ = reader.readNextInt();
|
||||
|
@ -69,7 +72,7 @@ class OatHeader_Marshmallow extends OatHeader {
|
|||
@Override
|
||||
public int getOatDexFilesOffset(BinaryReader reader) {
|
||||
//the DEX offset is the current reader offset!
|
||||
return (int)reader.getPointerIndex();
|
||||
return (int) reader.getPointerIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,9 +135,8 @@ class OatHeader_Marshmallow extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_Marshmallow.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "adler32_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -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.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat.h#34">nougat-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_079 extends OatHeader_064 {
|
||||
public OatHeader_079(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -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.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr1-release/runtime/oat.h#34">nougat-mr1-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_088 extends OatHeader_064 {
|
||||
public OatHeader_088(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -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.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat.h#34">oreo-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_124 extends OatHeader_064 {
|
||||
public OatHeader_124(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -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.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat.h#34">oreo-dr3-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_126 extends OatHeader_064 {
|
||||
public OatHeader_126(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -13,20 +13,23 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat.h#34">oreo-m2-release/runtime/oat.h</a>
|
||||
*/
|
||||
class OatHeader_Oreo_M2 extends OatHeader {
|
||||
public class OatHeader_131 extends OatHeader {
|
||||
|
||||
protected int adler32_checksum_;
|
||||
protected int instruction_set_;
|
||||
|
@ -46,7 +49,7 @@ class OatHeader_Oreo_M2 extends OatHeader {
|
|||
protected int image_file_location_oat_data_begin_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_Oreo_M2(BinaryReader reader) throws IOException {
|
||||
public OatHeader_131(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
adler32_checksum_ = reader.readNextInt();
|
||||
|
@ -133,9 +136,8 @@ class OatHeader_Oreo_M2 extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_Oreo_M2.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "adler32_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -13,20 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h#34">pie-release/runtime/oat.h</a>
|
||||
*/
|
||||
class OatHeader_Pie extends OatHeader {
|
||||
public class OatHeader_138 extends OatHeader {
|
||||
|
||||
protected int adler32_checksum_;
|
||||
protected int instruction_set_;
|
||||
|
@ -46,7 +48,7 @@ class OatHeader_Pie extends OatHeader {
|
|||
protected int image_file_location_oat_data_begin_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_Pie(BinaryReader reader) throws IOException {
|
||||
public OatHeader_138(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
adler32_checksum_ = reader.readNextInt();
|
||||
instruction_set_ = reader.readNextInt();
|
||||
|
@ -104,9 +106,8 @@ class OatHeader_Pie extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_Pie.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "adler32_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -13,17 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public class OatHeader_10 extends OatHeader {
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat.h#3"4>android10-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_170 extends OatHeader {
|
||||
protected int oat_checksum_;
|
||||
protected int instruction_set_;
|
||||
protected int instruction_set_features_bitmap_;
|
||||
|
@ -37,7 +42,7 @@ public class OatHeader_10 extends OatHeader {
|
|||
protected int quick_to_interpreter_bridge_offset_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_10(BinaryReader reader) throws IOException {
|
||||
public OatHeader_170(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
oat_checksum_ = reader.readNextInt();
|
||||
|
@ -91,9 +96,8 @@ public class OatHeader_10 extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_10.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "oat_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -13,17 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public class OatHeader_11 extends OatHeader {
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat.h#34">android11-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_183 extends OatHeader {
|
||||
protected int oat_checksum_;
|
||||
protected int instruction_set_;
|
||||
protected int instruction_set_features_bitmap_;
|
||||
|
@ -38,7 +43,7 @@ public class OatHeader_11 extends OatHeader {
|
|||
protected int quick_to_interpreter_bridge_offset_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_11(BinaryReader reader) throws IOException {
|
||||
public OatHeader_183(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
oat_checksum_ = reader.readNextInt();
|
||||
|
@ -93,9 +98,8 @@ public class OatHeader_11 extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_11.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "oat_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -13,24 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/oat.h#125
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat.h#125
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-preview-1/runtime/oat.h#125
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat.h#3"6>android12-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_12 extends OatHeader {
|
||||
public class OatHeader_195 extends OatHeader {
|
||||
protected int oat_checksum_;
|
||||
protected int instruction_set_;
|
||||
protected int instruction_set_features_bitmap_;
|
||||
|
@ -46,7 +44,7 @@ public class OatHeader_12 extends OatHeader {
|
|||
protected int nterp_trampoline_offset_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_12(BinaryReader reader) throws IOException {
|
||||
public OatHeader_195(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
oat_checksum_ = reader.readNextInt();
|
||||
|
@ -102,9 +100,8 @@ public class OatHeader_12 extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_12.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "oat_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -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.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-preview-1/runtime/oat.h#36">android-s-v2-preview-1/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_199 extends OatHeader_195 {
|
||||
public OatHeader_199(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -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.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-t-preview-1/runtime/oat.h#36">android-t-preview-1/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_220 extends OatHeader_195 {
|
||||
public OatHeader_220(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -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.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-beta-3/runtime/oat.h#36">android-s-v2-beta-3/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_223 extends OatHeader_195 {
|
||||
public OatHeader_223(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -13,20 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat.h#127
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat.h#36">android13-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_13 extends OatHeader {
|
||||
public class OatHeader_225 extends OatHeader {
|
||||
protected int oat_checksum_;
|
||||
protected int instruction_set_;
|
||||
protected int instruction_set_features_bitmap_;
|
||||
|
@ -43,7 +45,7 @@ public class OatHeader_13 extends OatHeader {
|
|||
protected int nterp_trampoline_offset_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_13(BinaryReader reader) throws IOException {
|
||||
public OatHeader_225(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
oat_checksum_ = reader.readNextInt();
|
||||
|
@ -100,9 +102,8 @@ public class OatHeader_13 extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_13.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "oat_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -49,39 +49,39 @@ public abstract class OatClass implements StructConverter {
|
|||
status_ = reader.readNextShort();
|
||||
|
||||
switch (oatVersion) {
|
||||
case OatConstants.VERSION_KITKAT_RELEASE: {
|
||||
case OatConstants.OAT_VERSION_007: {
|
||||
statusEnum = OatClassStatusEnum_K.kStatusInitialized.get(status_);
|
||||
break;
|
||||
}
|
||||
case OatConstants.VERSION_LOLLIPOP_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE:
|
||||
case OatConstants.VERSION_MARSHMALLOW_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_MR1_RELEASE: {
|
||||
case OatConstants.OAT_VERSION_039:
|
||||
case OatConstants.OAT_VERSION_045:
|
||||
case OatConstants.OAT_VERSION_051:
|
||||
case OatConstants.OAT_VERSION_064:
|
||||
case OatConstants.OAT_VERSION_079:
|
||||
case OatConstants.OAT_VERSION_088: {
|
||||
statusEnum = OatClassStatusEnum_L_M_N.kStatusMax.get(status_);
|
||||
break;
|
||||
}
|
||||
case OatConstants.VERSION_OREO_RELEASE: {
|
||||
case OatConstants.OAT_VERSION_124: {
|
||||
statusEnum = OatClassStatusEnum_O.kStatusMax.get(status_);
|
||||
break;
|
||||
}
|
||||
case OatConstants.VERSION_OREO_M2_RELEASE: {
|
||||
case OatConstants.OAT_VERSION_131: {
|
||||
statusEnum = OatClassStatusEnum_O_M2.kStatusMax.get(status_);
|
||||
break;
|
||||
}
|
||||
case OatConstants.VERSION_PIE_RELEASE:
|
||||
case OatConstants.VERSION_10_RELEASE: {
|
||||
statusEnum = OatClassStatusEnum_P_10.kLast.get(status_);
|
||||
case OatConstants.OAT_VERSION_138:
|
||||
case OatConstants.OAT_VERSION_170: {
|
||||
statusEnum = OatClassStatusEnum_P_Q.kLast.get(status_);
|
||||
break;
|
||||
}
|
||||
case OatConstants.VERSION_11_RELEASE:
|
||||
case OatConstants.VERSION_12_RELEASE:
|
||||
case OatConstants.VERSION_S_V2_PREVIEW:
|
||||
case OatConstants.VERSION_T_PREVIEW_1:
|
||||
case OatConstants.VERSION_S_V2_BETA2:
|
||||
case OatConstants.VERSION_13_RELEASE: {
|
||||
statusEnum = OatClassStatusEnum_11_12.kLast.get(status_);
|
||||
case OatConstants.OAT_VERSION_183:
|
||||
case OatConstants.OAT_VERSION_195:
|
||||
case OatConstants.OAT_VERSION_199:
|
||||
case OatConstants.OAT_VERSION_220:
|
||||
case OatConstants.OAT_VERSION_223:
|
||||
case OatConstants.OAT_VERSION_225: {
|
||||
statusEnum = OatClassStatusEnum_R_S_T.kLast.get(status_);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
|
|
@ -28,33 +28,33 @@ public class OatClassFactory {
|
|||
String oatVersion) throws IOException, UnsupportedOatVersionException {
|
||||
|
||||
switch (oatVersion) {
|
||||
case OatConstants.VERSION_KITKAT_RELEASE:
|
||||
case OatConstants.OAT_VERSION_007:
|
||||
return new OatClass_KitKat(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_LOLLIPOP_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE:
|
||||
case OatConstants.OAT_VERSION_039:
|
||||
case OatConstants.OAT_VERSION_045:
|
||||
case OatConstants.OAT_VERSION_051:
|
||||
return new OatClass_Lollipop(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_MARSHMALLOW_RELEASE:
|
||||
case OatConstants.OAT_VERSION_064:
|
||||
return new OatClass_Marshmallow(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_NOUGAT_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_MR1_RELEASE:
|
||||
case OatConstants.OAT_VERSION_079:
|
||||
case OatConstants.OAT_VERSION_088:
|
||||
return new OatClass_Nougat(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_OREO_RELEASE:
|
||||
case OatConstants.OAT_VERSION_124:
|
||||
return new OatClass_Oreo(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_OREO_M2_RELEASE:
|
||||
case OatConstants.OAT_VERSION_131:
|
||||
return new OatClass_OreoM2(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_PIE_RELEASE:
|
||||
case OatConstants.OAT_VERSION_138:
|
||||
return new OatClass_Pie(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_10_RELEASE:
|
||||
return new OatClass_Android10(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_11_RELEASE:
|
||||
return new OatClass_Android11(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_12_RELEASE:
|
||||
case OatConstants.VERSION_S_V2_PREVIEW:
|
||||
case OatConstants.VERSION_T_PREVIEW_1:
|
||||
case OatConstants.VERSION_S_V2_BETA2:
|
||||
case OatConstants.VERSION_13_RELEASE:
|
||||
return new OatClass_Android12(reader, classDataItem, oatVersion);
|
||||
case OatConstants.OAT_VERSION_170:
|
||||
return new OatClass_Q(reader, classDataItem, oatVersion);
|
||||
case OatConstants.OAT_VERSION_183:
|
||||
return new OatClass_R(reader, classDataItem, oatVersion);
|
||||
case OatConstants.OAT_VERSION_195:
|
||||
case OatConstants.OAT_VERSION_199:
|
||||
case OatConstants.OAT_VERSION_220:
|
||||
case OatConstants.OAT_VERSION_223:
|
||||
case OatConstants.OAT_VERSION_225:
|
||||
return new OatClass_S_T(reader, classDataItem, oatVersion);
|
||||
default:
|
||||
throw new UnsupportedOatVersionException(
|
||||
"OatClass not supported for OAT Version: " + oatVersion);
|
||||
|
|
|
@ -21,7 +21,7 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/kitkat-release/runtime/mirror/class.h#112
|
||||
* <a href="https://android.googlesource.com/platform/art/+/kitkat-release/runtime/mirror/class.h#112">kitkat-release/runtime/mirror/class.h</a>
|
||||
*
|
||||
*/
|
||||
public enum OatClassStatusEnum_K implements OatClassStatusEnum {
|
||||
|
|
|
@ -21,15 +21,15 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/lollipop-release/runtime/mirror/class.h#133
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/mirror/class.h#138
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/mirror/class.h#119
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/mirror/class.h#112
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/nougat-release/runtime/mirror/class.h#116
|
||||
* <a href="https://android.googlesource.com/platform/art/+/lollipop-release/runtime/mirror/class.h#133">lollipop-release/runtime/mirror/class.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/mirror/class.h#138">lollipop-mr1-fi-release/runtime/mirror/class.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/mirror/class.h#119">lollipop-wear-release/runtime/mirror/class.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/mirror/class.h#112">marshmallow-release/runtime/mirror/class.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/nougat-release/runtime/mirror/class.h#116">nougat-release/runtime/mirror/class.h</a>
|
||||
*/
|
||||
public enum OatClassStatusEnum_L_M_N implements OatClassStatusEnum {
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/mirror/class.h#128
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/mirror/class.h#128">oreo-release/runtime/mirror/class.h</a>
|
||||
*/
|
||||
public enum OatClassStatusEnum_O implements OatClassStatusEnum {
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/mirror/class.h#128
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/mirror/class.h#128">oreo-m2-release/runtime/mirror/class.h</a>
|
||||
*/
|
||||
public enum OatClassStatusEnum_O_M2 implements OatClassStatusEnum {
|
||||
|
||||
|
|
|
@ -21,12 +21,11 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/class_status.h#74
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/class_status.h#74
|
||||
*
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/class_status.h#74">pie-release/runtime/class_status.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/class_status.h#74">android10-release/runtime/class_status.h<a/>
|
||||
*/
|
||||
public enum OatClassStatusEnum_P_10 implements OatClassStatusEnum {
|
||||
public enum OatClassStatusEnum_P_Q implements OatClassStatusEnum {
|
||||
|
||||
kNotReady(0),
|
||||
kRetired(1),
|
||||
|
@ -47,11 +46,11 @@ public enum OatClassStatusEnum_P_10 implements OatClassStatusEnum {
|
|||
|
||||
private byte value;
|
||||
|
||||
private OatClassStatusEnum_P_10(byte value) {
|
||||
private OatClassStatusEnum_P_Q(byte value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private OatClassStatusEnum_P_10(int value) {
|
||||
private OatClassStatusEnum_P_Q(int value) {
|
||||
this.value = (byte) value;
|
||||
}
|
||||
|
||||
|
@ -61,7 +60,7 @@ public enum OatClassStatusEnum_P_10 implements OatClassStatusEnum {
|
|||
|
||||
@Override
|
||||
public OatClassStatusEnum get(short value) {
|
||||
for (OatClassStatusEnum_P_10 valueX : values()) {
|
||||
for (OatClassStatusEnum_P_Q valueX : values()) {
|
||||
if (valueX.getValue() == value) {
|
||||
return valueX;
|
||||
}
|
||||
|
@ -71,8 +70,8 @@ public enum OatClassStatusEnum_P_10 implements OatClassStatusEnum {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_P_10.class.getSimpleName(), 2);
|
||||
for (OatClassStatusEnum_P_10 valueX : values()) {
|
||||
EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_P_Q.class.getSimpleName(), 2);
|
||||
for (OatClassStatusEnum_P_Q valueX : values()) {
|
||||
enumDataType.add(valueX.name(), valueX.getValue());
|
||||
}
|
||||
enumDataType.setCategoryPath(new CategoryPath("/oat"));
|
|
@ -21,11 +21,13 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/class_status.h#82
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/class_status.h#82
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/class_status.h#82">android11-release/runtime/class_status.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/class_status.h#82">android12-release/runtime/class_status.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/class_status.h#82">android13-release/runtime/class_status.h</a>
|
||||
*/
|
||||
public enum OatClassStatusEnum_11_12 implements OatClassStatusEnum {
|
||||
public enum OatClassStatusEnum_R_S_T implements OatClassStatusEnum {
|
||||
|
||||
kNotReady(0),
|
||||
kRetired(1),
|
||||
|
@ -47,11 +49,11 @@ public enum OatClassStatusEnum_11_12 implements OatClassStatusEnum {
|
|||
|
||||
private byte value;
|
||||
|
||||
private OatClassStatusEnum_11_12(byte value) {
|
||||
private OatClassStatusEnum_R_S_T(byte value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private OatClassStatusEnum_11_12(int value) {
|
||||
private OatClassStatusEnum_R_S_T(int value) {
|
||||
this.value = (byte) value;
|
||||
}
|
||||
|
||||
|
@ -61,7 +63,7 @@ public enum OatClassStatusEnum_11_12 implements OatClassStatusEnum {
|
|||
|
||||
@Override
|
||||
public OatClassStatusEnum get(short value) {
|
||||
for (OatClassStatusEnum_11_12 valueX : values()) {
|
||||
for (OatClassStatusEnum_R_S_T valueX : values()) {
|
||||
if (valueX.getValue() == value) {
|
||||
return valueX;
|
||||
}
|
||||
|
@ -71,8 +73,8 @@ public enum OatClassStatusEnum_11_12 implements OatClassStatusEnum {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_11_12.class.getSimpleName(), 2);
|
||||
for (OatClassStatusEnum_11_12 valueX : values()) {
|
||||
EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_R_S_T.class.getSimpleName(), 2);
|
||||
for (OatClassStatusEnum_R_S_T valueX : values()) {
|
||||
enumDataType.add(valueX.name(), valueX.getValue());
|
||||
}
|
||||
enumDataType.setCategoryPath(new CategoryPath("/oat"));
|
|
@ -25,9 +25,9 @@ import ghidra.program.model.data.*;
|
|||
* using a bitmap pays for itself since few classes will have 160
|
||||
* methods.
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/lollipop-release/runtime/oat.h#152
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/oat_file.h#66
|
||||
* <a href="https://android.googlesource.com/platform/art/+/lollipop-release/runtime/oat.h#152">lollipop-release/runtime/oat.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/oat_file.h#66">android-s-beta-5/runtime/oat_file.h</a>
|
||||
*/
|
||||
public enum OatClassType {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat_file.h#156
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat_file.h#156">kitkat-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_KitKat extends OatClass {
|
||||
|
||||
|
|
|
@ -24,11 +24,11 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat_file.h#205
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/oat_file.h#202
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat_file.h#211
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat_file.h#205">lollipop-release/runtime/oat_file.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/oat_file.h#202">lollipop-mr1-fi-release/runtime/oat_file.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat_file.h#211">lollipop-wear-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Lollipop extends OatClass {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat_file.h#200
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat_file.h#200">marshmallow-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Marshmallow extends OatClass_Lollipop {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat_file.h#197
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat_file.h#197">nougat-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Nougat extends OatClass_Marshmallow {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_file.h#213
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_file.h#213">oreo-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Oreo extends OatClass_Nougat {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat_file.h#219
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat_file.h#219">oreo-m2-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_OreoM2 extends OatClass_Oreo {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat_file.h#248
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat_file.h#248">pie-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Pie extends OatClass_OreoM2 {
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat_file.h#278
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat_file.h#248">android10-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Android11 extends OatClass_Android10 {
|
||||
public class OatClass_Q extends OatClass_Pie {
|
||||
|
||||
OatClass_Android11(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
OatClass_Q(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
throws IOException {
|
||||
super(reader, classDataItem, oatVersion);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class OatClass_Android11 extends OatClass_Android10 {
|
|||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
renameDataType(dataType, OatClass_Android11.class.getSimpleName());
|
||||
renameDataType(dataType, OatClass_Q.class.getSimpleName());
|
||||
}
|
||||
catch (Exception e) {
|
||||
//ignore...
|
|
@ -23,11 +23,11 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat_file.h#248
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat_file.h#278">android11-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Android10 extends OatClass_Pie {
|
||||
public class OatClass_R extends OatClass_Q {
|
||||
|
||||
OatClass_Android10(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
OatClass_R(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
throws IOException {
|
||||
super(reader, classDataItem, oatVersion);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class OatClass_Android10 extends OatClass_Pie {
|
|||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
renameDataType(dataType, OatClass_Android10.class.getSimpleName());
|
||||
renameDataType(dataType, OatClass_R.class.getSimpleName());
|
||||
}
|
||||
catch (Exception e) {
|
||||
//ignore...
|
|
@ -25,9 +25,11 @@ import ghidra.util.NumericUtilities;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/oat_file.h#283
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat_file.h#283">android12-release/runtime/oat_file.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat_file.h#279">android13-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Android12 extends OatClass {
|
||||
public class OatClass_S_T extends OatClass {
|
||||
|
||||
//https://android.googlesource.com/platform/art/+/master/libartbase/base/bit_vector.h#38
|
||||
public static final int kWordBytes = 4;
|
||||
|
@ -36,7 +38,7 @@ public class OatClass_Android12 extends OatClass {
|
|||
|
||||
private byte[] bitmap_ = new byte[0];
|
||||
|
||||
OatClass_Android12(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
OatClass_S_T(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
throws IOException {
|
||||
|
||||
super(reader, oatVersion);
|
||||
|
@ -106,7 +108,7 @@ public class OatClass_Android12 extends OatClass {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
String className = OatClass_Android12.class.getSimpleName();
|
||||
String className = OatClass_S_T.class.getSimpleName();
|
||||
|
||||
if (methods_pointer_.size() > 0) {
|
||||
className += "_" + methods_pointer_.size();
|
|
@ -27,34 +27,34 @@ public final class OatDexFileFactory {
|
|||
OatBundle bundle) throws IOException {
|
||||
|
||||
switch (oatVersion) {
|
||||
case OatConstants.VERSION_KITKAT_RELEASE:
|
||||
case OatConstants.OAT_VERSION_007:
|
||||
return new OatDexFile_KitKat(reader);
|
||||
case OatConstants.VERSION_LOLLIPOP_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE:
|
||||
case OatConstants.OAT_VERSION_039:
|
||||
case OatConstants.OAT_VERSION_045:
|
||||
case OatConstants.OAT_VERSION_051:
|
||||
return new OatDexFile_Lollipop(reader);
|
||||
case OatConstants.VERSION_MARSHMALLOW_RELEASE:
|
||||
case OatConstants.OAT_VERSION_064:
|
||||
return new OatDexFile_Marshmallow(reader);
|
||||
case OatConstants.VERSION_NOUGAT_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_MR1_RELEASE:
|
||||
case OatConstants.OAT_VERSION_079:
|
||||
case OatConstants.OAT_VERSION_088:
|
||||
return new OatDexFile_Nougat(reader);
|
||||
case OatConstants.VERSION_OREO_RELEASE:
|
||||
case OatConstants.VERSION_OREO_DR3_RELEASE:
|
||||
case OatConstants.OAT_VERSION_124:
|
||||
case OatConstants.OAT_VERSION_126:
|
||||
return new OatDexFile_Oreo(reader, bundle);
|
||||
case OatConstants.VERSION_OREO_M2_RELEASE:
|
||||
case OatConstants.OAT_VERSION_131:
|
||||
return new OatDexFile_OreoM2(reader, bundle);
|
||||
case OatConstants.VERSION_PIE_RELEASE:
|
||||
case OatConstants.OAT_VERSION_138:
|
||||
return new OatDexFile_Pie(reader, bundle);
|
||||
case OatConstants.VERSION_10_RELEASE:
|
||||
return new OatDexFile_Android10(reader, bundle);
|
||||
case OatConstants.VERSION_11_RELEASE:
|
||||
return new OatDexFile_Android11(reader, bundle);
|
||||
case OatConstants.VERSION_12_RELEASE:
|
||||
case OatConstants.VERSION_S_V2_PREVIEW:
|
||||
case OatConstants.VERSION_T_PREVIEW_1:
|
||||
case OatConstants.VERSION_S_V2_BETA2:
|
||||
case OatConstants.VERSION_13_RELEASE:
|
||||
return new OatDexFile_Android12(reader, bundle);
|
||||
case OatConstants.OAT_VERSION_170:
|
||||
return new OatDexFile_Q(reader, bundle);
|
||||
case OatConstants.OAT_VERSION_183:
|
||||
return new OatDexFile_R(reader, bundle);
|
||||
case OatConstants.OAT_VERSION_195:
|
||||
case OatConstants.OAT_VERSION_199:
|
||||
case OatConstants.OAT_VERSION_220:
|
||||
case OatConstants.OAT_VERSION_223:
|
||||
case OatConstants.OAT_VERSION_225:
|
||||
return new OatDexFile_S_T(reader, bundle);
|
||||
}
|
||||
|
||||
throw new IOException("Unsupported OAT version: " + oatVersion);
|
||||
|
|
|
@ -40,8 +40,7 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat_file.h#191
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat_file.h#191">kitkat-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_KitKat extends OatDexFile {
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
|
||||
/**
|
||||
* Note: actual data structure seen in firmware does not contain the "canonical_dex_file_location_" field.
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat_file.h#261
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat_file.h#261">lollipop-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_Lollipop extends OatDexFile_KitKat {
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
|
||||
/**
|
||||
* Note: actual data structure seen in firmware does not contain the "canonical_dex_file_location_" field.
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat_file.h#405
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat_file.h#405">marshmallow-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_Marshmallow extends OatDexFile_Lollipop {
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@ import ghidra.util.task.TaskMonitor;
|
|||
|
||||
/**
|
||||
* Used for OAT Header version 079 to 088.
|
||||
*
|
||||
* <br>
|
||||
* Versions: Nougat, Nougat MR1
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/nougat-release/runtime/oat_file.h#383
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/nougat-release/runtime/oat_file.h#383">nougat-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_Nougat extends OatDexFile {
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_file.h#444
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_file.h#444">oreo-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_Oreo extends OatDexFile_Nougat {
|
||||
|
||||
|
|
|
@ -33,8 +33,7 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/oat_file.h#467
|
||||
* <a href="https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/oat_file.h#467">oreo-m2-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_OreoM2 extends OatDexFile {
|
||||
|
||||
|
|
|
@ -35,8 +35,7 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/pie-release/runtime/oat_file.h#518
|
||||
* <a href="https://android.googlesource.com/platform/art/+/pie-release/runtime/oat_file.h#518">pie-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_Pie extends OatDexFile {
|
||||
|
||||
|
|
|
@ -23,12 +23,11 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/android10-release/runtime/oat_file.h#569
|
||||
* <a href="https://android.googlesource.com/platform/art/+/android10-release/runtime/oat_file.h#569">android10-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatDexFile_Android10 extends OatDexFile_Pie {
|
||||
public class OatDexFile_Q extends OatDexFile_Pie {
|
||||
|
||||
public OatDexFile_Android10(BinaryReader reader, OatBundle bundle) throws IOException {
|
||||
public OatDexFile_Q(BinaryReader reader, OatBundle bundle) throws IOException {
|
||||
super(reader, bundle);
|
||||
}
|
||||
|
||||
|
@ -36,7 +35,7 @@ public class OatDexFile_Android10 extends OatDexFile_Pie {
|
|||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
dataType.setName(OatDexFile_Android10.class.getSimpleName()+ "_" +
|
||||
dataType.setName(OatDexFile_Q.class.getSimpleName()+ "_" +
|
||||
getDexFileLocation().length());
|
||||
}
|
||||
catch (Exception e) {
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue