Renamed and reorganized OAT classes.

This commit is contained in:
lazybinding-dev 2022-09-21 10:45:30 -04:00
parent f94a2d6058
commit 25840cf121
74 changed files with 759 additions and 508 deletions

View File

@ -67,94 +67,94 @@ public final class OatConstants {
// NOTE: we plan to only support RELEASE versions... // NOTE: we plan to only support RELEASE versions...
// Upper case indicates supported version. // Upper case indicates supported version.
/** https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat.cc#24 */ /** <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 VERSION_KITKAT_RELEASE = "007"; public final static String OAT_VERSION_007 = "007";
/** https://android.googlesource.com/platform/art/+/refs/heads/kitkat-dev/runtime/oat.cc#24 */ /** <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 version_kitkat_dev = "008"; public final static String oat_version_008 = "008";
/** https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat.cc#25 */ /** <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 VERSION_LOLLIPOP_RELEASE = "039"; public final static String OAT_VERSION_039 = "039";
/** https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-release/runtime/oat.cc#25 */ /** <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 VERSION_LOLLIPOP_MR1_FI_RELEASE = "045"; public final static String OAT_VERSION_045 = "045";
/** https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.cc#27 */ /** <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 VERSION_LOLLIPOP_WEAR_RELEASE = "051"; public final static String OAT_VERSION_051 = "051";
/** https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat.h#34 */ /** <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 VERSION_MARSHMALLOW_RELEASE = "064"; public final static String OAT_VERSION_064 = "064";
/** https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat.h#34 */ /** <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 VERSION_NOUGAT_RELEASE = "079"; public final static String OAT_VERSION_079 = "079";
/** https://android.googlesource.com/platform/art/+/refs/heads/n-iot-preview-2/runtime/oat.h#34 */ /** <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 version_n_iot_preview_2 = "083"; public final static String oat_version_083 = "083";
/** https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr1-release/runtime/oat.h#34 */ /** <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 VERSION_NOUGAT_MR1_RELEASE = "088"; public final static String OAT_VERSION_088 = "088";
/** https://android.googlesource.com/platform/art/+/refs/heads/o-preview/runtime/oat.h#34 */ /** <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 version_o_preview = "114"; public final static String oat_version_114 = "114";
/** https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat.h#34 */ /** <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 VERSION_OREO_RELEASE = "124"; public final static String OAT_VERSION_124 = "124";
/** https://android.googlesource.com/platform/art/+/refs/heads/n-iot-preview-4/runtime/oat.h#34 */ /** <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 version_n_iot_preview_4 = "125"; public final static String oat_version_125 = "125";
/** https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat.h#34 */ /** <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 VERSION_OREO_DR3_RELEASE = "126"; public final static String OAT_VERSION_126 = "126";
/** https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat.h#34 */ /** <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 VERSION_OREO_M2_RELEASE = "131"; public final static String OAT_VERSION_131 = "131";
/** https://android.googlesource.com/platform/art/+/refs/heads/o-iot-preview-5/runtime/oat.h#34 */ /** <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 version_o_iot_preview_5 = "132"; public final static String oat_version_132 = "132";
/** https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-6/runtime/oat.h#34 */ /** <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 version_o_mr1_iot_preview_6 = "135"; public final static String oat_version_135 = "135";
/** https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h#34 */ /** <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 VERSION_PIE_RELEASE = "138"; public final static String OAT_VERSION_138 = "138";
/** https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-7/runtime/oat.h#34 */ /** <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 version_o_mr1_iot_preview_7 = "139"; public final static String oat_version_139 = "139";
/** https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-8/runtime/oat.h#34 */ /** <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 version_o_mr1_iot_preview_8 = "140"; public final static String oat_version_140 = "140";
/** https://android.googlesource.com/platform/art/+/refs/tags/android-o-mr1-iot-release-1.0.0/runtime/oat.h#34 */ /** <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 version_o_mr1_iot_release_1_0_0 = "141"; public final static String oat_version_141 = "141";
/** https://android.googlesource.com/platform/art/+/refs/tags/android-o-mr1-iot-release-1.0.1/runtime/oat.h#34 */ /** <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 version_o_mr1_iot_release_1_0_1 = "146"; public final static String oat_version_146 = "146";
/** https://android.googlesource.com/platform/art/+/refs/tags/android-n-iot-release-polk-at1/runtime/oat.h#34 */ /** <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 version_n_iot_release_polk_at1 = "147"; public final static String oat_version_147 = "147";
/** https://android.googlesource.com/platform/art/+/refs/tags/android-q-preview-1/runtime/oat.h#33 */ /** <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 version_q_preview_1 = "166"; public final static String oat_version_166 = "166";
/** https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat.h#34 */ /** <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 VERSION_10_RELEASE = "170"; public final static String OAT_VERSION_170 = "170";
/** https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat.h#34 */ /** <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 VERSION_11_RELEASE = "183"; public final static String OAT_VERSION_183 = "183";
/** https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat.h#36 */ /** <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 VERSION_12_RELEASE = "195"; public final static String OAT_VERSION_195 = "195";
/** https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/oat.h#36 */ /** <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 VERSION_S_BETA4 = "197"; public final static String oat_version_197 = "197";
/** https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-preview-1/runtime/oat.h#36 */ /** <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 VERSION_S_V2_PREVIEW = "199"; public final static String OAT_VERSION_199 = "199";
/** https://android.googlesource.com/platform/art/+/refs/heads/android-t-preview-1/runtime/oat.h#36 */ /** <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 VERSION_T_PREVIEW_1 = "220"; public final static String OAT_VERSION_220 = "220";
/** https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-beta-3/runtime/oat.h#36 */ /** <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 VERSION_S_V2_BETA2 = "223"; public final static String OAT_VERSION_223 = "223";
/** https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat.h#36 */ /** <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 VERSION_13_RELEASE = "225"; public final static String OAT_VERSION_225 = "225";
/** https://android.googlesource.com/platform/art/+/master/runtime/oat.h#36 */ /** <a href="https://android.googlesource.com/platform/art/+/master/runtime/oat.h#36">master/runtime/oat.h</a> */
public final static String VERSION_227 = "227"; public final static String OAT_VERSION_227 = "227";
/** /**
* This array contains versions that have been actively tested and verified. * This array contains versions that have been actively tested and verified.
* All other versions will be considered unsupported until tested on exemplar firmware. * All other versions will be considered unsupported until tested on exemplar firmware.
*/ */
public final static String [] SUPPORTED_VERSIONS = new String [] { public final static String [] SUPPORTED_VERSIONS = new String [] {
VERSION_KITKAT_RELEASE, OAT_VERSION_007,
VERSION_LOLLIPOP_RELEASE, OAT_VERSION_039,
VERSION_LOLLIPOP_MR1_FI_RELEASE, OAT_VERSION_045,
VERSION_LOLLIPOP_WEAR_RELEASE, OAT_VERSION_051,
VERSION_MARSHMALLOW_RELEASE, OAT_VERSION_064,
VERSION_NOUGAT_RELEASE, OAT_VERSION_079,
VERSION_NOUGAT_MR1_RELEASE, OAT_VERSION_088,
VERSION_OREO_RELEASE, OAT_VERSION_124,
VERSION_OREO_DR3_RELEASE, OAT_VERSION_126,
VERSION_OREO_M2_RELEASE, OAT_VERSION_131,
VERSION_PIE_RELEASE, OAT_VERSION_138,
VERSION_10_RELEASE, OAT_VERSION_170,
VERSION_11_RELEASE, OAT_VERSION_183,
VERSION_12_RELEASE, OAT_VERSION_195,
VERSION_S_V2_PREVIEW, OAT_VERSION_199,
VERSION_T_PREVIEW_1, OAT_VERSION_220,
VERSION_S_V2_BETA2, OAT_VERSION_223,
VERSION_13_RELEASE, OAT_VERSION_225,
}; };
//@formatter:on //@formatter:on

View File

@ -23,6 +23,8 @@ import ghidra.app.util.bin.StructConverter;
import ghidra.file.formats.android.oat.bundle.OatBundle; import ghidra.file.formats.android.oat.bundle.OatBundle;
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile; import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
import ghidra.file.formats.android.oat.oatdexfile.OatDexFileFactory; import ghidra.file.formats.android.oat.oatdexfile.OatDexFileFactory;
import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException;
/** /**
* Base OatHeader implementations * Base OatHeader implementations
@ -142,4 +144,13 @@ public abstract class OatHeader implements StructConverter {
*/ */
abstract public int getChecksum(); 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;
}
} }

View File

@ -180,7 +180,7 @@ public class OatHeaderAnalyzer extends FileFormatAnalyzer {
monitor.setMessage("Annotating OAT Patches..."); monitor.setMessage("Annotating OAT Patches...");
Memory memory = program.getMemory(); 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 oatBlock = memory.getBlock(OatConstants.DOT_OAT_PATCHES_SECTION_NAME);
MemoryBlock destinationBlock = findOatPatchesDestinationBlock(program, oatBlock); MemoryBlock destinationBlock = findOatPatchesDestinationBlock(program, oatBlock);
if (oatBlock == null || destinationBlock == null) { 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 //TODO
} }
else if (oatHeader.getVersion().equals(OatConstants.VERSION_NOUGAT_MR1_RELEASE)) { else if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_088)) {
//TODO //TODO
} }
else if (oatHeader.getVersion().equals(OatConstants.VERSION_OREO_RELEASE)) { else if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_124)) {
//TODO //TODO
} }
else if (oatHeader.getVersion().equals(OatConstants.VERSION_OREO_M2_RELEASE)) { else if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_131)) {
//TODO //TODO
} }
} }

View File

@ -21,6 +21,7 @@ import ghidra.app.util.bin.BinaryReader;
import ghidra.app.util.importer.MessageLog; import ghidra.app.util.importer.MessageLog;
import ghidra.file.formats.android.oat.bundle.OatBundle; import ghidra.file.formats.android.oat.bundle.OatBundle;
import ghidra.file.formats.android.oat.bundle.OatBundleFactory; import ghidra.file.formats.android.oat.bundle.OatBundleFactory;
import ghidra.file.formats.android.oat.headers.*;
import ghidra.program.model.listing.Program; import ghidra.program.model.listing.Program;
import ghidra.util.task.TaskMonitor; import ghidra.util.task.TaskMonitor;
@ -40,35 +41,42 @@ public final class OatHeaderFactory {
if (magic.equals(OatConstants.MAGIC)) { if (magic.equals(OatConstants.MAGIC)) {
if (OatConstants.isSupportedVersion(version)) { if (OatConstants.isSupportedVersion(version)) {
switch (version) { switch (version) {
case OatConstants.VERSION_KITKAT_RELEASE: case OatConstants.OAT_VERSION_007:
return new OatHeader_KitKat(reader); return new OatHeader_007(reader);
case OatConstants.VERSION_LOLLIPOP_RELEASE: case OatConstants.OAT_VERSION_039:
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE: return new OatHeader_039(reader);
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE: case OatConstants.OAT_VERSION_045:
return new OatHeader_Lollipop(reader); return new OatHeader_045(reader);
case OatConstants.VERSION_MARSHMALLOW_RELEASE: case OatConstants.OAT_VERSION_051:
return new OatHeader_Marshmallow(reader); return new OatHeader_051(reader);
case OatConstants.VERSION_NOUGAT_RELEASE: case OatConstants.OAT_VERSION_064:
case OatConstants.VERSION_NOUGAT_MR1_RELEASE: return new OatHeader_064(reader);
return new OatHeader_Nougat(reader); case OatConstants.OAT_VERSION_079:
case OatConstants.VERSION_OREO_RELEASE: return new OatHeader_079(reader);
case OatConstants.VERSION_OREO_DR3_RELEASE: case OatConstants.OAT_VERSION_088:
return new OatHeader_Oreo(reader);//v124 and v126 are same format return new OatHeader_088(reader);
case OatConstants.VERSION_OREO_M2_RELEASE: case OatConstants.OAT_VERSION_124:
return new OatHeader_Oreo_M2(reader); return new OatHeader_124(reader);
case OatConstants.VERSION_PIE_RELEASE: case OatConstants.OAT_VERSION_126:
return new OatHeader_Pie(reader); return new OatHeader_126(reader);
case OatConstants.VERSION_10_RELEASE: case OatConstants.OAT_VERSION_131:
return new OatHeader_10(reader); return new OatHeader_131(reader);
case OatConstants.VERSION_11_RELEASE: case OatConstants.OAT_VERSION_138:
return new OatHeader_11(reader); return new OatHeader_138(reader);
case OatConstants.VERSION_12_RELEASE: case OatConstants.OAT_VERSION_170:
case OatConstants.VERSION_S_V2_PREVIEW: return new OatHeader_170(reader);
case OatConstants.VERSION_T_PREVIEW_1: case OatConstants.OAT_VERSION_183:
case OatConstants.VERSION_S_V2_BETA2: return new OatHeader_183(reader);
return new OatHeader_12(reader); case OatConstants.OAT_VERSION_195:
case OatConstants.VERSION_13_RELEASE: return new OatHeader_195(reader);
return new OatHeader_13(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);
} }
} }
} }

View File

@ -13,19 +13,24 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ghidra.file.formats.android.oat; package ghidra.file.formats.android.oat.headers;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import ghidra.app.util.bin.BinaryReader; 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.bundle.OatBundle;
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile; import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
import ghidra.program.model.data.*; import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 adler32_checksum_;
protected int instruction_set_; protected int instruction_set_;
@ -41,7 +46,7 @@ public class OatHeader_KitKat extends OatHeader {
protected int image_file_location_size_; protected int image_file_location_size_;
protected byte[] image_file_location_data_; // note variable width data at end 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); super(reader);
adler32_checksum_ = reader.readNextInt(); adler32_checksum_ = reader.readNextInt();
instruction_set_ = reader.readNextInt(); instruction_set_ = reader.readNextInt();
@ -134,9 +139,8 @@ public class OatHeader_KitKat extends OatHeader {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType(OatHeader_KitKat.class.getSimpleName(), 0); Structure structure = (Structure) super.toDataType();
structure.add(STRING, 4, "magic_", null);
structure.add(STRING, 4, "version_", null);
structure.add(DWORD, "adler32_checksum_", null); structure.add(DWORD, "adler32_checksum_", null);
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null); structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
structure.add(DWORD, "dex_file_count_", null); structure.add(DWORD, "dex_file_count_", null);

View File

@ -13,20 +13,22 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ghidra.file.formats.android.oat; package ghidra.file.formats.android.oat.headers;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.List;
import ghidra.app.util.bin.BinaryReader; 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.file.formats.android.oat.oatdexfile.OatDexFile;
import ghidra.program.model.data.*; import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 adler32_checksum_;
protected int instruction_set_; protected int instruction_set_;
@ -48,7 +50,7 @@ public class OatHeader_Lollipop extends OatHeader {
protected int image_file_location_oat_data_begin_; protected int image_file_location_oat_data_begin_;
protected int key_value_store_size_; protected int key_value_store_size_;
OatHeader_Lollipop(BinaryReader reader) throws IOException { public OatHeader_039(BinaryReader reader) throws IOException {
super(reader); super(reader);
adler32_checksum_ = reader.readNextInt(); adler32_checksum_ = reader.readNextInt();
instruction_set_ = reader.readNextInt(); instruction_set_ = reader.readNextInt();
@ -109,9 +111,8 @@ public class OatHeader_Lollipop extends OatHeader {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType(OatHeader_Lollipop.class.getSimpleName(), 0); Structure structure = (Structure) super.toDataType();
structure.add(STRING, 4, "magic_", null);
structure.add(STRING, 4, "version_", null);
structure.add(DWORD, "adler32_checksum_", null); structure.add(DWORD, "adler32_checksum_", null);
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null); structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
structure.add(DWORD, "instruction_set_features_", null); structure.add(DWORD, "instruction_set_features_", null);

View File

@ -13,29 +13,17 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ghidra.file.formats.android.oat; package ghidra.file.formats.android.oat.headers;
import java.io.IOException; import java.io.IOException;
import ghidra.app.util.bin.BinaryReader; import ghidra.app.util.bin.BinaryReader;
import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException;
public class OatHeader_Oreo extends OatHeader_Marshmallow { /**
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-release/runtime/oat.cc#25">lollipop-mr1-release/runtime/oat.cc</a>
OatHeader_Oreo(BinaryReader reader) throws IOException { */
public class OatHeader_045 extends OatHeader_039 {
public OatHeader_045(BinaryReader reader) throws IOException {
super(reader); 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;
}
} }

View File

@ -13,29 +13,17 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ghidra.file.formats.android.oat; package ghidra.file.formats.android.oat.headers;
import java.io.IOException; import java.io.IOException;
import ghidra.app.util.bin.BinaryReader; import ghidra.app.util.bin.BinaryReader;
import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException;
public class OatHeader_Nougat extends OatHeader_Marshmallow { /**
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.cc#27">lollipop-wear-release/runtime/oat.cc</a>
OatHeader_Nougat(BinaryReader reader) throws IOException { */
public class OatHeader_051 extends OatHeader_039 {
public OatHeader_051(BinaryReader reader) throws IOException {
super(reader); 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;
}
} }

View File

@ -13,20 +13,23 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ghidra.file.formats.android.oat; package ghidra.file.formats.android.oat.headers;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.Collections;
import java.util.List;
import ghidra.app.util.bin.BinaryReader; 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.file.formats.android.oat.oatdexfile.OatDexFile;
import ghidra.program.model.data.*; import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 adler32_checksum_;
protected int instruction_set_; protected int instruction_set_;
@ -45,7 +48,7 @@ class OatHeader_Marshmallow extends OatHeader {
protected int image_file_location_oat_data_begin_; protected int image_file_location_oat_data_begin_;
protected int key_value_store_size_; protected int key_value_store_size_;
OatHeader_Marshmallow(BinaryReader reader) throws IOException { public OatHeader_064(BinaryReader reader) throws IOException {
super(reader); super(reader);
adler32_checksum_ = reader.readNextInt(); adler32_checksum_ = reader.readNextInt();
@ -69,7 +72,7 @@ class OatHeader_Marshmallow extends OatHeader {
@Override @Override
public int getOatDexFilesOffset(BinaryReader reader) { public int getOatDexFilesOffset(BinaryReader reader) {
//the DEX offset is the current reader offset! //the DEX offset is the current reader offset!
return (int)reader.getPointerIndex(); return (int) reader.getPointerIndex();
} }
@Override @Override
@ -132,9 +135,8 @@ class OatHeader_Marshmallow extends OatHeader {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType(OatHeader_Marshmallow.class.getSimpleName(), 0); Structure structure = (Structure) super.toDataType();
structure.add(STRING, 4, "magic_", null);
structure.add(STRING, 4, "version_", null);
structure.add(DWORD, "adler32_checksum_", null); structure.add(DWORD, "adler32_checksum_", null);
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null); structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
structure.add(DWORD, "instruction_set_features_bitmap_", null); structure.add(DWORD, "instruction_set_features_bitmap_", null);

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -13,20 +13,23 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ghidra.file.formats.android.oat; package ghidra.file.formats.android.oat.headers;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.Collections;
import java.util.List;
import ghidra.app.util.bin.BinaryReader; 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.file.formats.android.oat.oatdexfile.OatDexFile;
import ghidra.program.model.data.*; import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 adler32_checksum_;
protected int instruction_set_; protected int instruction_set_;
@ -46,7 +49,7 @@ class OatHeader_Oreo_M2 extends OatHeader {
protected int image_file_location_oat_data_begin_; protected int image_file_location_oat_data_begin_;
protected int key_value_store_size_; protected int key_value_store_size_;
OatHeader_Oreo_M2(BinaryReader reader) throws IOException { public OatHeader_131(BinaryReader reader) throws IOException {
super(reader); super(reader);
adler32_checksum_ = reader.readNextInt(); adler32_checksum_ = reader.readNextInt();
@ -133,9 +136,8 @@ class OatHeader_Oreo_M2 extends OatHeader {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType(OatHeader_Oreo_M2.class.getSimpleName(), 0); Structure structure = (Structure) super.toDataType();
structure.add(STRING, 4, "magic_", null);
structure.add(STRING, 4, "version_", null);
structure.add(DWORD, "adler32_checksum_", null); structure.add(DWORD, "adler32_checksum_", null);
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null); structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
structure.add(DWORD, "instruction_set_features_bitmap_", null); structure.add(DWORD, "instruction_set_features_bitmap_", null);

View File

@ -13,20 +13,22 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ghidra.file.formats.android.oat; package ghidra.file.formats.android.oat.headers;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.List;
import ghidra.app.util.bin.BinaryReader; 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.file.formats.android.oat.oatdexfile.OatDexFile;
import ghidra.program.model.data.*; import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 adler32_checksum_;
protected int instruction_set_; protected int instruction_set_;
@ -46,7 +48,7 @@ class OatHeader_Pie extends OatHeader {
protected int image_file_location_oat_data_begin_; protected int image_file_location_oat_data_begin_;
protected int key_value_store_size_; protected int key_value_store_size_;
OatHeader_Pie(BinaryReader reader) throws IOException { public OatHeader_138(BinaryReader reader) throws IOException {
super(reader); super(reader);
adler32_checksum_ = reader.readNextInt(); adler32_checksum_ = reader.readNextInt();
instruction_set_ = reader.readNextInt(); instruction_set_ = reader.readNextInt();
@ -104,9 +106,8 @@ class OatHeader_Pie extends OatHeader {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType(OatHeader_Pie.class.getSimpleName(), 0); Structure structure = (Structure) super.toDataType();
structure.add(STRING, 4, "magic_", null);
structure.add(STRING, 4, "version_", null);
structure.add(DWORD, "adler32_checksum_", null); structure.add(DWORD, "adler32_checksum_", null);
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null); structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
structure.add(DWORD, "instruction_set_features_bitmap_", null); structure.add(DWORD, "instruction_set_features_bitmap_", null);

View File

@ -13,17 +13,22 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ghidra.file.formats.android.oat; package ghidra.file.formats.android.oat.headers;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.List;
import ghidra.app.util.bin.BinaryReader; 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.file.formats.android.oat.oatdexfile.OatDexFile;
import ghidra.program.model.data.*; import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 oat_checksum_;
protected int instruction_set_; protected int instruction_set_;
protected int instruction_set_features_bitmap_; 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 quick_to_interpreter_bridge_offset_;
protected int key_value_store_size_; protected int key_value_store_size_;
OatHeader_10(BinaryReader reader) throws IOException { public OatHeader_170(BinaryReader reader) throws IOException {
super(reader); super(reader);
oat_checksum_ = reader.readNextInt(); oat_checksum_ = reader.readNextInt();
@ -91,9 +96,8 @@ public class OatHeader_10 extends OatHeader {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType(OatHeader_10.class.getSimpleName(), 0); Structure structure = (Structure) super.toDataType();
structure.add(STRING, 4, "magic_", null);
structure.add(STRING, 4, "version_", null);
structure.add(DWORD, "oat_checksum_", null); structure.add(DWORD, "oat_checksum_", null);
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null); structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
structure.add(DWORD, "instruction_set_features_bitmap_", null); structure.add(DWORD, "instruction_set_features_bitmap_", null);

View File

@ -13,17 +13,22 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ghidra.file.formats.android.oat; package ghidra.file.formats.android.oat.headers;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.List;
import ghidra.app.util.bin.BinaryReader; 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.file.formats.android.oat.oatdexfile.OatDexFile;
import ghidra.program.model.data.*; import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 oat_checksum_;
protected int instruction_set_; protected int instruction_set_;
protected int instruction_set_features_bitmap_; 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 quick_to_interpreter_bridge_offset_;
protected int key_value_store_size_; protected int key_value_store_size_;
OatHeader_11(BinaryReader reader) throws IOException { public OatHeader_183(BinaryReader reader) throws IOException {
super(reader); super(reader);
oat_checksum_ = reader.readNextInt(); oat_checksum_ = reader.readNextInt();
@ -93,9 +98,8 @@ public class OatHeader_11 extends OatHeader {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType(OatHeader_11.class.getSimpleName(), 0); Structure structure = (Structure) super.toDataType();
structure.add(STRING, 4, "magic_", null);
structure.add(STRING, 4, "version_", null);
structure.add(DWORD, "oat_checksum_", null); structure.add(DWORD, "oat_checksum_", null);
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null); structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
structure.add(DWORD, "instruction_set_features_bitmap_", null); structure.add(DWORD, "instruction_set_features_bitmap_", null);

View File

@ -13,24 +13,22 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ghidra.file.formats.android.oat; package ghidra.file.formats.android.oat.headers;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.List;
import ghidra.app.util.bin.BinaryReader; 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.file.formats.android.oat.oatdexfile.OatDexFile;
import ghidra.program.model.data.*; import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/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>
*
* 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
*/ */
public class OatHeader_12 extends OatHeader { public class OatHeader_195 extends OatHeader {
protected int oat_checksum_; protected int oat_checksum_;
protected int instruction_set_; protected int instruction_set_;
protected int instruction_set_features_bitmap_; protected int instruction_set_features_bitmap_;
@ -46,7 +44,7 @@ public class OatHeader_12 extends OatHeader {
protected int nterp_trampoline_offset_; protected int nterp_trampoline_offset_;
protected int key_value_store_size_; protected int key_value_store_size_;
OatHeader_12(BinaryReader reader) throws IOException { public OatHeader_195(BinaryReader reader) throws IOException {
super(reader); super(reader);
oat_checksum_ = reader.readNextInt(); oat_checksum_ = reader.readNextInt();
@ -102,9 +100,8 @@ public class OatHeader_12 extends OatHeader {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType(OatHeader_12.class.getSimpleName(), 0); Structure structure = (Structure) super.toDataType();
structure.add(STRING, 4, "magic_", null);
structure.add(STRING, 4, "version_", null);
structure.add(DWORD, "oat_checksum_", null); structure.add(DWORD, "oat_checksum_", null);
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null); structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
structure.add(DWORD, "instruction_set_features_bitmap_", null); structure.add(DWORD, "instruction_set_features_bitmap_", null);

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -13,20 +13,22 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package ghidra.file.formats.android.oat; package ghidra.file.formats.android.oat.headers;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.List;
import ghidra.app.util.bin.BinaryReader; 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.file.formats.android.oat.oatdexfile.OatDexFile;
import ghidra.program.model.data.*; import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 oat_checksum_;
protected int instruction_set_; protected int instruction_set_;
protected int instruction_set_features_bitmap_; protected int instruction_set_features_bitmap_;
@ -43,7 +45,7 @@ public class OatHeader_13 extends OatHeader {
protected int nterp_trampoline_offset_; protected int nterp_trampoline_offset_;
protected int key_value_store_size_; protected int key_value_store_size_;
OatHeader_13(BinaryReader reader) throws IOException { public OatHeader_225(BinaryReader reader) throws IOException {
super(reader); super(reader);
oat_checksum_ = reader.readNextInt(); oat_checksum_ = reader.readNextInt();
@ -100,9 +102,8 @@ public class OatHeader_13 extends OatHeader {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType(OatHeader_13.class.getSimpleName(), 0); Structure structure = (Structure) super.toDataType();
structure.add(STRING, 4, "magic_", null);
structure.add(STRING, 4, "version_", null);
structure.add(DWORD, "oat_checksum_", null); structure.add(DWORD, "oat_checksum_", null);
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null); structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
structure.add(DWORD, "instruction_set_features_bitmap_", null); structure.add(DWORD, "instruction_set_features_bitmap_", null);

View File

@ -49,39 +49,39 @@ public abstract class OatClass implements StructConverter {
status_ = reader.readNextShort(); status_ = reader.readNextShort();
switch (oatVersion) { switch (oatVersion) {
case OatConstants.VERSION_KITKAT_RELEASE: { case OatConstants.OAT_VERSION_007: {
statusEnum = OatClassStatusEnum_K.kStatusInitialized.get(status_); statusEnum = OatClassStatusEnum_K.kStatusInitialized.get(status_);
break; break;
} }
case OatConstants.VERSION_LOLLIPOP_RELEASE: case OatConstants.OAT_VERSION_039:
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE: case OatConstants.OAT_VERSION_045:
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE: case OatConstants.OAT_VERSION_051:
case OatConstants.VERSION_MARSHMALLOW_RELEASE: case OatConstants.OAT_VERSION_064:
case OatConstants.VERSION_NOUGAT_RELEASE: case OatConstants.OAT_VERSION_079:
case OatConstants.VERSION_NOUGAT_MR1_RELEASE: { case OatConstants.OAT_VERSION_088: {
statusEnum = OatClassStatusEnum_L_M_N.kStatusMax.get(status_); statusEnum = OatClassStatusEnum_L_M_N.kStatusMax.get(status_);
break; break;
} }
case OatConstants.VERSION_OREO_RELEASE: { case OatConstants.OAT_VERSION_124: {
statusEnum = OatClassStatusEnum_O.kStatusMax.get(status_); statusEnum = OatClassStatusEnum_O.kStatusMax.get(status_);
break; break;
} }
case OatConstants.VERSION_OREO_M2_RELEASE: { case OatConstants.OAT_VERSION_131: {
statusEnum = OatClassStatusEnum_O_M2.kStatusMax.get(status_); statusEnum = OatClassStatusEnum_O_M2.kStatusMax.get(status_);
break; break;
} }
case OatConstants.VERSION_PIE_RELEASE: case OatConstants.OAT_VERSION_138:
case OatConstants.VERSION_10_RELEASE: { case OatConstants.OAT_VERSION_170: {
statusEnum = OatClassStatusEnum_P_10.kLast.get(status_); statusEnum = OatClassStatusEnum_P_Q.kLast.get(status_);
break; break;
} }
case OatConstants.VERSION_11_RELEASE: case OatConstants.OAT_VERSION_183:
case OatConstants.VERSION_12_RELEASE: case OatConstants.OAT_VERSION_195:
case OatConstants.VERSION_S_V2_PREVIEW: case OatConstants.OAT_VERSION_199:
case OatConstants.VERSION_T_PREVIEW_1: case OatConstants.OAT_VERSION_220:
case OatConstants.VERSION_S_V2_BETA2: case OatConstants.OAT_VERSION_223:
case OatConstants.VERSION_13_RELEASE: { case OatConstants.OAT_VERSION_225: {
statusEnum = OatClassStatusEnum_11_12.kLast.get(status_); statusEnum = OatClassStatusEnum_R_S_T.kLast.get(status_);
break; break;
} }
default: { default: {

View File

@ -28,33 +28,33 @@ public class OatClassFactory {
String oatVersion) throws IOException, UnsupportedOatVersionException { String oatVersion) throws IOException, UnsupportedOatVersionException {
switch (oatVersion) { switch (oatVersion) {
case OatConstants.VERSION_KITKAT_RELEASE: case OatConstants.OAT_VERSION_007:
return new OatClass_KitKat(reader, classDataItem, oatVersion); return new OatClass_KitKat(reader, classDataItem, oatVersion);
case OatConstants.VERSION_LOLLIPOP_RELEASE: case OatConstants.OAT_VERSION_039:
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE: case OatConstants.OAT_VERSION_045:
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE: case OatConstants.OAT_VERSION_051:
return new OatClass_Lollipop(reader, classDataItem, oatVersion); return new OatClass_Lollipop(reader, classDataItem, oatVersion);
case OatConstants.VERSION_MARSHMALLOW_RELEASE: case OatConstants.OAT_VERSION_064:
return new OatClass_Marshmallow(reader, classDataItem, oatVersion); return new OatClass_Marshmallow(reader, classDataItem, oatVersion);
case OatConstants.VERSION_NOUGAT_RELEASE: case OatConstants.OAT_VERSION_079:
case OatConstants.VERSION_NOUGAT_MR1_RELEASE: case OatConstants.OAT_VERSION_088:
return new OatClass_Nougat(reader, classDataItem, oatVersion); return new OatClass_Nougat(reader, classDataItem, oatVersion);
case OatConstants.VERSION_OREO_RELEASE: case OatConstants.OAT_VERSION_124:
return new OatClass_Oreo(reader, classDataItem, oatVersion); 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); return new OatClass_OreoM2(reader, classDataItem, oatVersion);
case OatConstants.VERSION_PIE_RELEASE: case OatConstants.OAT_VERSION_138:
return new OatClass_Pie(reader, classDataItem, oatVersion); return new OatClass_Pie(reader, classDataItem, oatVersion);
case OatConstants.VERSION_10_RELEASE: case OatConstants.OAT_VERSION_170:
return new OatClass_Android10(reader, classDataItem, oatVersion); return new OatClass_Q(reader, classDataItem, oatVersion);
case OatConstants.VERSION_11_RELEASE: case OatConstants.OAT_VERSION_183:
return new OatClass_Android11(reader, classDataItem, oatVersion); return new OatClass_R(reader, classDataItem, oatVersion);
case OatConstants.VERSION_12_RELEASE: case OatConstants.OAT_VERSION_195:
case OatConstants.VERSION_S_V2_PREVIEW: case OatConstants.OAT_VERSION_199:
case OatConstants.VERSION_T_PREVIEW_1: case OatConstants.OAT_VERSION_220:
case OatConstants.VERSION_S_V2_BETA2: case OatConstants.OAT_VERSION_223:
case OatConstants.VERSION_13_RELEASE: case OatConstants.OAT_VERSION_225:
return new OatClass_Android12(reader, classDataItem, oatVersion); return new OatClass_S_T(reader, classDataItem, oatVersion);
default: default:
throw new UnsupportedOatVersionException( throw new UnsupportedOatVersionException(
"OatClass not supported for OAT Version: " + oatVersion); "OatClass not supported for OAT Version: " + oatVersion);

View File

@ -21,7 +21,7 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 { public enum OatClassStatusEnum_K implements OatClassStatusEnum {

View File

@ -21,15 +21,15 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/lollipop-release/runtime/mirror/class.h#133 * <a href="https://android.googlesource.com/platform/art/+/lollipop-release/runtime/mirror/class.h#133">lollipop-release/runtime/mirror/class.h</a>
* * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/mirror/class.h#138 * <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>
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/mirror/class.h#119 * <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>
* https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/mirror/class.h#112 * <a href="https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/mirror/class.h#112">marshmallow-release/runtime/mirror/class.h</a>
* * <br>
* https://android.googlesource.com/platform/art/+/nougat-release/runtime/mirror/class.h#116 * <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 { public enum OatClassStatusEnum_L_M_N implements OatClassStatusEnum {

View File

@ -21,7 +21,7 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 { public enum OatClassStatusEnum_O implements OatClassStatusEnum {

View File

@ -21,7 +21,7 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 { public enum OatClassStatusEnum_O_M2 implements OatClassStatusEnum {

View File

@ -21,12 +21,11 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/pie-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>
* 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/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), kNotReady(0),
kRetired(1), kRetired(1),
@ -47,11 +46,11 @@ public enum OatClassStatusEnum_P_10 implements OatClassStatusEnum {
private byte value; private byte value;
private OatClassStatusEnum_P_10(byte value) { private OatClassStatusEnum_P_Q(byte value) {
this.value = value; this.value = value;
} }
private OatClassStatusEnum_P_10(int value) { private OatClassStatusEnum_P_Q(int value) {
this.value = (byte) value; this.value = (byte) value;
} }
@ -61,7 +60,7 @@ public enum OatClassStatusEnum_P_10 implements OatClassStatusEnum {
@Override @Override
public OatClassStatusEnum get(short value) { public OatClassStatusEnum get(short value) {
for (OatClassStatusEnum_P_10 valueX : values()) { for (OatClassStatusEnum_P_Q valueX : values()) {
if (valueX.getValue() == value) { if (valueX.getValue() == value) {
return valueX; return valueX;
} }
@ -71,8 +70,8 @@ public enum OatClassStatusEnum_P_10 implements OatClassStatusEnum {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_P_10.class.getSimpleName(), 2); EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_P_Q.class.getSimpleName(), 2);
for (OatClassStatusEnum_P_10 valueX : values()) { for (OatClassStatusEnum_P_Q valueX : values()) {
enumDataType.add(valueX.name(), valueX.getValue()); enumDataType.add(valueX.name(), valueX.getValue());
} }
enumDataType.setCategoryPath(new CategoryPath("/oat")); enumDataType.setCategoryPath(new CategoryPath("/oat"));

View File

@ -21,11 +21,13 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/android11-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>
* 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/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), kNotReady(0),
kRetired(1), kRetired(1),
@ -47,11 +49,11 @@ public enum OatClassStatusEnum_11_12 implements OatClassStatusEnum {
private byte value; private byte value;
private OatClassStatusEnum_11_12(byte value) { private OatClassStatusEnum_R_S_T(byte value) {
this.value = value; this.value = value;
} }
private OatClassStatusEnum_11_12(int value) { private OatClassStatusEnum_R_S_T(int value) {
this.value = (byte) value; this.value = (byte) value;
} }
@ -61,7 +63,7 @@ public enum OatClassStatusEnum_11_12 implements OatClassStatusEnum {
@Override @Override
public OatClassStatusEnum get(short value) { public OatClassStatusEnum get(short value) {
for (OatClassStatusEnum_11_12 valueX : values()) { for (OatClassStatusEnum_R_S_T valueX : values()) {
if (valueX.getValue() == value) { if (valueX.getValue() == value) {
return valueX; return valueX;
} }
@ -71,8 +73,8 @@ public enum OatClassStatusEnum_11_12 implements OatClassStatusEnum {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_11_12.class.getSimpleName(), 2); EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_R_S_T.class.getSimpleName(), 2);
for (OatClassStatusEnum_11_12 valueX : values()) { for (OatClassStatusEnum_R_S_T valueX : values()) {
enumDataType.add(valueX.name(), valueX.getValue()); enumDataType.add(valueX.name(), valueX.getValue());
} }
enumDataType.setCategoryPath(new CategoryPath("/oat")); enumDataType.setCategoryPath(new CategoryPath("/oat"));

View File

@ -25,9 +25,9 @@ import ghidra.program.model.data.*;
* using a bitmap pays for itself since few classes will have 160 * using a bitmap pays for itself since few classes will have 160
* methods. * methods.
* *
* https://android.googlesource.com/platform/art/+/lollipop-release/runtime/oat.h#152 * <a href="https://android.googlesource.com/platform/art/+/lollipop-release/runtime/oat.h#152">lollipop-release/runtime/oat.h</a>
* * <br>
* 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/+/refs/heads/android-s-beta-5/runtime/oat_file.h#66">android-s-beta-5/runtime/oat_file.h</a>
*/ */
public enum OatClassType { public enum OatClassType {

View File

@ -23,7 +23,7 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; 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 { public class OatClass_KitKat extends OatClass {

View File

@ -24,11 +24,11 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat_file.h#205 * <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>
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/oat_file.h#202 * <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>
* 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-wear-release/runtime/oat_file.h#211">lollipop-wear-release/runtime/oat_file.h</a>
*/ */
public class OatClass_Lollipop extends OatClass { public class OatClass_Lollipop extends OatClass {

View File

@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; 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 { public class OatClass_Marshmallow extends OatClass_Lollipop {

View File

@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; 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 { public class OatClass_Nougat extends OatClass_Marshmallow {

View File

@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; 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 { public class OatClass_Oreo extends OatClass_Nougat {

View File

@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; 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 { public class OatClass_OreoM2 extends OatClass_Oreo {

View File

@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; 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 { public class OatClass_Pie extends OatClass_OreoM2 {

View File

@ -23,11 +23,11 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; 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 { throws IOException {
super(reader, classDataItem, oatVersion); super(reader, classDataItem, oatVersion);
} }
@ -36,7 +36,7 @@ public class OatClass_Android11 extends OatClass_Android10 {
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
DataType dataType = super.toDataType(); DataType dataType = super.toDataType();
try { try {
renameDataType(dataType, OatClass_Android11.class.getSimpleName()); renameDataType(dataType, OatClass_Q.class.getSimpleName());
} }
catch (Exception e) { catch (Exception e) {
//ignore... //ignore...

View File

@ -23,11 +23,11 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; 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 { throws IOException {
super(reader, classDataItem, oatVersion); super(reader, classDataItem, oatVersion);
} }
@ -36,7 +36,7 @@ public class OatClass_Android10 extends OatClass_Pie {
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
DataType dataType = super.toDataType(); DataType dataType = super.toDataType();
try { try {
renameDataType(dataType, OatClass_Android10.class.getSimpleName()); renameDataType(dataType, OatClass_R.class.getSimpleName());
} }
catch (Exception e) { catch (Exception e) {
//ignore... //ignore...

View File

@ -25,9 +25,11 @@ import ghidra.util.NumericUtilities;
import ghidra.util.exception.DuplicateNameException; 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 //https://android.googlesource.com/platform/art/+/master/libartbase/base/bit_vector.h#38
public static final int kWordBytes = 4; public static final int kWordBytes = 4;
@ -36,7 +38,7 @@ public class OatClass_Android12 extends OatClass {
private byte[] bitmap_ = new byte[0]; 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 { throws IOException {
super(reader, oatVersion); super(reader, oatVersion);
@ -106,7 +108,7 @@ public class OatClass_Android12 extends OatClass {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
String className = OatClass_Android12.class.getSimpleName(); String className = OatClass_S_T.class.getSimpleName();
if (methods_pointer_.size() > 0) { if (methods_pointer_.size() > 0) {
className += "_" + methods_pointer_.size(); className += "_" + methods_pointer_.size();

View File

@ -27,34 +27,34 @@ public final class OatDexFileFactory {
OatBundle bundle) throws IOException { OatBundle bundle) throws IOException {
switch (oatVersion) { switch (oatVersion) {
case OatConstants.VERSION_KITKAT_RELEASE: case OatConstants.OAT_VERSION_007:
return new OatDexFile_KitKat(reader); return new OatDexFile_KitKat(reader);
case OatConstants.VERSION_LOLLIPOP_RELEASE: case OatConstants.OAT_VERSION_039:
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE: case OatConstants.OAT_VERSION_045:
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE: case OatConstants.OAT_VERSION_051:
return new OatDexFile_Lollipop(reader); return new OatDexFile_Lollipop(reader);
case OatConstants.VERSION_MARSHMALLOW_RELEASE: case OatConstants.OAT_VERSION_064:
return new OatDexFile_Marshmallow(reader); return new OatDexFile_Marshmallow(reader);
case OatConstants.VERSION_NOUGAT_RELEASE: case OatConstants.OAT_VERSION_079:
case OatConstants.VERSION_NOUGAT_MR1_RELEASE: case OatConstants.OAT_VERSION_088:
return new OatDexFile_Nougat(reader); return new OatDexFile_Nougat(reader);
case OatConstants.VERSION_OREO_RELEASE: case OatConstants.OAT_VERSION_124:
case OatConstants.VERSION_OREO_DR3_RELEASE: case OatConstants.OAT_VERSION_126:
return new OatDexFile_Oreo(reader, bundle); return new OatDexFile_Oreo(reader, bundle);
case OatConstants.VERSION_OREO_M2_RELEASE: case OatConstants.OAT_VERSION_131:
return new OatDexFile_OreoM2(reader, bundle); return new OatDexFile_OreoM2(reader, bundle);
case OatConstants.VERSION_PIE_RELEASE: case OatConstants.OAT_VERSION_138:
return new OatDexFile_Pie(reader, bundle); return new OatDexFile_Pie(reader, bundle);
case OatConstants.VERSION_10_RELEASE: case OatConstants.OAT_VERSION_170:
return new OatDexFile_Android10(reader, bundle); return new OatDexFile_Q(reader, bundle);
case OatConstants.VERSION_11_RELEASE: case OatConstants.OAT_VERSION_183:
return new OatDexFile_Android11(reader, bundle); return new OatDexFile_R(reader, bundle);
case OatConstants.VERSION_12_RELEASE: case OatConstants.OAT_VERSION_195:
case OatConstants.VERSION_S_V2_PREVIEW: case OatConstants.OAT_VERSION_199:
case OatConstants.VERSION_T_PREVIEW_1: case OatConstants.OAT_VERSION_220:
case OatConstants.VERSION_S_V2_BETA2: case OatConstants.OAT_VERSION_223:
case OatConstants.VERSION_13_RELEASE: case OatConstants.OAT_VERSION_225:
return new OatDexFile_Android12(reader, bundle); return new OatDexFile_S_T(reader, bundle);
} }
throw new IOException("Unsupported OAT version: " + oatVersion); throw new IOException("Unsupported OAT version: " + oatVersion);

View File

@ -40,8 +40,7 @@ import ghidra.util.exception.DuplicateNameException;
import ghidra.util.task.TaskMonitor; import ghidra.util.task.TaskMonitor;
/** /**
* * <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat_file.h#191">kitkat-release/runtime/oat_file.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat_file.h#191
*/ */
class OatDexFile_KitKat extends OatDexFile { class OatDexFile_KitKat extends OatDexFile {

View File

@ -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. * Note: actual data structure seen in firmware does not contain the "canonical_dex_file_location_" field.
* * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat_file.h#261 * <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 { class OatDexFile_Lollipop extends OatDexFile_KitKat {

View File

@ -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. * Note: actual data structure seen in firmware does not contain the "canonical_dex_file_location_" field.
* * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat_file.h#405 * <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 { class OatDexFile_Marshmallow extends OatDexFile_Lollipop {

View File

@ -33,10 +33,10 @@ import ghidra.util.task.TaskMonitor;
/** /**
* Used for OAT Header version 079 to 088. * Used for OAT Header version 079 to 088.
* * <br>
* Versions: Nougat, Nougat MR1 * Versions: Nougat, Nougat MR1
* * <br>
* https://android.googlesource.com/platform/art/+/nougat-release/runtime/oat_file.h#383 * <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 { class OatDexFile_Nougat extends OatDexFile {

View File

@ -23,8 +23,7 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* * <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_file.h#444">oreo-release/runtime/oat_file.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_file.h#444
*/ */
class OatDexFile_Oreo extends OatDexFile_Nougat { class OatDexFile_Oreo extends OatDexFile_Nougat {

View File

@ -33,8 +33,7 @@ import ghidra.util.exception.DuplicateNameException;
import ghidra.util.task.TaskMonitor; import ghidra.util.task.TaskMonitor;
/** /**
* * <a href="https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/oat_file.h#467">oreo-m2-release/runtime/oat_file.h</a>
* https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/oat_file.h#467
*/ */
class OatDexFile_OreoM2 extends OatDexFile { class OatDexFile_OreoM2 extends OatDexFile {

View File

@ -35,8 +35,7 @@ import ghidra.util.exception.DuplicateNameException;
import ghidra.util.task.TaskMonitor; import ghidra.util.task.TaskMonitor;
/** /**
* * <a href="https://android.googlesource.com/platform/art/+/pie-release/runtime/oat_file.h#518">pie-release/runtime/oat_file.h</a>
* https://android.googlesource.com/platform/art/+/pie-release/runtime/oat_file.h#518
*/ */
class OatDexFile_Pie extends OatDexFile { class OatDexFile_Pie extends OatDexFile {

View File

@ -23,12 +23,11 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* * <a href="https://android.googlesource.com/platform/art/+/android10-release/runtime/oat_file.h#569">android10-release/runtime/oat_file.h</a>
* https://android.googlesource.com/platform/art/+/android10-release/runtime/oat_file.h#569
*/ */
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); super(reader, bundle);
} }
@ -36,7 +35,7 @@ public class OatDexFile_Android10 extends OatDexFile_Pie {
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
DataType dataType = super.toDataType(); DataType dataType = super.toDataType();
try { try {
dataType.setName(OatDexFile_Android10.class.getSimpleName()+ "_" + dataType.setName(OatDexFile_Q.class.getSimpleName()+ "_" +
getDexFileLocation().length()); getDexFileLocation().length());
} }
catch (Exception e) { catch (Exception e) {

View File

@ -23,12 +23,11 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* * <a href="https://android.googlesource.com/platform/art/+/android11-release/runtime/oat_file.h#571">android11-release/runtime/oat_file.h</a>
* https://android.googlesource.com/platform/art/+/android11-release/runtime/oat_file.h#571
*/ */
public class OatDexFile_Android11 extends OatDexFile_Pie { public class OatDexFile_R extends OatDexFile_Pie {
public OatDexFile_Android11(BinaryReader reader, OatBundle bundle) throws IOException { public OatDexFile_R(BinaryReader reader, OatBundle bundle) throws IOException {
super(reader, bundle); super(reader, bundle);
} }
@ -36,7 +35,7 @@ public class OatDexFile_Android11 extends OatDexFile_Pie {
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
DataType dataType = super.toDataType(); DataType dataType = super.toDataType();
try { try {
dataType.setName(OatDexFile_Android11.class.getSimpleName() + "_" + dataType.setName(OatDexFile_R.class.getSimpleName() + "_" +
getDexFileLocation().length()); getDexFileLocation().length());
} }
catch (Exception e) { catch (Exception e) {

View File

@ -34,9 +34,11 @@ import ghidra.util.exception.DuplicateNameException;
import ghidra.util.task.TaskMonitor; import ghidra.util.task.TaskMonitor;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/oat_file.h#596 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat_file.h#596">android12-release/runtime/oat_file.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat_file.h#610">android13-release/runtime/oat_file.h</a>
*/ */
public class OatDexFile_Android12 extends OatDexFile { public class OatDexFile_S_T extends OatDexFile {
private int dex_file_location_; private int dex_file_location_;
private String canonical_dex_file_location_; private String canonical_dex_file_location_;
@ -57,7 +59,7 @@ public class OatDexFile_Android12 extends OatDexFile {
private long _offset; private long _offset;
private DexHeader dexHeader; private DexHeader dexHeader;
public OatDexFile_Android12(BinaryReader reader, OatBundle bundle) public OatDexFile_S_T(BinaryReader reader, OatBundle bundle)
throws IOException { throws IOException {
_offset = reader.getPointerIndex(); _offset = reader.getPointerIndex();
@ -167,7 +169,7 @@ public class OatDexFile_Android12 extends OatDexFile {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType( Structure structure = new StructureDataType(
OatDexFile_Android12.class.getSimpleName() + "_" + dex_file_location_, 0); OatDexFile_S_T.class.getSimpleName() + "_" + dex_file_location_, 0);
structure.add(DWORD, "dex_file_location_", null); structure.add(DWORD, "dex_file_location_", null);
structure.add(STRING, dex_file_location_, "canonical_dex_file_location_", null); structure.add(STRING, dex_file_location_, "canonical_dex_file_location_", null);

View File

@ -23,19 +23,32 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* * <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-release/runtime/oat.h#163">lollipop-mr1-release/runtime/oat.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-release/runtime/oat.h#163 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.h#165 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.h#165">ollipop-wear-release/runtime/oat.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat.h#162 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat.h#172 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat.h#162">marshmallow-release/runtime/oat.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr1-release/runtime/oat.h#172 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat.h#172 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat.h#172">nougat-release/runtime/oat.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat.h#172 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat.h#176 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr1-release/runtime/oat.h#172">nougat-mr1-release/runtime/oat.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h#177 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat.h#150 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat.h#172">oreo-release/runtime/oat.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat_file.h#75 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/oat_file.h#75 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat.h#172">oreo-dr3-release/runtime/oat.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat.h#176">oreo-m2-release/runtime/oat.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h#177">pie-release/runtime/oat.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat.h#150">android10-release/runtime/oat.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat_file.h#75">android11-release/runtime/oat_file.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat_file.h#75">android12-release/runtime/oat_file.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat_file.h#75">android13-release/runtime/oat_file.h</a>
* <br>
*/ */
public class OatMethodOffsets implements StructConverter { public class OatMethodOffsets implements StructConverter {

View File

@ -26,9 +26,9 @@ public final class OatMethodOffsetsFactory {
throws IOException { throws IOException {
switch (oatVersion) { switch (oatVersion) {
case OatConstants.VERSION_KITKAT_RELEASE: case OatConstants.OAT_VERSION_007:
return new OatMethodOffsets_KitKat(reader); return new OatMethodOffsets_KitKat(reader);
case OatConstants.VERSION_LOLLIPOP_RELEASE: case OatConstants.OAT_VERSION_039:
return new OatMethodOffsets_Lollipop(reader); return new OatMethodOffsets_Lollipop(reader);
default: default:
return new OatMethodOffsets(reader); return new OatMethodOffsets(reader);

View File

@ -22,9 +22,7 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* * <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat.h#107">kitkat-release/runtime/oat.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat.h#107
*
*/ */
public class OatMethodOffsets_KitKat extends OatMethodOffsets { public class OatMethodOffsets_KitKat extends OatMethodOffsets {

View File

@ -22,9 +22,7 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* * <a href="https://android.googlesource.com/platform/art/+/lollipop-release/runtime/oat.h#161">lollipop-release/runtime/oat.h</a>
* https://android.googlesource.com/platform/art/+/lollipop-release/runtime/oat.h#161
*
*/ */
public class OatMethodOffsets_Lollipop extends OatMethodOffsets { public class OatMethodOffsets_Lollipop extends OatMethodOffsets {

View File

@ -24,28 +24,28 @@ public final class OatQuickMethodHeaderFactory {
public final static int getOatQuickMethodHeaderSize(String oatVersion) throws IOException { public final static int getOatQuickMethodHeaderSize(String oatVersion) throws IOException {
switch (oatVersion) { switch (oatVersion) {
case OatConstants.VERSION_LOLLIPOP_RELEASE: case OatConstants.OAT_VERSION_039:
return 12 + QuickMethodFrameInfo.SIZE; return 12 + QuickMethodFrameInfo.SIZE;
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE: case OatConstants.OAT_VERSION_045:
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE: case OatConstants.OAT_VERSION_051:
case OatConstants.VERSION_MARSHMALLOW_RELEASE: case OatConstants.OAT_VERSION_064:
return 16 + QuickMethodFrameInfo.SIZE; return 16 + QuickMethodFrameInfo.SIZE;
case OatConstants.VERSION_NOUGAT_RELEASE: case OatConstants.OAT_VERSION_079:
case OatConstants.VERSION_NOUGAT_MR1_RELEASE: case OatConstants.OAT_VERSION_088:
return 8 + QuickMethodFrameInfo.SIZE; return 8 + QuickMethodFrameInfo.SIZE;
case OatConstants.VERSION_OREO_RELEASE: case OatConstants.OAT_VERSION_124:
case OatConstants.VERSION_OREO_M2_RELEASE: case OatConstants.OAT_VERSION_131:
case OatConstants.VERSION_OREO_DR3_RELEASE: case OatConstants.OAT_VERSION_126:
case OatConstants.VERSION_PIE_RELEASE: case OatConstants.OAT_VERSION_138:
return 12 + QuickMethodFrameInfo.SIZE; return 12 + QuickMethodFrameInfo.SIZE;
case OatConstants.VERSION_10_RELEASE: case OatConstants.OAT_VERSION_170:
case OatConstants.VERSION_11_RELEASE: case OatConstants.OAT_VERSION_183:
return 8; return 8;
case OatConstants.VERSION_12_RELEASE: case OatConstants.OAT_VERSION_195:
case OatConstants.VERSION_S_V2_PREVIEW: case OatConstants.OAT_VERSION_199:
case OatConstants.VERSION_T_PREVIEW_1: case OatConstants.OAT_VERSION_220:
case OatConstants.VERSION_S_V2_BETA2: case OatConstants.OAT_VERSION_223:
case OatConstants.VERSION_13_RELEASE: case OatConstants.OAT_VERSION_225:
return 4; return 4;
} }
throw new IOException("OatQuickMethodHeader unsupported OAT version: " + oatVersion); throw new IOException("OatQuickMethodHeader unsupported OAT version: " + oatVersion);
@ -54,29 +54,29 @@ public final class OatQuickMethodHeaderFactory {
public final static OatQuickMethodHeader getOatQuickMethodHeader(BinaryReader reader, public final static OatQuickMethodHeader getOatQuickMethodHeader(BinaryReader reader,
String oatVersion) throws IOException { String oatVersion) throws IOException {
switch (oatVersion ) { switch (oatVersion ) {
case OatConstants.VERSION_LOLLIPOP_RELEASE: case OatConstants.OAT_VERSION_039:
return new OatQuickMethodHeader_Lollipop(reader); return new OatQuickMethodHeader_Lollipop(reader);
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE: case OatConstants.OAT_VERSION_045:
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE: case OatConstants.OAT_VERSION_051:
case OatConstants.VERSION_MARSHMALLOW_RELEASE: case OatConstants.OAT_VERSION_064:
return new OatQuickMethodHeader_LollipopMR1(reader); return new OatQuickMethodHeader_LollipopMR1(reader);
case OatConstants.VERSION_NOUGAT_RELEASE: case OatConstants.OAT_VERSION_079:
case OatConstants.VERSION_NOUGAT_MR1_RELEASE: case OatConstants.OAT_VERSION_088:
return new OatQuickMethodHeader_Nougat(reader); return new OatQuickMethodHeader_Nougat(reader);
case OatConstants.VERSION_OREO_RELEASE: case OatConstants.OAT_VERSION_124:
case OatConstants.VERSION_OREO_M2_RELEASE: case OatConstants.OAT_VERSION_131:
case OatConstants.VERSION_OREO_DR3_RELEASE: case OatConstants.OAT_VERSION_126:
case OatConstants.VERSION_PIE_RELEASE: case OatConstants.OAT_VERSION_138:
return new OatQuickMethodHeader_Oreo(reader); return new OatQuickMethodHeader_Oreo(reader);
case OatConstants.VERSION_10_RELEASE: case OatConstants.OAT_VERSION_170:
case OatConstants.VERSION_11_RELEASE: case OatConstants.OAT_VERSION_183:
return new OatQuickMethodHeader_Android10(reader); return new OatQuickMethodHeader_Q_R(reader);
case OatConstants.VERSION_12_RELEASE: case OatConstants.OAT_VERSION_195:
case OatConstants.VERSION_S_V2_PREVIEW: case OatConstants.OAT_VERSION_199:
case OatConstants.VERSION_T_PREVIEW_1: case OatConstants.OAT_VERSION_220:
case OatConstants.VERSION_S_V2_BETA2: case OatConstants.OAT_VERSION_223:
case OatConstants.VERSION_13_RELEASE: case OatConstants.OAT_VERSION_225:
return new OatQuickMethodHeader_Android12(reader); return new OatQuickMethodHeader_S_T(reader);
} }
throw new IOException("OatQuickMethodHeader unsupported OAT version: " + oatVersion); throw new IOException("OatQuickMethodHeader unsupported OAT version: " + oatVersion);
} }

View File

@ -22,7 +22,7 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat.h#185 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat.h#185">lollipop-release/runtime/oat.h</a>
*/ */
public class OatQuickMethodHeader_Lollipop extends OatQuickMethodHeader { public class OatQuickMethodHeader_Lollipop extends OatQuickMethodHeader {
private int mapping_table_offset_; private int mapping_table_offset_;

View File

@ -22,9 +22,11 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/oat.h#182 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/oat.h#182">lollipop-mr1-fi-release/runtime/oat.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.h#184 * <br>
* https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/oat.h#185 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.h#184">lollipop-wear-release/runtime/oat.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/oat.h#185">marshmallow-release/runtime/oat.h</a>
*/ */
public class OatQuickMethodHeader_LollipopMR1 extends OatQuickMethodHeader { public class OatQuickMethodHeader_LollipopMR1 extends OatQuickMethodHeader {
private int mapping_table_offset_; private int mapping_table_offset_;

View File

@ -22,8 +22,9 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat_quick_method_header.h#128 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat_quick_method_header.h#128">nougat-release/runtime/oat_quick_method_header.h</a>
* https://android.googlesource.com/platform/art/+/nougat-mr1-release/runtime/oat_quick_method_header.h#128 * <br>
* <a href="https://android.googlesource.com/platform/art/+/nougat-mr1-release/runtime/oat_quick_method_header.h#128">nougat-mr1-release/runtime/oat_quick_method_header.h</a>
*/ */
public class OatQuickMethodHeader_Nougat extends OatQuickMethodHeader { public class OatQuickMethodHeader_Nougat extends OatQuickMethodHeader {

View File

@ -22,10 +22,13 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_quick_method_header.h#190 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_quick_method_header.h#190">oreo-release/runtime/oat_quick_method_header.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat_quick_method_header.h#191 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat_quick_method_header.h#191 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat_quick_method_header.h#191">oreo-dr3-release/runtime/oat_quick_method_header.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat_quick_method_header.h#191 * <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat_quick_method_header.h#191">oreo-m2-release/runtime/oat_quick_method_header.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat_quick_method_header.h#191">pie-release/runtime/oat_quick_method_header.h</a>
*/ */
public class OatQuickMethodHeader_Oreo extends OatQuickMethodHeader { public class OatQuickMethodHeader_Oreo extends OatQuickMethodHeader {

View File

@ -22,15 +22,16 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat_quick_method_header.h#158 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat_quick_method_header.h#158">android10-release/runtime/oat_quick_method_header.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat_quick_method_header.h#175 * <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat_quick_method_header.h#175">android11-release/runtime/oat_quick_method_header.h</a>
*/ */
public class OatQuickMethodHeader_Android10 extends OatQuickMethodHeader { public class OatQuickMethodHeader_Q_R extends OatQuickMethodHeader {
private int vmap_table_offset_; private int vmap_table_offset_;
private int code_size_; private int code_size_;
private byte[] code_; private byte[] code_;
OatQuickMethodHeader_Android10(BinaryReader reader) throws IOException { OatQuickMethodHeader_Q_R(BinaryReader reader) throws IOException {
vmap_table_offset_ = reader.readNextInt(); vmap_table_offset_ = reader.readNextInt();
code_size_ = reader.readNextInt(); code_size_ = reader.readNextInt();
code_ = reader.readNextByteArray(code_size_); code_ = reader.readNextByteArray(code_size_);
@ -62,7 +63,7 @@ public class OatQuickMethodHeader_Android10 extends OatQuickMethodHeader {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType(OatQuickMethodHeader_Android10.class.getSimpleName(), 0); Structure structure = new StructureDataType(OatQuickMethodHeader_Q_R.class.getSimpleName(), 0);
structure.add(DWORD, "vmap_table_offset_", null); structure.add(DWORD, "vmap_table_offset_", null);
structure.add(DWORD, "code_size_", null); structure.add(DWORD, "code_size_", null);
structure.setCategoryPath(new CategoryPath("/oat")); structure.setCategoryPath(new CategoryPath("/oat"));

View File

@ -22,10 +22,11 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat_quick_method_header.h#160 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat_quick_method_header.h#160">android12-release/runtime/oat_quick_method_header.h>/a>
* * <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat_quick_method_header.h#167">android13-release/runtime/oat_quick_method_header.h</a>
*/ */
public class OatQuickMethodHeader_Android12 extends OatQuickMethodHeader { public class OatQuickMethodHeader_S_T extends OatQuickMethodHeader {
public static final int kShouldDeoptimizeMask = 0x80000000; public static final int kShouldDeoptimizeMask = 0x80000000;
public static final int kIsCodeInfoMask = 0x40000000; public static final int kIsCodeInfoMask = 0x40000000;
@ -34,7 +35,7 @@ public class OatQuickMethodHeader_Android12 extends OatQuickMethodHeader {
private int data_; private int data_;
OatQuickMethodHeader_Android12(BinaryReader reader) throws IOException { OatQuickMethodHeader_S_T(BinaryReader reader) throws IOException {
data_ = reader.readNextInt(); data_ = reader.readNextInt();
} }
@ -45,7 +46,7 @@ public class OatQuickMethodHeader_Android12 extends OatQuickMethodHeader {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = Structure structure =
new StructureDataType(OatQuickMethodHeader_Android12.class.getSimpleName(), 0); new StructureDataType(OatQuickMethodHeader_S_T.class.getSimpleName(), 0);
structure.add(DWORD, "data_", null); structure.add(DWORD, "data_", null);
structure.setCategoryPath(new CategoryPath("/oat")); structure.setCategoryPath(new CategoryPath("/oat"));
return structure; return structure;

View File

@ -23,18 +23,29 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/quick/quick_method_frame_info.h#53 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/quick/quick_method_frame_info.h#53">lollipop-release/runtime/quick/quick_method_frame_info.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/quick/quick_method_frame_info.h#54 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/quick/quick_method_frame_info.h#54 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/quick/quick_method_frame_info.h#54">lollipop-mr1-fi-release/runtime/quick/quick_method_frame_info.h</a>
* https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/quick/quick_method_frame_info.h#54 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/quick/quick_method_frame_info.h#57 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/quick/quick_method_frame_info.h#54">lollipop-wear-release/runtime/quick/quick_method_frame_info.h</a>
* https://android.googlesource.com/platform/art/+/nougat-mr1-release/runtime/quick/quick_method_frame_info.h#57 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/quick/quick_method_frame_info.h#57 * <a href="https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/quick/quick_method_frame_info.h#54">marshmallow-release/runtime/quick/quick_method_frame_info.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/quick/quick_method_frame_info.h#57 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/quick/quick_method_frame_info.h#57 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/quick/quick_method_frame_info.h#57">nougat-release/runtime/quick/quick_method_frame_info.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/quick/quick_method_frame_info.h#57 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/quick/quick_method_frame_info.h#57 * <a href="https://android.googlesource.com/platform/art/+/nougat-mr1-release/runtime/quick/quick_method_frame_info.h#57">nougat-mr1-release/runtime/quick/quick_method_frame_info.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/quick/quick_method_frame_info.h#57 * <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/quick/quick_method_frame_info.h#57">oreo-release/runtime/quick/quick_method_frame_info.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/quick/quick_method_frame_info.h#57">oreo-dr3-release/runtime/quick/quick_method_frame_info.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/quick/quick_method_frame_info.h#57">oreo-m2-release/runtime/quick/quick_method_frame_info.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/quick/quick_method_frame_info.h#57">pie-release/runtime/quick/quick_method_frame_info.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/quick/quick_method_frame_info.h#57">android10-release/runtime/quick/quick_method_frame_info.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/quick/quick_method_frame_info.h#57">android11-release/runtime/quick/quick_method_frame_info.h</a>
*/ */
public class QuickMethodFrameInfo implements StructConverter { public class QuickMethodFrameInfo implements StructConverter {

View File

@ -18,8 +18,9 @@ package ghidra.file.formats.android.oat.tlt;
import ghidra.app.util.bin.StructConverter; import ghidra.app.util.bin.StructConverter;
/** /**
* https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#161 * <a href="https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#161">oreo-release/runtime/type_lookup_table.h</a>
* https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/type_lookup_table.h#161 * <br>
* <a href="https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/type_lookup_table.h#161">oreo-m2-release/runtime/type_lookup_table.h</a>
*/ */
public abstract class TypeLookupTable implements StructConverter { public abstract class TypeLookupTable implements StructConverter {

View File

@ -23,11 +23,13 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/nougat-release/runtime/type_lookup_table.h#99 * <a href="https://android.googlesource.com/platform/art/+/nougat-release/runtime/type_lookup_table.h#99">nougat-release/runtime/type_lookup_table.h</a>
* https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#100 * <br>
* https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/type_lookup_table.h#100 * <a href="https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#100">oreo-release/runtime/type_lookup_table.h</a>
* https://android.googlesource.com/platform/art/+/pie-release/runtime/type_lookup_table.h#102 * <br>
* * <a href="https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/type_lookup_table.h#100">oreo-m2-release/runtime/type_lookup_table.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/pie-release/runtime/type_lookup_table.h#102">pie-release/runtime/type_lookup_table.h</a>
*/ */
public class TypeLookupTableEntry implements StructConverter { public class TypeLookupTableEntry implements StructConverter {

View File

@ -22,13 +22,17 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/libdexfile/dex/type_lookup_table.h#110 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/libdexfile/dex/type_lookup_table.h#110">android10-release/libdexfile/dex/type_lookup_table.h</a>
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/libdexfile/dex/type_lookup_table.h#110 * <br>
* https://android.googlesource.com/platform/art/+/refs/heads/android12-release/libdexfile/dex/type_lookup_table.h#110 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/libdexfile/dex/type_lookup_table.h#110">android11-release/libdexfile/dex/type_lookup_table.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/libdexfile/dex/type_lookup_table.h#110">android12-release/libdexfile/dex/type_lookup_table.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/libdexfile/dex/type_lookup_table.h#112">android13-release/libdexfile/dex/type_lookup_table.h</a>
*/ */
public class TypeLookupTableEntry_Android10 extends TypeLookupTableEntry { public class TypeLookupTableEntry_Q_R_S_T extends TypeLookupTableEntry {
public TypeLookupTableEntry_Android10(BinaryReader reader) throws IOException { public TypeLookupTableEntry_Q_R_S_T(BinaryReader reader) throws IOException {
super(); super();
str_offset_ = reader.readNextInt(); str_offset_ = reader.readNextInt();
data_ = reader.readNextInt(); data_ = reader.readNextInt();
@ -50,7 +54,7 @@ public class TypeLookupTableEntry_Android10 extends TypeLookupTableEntry {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType(TypeLookupTableEntry_Android10.class.getSimpleName(), 0); Structure structure = new StructureDataType(TypeLookupTableEntry_Q_R_S_T.class.getSimpleName(), 0);
structure.add(DWORD, "str_offset_", null); structure.add(DWORD, "str_offset_", null);
structure.add(DWORD, "data_", null); structure.add(DWORD, "data_", null);
structure.setCategoryPath(new CategoryPath("/oat")); structure.setCategoryPath(new CategoryPath("/oat"));

View File

@ -27,25 +27,25 @@ public final class TypeLookupTableFactory {
throws IOException { throws IOException {
switch (oatVersion) { switch (oatVersion) {
case OatConstants.VERSION_NOUGAT_RELEASE: case OatConstants.OAT_VERSION_079:
case OatConstants.VERSION_NOUGAT_MR1_RELEASE: case OatConstants.OAT_VERSION_088:
return new TypeLookupTable_Nougat(reader); return new TypeLookupTable_Nougat(reader);
case OatConstants.VERSION_OREO_RELEASE: case OatConstants.OAT_VERSION_124:
case OatConstants.VERSION_OREO_M2_RELEASE: case OatConstants.OAT_VERSION_131:
case OatConstants.VERSION_OREO_DR3_RELEASE: case OatConstants.OAT_VERSION_126:
return new TypeLookupTable_Oreo(reader); return new TypeLookupTable_Oreo(reader);
case OatConstants.VERSION_PIE_RELEASE: case OatConstants.OAT_VERSION_138:
return new TypeLookupTable_Pie(reader); return new TypeLookupTable_Pie(reader);
case OatConstants.VERSION_10_RELEASE: case OatConstants.OAT_VERSION_170:
return new TypeLookupTable_Android10(reader); return new TypeLookupTable_Q(reader);
case OatConstants.VERSION_11_RELEASE: case OatConstants.OAT_VERSION_183:
return new TypeLookupTable_Android11(reader); return new TypeLookupTable_R(reader);
case OatConstants.VERSION_12_RELEASE: case OatConstants.OAT_VERSION_195:
case OatConstants.VERSION_S_V2_PREVIEW: case OatConstants.OAT_VERSION_199:
case OatConstants.VERSION_T_PREVIEW_1: case OatConstants.OAT_VERSION_220:
case OatConstants.VERSION_S_V2_BETA2: case OatConstants.OAT_VERSION_223:
case OatConstants.VERSION_13_RELEASE: case OatConstants.OAT_VERSION_225:
return new TypeLookupTable_Android12(reader); return new TypeLookupTable_S_T(reader);
default: default:
throw new IOException(new UnsupportedOatVersionException( throw new IOException(new UnsupportedOatVersionException(
"Unsupported TypeLookupTable for OAT version " + oatVersion)); "Unsupported TypeLookupTable for OAT version " + oatVersion));

View File

@ -24,7 +24,7 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/nougat-release/runtime/type_lookup_table.h * <a href="https://android.googlesource.com/platform/art/+/nougat-release/runtime/type_lookup_table.h">nougat-release/runtime/type_lookup_table.h</a>
*/ */
public class TypeLookupTable_Nougat extends TypeLookupTable { public class TypeLookupTable_Nougat extends TypeLookupTable {

View File

@ -24,8 +24,9 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#161 * <a href="https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#161">oreo-release/runtime/type_lookup_table.h</a>
* https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/type_lookup_table.h#161 * <br>
* <a href="https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/type_lookup_table.h#161">oreo-m2-release/runtime/type_lookup_table.h</a>
*/ */
public class TypeLookupTable_Oreo extends TypeLookupTable { public class TypeLookupTable_Oreo extends TypeLookupTable {

View File

@ -24,8 +24,9 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#161 * <a href="https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#161">oreo-release/runtime/type_lookup_table.h</a>
* https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/type_lookup_table.h#161 * <br>
* <a href="https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/type_lookup_table.h#161">oreo-m2-release/runtime/type_lookup_table.h</a>
*/ */
public class TypeLookupTable_Pie extends TypeLookupTable { public class TypeLookupTable_Pie extends TypeLookupTable {

View File

@ -24,9 +24,9 @@ import ghidra.program.model.data.*;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/libdexfile/dex/type_lookup_table.h#35 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/libdexfile/dex/type_lookup_table.h#35">android10-release/libdexfile/dex/type_lookup_table.h</a>
*/ */
public class TypeLookupTable_Android10 extends TypeLookupTable { public class TypeLookupTable_Q extends TypeLookupTable {
private int dex_file_begin_; private int dex_file_begin_;
private int mask_bits_; private int mask_bits_;
@ -35,14 +35,14 @@ public class TypeLookupTable_Android10 extends TypeLookupTable {
protected List<TypeLookupTableEntry> entryList = new ArrayList<>(); protected List<TypeLookupTableEntry> entryList = new ArrayList<>();
public TypeLookupTable_Android10(BinaryReader reader) throws IOException { public TypeLookupTable_Q(BinaryReader reader) throws IOException {
dex_file_begin_ = reader.readNextInt(); dex_file_begin_ = reader.readNextInt();
mask_bits_ = reader.readNextInt(); mask_bits_ = reader.readNextInt();
entries_ = reader.readNextInt(); entries_ = reader.readNextInt();
owns_entries_ = reader.readNextInt(); owns_entries_ = reader.readNextInt();
while (true) { while (true) {
TypeLookupTableEntry entry = new TypeLookupTableEntry_Android10(reader); TypeLookupTableEntry entry = new TypeLookupTableEntry_Q_R_S_T(reader);
entryList.add(entry); entryList.add(entry);
if (entry.isEmpty()) { if (entry.isEmpty()) {
break; break;
@ -76,7 +76,7 @@ public class TypeLookupTable_Android10 extends TypeLookupTable {
@Override @Override
public DataType toDataType() throws DuplicateNameException, IOException { public DataType toDataType() throws DuplicateNameException, IOException {
Structure structure = new StructureDataType( Structure structure = new StructureDataType(
TypeLookupTable_Android10.class.getSimpleName() + "_" + entryList.size(), 0); TypeLookupTable_Q.class.getSimpleName() + "_" + entryList.size(), 0);
structure.add(DWORD, "dex_file_begin_", null); structure.add(DWORD, "dex_file_begin_", null);
structure.add(DWORD, "mask_bits_", null); structure.add(DWORD, "mask_bits_", null);
structure.add(DWORD, "entries_", null); structure.add(DWORD, "entries_", null);

View File

@ -22,12 +22,11 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/libdexfile/dex/type_lookup_table.h#35 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/libdexfile/dex/type_lookup_table.h#35">android11-release/libdexfile/dex/type_lookup_table.h</a>
*
*/ */
public class TypeLookupTable_Android11 extends TypeLookupTable_Android10 { public class TypeLookupTable_R extends TypeLookupTable_Q {
public TypeLookupTable_Android11(BinaryReader reader) throws IOException { public TypeLookupTable_R(BinaryReader reader) throws IOException {
super(reader); super(reader);
} }
@ -36,7 +35,7 @@ public class TypeLookupTable_Android11 extends TypeLookupTable_Android10 {
DataType dataType = super.toDataType(); DataType dataType = super.toDataType();
try { try {
dataType.setName( dataType.setName(
TypeLookupTable_Android11.class.getSimpleName() + "_" + entryList.size()); TypeLookupTable_R.class.getSimpleName() + "_" + entryList.size());
} }
catch (Exception e) { catch (Exception e) {
//ignore //ignore

View File

@ -22,11 +22,13 @@ import ghidra.program.model.data.DataType;
import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.DuplicateNameException;
/** /**
* https://android.googlesource.com/platform/art/+/refs/heads/android12-release/libdexfile/dex/type_lookup_table.h#35 * <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/libdexfile/dex/type_lookup_table.h#35">android12-release/libdexfile/dex/type_lookup_table.h</a>
* <br>
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/libdexfile/dex/type_lookup_table.h#35">android13-release/libdexfile/dex/type_lookup_table.h</a>
*/ */
public class TypeLookupTable_Android12 extends TypeLookupTable_Android10 { public class TypeLookupTable_S_T extends TypeLookupTable_Q {
public TypeLookupTable_Android12(BinaryReader reader) throws IOException { public TypeLookupTable_S_T(BinaryReader reader) throws IOException {
super(reader); super(reader);
} }
@ -35,7 +37,7 @@ public class TypeLookupTable_Android12 extends TypeLookupTable_Android10 {
DataType dataType = super.toDataType(); DataType dataType = super.toDataType();
try { try {
dataType.setName( dataType.setName(
TypeLookupTable_Android12.class.getSimpleName() + "_" + entryList.size()); TypeLookupTable_S_T.class.getSimpleName() + "_" + entryList.size());
} }
catch (Exception e) { catch (Exception e) {
//ignore //ignore