mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-10-23 13:41:04 +00:00
Renamed and reorganized OAT classes.
This commit is contained in:
parent
f94a2d6058
commit
25840cf121
|
@ -67,94 +67,94 @@ public final class OatConstants {
|
|||
// NOTE: we plan to only support RELEASE versions...
|
||||
// Upper case indicates supported version.
|
||||
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat.cc#24 */
|
||||
public final static String VERSION_KITKAT_RELEASE = "007";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/kitkat-dev/runtime/oat.cc#24 */
|
||||
public final static String version_kitkat_dev = "008";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat.cc#25 */
|
||||
public final static String VERSION_LOLLIPOP_RELEASE = "039";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-release/runtime/oat.cc#25 */
|
||||
public final static String VERSION_LOLLIPOP_MR1_FI_RELEASE = "045";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.cc#27 */
|
||||
public final static String VERSION_LOLLIPOP_WEAR_RELEASE = "051";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_MARSHMALLOW_RELEASE = "064";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_NOUGAT_RELEASE = "079";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/n-iot-preview-2/runtime/oat.h#34 */
|
||||
public final static String version_n_iot_preview_2 = "083";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr1-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_NOUGAT_MR1_RELEASE = "088";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/o-preview/runtime/oat.h#34 */
|
||||
public final static String version_o_preview = "114";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_OREO_RELEASE = "124";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/n-iot-preview-4/runtime/oat.h#34 */
|
||||
public final static String version_n_iot_preview_4 = "125";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_OREO_DR3_RELEASE = "126";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_OREO_M2_RELEASE = "131";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/o-iot-preview-5/runtime/oat.h#34 */
|
||||
public final static String version_o_iot_preview_5 = "132";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-6/runtime/oat.h#34 */
|
||||
public final static String version_o_mr1_iot_preview_6 = "135";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_PIE_RELEASE = "138";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-7/runtime/oat.h#34 */
|
||||
public final static String version_o_mr1_iot_preview_7 = "139";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-8/runtime/oat.h#34 */
|
||||
public final static String version_o_mr1_iot_preview_8 = "140";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/tags/android-o-mr1-iot-release-1.0.0/runtime/oat.h#34 */
|
||||
public final static String version_o_mr1_iot_release_1_0_0 = "141";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/tags/android-o-mr1-iot-release-1.0.1/runtime/oat.h#34 */
|
||||
public final static String version_o_mr1_iot_release_1_0_1 = "146";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/tags/android-n-iot-release-polk-at1/runtime/oat.h#34 */
|
||||
public final static String version_n_iot_release_polk_at1 = "147";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/tags/android-q-preview-1/runtime/oat.h#33 */
|
||||
public final static String version_q_preview_1 = "166";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_10_RELEASE = "170";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat.h#34 */
|
||||
public final static String VERSION_11_RELEASE = "183";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat.h#36 */
|
||||
public final static String VERSION_12_RELEASE = "195";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/oat.h#36 */
|
||||
public final static String VERSION_S_BETA4 = "197";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-preview-1/runtime/oat.h#36 */
|
||||
public final static String VERSION_S_V2_PREVIEW = "199";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android-t-preview-1/runtime/oat.h#36 */
|
||||
public final static String VERSION_T_PREVIEW_1 = "220";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-beta-3/runtime/oat.h#36 */
|
||||
public final static String VERSION_S_V2_BETA2 = "223";
|
||||
/** https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat.h#36 */
|
||||
public final static String VERSION_13_RELEASE = "225";
|
||||
/** https://android.googlesource.com/platform/art/+/master/runtime/oat.h#36 */
|
||||
public final static String VERSION_227 = "227";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat.cc#24">kitkat-release/runtime/oat.cc</a> */
|
||||
public final static String OAT_VERSION_007 = "007";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-dev/runtime/oat.cc#24">kitkat-dev/runtime/oat.cc</a> */
|
||||
public final static String oat_version_008 = "008";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat.cc#25">lollipop-release/runtime/oat.cc</a> */
|
||||
public final static String OAT_VERSION_039 = "039";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-release/runtime/oat.cc#25">lollipop-mr1-release/runtime/oat.cc</a> */
|
||||
public final static String OAT_VERSION_045 = "045";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.cc#27">lollipop-wear-release/runtime/oat.cc</a> */
|
||||
public final static String OAT_VERSION_051 = "051";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat.h#34">marshmallow-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_064 = "064";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat.h#34">nougat-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_079 = "079";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/n-iot-preview-2/runtime/oat.h#34">n-iot-preview-2/runtime/oat.h</a> */
|
||||
public final static String oat_version_083 = "083";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr1-release/runtime/oat.h#34">nougat-mr1-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_088 = "088";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/o-preview/runtime/oat.h#34">o-preview/runtime/oat.h</a> */
|
||||
public final static String oat_version_114 = "114";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat.h#34">oreo-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_124 = "124";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/n-iot-preview-4/runtime/oat.h#34">n-iot-preview-4/runtime/oat.h</a> */
|
||||
public final static String oat_version_125 = "125";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat.h#34">oreo-dr3-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_126 = "126";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat.h#34">oreo-m2-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_131 = "131";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/o-iot-preview-5/runtime/oat.h#34">o-iot-preview-5/runtime/oat.h</a> */
|
||||
public final static String oat_version_132 = "132";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-6/runtime/oat.h#34">o-mr1-iot-preview-6/runtime/oat.h</a> */
|
||||
public final static String oat_version_135 = "135";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h#34">pie-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_138 = "138";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-7/runtime/oat.h#34">o-mr1-iot-preview-7/runtime/oat.h</a> */
|
||||
public final static String oat_version_139 = "139";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/o-mr1-iot-preview-8/runtime/oat.h#34">o-mr1-iot-preview-8/runtime/oat.h</a> */
|
||||
public final static String oat_version_140 = "140";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/tags/android-o-mr1-iot-release-1.0.0/runtime/oat.h#34">android-o-mr1-iot-release-1.0.0/runtime/oat.h</a> */
|
||||
public final static String oat_version_141 = "141";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/tags/android-o-mr1-iot-release-1.0.1/runtime/oat.h#34">android-o-mr1-iot-release-1.0.1/runtime/oat.h</a> */
|
||||
public final static String oat_version_146 = "146";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/tags/android-n-iot-release-polk-at1/runtime/oat.h#34">android-n-iot-release-polk-at1/runtime/oat.h</a> */
|
||||
public final static String oat_version_147 = "147";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/tags/android-q-preview-1/runtime/oat.h#33">android-q-preview-1/runtime/oat.h</a> */
|
||||
public final static String oat_version_166 = "166";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat.h#3"4>android10-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_170 = "170";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat.h#34">android11-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_183 = "183";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat.h#3"6>android12-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_195 = "195";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-4/runtime/oat.h#36">android-s-beta-4/runtime/oat.h</a> */
|
||||
public final static String oat_version_197 = "197";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-preview-1/runtime/oat.h#36">android-s-v2-preview-1/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_199 = "199";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-t-preview-1/runtime/oat.h#36">android-t-preview-1/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_220 = "220";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-beta-3/runtime/oat.h#36">android-s-v2-beta-3/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_223 = "223";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat.h#36">android13-release/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_225 = "225";
|
||||
/** <a href="https://android.googlesource.com/platform/art/+/master/runtime/oat.h#36">master/runtime/oat.h</a> */
|
||||
public final static String OAT_VERSION_227 = "227";
|
||||
|
||||
/**
|
||||
* This array contains versions that have been actively tested and verified.
|
||||
* All other versions will be considered unsupported until tested on exemplar firmware.
|
||||
*/
|
||||
public final static String [] SUPPORTED_VERSIONS = new String [] {
|
||||
VERSION_KITKAT_RELEASE,
|
||||
VERSION_LOLLIPOP_RELEASE,
|
||||
VERSION_LOLLIPOP_MR1_FI_RELEASE,
|
||||
VERSION_LOLLIPOP_WEAR_RELEASE,
|
||||
VERSION_MARSHMALLOW_RELEASE,
|
||||
VERSION_NOUGAT_RELEASE,
|
||||
VERSION_NOUGAT_MR1_RELEASE,
|
||||
VERSION_OREO_RELEASE,
|
||||
VERSION_OREO_DR3_RELEASE,
|
||||
VERSION_OREO_M2_RELEASE,
|
||||
VERSION_PIE_RELEASE,
|
||||
VERSION_10_RELEASE,
|
||||
VERSION_11_RELEASE,
|
||||
VERSION_12_RELEASE,
|
||||
VERSION_S_V2_PREVIEW,
|
||||
VERSION_T_PREVIEW_1,
|
||||
VERSION_S_V2_BETA2,
|
||||
VERSION_13_RELEASE,
|
||||
OAT_VERSION_007,
|
||||
OAT_VERSION_039,
|
||||
OAT_VERSION_045,
|
||||
OAT_VERSION_051,
|
||||
OAT_VERSION_064,
|
||||
OAT_VERSION_079,
|
||||
OAT_VERSION_088,
|
||||
OAT_VERSION_124,
|
||||
OAT_VERSION_126,
|
||||
OAT_VERSION_131,
|
||||
OAT_VERSION_138,
|
||||
OAT_VERSION_170,
|
||||
OAT_VERSION_183,
|
||||
OAT_VERSION_195,
|
||||
OAT_VERSION_199,
|
||||
OAT_VERSION_220,
|
||||
OAT_VERSION_223,
|
||||
OAT_VERSION_225,
|
||||
};
|
||||
|
||||
//@formatter:on
|
||||
|
|
|
@ -23,6 +23,8 @@ import ghidra.app.util.bin.StructConverter;
|
|||
import ghidra.file.formats.android.oat.bundle.OatBundle;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFileFactory;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* Base OatHeader implementations
|
||||
|
@ -142,4 +144,13 @@ public abstract class OatHeader implements StructConverter {
|
|||
*/
|
||||
abstract public int getChecksum();
|
||||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure =
|
||||
new StructureDataType(OatHeader.class.getSimpleName() + "_" + version, 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
structure.setCategoryPath(new CategoryPath("/oat"));
|
||||
return structure;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ public class OatHeaderAnalyzer extends FileFormatAnalyzer {
|
|||
monitor.setMessage("Annotating OAT Patches...");
|
||||
Memory memory = program.getMemory();
|
||||
|
||||
if (oatHeader.getVersion().equals(OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE)) {
|
||||
if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_045)) {
|
||||
MemoryBlock oatBlock = memory.getBlock(OatConstants.DOT_OAT_PATCHES_SECTION_NAME);
|
||||
MemoryBlock destinationBlock = findOatPatchesDestinationBlock(program, oatBlock);
|
||||
if (oatBlock == null || destinationBlock == null) {
|
||||
|
@ -207,16 +207,16 @@ public class OatHeaderAnalyzer extends FileFormatAnalyzer {
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (oatHeader.getVersion().equals(OatConstants.VERSION_MARSHMALLOW_RELEASE)) {
|
||||
else if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_064)) {
|
||||
//TODO
|
||||
}
|
||||
else if (oatHeader.getVersion().equals(OatConstants.VERSION_NOUGAT_MR1_RELEASE)) {
|
||||
else if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_088)) {
|
||||
//TODO
|
||||
}
|
||||
else if (oatHeader.getVersion().equals(OatConstants.VERSION_OREO_RELEASE)) {
|
||||
else if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_124)) {
|
||||
//TODO
|
||||
}
|
||||
else if (oatHeader.getVersion().equals(OatConstants.VERSION_OREO_M2_RELEASE)) {
|
||||
else if (oatHeader.getVersion().equals(OatConstants.OAT_VERSION_131)) {
|
||||
//TODO
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import ghidra.app.util.bin.BinaryReader;
|
|||
import ghidra.app.util.importer.MessageLog;
|
||||
import ghidra.file.formats.android.oat.bundle.OatBundle;
|
||||
import ghidra.file.formats.android.oat.bundle.OatBundleFactory;
|
||||
import ghidra.file.formats.android.oat.headers.*;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
|
@ -40,35 +41,42 @@ public final class OatHeaderFactory {
|
|||
if (magic.equals(OatConstants.MAGIC)) {
|
||||
if (OatConstants.isSupportedVersion(version)) {
|
||||
switch (version) {
|
||||
case OatConstants.VERSION_KITKAT_RELEASE:
|
||||
return new OatHeader_KitKat(reader);
|
||||
case OatConstants.VERSION_LOLLIPOP_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE:
|
||||
return new OatHeader_Lollipop(reader);
|
||||
case OatConstants.VERSION_MARSHMALLOW_RELEASE:
|
||||
return new OatHeader_Marshmallow(reader);
|
||||
case OatConstants.VERSION_NOUGAT_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_MR1_RELEASE:
|
||||
return new OatHeader_Nougat(reader);
|
||||
case OatConstants.VERSION_OREO_RELEASE:
|
||||
case OatConstants.VERSION_OREO_DR3_RELEASE:
|
||||
return new OatHeader_Oreo(reader);//v124 and v126 are same format
|
||||
case OatConstants.VERSION_OREO_M2_RELEASE:
|
||||
return new OatHeader_Oreo_M2(reader);
|
||||
case OatConstants.VERSION_PIE_RELEASE:
|
||||
return new OatHeader_Pie(reader);
|
||||
case OatConstants.VERSION_10_RELEASE:
|
||||
return new OatHeader_10(reader);
|
||||
case OatConstants.VERSION_11_RELEASE:
|
||||
return new OatHeader_11(reader);
|
||||
case OatConstants.VERSION_12_RELEASE:
|
||||
case OatConstants.VERSION_S_V2_PREVIEW:
|
||||
case OatConstants.VERSION_T_PREVIEW_1:
|
||||
case OatConstants.VERSION_S_V2_BETA2:
|
||||
return new OatHeader_12(reader);
|
||||
case OatConstants.VERSION_13_RELEASE:
|
||||
return new OatHeader_13(reader);
|
||||
case OatConstants.OAT_VERSION_007:
|
||||
return new OatHeader_007(reader);
|
||||
case OatConstants.OAT_VERSION_039:
|
||||
return new OatHeader_039(reader);
|
||||
case OatConstants.OAT_VERSION_045:
|
||||
return new OatHeader_045(reader);
|
||||
case OatConstants.OAT_VERSION_051:
|
||||
return new OatHeader_051(reader);
|
||||
case OatConstants.OAT_VERSION_064:
|
||||
return new OatHeader_064(reader);
|
||||
case OatConstants.OAT_VERSION_079:
|
||||
return new OatHeader_079(reader);
|
||||
case OatConstants.OAT_VERSION_088:
|
||||
return new OatHeader_088(reader);
|
||||
case OatConstants.OAT_VERSION_124:
|
||||
return new OatHeader_124(reader);
|
||||
case OatConstants.OAT_VERSION_126:
|
||||
return new OatHeader_126(reader);
|
||||
case OatConstants.OAT_VERSION_131:
|
||||
return new OatHeader_131(reader);
|
||||
case OatConstants.OAT_VERSION_138:
|
||||
return new OatHeader_138(reader);
|
||||
case OatConstants.OAT_VERSION_170:
|
||||
return new OatHeader_170(reader);
|
||||
case OatConstants.OAT_VERSION_183:
|
||||
return new OatHeader_183(reader);
|
||||
case OatConstants.OAT_VERSION_195:
|
||||
return new OatHeader_195(reader);
|
||||
case OatConstants.OAT_VERSION_199:
|
||||
return new OatHeader_199(reader);
|
||||
case OatConstants.OAT_VERSION_220:
|
||||
return new OatHeader_220(reader);
|
||||
case OatConstants.OAT_VERSION_223:
|
||||
return new OatHeader_223(reader);
|
||||
case OatConstants.OAT_VERSION_225:
|
||||
return new OatHeader_225(reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,19 +13,24 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.bundle.OatBundle;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public class OatHeader_KitKat extends OatHeader {
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat.cc#24">kitkat-release/runtime/oat.cc</a>
|
||||
*/
|
||||
public class OatHeader_007 extends OatHeader {
|
||||
|
||||
protected int adler32_checksum_;
|
||||
protected int instruction_set_;
|
||||
|
@ -41,7 +46,7 @@ public class OatHeader_KitKat extends OatHeader {
|
|||
protected int image_file_location_size_;
|
||||
protected byte[] image_file_location_data_; // note variable width data at end
|
||||
|
||||
OatHeader_KitKat(BinaryReader reader) throws IOException {
|
||||
public OatHeader_007(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
adler32_checksum_ = reader.readNextInt();
|
||||
instruction_set_ = reader.readNextInt();
|
||||
|
@ -134,9 +139,8 @@ public class OatHeader_KitKat extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_KitKat.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "adler32_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "dex_file_count_", null);
|
|
@ -13,20 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/oat.h
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat.cc#25">lollipop-release/runtime/oat.cc</a>
|
||||
*/
|
||||
public class OatHeader_Lollipop extends OatHeader {
|
||||
public class OatHeader_039 extends OatHeader {
|
||||
|
||||
protected int adler32_checksum_;
|
||||
protected int instruction_set_;
|
||||
|
@ -48,7 +50,7 @@ public class OatHeader_Lollipop extends OatHeader {
|
|||
protected int image_file_location_oat_data_begin_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_Lollipop(BinaryReader reader) throws IOException {
|
||||
public OatHeader_039(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
adler32_checksum_ = reader.readNextInt();
|
||||
instruction_set_ = reader.readNextInt();
|
||||
|
@ -109,9 +111,8 @@ public class OatHeader_Lollipop extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_Lollipop.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "adler32_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_", null);
|
|
@ -13,29 +13,17 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.program.model.data.DataType;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public class OatHeader_Oreo extends OatHeader_Marshmallow {
|
||||
|
||||
OatHeader_Oreo(BinaryReader reader) throws IOException {
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-release/runtime/oat.cc#25">lollipop-mr1-release/runtime/oat.cc</a>
|
||||
*/
|
||||
public class OatHeader_045 extends OatHeader_039 {
|
||||
public OatHeader_045(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
dataType.setName(OatHeader_Oreo.class.getSimpleName());
|
||||
}
|
||||
catch (Exception e) {
|
||||
//ignore
|
||||
}
|
||||
return dataType;
|
||||
}
|
||||
}
|
|
@ -13,29 +13,17 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.program.model.data.DataType;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public class OatHeader_Nougat extends OatHeader_Marshmallow {
|
||||
|
||||
OatHeader_Nougat(BinaryReader reader) throws IOException {
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.cc#27">lollipop-wear-release/runtime/oat.cc</a>
|
||||
*/
|
||||
public class OatHeader_051 extends OatHeader_039 {
|
||||
public OatHeader_051(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
dataType.setName(OatHeader_Nougat.class.getSimpleName());
|
||||
}
|
||||
catch (Exception e) {
|
||||
//ignore
|
||||
}
|
||||
return dataType;
|
||||
}
|
||||
}
|
|
@ -13,20 +13,23 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat.h#34">marshmallow-release/runtime/oat.h</a>
|
||||
*/
|
||||
class OatHeader_Marshmallow extends OatHeader {
|
||||
public class OatHeader_064 extends OatHeader {
|
||||
|
||||
protected int adler32_checksum_;
|
||||
protected int instruction_set_;
|
||||
|
@ -45,7 +48,7 @@ class OatHeader_Marshmallow extends OatHeader {
|
|||
protected int image_file_location_oat_data_begin_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_Marshmallow(BinaryReader reader) throws IOException {
|
||||
public OatHeader_064(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
adler32_checksum_ = reader.readNextInt();
|
||||
|
@ -69,7 +72,7 @@ class OatHeader_Marshmallow extends OatHeader {
|
|||
@Override
|
||||
public int getOatDexFilesOffset(BinaryReader reader) {
|
||||
//the DEX offset is the current reader offset!
|
||||
return (int)reader.getPointerIndex();
|
||||
return (int) reader.getPointerIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,9 +135,8 @@ class OatHeader_Marshmallow extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_Marshmallow.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "adler32_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -0,0 +1,29 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat.h#34">nougat-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_079 extends OatHeader_064 {
|
||||
public OatHeader_079(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr1-release/runtime/oat.h#34">nougat-mr1-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_088 extends OatHeader_064 {
|
||||
public OatHeader_088(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat.h#34">oreo-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_124 extends OatHeader_064 {
|
||||
public OatHeader_124(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat.h#34">oreo-dr3-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_126 extends OatHeader_064 {
|
||||
public OatHeader_126(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -13,20 +13,23 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat.h#34">oreo-m2-release/runtime/oat.h</a>
|
||||
*/
|
||||
class OatHeader_Oreo_M2 extends OatHeader {
|
||||
public class OatHeader_131 extends OatHeader {
|
||||
|
||||
protected int adler32_checksum_;
|
||||
protected int instruction_set_;
|
||||
|
@ -46,7 +49,7 @@ class OatHeader_Oreo_M2 extends OatHeader {
|
|||
protected int image_file_location_oat_data_begin_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_Oreo_M2(BinaryReader reader) throws IOException {
|
||||
public OatHeader_131(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
adler32_checksum_ = reader.readNextInt();
|
||||
|
@ -133,9 +136,8 @@ class OatHeader_Oreo_M2 extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_Oreo_M2.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "adler32_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -13,20 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h#34">pie-release/runtime/oat.h</a>
|
||||
*/
|
||||
class OatHeader_Pie extends OatHeader {
|
||||
public class OatHeader_138 extends OatHeader {
|
||||
|
||||
protected int adler32_checksum_;
|
||||
protected int instruction_set_;
|
||||
|
@ -46,7 +48,7 @@ class OatHeader_Pie extends OatHeader {
|
|||
protected int image_file_location_oat_data_begin_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_Pie(BinaryReader reader) throws IOException {
|
||||
public OatHeader_138(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
adler32_checksum_ = reader.readNextInt();
|
||||
instruction_set_ = reader.readNextInt();
|
||||
|
@ -104,9 +106,8 @@ class OatHeader_Pie extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_Pie.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "adler32_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -13,17 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public class OatHeader_10 extends OatHeader {
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat.h#3"4>android10-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_170 extends OatHeader {
|
||||
protected int oat_checksum_;
|
||||
protected int instruction_set_;
|
||||
protected int instruction_set_features_bitmap_;
|
||||
|
@ -37,7 +42,7 @@ public class OatHeader_10 extends OatHeader {
|
|||
protected int quick_to_interpreter_bridge_offset_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_10(BinaryReader reader) throws IOException {
|
||||
public OatHeader_170(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
oat_checksum_ = reader.readNextInt();
|
||||
|
@ -91,9 +96,8 @@ public class OatHeader_10 extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_10.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "oat_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -13,17 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
public class OatHeader_11 extends OatHeader {
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat.h#34">android11-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_183 extends OatHeader {
|
||||
protected int oat_checksum_;
|
||||
protected int instruction_set_;
|
||||
protected int instruction_set_features_bitmap_;
|
||||
|
@ -38,7 +43,7 @@ public class OatHeader_11 extends OatHeader {
|
|||
protected int quick_to_interpreter_bridge_offset_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_11(BinaryReader reader) throws IOException {
|
||||
public OatHeader_183(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
oat_checksum_ = reader.readNextInt();
|
||||
|
@ -93,9 +98,8 @@ public class OatHeader_11 extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_11.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "oat_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -13,24 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/oat.h#125
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat.h#125
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-preview-1/runtime/oat.h#125
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat.h#3"6>android12-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_12 extends OatHeader {
|
||||
public class OatHeader_195 extends OatHeader {
|
||||
protected int oat_checksum_;
|
||||
protected int instruction_set_;
|
||||
protected int instruction_set_features_bitmap_;
|
||||
|
@ -46,7 +44,7 @@ public class OatHeader_12 extends OatHeader {
|
|||
protected int nterp_trampoline_offset_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_12(BinaryReader reader) throws IOException {
|
||||
public OatHeader_195(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
oat_checksum_ = reader.readNextInt();
|
||||
|
@ -102,9 +100,8 @@ public class OatHeader_12 extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_12.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "oat_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -0,0 +1,29 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-preview-1/runtime/oat.h#36">android-s-v2-preview-1/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_199 extends OatHeader_195 {
|
||||
public OatHeader_199(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-t-preview-1/runtime/oat.h#36">android-t-preview-1/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_220 extends OatHeader_195 {
|
||||
public OatHeader_220(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
|
||||
/**
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-v2-beta-3/runtime/oat.h#36">android-s-v2-beta-3/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_223 extends OatHeader_195 {
|
||||
public OatHeader_223(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
}
|
||||
}
|
|
@ -13,20 +13,22 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.file.formats.android.oat;
|
||||
package ghidra.file.formats.android.oat.headers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import ghidra.app.util.bin.BinaryReader;
|
||||
import ghidra.file.formats.android.oat.OatHeader;
|
||||
import ghidra.file.formats.android.oat.OatInstructionSet;
|
||||
import ghidra.file.formats.android.oat.oatdexfile.OatDexFile;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat.h#127
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat.h#36">android13-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatHeader_13 extends OatHeader {
|
||||
public class OatHeader_225 extends OatHeader {
|
||||
protected int oat_checksum_;
|
||||
protected int instruction_set_;
|
||||
protected int instruction_set_features_bitmap_;
|
||||
|
@ -43,7 +45,7 @@ public class OatHeader_13 extends OatHeader {
|
|||
protected int nterp_trampoline_offset_;
|
||||
protected int key_value_store_size_;
|
||||
|
||||
OatHeader_13(BinaryReader reader) throws IOException {
|
||||
public OatHeader_225(BinaryReader reader) throws IOException {
|
||||
super(reader);
|
||||
|
||||
oat_checksum_ = reader.readNextInt();
|
||||
|
@ -100,9 +102,8 @@ public class OatHeader_13 extends OatHeader {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure = new StructureDataType(OatHeader_13.class.getSimpleName(), 0);
|
||||
structure.add(STRING, 4, "magic_", null);
|
||||
structure.add(STRING, 4, "version_", null);
|
||||
Structure structure = (Structure) super.toDataType();
|
||||
|
||||
structure.add(DWORD, "oat_checksum_", null);
|
||||
structure.add(DWORD, OatInstructionSet.DISPLAY_NAME, null);
|
||||
structure.add(DWORD, "instruction_set_features_bitmap_", null);
|
|
@ -49,39 +49,39 @@ public abstract class OatClass implements StructConverter {
|
|||
status_ = reader.readNextShort();
|
||||
|
||||
switch (oatVersion) {
|
||||
case OatConstants.VERSION_KITKAT_RELEASE: {
|
||||
case OatConstants.OAT_VERSION_007: {
|
||||
statusEnum = OatClassStatusEnum_K.kStatusInitialized.get(status_);
|
||||
break;
|
||||
}
|
||||
case OatConstants.VERSION_LOLLIPOP_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE:
|
||||
case OatConstants.VERSION_MARSHMALLOW_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_MR1_RELEASE: {
|
||||
case OatConstants.OAT_VERSION_039:
|
||||
case OatConstants.OAT_VERSION_045:
|
||||
case OatConstants.OAT_VERSION_051:
|
||||
case OatConstants.OAT_VERSION_064:
|
||||
case OatConstants.OAT_VERSION_079:
|
||||
case OatConstants.OAT_VERSION_088: {
|
||||
statusEnum = OatClassStatusEnum_L_M_N.kStatusMax.get(status_);
|
||||
break;
|
||||
}
|
||||
case OatConstants.VERSION_OREO_RELEASE: {
|
||||
case OatConstants.OAT_VERSION_124: {
|
||||
statusEnum = OatClassStatusEnum_O.kStatusMax.get(status_);
|
||||
break;
|
||||
}
|
||||
case OatConstants.VERSION_OREO_M2_RELEASE: {
|
||||
case OatConstants.OAT_VERSION_131: {
|
||||
statusEnum = OatClassStatusEnum_O_M2.kStatusMax.get(status_);
|
||||
break;
|
||||
}
|
||||
case OatConstants.VERSION_PIE_RELEASE:
|
||||
case OatConstants.VERSION_10_RELEASE: {
|
||||
statusEnum = OatClassStatusEnum_P_10.kLast.get(status_);
|
||||
case OatConstants.OAT_VERSION_138:
|
||||
case OatConstants.OAT_VERSION_170: {
|
||||
statusEnum = OatClassStatusEnum_P_Q.kLast.get(status_);
|
||||
break;
|
||||
}
|
||||
case OatConstants.VERSION_11_RELEASE:
|
||||
case OatConstants.VERSION_12_RELEASE:
|
||||
case OatConstants.VERSION_S_V2_PREVIEW:
|
||||
case OatConstants.VERSION_T_PREVIEW_1:
|
||||
case OatConstants.VERSION_S_V2_BETA2:
|
||||
case OatConstants.VERSION_13_RELEASE: {
|
||||
statusEnum = OatClassStatusEnum_11_12.kLast.get(status_);
|
||||
case OatConstants.OAT_VERSION_183:
|
||||
case OatConstants.OAT_VERSION_195:
|
||||
case OatConstants.OAT_VERSION_199:
|
||||
case OatConstants.OAT_VERSION_220:
|
||||
case OatConstants.OAT_VERSION_223:
|
||||
case OatConstants.OAT_VERSION_225: {
|
||||
statusEnum = OatClassStatusEnum_R_S_T.kLast.get(status_);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
|
|
@ -28,33 +28,33 @@ public class OatClassFactory {
|
|||
String oatVersion) throws IOException, UnsupportedOatVersionException {
|
||||
|
||||
switch (oatVersion) {
|
||||
case OatConstants.VERSION_KITKAT_RELEASE:
|
||||
case OatConstants.OAT_VERSION_007:
|
||||
return new OatClass_KitKat(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_LOLLIPOP_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE:
|
||||
case OatConstants.OAT_VERSION_039:
|
||||
case OatConstants.OAT_VERSION_045:
|
||||
case OatConstants.OAT_VERSION_051:
|
||||
return new OatClass_Lollipop(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_MARSHMALLOW_RELEASE:
|
||||
case OatConstants.OAT_VERSION_064:
|
||||
return new OatClass_Marshmallow(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_NOUGAT_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_MR1_RELEASE:
|
||||
case OatConstants.OAT_VERSION_079:
|
||||
case OatConstants.OAT_VERSION_088:
|
||||
return new OatClass_Nougat(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_OREO_RELEASE:
|
||||
case OatConstants.OAT_VERSION_124:
|
||||
return new OatClass_Oreo(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_OREO_M2_RELEASE:
|
||||
case OatConstants.OAT_VERSION_131:
|
||||
return new OatClass_OreoM2(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_PIE_RELEASE:
|
||||
case OatConstants.OAT_VERSION_138:
|
||||
return new OatClass_Pie(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_10_RELEASE:
|
||||
return new OatClass_Android10(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_11_RELEASE:
|
||||
return new OatClass_Android11(reader, classDataItem, oatVersion);
|
||||
case OatConstants.VERSION_12_RELEASE:
|
||||
case OatConstants.VERSION_S_V2_PREVIEW:
|
||||
case OatConstants.VERSION_T_PREVIEW_1:
|
||||
case OatConstants.VERSION_S_V2_BETA2:
|
||||
case OatConstants.VERSION_13_RELEASE:
|
||||
return new OatClass_Android12(reader, classDataItem, oatVersion);
|
||||
case OatConstants.OAT_VERSION_170:
|
||||
return new OatClass_Q(reader, classDataItem, oatVersion);
|
||||
case OatConstants.OAT_VERSION_183:
|
||||
return new OatClass_R(reader, classDataItem, oatVersion);
|
||||
case OatConstants.OAT_VERSION_195:
|
||||
case OatConstants.OAT_VERSION_199:
|
||||
case OatConstants.OAT_VERSION_220:
|
||||
case OatConstants.OAT_VERSION_223:
|
||||
case OatConstants.OAT_VERSION_225:
|
||||
return new OatClass_S_T(reader, classDataItem, oatVersion);
|
||||
default:
|
||||
throw new UnsupportedOatVersionException(
|
||||
"OatClass not supported for OAT Version: " + oatVersion);
|
||||
|
|
|
@ -21,7 +21,7 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/kitkat-release/runtime/mirror/class.h#112
|
||||
* <a href="https://android.googlesource.com/platform/art/+/kitkat-release/runtime/mirror/class.h#112">kitkat-release/runtime/mirror/class.h</a>
|
||||
*
|
||||
*/
|
||||
public enum OatClassStatusEnum_K implements OatClassStatusEnum {
|
||||
|
|
|
@ -21,15 +21,15 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/lollipop-release/runtime/mirror/class.h#133
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/mirror/class.h#138
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/mirror/class.h#119
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/mirror/class.h#112
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/nougat-release/runtime/mirror/class.h#116
|
||||
* <a href="https://android.googlesource.com/platform/art/+/lollipop-release/runtime/mirror/class.h#133">lollipop-release/runtime/mirror/class.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/mirror/class.h#138">lollipop-mr1-fi-release/runtime/mirror/class.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/mirror/class.h#119">lollipop-wear-release/runtime/mirror/class.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/mirror/class.h#112">marshmallow-release/runtime/mirror/class.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/nougat-release/runtime/mirror/class.h#116">nougat-release/runtime/mirror/class.h</a>
|
||||
*/
|
||||
public enum OatClassStatusEnum_L_M_N implements OatClassStatusEnum {
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/mirror/class.h#128
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/mirror/class.h#128">oreo-release/runtime/mirror/class.h</a>
|
||||
*/
|
||||
public enum OatClassStatusEnum_O implements OatClassStatusEnum {
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/mirror/class.h#128
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/mirror/class.h#128">oreo-m2-release/runtime/mirror/class.h</a>
|
||||
*/
|
||||
public enum OatClassStatusEnum_O_M2 implements OatClassStatusEnum {
|
||||
|
||||
|
|
|
@ -21,12 +21,11 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/class_status.h#74
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/class_status.h#74
|
||||
*
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/class_status.h#74">pie-release/runtime/class_status.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/class_status.h#74">android10-release/runtime/class_status.h<a/>
|
||||
*/
|
||||
public enum OatClassStatusEnum_P_10 implements OatClassStatusEnum {
|
||||
public enum OatClassStatusEnum_P_Q implements OatClassStatusEnum {
|
||||
|
||||
kNotReady(0),
|
||||
kRetired(1),
|
||||
|
@ -47,11 +46,11 @@ public enum OatClassStatusEnum_P_10 implements OatClassStatusEnum {
|
|||
|
||||
private byte value;
|
||||
|
||||
private OatClassStatusEnum_P_10(byte value) {
|
||||
private OatClassStatusEnum_P_Q(byte value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private OatClassStatusEnum_P_10(int value) {
|
||||
private OatClassStatusEnum_P_Q(int value) {
|
||||
this.value = (byte) value;
|
||||
}
|
||||
|
||||
|
@ -61,7 +60,7 @@ public enum OatClassStatusEnum_P_10 implements OatClassStatusEnum {
|
|||
|
||||
@Override
|
||||
public OatClassStatusEnum get(short value) {
|
||||
for (OatClassStatusEnum_P_10 valueX : values()) {
|
||||
for (OatClassStatusEnum_P_Q valueX : values()) {
|
||||
if (valueX.getValue() == value) {
|
||||
return valueX;
|
||||
}
|
||||
|
@ -71,8 +70,8 @@ public enum OatClassStatusEnum_P_10 implements OatClassStatusEnum {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_P_10.class.getSimpleName(), 2);
|
||||
for (OatClassStatusEnum_P_10 valueX : values()) {
|
||||
EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_P_Q.class.getSimpleName(), 2);
|
||||
for (OatClassStatusEnum_P_Q valueX : values()) {
|
||||
enumDataType.add(valueX.name(), valueX.getValue());
|
||||
}
|
||||
enumDataType.setCategoryPath(new CategoryPath("/oat"));
|
|
@ -21,11 +21,13 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/class_status.h#82
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/class_status.h#82
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/class_status.h#82">android11-release/runtime/class_status.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/class_status.h#82">android12-release/runtime/class_status.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/class_status.h#82">android13-release/runtime/class_status.h</a>
|
||||
*/
|
||||
public enum OatClassStatusEnum_11_12 implements OatClassStatusEnum {
|
||||
public enum OatClassStatusEnum_R_S_T implements OatClassStatusEnum {
|
||||
|
||||
kNotReady(0),
|
||||
kRetired(1),
|
||||
|
@ -47,11 +49,11 @@ public enum OatClassStatusEnum_11_12 implements OatClassStatusEnum {
|
|||
|
||||
private byte value;
|
||||
|
||||
private OatClassStatusEnum_11_12(byte value) {
|
||||
private OatClassStatusEnum_R_S_T(byte value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private OatClassStatusEnum_11_12(int value) {
|
||||
private OatClassStatusEnum_R_S_T(int value) {
|
||||
this.value = (byte) value;
|
||||
}
|
||||
|
||||
|
@ -61,7 +63,7 @@ public enum OatClassStatusEnum_11_12 implements OatClassStatusEnum {
|
|||
|
||||
@Override
|
||||
public OatClassStatusEnum get(short value) {
|
||||
for (OatClassStatusEnum_11_12 valueX : values()) {
|
||||
for (OatClassStatusEnum_R_S_T valueX : values()) {
|
||||
if (valueX.getValue() == value) {
|
||||
return valueX;
|
||||
}
|
||||
|
@ -71,8 +73,8 @@ public enum OatClassStatusEnum_11_12 implements OatClassStatusEnum {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_11_12.class.getSimpleName(), 2);
|
||||
for (OatClassStatusEnum_11_12 valueX : values()) {
|
||||
EnumDataType enumDataType = new EnumDataType(OatClassStatusEnum_R_S_T.class.getSimpleName(), 2);
|
||||
for (OatClassStatusEnum_R_S_T valueX : values()) {
|
||||
enumDataType.add(valueX.name(), valueX.getValue());
|
||||
}
|
||||
enumDataType.setCategoryPath(new CategoryPath("/oat"));
|
|
@ -25,9 +25,9 @@ import ghidra.program.model.data.*;
|
|||
* using a bitmap pays for itself since few classes will have 160
|
||||
* methods.
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/lollipop-release/runtime/oat.h#152
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/oat_file.h#66
|
||||
* <a href="https://android.googlesource.com/platform/art/+/lollipop-release/runtime/oat.h#152">lollipop-release/runtime/oat.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/oat_file.h#66">android-s-beta-5/runtime/oat_file.h</a>
|
||||
*/
|
||||
public enum OatClassType {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat_file.h#156
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat_file.h#156">kitkat-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_KitKat extends OatClass {
|
||||
|
||||
|
|
|
@ -24,11 +24,11 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat_file.h#205
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/oat_file.h#202
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat_file.h#211
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat_file.h#205">lollipop-release/runtime/oat_file.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/oat_file.h#202">lollipop-mr1-fi-release/runtime/oat_file.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat_file.h#211">lollipop-wear-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Lollipop extends OatClass {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat_file.h#200
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat_file.h#200">marshmallow-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Marshmallow extends OatClass_Lollipop {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat_file.h#197
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat_file.h#197">nougat-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Nougat extends OatClass_Marshmallow {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_file.h#213
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_file.h#213">oreo-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Oreo extends OatClass_Nougat {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat_file.h#219
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat_file.h#219">oreo-m2-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_OreoM2 extends OatClass_Oreo {
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat_file.h#248
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat_file.h#248">pie-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Pie extends OatClass_OreoM2 {
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat_file.h#278
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat_file.h#248">android10-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Android11 extends OatClass_Android10 {
|
||||
public class OatClass_Q extends OatClass_Pie {
|
||||
|
||||
OatClass_Android11(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
OatClass_Q(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
throws IOException {
|
||||
super(reader, classDataItem, oatVersion);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class OatClass_Android11 extends OatClass_Android10 {
|
|||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
renameDataType(dataType, OatClass_Android11.class.getSimpleName());
|
||||
renameDataType(dataType, OatClass_Q.class.getSimpleName());
|
||||
}
|
||||
catch (Exception e) {
|
||||
//ignore...
|
|
@ -23,11 +23,11 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat_file.h#248
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat_file.h#278">android11-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Android10 extends OatClass_Pie {
|
||||
public class OatClass_R extends OatClass_Q {
|
||||
|
||||
OatClass_Android10(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
OatClass_R(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
throws IOException {
|
||||
super(reader, classDataItem, oatVersion);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class OatClass_Android10 extends OatClass_Pie {
|
|||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
renameDataType(dataType, OatClass_Android10.class.getSimpleName());
|
||||
renameDataType(dataType, OatClass_R.class.getSimpleName());
|
||||
}
|
||||
catch (Exception e) {
|
||||
//ignore...
|
|
@ -25,9 +25,11 @@ import ghidra.util.NumericUtilities;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android-s-beta-5/runtime/oat_file.h#283
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android12-release/runtime/oat_file.h#283">android12-release/runtime/oat_file.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/android13-release/runtime/oat_file.h#279">android13-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatClass_Android12 extends OatClass {
|
||||
public class OatClass_S_T extends OatClass {
|
||||
|
||||
//https://android.googlesource.com/platform/art/+/master/libartbase/base/bit_vector.h#38
|
||||
public static final int kWordBytes = 4;
|
||||
|
@ -36,7 +38,7 @@ public class OatClass_Android12 extends OatClass {
|
|||
|
||||
private byte[] bitmap_ = new byte[0];
|
||||
|
||||
OatClass_Android12(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
OatClass_S_T(BinaryReader reader, ClassDataItem classDataItem, String oatVersion)
|
||||
throws IOException {
|
||||
|
||||
super(reader, oatVersion);
|
||||
|
@ -106,7 +108,7 @@ public class OatClass_Android12 extends OatClass {
|
|||
|
||||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
String className = OatClass_Android12.class.getSimpleName();
|
||||
String className = OatClass_S_T.class.getSimpleName();
|
||||
|
||||
if (methods_pointer_.size() > 0) {
|
||||
className += "_" + methods_pointer_.size();
|
|
@ -27,34 +27,34 @@ public final class OatDexFileFactory {
|
|||
OatBundle bundle) throws IOException {
|
||||
|
||||
switch (oatVersion) {
|
||||
case OatConstants.VERSION_KITKAT_RELEASE:
|
||||
case OatConstants.OAT_VERSION_007:
|
||||
return new OatDexFile_KitKat(reader);
|
||||
case OatConstants.VERSION_LOLLIPOP_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE:
|
||||
case OatConstants.OAT_VERSION_039:
|
||||
case OatConstants.OAT_VERSION_045:
|
||||
case OatConstants.OAT_VERSION_051:
|
||||
return new OatDexFile_Lollipop(reader);
|
||||
case OatConstants.VERSION_MARSHMALLOW_RELEASE:
|
||||
case OatConstants.OAT_VERSION_064:
|
||||
return new OatDexFile_Marshmallow(reader);
|
||||
case OatConstants.VERSION_NOUGAT_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_MR1_RELEASE:
|
||||
case OatConstants.OAT_VERSION_079:
|
||||
case OatConstants.OAT_VERSION_088:
|
||||
return new OatDexFile_Nougat(reader);
|
||||
case OatConstants.VERSION_OREO_RELEASE:
|
||||
case OatConstants.VERSION_OREO_DR3_RELEASE:
|
||||
case OatConstants.OAT_VERSION_124:
|
||||
case OatConstants.OAT_VERSION_126:
|
||||
return new OatDexFile_Oreo(reader, bundle);
|
||||
case OatConstants.VERSION_OREO_M2_RELEASE:
|
||||
case OatConstants.OAT_VERSION_131:
|
||||
return new OatDexFile_OreoM2(reader, bundle);
|
||||
case OatConstants.VERSION_PIE_RELEASE:
|
||||
case OatConstants.OAT_VERSION_138:
|
||||
return new OatDexFile_Pie(reader, bundle);
|
||||
case OatConstants.VERSION_10_RELEASE:
|
||||
return new OatDexFile_Android10(reader, bundle);
|
||||
case OatConstants.VERSION_11_RELEASE:
|
||||
return new OatDexFile_Android11(reader, bundle);
|
||||
case OatConstants.VERSION_12_RELEASE:
|
||||
case OatConstants.VERSION_S_V2_PREVIEW:
|
||||
case OatConstants.VERSION_T_PREVIEW_1:
|
||||
case OatConstants.VERSION_S_V2_BETA2:
|
||||
case OatConstants.VERSION_13_RELEASE:
|
||||
return new OatDexFile_Android12(reader, bundle);
|
||||
case OatConstants.OAT_VERSION_170:
|
||||
return new OatDexFile_Q(reader, bundle);
|
||||
case OatConstants.OAT_VERSION_183:
|
||||
return new OatDexFile_R(reader, bundle);
|
||||
case OatConstants.OAT_VERSION_195:
|
||||
case OatConstants.OAT_VERSION_199:
|
||||
case OatConstants.OAT_VERSION_220:
|
||||
case OatConstants.OAT_VERSION_223:
|
||||
case OatConstants.OAT_VERSION_225:
|
||||
return new OatDexFile_S_T(reader, bundle);
|
||||
}
|
||||
|
||||
throw new IOException("Unsupported OAT version: " + oatVersion);
|
||||
|
|
|
@ -40,8 +40,7 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat_file.h#191
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat_file.h#191">kitkat-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_KitKat extends OatDexFile {
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
|
||||
/**
|
||||
* Note: actual data structure seen in firmware does not contain the "canonical_dex_file_location_" field.
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat_file.h#261
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/oat_file.h#261">lollipop-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_Lollipop extends OatDexFile_KitKat {
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
|
||||
/**
|
||||
* Note: actual data structure seen in firmware does not contain the "canonical_dex_file_location_" field.
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat_file.h#405
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat_file.h#405">marshmallow-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_Marshmallow extends OatDexFile_Lollipop {
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@ import ghidra.util.task.TaskMonitor;
|
|||
|
||||
/**
|
||||
* Used for OAT Header version 079 to 088.
|
||||
*
|
||||
* <br>
|
||||
* Versions: Nougat, Nougat MR1
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/nougat-release/runtime/oat_file.h#383
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/nougat-release/runtime/oat_file.h#383">nougat-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_Nougat extends OatDexFile {
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_file.h#444
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_file.h#444">oreo-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_Oreo extends OatDexFile_Nougat {
|
||||
|
||||
|
|
|
@ -33,8 +33,7 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/oat_file.h#467
|
||||
* <a href="https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/oat_file.h#467">oreo-m2-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_OreoM2 extends OatDexFile {
|
||||
|
||||
|
|
|
@ -35,8 +35,7 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/pie-release/runtime/oat_file.h#518
|
||||
* <a href="https://android.googlesource.com/platform/art/+/pie-release/runtime/oat_file.h#518">pie-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
class OatDexFile_Pie extends OatDexFile {
|
||||
|
||||
|
|
|
@ -23,12 +23,11 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/android10-release/runtime/oat_file.h#569
|
||||
* <a href="https://android.googlesource.com/platform/art/+/android10-release/runtime/oat_file.h#569">android10-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
public class OatDexFile_Android10 extends OatDexFile_Pie {
|
||||
public class OatDexFile_Q extends OatDexFile_Pie {
|
||||
|
||||
public OatDexFile_Android10(BinaryReader reader, OatBundle bundle) throws IOException {
|
||||
public OatDexFile_Q(BinaryReader reader, OatBundle bundle) throws IOException {
|
||||
super(reader, bundle);
|
||||
}
|
||||
|
||||
|
@ -36,7 +35,7 @@ public class OatDexFile_Android10 extends OatDexFile_Pie {
|
|||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
dataType.setName(OatDexFile_Android10.class.getSimpleName()+ "_" +
|
||||
dataType.setName(OatDexFile_Q.class.getSimpleName()+ "_" +
|
||||
getDexFileLocation().length());
|
||||
}
|
||||
catch (Exception e) {
|
|
@ -23,12 +23,11 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/android11-release/runtime/oat_file.h#571
|
||||
* <a href="https://android.googlesource.com/platform/art/+/android11-release/runtime/oat_file.h#571">android11-release/runtime/oat_file.h</a>
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -36,7 +35,7 @@ public class OatDexFile_Android11 extends OatDexFile_Pie {
|
|||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
dataType.setName(OatDexFile_Android11.class.getSimpleName() + "_" +
|
||||
dataType.setName(OatDexFile_R.class.getSimpleName() + "_" +
|
||||
getDexFileLocation().length());
|
||||
}
|
||||
catch (Exception e) {
|
|
@ -34,9 +34,11 @@ import ghidra.util.exception.DuplicateNameException;
|
|||
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 String canonical_dex_file_location_;
|
||||
|
@ -57,7 +59,7 @@ public class OatDexFile_Android12 extends OatDexFile {
|
|||
private long _offset;
|
||||
private DexHeader dexHeader;
|
||||
|
||||
public OatDexFile_Android12(BinaryReader reader, OatBundle bundle)
|
||||
public OatDexFile_S_T(BinaryReader reader, OatBundle bundle)
|
||||
throws IOException {
|
||||
|
||||
_offset = reader.getPointerIndex();
|
||||
|
@ -167,7 +169,7 @@ public class OatDexFile_Android12 extends OatDexFile {
|
|||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
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(STRING, dex_file_location_, "canonical_dex_file_location_", null);
|
|
@ -23,19 +23,32 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-release/runtime/oat.h#163
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.h#165
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat.h#162
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat.h#172
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr1-release/runtime/oat.h#172
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat.h#172
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat.h#172
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat.h#176
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat.h#177
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat.h#150
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat_file.h#75
|
||||
* 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/lollipop-mr1-release/runtime/oat.h#163">lollipop-mr1-release/runtime/oat.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.h#165">ollipop-wear-release/runtime/oat.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/marshmallow-release/runtime/oat.h#162">marshmallow-release/runtime/oat.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat.h#172">nougat-release/runtime/oat.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/nougat-mr1-release/runtime/oat.h#172">nougat-mr1-release/runtime/oat.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat.h#172">oreo-release/runtime/oat.h</a>
|
||||
* <br>
|
||||
* <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 {
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ public final class OatMethodOffsetsFactory {
|
|||
throws IOException {
|
||||
|
||||
switch (oatVersion) {
|
||||
case OatConstants.VERSION_KITKAT_RELEASE:
|
||||
case OatConstants.OAT_VERSION_007:
|
||||
return new OatMethodOffsets_KitKat(reader);
|
||||
case OatConstants.VERSION_LOLLIPOP_RELEASE:
|
||||
case OatConstants.OAT_VERSION_039:
|
||||
return new OatMethodOffsets_Lollipop(reader);
|
||||
default:
|
||||
return new OatMethodOffsets(reader);
|
||||
|
|
|
@ -22,9 +22,7 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat.h#107
|
||||
*
|
||||
* <a href="https://android.googlesource.com/platform/art/+/refs/heads/kitkat-release/runtime/oat.h#107">kitkat-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatMethodOffsets_KitKat extends OatMethodOffsets {
|
||||
|
||||
|
|
|
@ -22,9 +22,7 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
*
|
||||
* https://android.googlesource.com/platform/art/+/lollipop-release/runtime/oat.h#161
|
||||
*
|
||||
* <a href="https://android.googlesource.com/platform/art/+/lollipop-release/runtime/oat.h#161">lollipop-release/runtime/oat.h</a>
|
||||
*/
|
||||
public class OatMethodOffsets_Lollipop extends OatMethodOffsets {
|
||||
|
||||
|
|
|
@ -24,28 +24,28 @@ public final class OatQuickMethodHeaderFactory {
|
|||
|
||||
public final static int getOatQuickMethodHeaderSize(String oatVersion) throws IOException {
|
||||
switch (oatVersion) {
|
||||
case OatConstants.VERSION_LOLLIPOP_RELEASE:
|
||||
case OatConstants.OAT_VERSION_039:
|
||||
return 12 + QuickMethodFrameInfo.SIZE;
|
||||
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE:
|
||||
case OatConstants.VERSION_MARSHMALLOW_RELEASE:
|
||||
case OatConstants.OAT_VERSION_045:
|
||||
case OatConstants.OAT_VERSION_051:
|
||||
case OatConstants.OAT_VERSION_064:
|
||||
return 16 + QuickMethodFrameInfo.SIZE;
|
||||
case OatConstants.VERSION_NOUGAT_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_MR1_RELEASE:
|
||||
case OatConstants.OAT_VERSION_079:
|
||||
case OatConstants.OAT_VERSION_088:
|
||||
return 8 + QuickMethodFrameInfo.SIZE;
|
||||
case OatConstants.VERSION_OREO_RELEASE:
|
||||
case OatConstants.VERSION_OREO_M2_RELEASE:
|
||||
case OatConstants.VERSION_OREO_DR3_RELEASE:
|
||||
case OatConstants.VERSION_PIE_RELEASE:
|
||||
case OatConstants.OAT_VERSION_124:
|
||||
case OatConstants.OAT_VERSION_131:
|
||||
case OatConstants.OAT_VERSION_126:
|
||||
case OatConstants.OAT_VERSION_138:
|
||||
return 12 + QuickMethodFrameInfo.SIZE;
|
||||
case OatConstants.VERSION_10_RELEASE:
|
||||
case OatConstants.VERSION_11_RELEASE:
|
||||
case OatConstants.OAT_VERSION_170:
|
||||
case OatConstants.OAT_VERSION_183:
|
||||
return 8;
|
||||
case OatConstants.VERSION_12_RELEASE:
|
||||
case OatConstants.VERSION_S_V2_PREVIEW:
|
||||
case OatConstants.VERSION_T_PREVIEW_1:
|
||||
case OatConstants.VERSION_S_V2_BETA2:
|
||||
case OatConstants.VERSION_13_RELEASE:
|
||||
case OatConstants.OAT_VERSION_195:
|
||||
case OatConstants.OAT_VERSION_199:
|
||||
case OatConstants.OAT_VERSION_220:
|
||||
case OatConstants.OAT_VERSION_223:
|
||||
case OatConstants.OAT_VERSION_225:
|
||||
return 4;
|
||||
}
|
||||
throw new IOException("OatQuickMethodHeader unsupported OAT version: " + oatVersion);
|
||||
|
@ -54,29 +54,29 @@ public final class OatQuickMethodHeaderFactory {
|
|||
public final static OatQuickMethodHeader getOatQuickMethodHeader(BinaryReader reader,
|
||||
String oatVersion) throws IOException {
|
||||
switch (oatVersion ) {
|
||||
case OatConstants.VERSION_LOLLIPOP_RELEASE:
|
||||
case OatConstants.OAT_VERSION_039:
|
||||
return new OatQuickMethodHeader_Lollipop(reader);
|
||||
case OatConstants.VERSION_LOLLIPOP_MR1_FI_RELEASE:
|
||||
case OatConstants.VERSION_LOLLIPOP_WEAR_RELEASE:
|
||||
case OatConstants.VERSION_MARSHMALLOW_RELEASE:
|
||||
case OatConstants.OAT_VERSION_045:
|
||||
case OatConstants.OAT_VERSION_051:
|
||||
case OatConstants.OAT_VERSION_064:
|
||||
return new OatQuickMethodHeader_LollipopMR1(reader);
|
||||
case OatConstants.VERSION_NOUGAT_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_MR1_RELEASE:
|
||||
case OatConstants.OAT_VERSION_079:
|
||||
case OatConstants.OAT_VERSION_088:
|
||||
return new OatQuickMethodHeader_Nougat(reader);
|
||||
case OatConstants.VERSION_OREO_RELEASE:
|
||||
case OatConstants.VERSION_OREO_M2_RELEASE:
|
||||
case OatConstants.VERSION_OREO_DR3_RELEASE:
|
||||
case OatConstants.VERSION_PIE_RELEASE:
|
||||
case OatConstants.OAT_VERSION_124:
|
||||
case OatConstants.OAT_VERSION_131:
|
||||
case OatConstants.OAT_VERSION_126:
|
||||
case OatConstants.OAT_VERSION_138:
|
||||
return new OatQuickMethodHeader_Oreo(reader);
|
||||
case OatConstants.VERSION_10_RELEASE:
|
||||
case OatConstants.VERSION_11_RELEASE:
|
||||
return new OatQuickMethodHeader_Android10(reader);
|
||||
case OatConstants.VERSION_12_RELEASE:
|
||||
case OatConstants.VERSION_S_V2_PREVIEW:
|
||||
case OatConstants.VERSION_T_PREVIEW_1:
|
||||
case OatConstants.VERSION_S_V2_BETA2:
|
||||
case OatConstants.VERSION_13_RELEASE:
|
||||
return new OatQuickMethodHeader_Android12(reader);
|
||||
case OatConstants.OAT_VERSION_170:
|
||||
case OatConstants.OAT_VERSION_183:
|
||||
return new OatQuickMethodHeader_Q_R(reader);
|
||||
case OatConstants.OAT_VERSION_195:
|
||||
case OatConstants.OAT_VERSION_199:
|
||||
case OatConstants.OAT_VERSION_220:
|
||||
case OatConstants.OAT_VERSION_223:
|
||||
case OatConstants.OAT_VERSION_225:
|
||||
return new OatQuickMethodHeader_S_T(reader);
|
||||
}
|
||||
throw new IOException("OatQuickMethodHeader unsupported OAT version: " + oatVersion);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import ghidra.program.model.data.*;
|
|||
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 {
|
||||
private int mapping_table_offset_;
|
||||
|
|
|
@ -22,9 +22,11 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/oat.h#182
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/oat.h#184
|
||||
* https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/oat.h#185
|
||||
* <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>
|
||||
* <br>
|
||||
* <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 {
|
||||
private int mapping_table_offset_;
|
||||
|
|
|
@ -22,8 +22,9 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/oat_quick_method_header.h#128
|
||||
* https://android.googlesource.com/platform/art/+/nougat-mr1-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>
|
||||
* <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 {
|
||||
|
||||
|
|
|
@ -22,10 +22,13 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/oat_quick_method_header.h#190
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/oat_quick_method_header.h#191
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/oat_quick_method_header.h#191
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/oat_quick_method_header.h#191
|
||||
* <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>
|
||||
* <br>
|
||||
* <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>
|
||||
* <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 {
|
||||
|
||||
|
|
|
@ -22,15 +22,16 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/oat_quick_method_header.h#158
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/oat_quick_method_header.h#175
|
||||
* <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>
|
||||
* <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 code_size_;
|
||||
private byte[] code_;
|
||||
|
||||
OatQuickMethodHeader_Android10(BinaryReader reader) throws IOException {
|
||||
OatQuickMethodHeader_Q_R(BinaryReader reader) throws IOException {
|
||||
vmap_table_offset_ = reader.readNextInt();
|
||||
code_size_ = reader.readNextInt();
|
||||
code_ = reader.readNextByteArray(code_size_);
|
||||
|
@ -62,7 +63,7 @@ public class OatQuickMethodHeader_Android10 extends OatQuickMethodHeader {
|
|||
|
||||
@Override
|
||||
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, "code_size_", null);
|
||||
structure.setCategoryPath(new CategoryPath("/oat"));
|
|
@ -22,10 +22,11 @@ import ghidra.program.model.data.*;
|
|||
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 kIsCodeInfoMask = 0x40000000;
|
||||
|
@ -34,7 +35,7 @@ public class OatQuickMethodHeader_Android12 extends OatQuickMethodHeader {
|
|||
|
||||
private int data_;
|
||||
|
||||
OatQuickMethodHeader_Android12(BinaryReader reader) throws IOException {
|
||||
OatQuickMethodHeader_S_T(BinaryReader reader) throws IOException {
|
||||
data_ = reader.readNextInt();
|
||||
}
|
||||
|
||||
|
@ -45,7 +46,7 @@ public class OatQuickMethodHeader_Android12 extends OatQuickMethodHeader {
|
|||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
Structure structure =
|
||||
new StructureDataType(OatQuickMethodHeader_Android12.class.getSimpleName(), 0);
|
||||
new StructureDataType(OatQuickMethodHeader_S_T.class.getSimpleName(), 0);
|
||||
structure.add(DWORD, "data_", null);
|
||||
structure.setCategoryPath(new CategoryPath("/oat"));
|
||||
return structure;
|
|
@ -23,18 +23,29 @@ import ghidra.program.model.data.DataType;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-release/runtime/quick/quick_method_frame_info.h#53
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-mr1-fi-release/runtime/quick/quick_method_frame_info.h#54
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/lollipop-wear-release/runtime/quick/quick_method_frame_info.h#54
|
||||
* https://android.googlesource.com/platform/art/+/marshmallow-release/runtime/quick/quick_method_frame_info.h#54
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/nougat-release/runtime/quick/quick_method_frame_info.h#57
|
||||
* https://android.googlesource.com/platform/art/+/nougat-mr1-release/runtime/quick/quick_method_frame_info.h#57
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-release/runtime/quick/quick_method_frame_info.h#57
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-dr3-release/runtime/quick/quick_method_frame_info.h#57
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/oreo-m2-release/runtime/quick/quick_method_frame_info.h#57
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/pie-release/runtime/quick/quick_method_frame_info.h#57
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/runtime/quick/quick_method_frame_info.h#57
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/runtime/quick/quick_method_frame_info.h#57
|
||||
* <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>
|
||||
* <br>
|
||||
* <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>
|
||||
* <br>
|
||||
* <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>
|
||||
* <br>
|
||||
* <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>
|
||||
* <br>
|
||||
* <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>
|
||||
* <br>
|
||||
* <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>
|
||||
* <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 {
|
||||
|
||||
|
|
|
@ -18,8 +18,9 @@ package ghidra.file.formats.android.oat.tlt;
|
|||
import ghidra.app.util.bin.StructConverter;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#161
|
||||
* https://android.googlesource.com/platform/art/+/oreo-m2-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>
|
||||
* <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 {
|
||||
|
||||
|
|
|
@ -23,11 +23,13 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/nougat-release/runtime/type_lookup_table.h#99
|
||||
* https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#100
|
||||
* https://android.googlesource.com/platform/art/+/oreo-m2-release/runtime/type_lookup_table.h#100
|
||||
* https://android.googlesource.com/platform/art/+/pie-release/runtime/type_lookup_table.h#102
|
||||
*
|
||||
* <a href="https://android.googlesource.com/platform/art/+/nougat-release/runtime/type_lookup_table.h#99">nougat-release/runtime/type_lookup_table.h</a>
|
||||
* <br>
|
||||
* <a href="https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#100">oreo-release/runtime/type_lookup_table.h</a>
|
||||
* <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 {
|
||||
|
||||
|
|
|
@ -22,13 +22,17 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android10-release/libdexfile/dex/type_lookup_table.h#110
|
||||
* https://android.googlesource.com/platform/art/+/refs/heads/android11-release/libdexfile/dex/type_lookup_table.h#110
|
||||
* 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/android10-release/libdexfile/dex/type_lookup_table.h#110">android10-release/libdexfile/dex/type_lookup_table.h</a>
|
||||
* <br>
|
||||
* <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();
|
||||
str_offset_ = reader.readNextInt();
|
||||
data_ = reader.readNextInt();
|
||||
|
@ -50,7 +54,7 @@ public class TypeLookupTableEntry_Android10 extends TypeLookupTableEntry {
|
|||
|
||||
@Override
|
||||
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, "data_", null);
|
||||
structure.setCategoryPath(new CategoryPath("/oat"));
|
|
@ -27,25 +27,25 @@ public final class TypeLookupTableFactory {
|
|||
throws IOException {
|
||||
|
||||
switch (oatVersion) {
|
||||
case OatConstants.VERSION_NOUGAT_RELEASE:
|
||||
case OatConstants.VERSION_NOUGAT_MR1_RELEASE:
|
||||
case OatConstants.OAT_VERSION_079:
|
||||
case OatConstants.OAT_VERSION_088:
|
||||
return new TypeLookupTable_Nougat(reader);
|
||||
case OatConstants.VERSION_OREO_RELEASE:
|
||||
case OatConstants.VERSION_OREO_M2_RELEASE:
|
||||
case OatConstants.VERSION_OREO_DR3_RELEASE:
|
||||
case OatConstants.OAT_VERSION_124:
|
||||
case OatConstants.OAT_VERSION_131:
|
||||
case OatConstants.OAT_VERSION_126:
|
||||
return new TypeLookupTable_Oreo(reader);
|
||||
case OatConstants.VERSION_PIE_RELEASE:
|
||||
case OatConstants.OAT_VERSION_138:
|
||||
return new TypeLookupTable_Pie(reader);
|
||||
case OatConstants.VERSION_10_RELEASE:
|
||||
return new TypeLookupTable_Android10(reader);
|
||||
case OatConstants.VERSION_11_RELEASE:
|
||||
return new TypeLookupTable_Android11(reader);
|
||||
case OatConstants.VERSION_12_RELEASE:
|
||||
case OatConstants.VERSION_S_V2_PREVIEW:
|
||||
case OatConstants.VERSION_T_PREVIEW_1:
|
||||
case OatConstants.VERSION_S_V2_BETA2:
|
||||
case OatConstants.VERSION_13_RELEASE:
|
||||
return new TypeLookupTable_Android12(reader);
|
||||
case OatConstants.OAT_VERSION_170:
|
||||
return new TypeLookupTable_Q(reader);
|
||||
case OatConstants.OAT_VERSION_183:
|
||||
return new TypeLookupTable_R(reader);
|
||||
case OatConstants.OAT_VERSION_195:
|
||||
case OatConstants.OAT_VERSION_199:
|
||||
case OatConstants.OAT_VERSION_220:
|
||||
case OatConstants.OAT_VERSION_223:
|
||||
case OatConstants.OAT_VERSION_225:
|
||||
return new TypeLookupTable_S_T(reader);
|
||||
default:
|
||||
throw new IOException(new UnsupportedOatVersionException(
|
||||
"Unsupported TypeLookupTable for OAT version " + oatVersion));
|
||||
|
|
|
@ -24,7 +24,7 @@ import ghidra.program.model.data.*;
|
|||
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 {
|
||||
|
||||
|
|
|
@ -24,8 +24,9 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#161
|
||||
* https://android.googlesource.com/platform/art/+/oreo-m2-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>
|
||||
* <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 {
|
||||
|
||||
|
|
|
@ -24,8 +24,9 @@ import ghidra.program.model.data.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
|
||||
/**
|
||||
* https://android.googlesource.com/platform/art/+/oreo-release/runtime/type_lookup_table.h#161
|
||||
* https://android.googlesource.com/platform/art/+/oreo-m2-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>
|
||||
* <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 {
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@ import ghidra.program.model.data.*;
|
|||
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 mask_bits_;
|
||||
|
@ -35,14 +35,14 @@ public class TypeLookupTable_Android10 extends TypeLookupTable {
|
|||
|
||||
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();
|
||||
mask_bits_ = reader.readNextInt();
|
||||
entries_ = reader.readNextInt();
|
||||
owns_entries_ = reader.readNextInt();
|
||||
|
||||
while (true) {
|
||||
TypeLookupTableEntry entry = new TypeLookupTableEntry_Android10(reader);
|
||||
TypeLookupTableEntry entry = new TypeLookupTableEntry_Q_R_S_T(reader);
|
||||
entryList.add(entry);
|
||||
if (entry.isEmpty()) {
|
||||
break;
|
||||
|
@ -76,7 +76,7 @@ public class TypeLookupTable_Android10 extends TypeLookupTable {
|
|||
@Override
|
||||
public DataType toDataType() throws DuplicateNameException, IOException {
|
||||
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, "mask_bits_", null);
|
||||
structure.add(DWORD, "entries_", null);
|
|
@ -22,12 +22,11 @@ import ghidra.program.model.data.DataType;
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -36,7 +35,7 @@ public class TypeLookupTable_Android11 extends TypeLookupTable_Android10 {
|
|||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
dataType.setName(
|
||||
TypeLookupTable_Android11.class.getSimpleName() + "_" + entryList.size());
|
||||
TypeLookupTable_R.class.getSimpleName() + "_" + entryList.size());
|
||||
}
|
||||
catch (Exception e) {
|
||||
//ignore
|
|
@ -22,11 +22,13 @@ import ghidra.program.model.data.DataType;
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -35,7 +37,7 @@ public class TypeLookupTable_Android12 extends TypeLookupTable_Android10 {
|
|||
DataType dataType = super.toDataType();
|
||||
try {
|
||||
dataType.setName(
|
||||
TypeLookupTable_Android12.class.getSimpleName() + "_" + entryList.size());
|
||||
TypeLookupTable_S_T.class.getSimpleName() + "_" + entryList.size());
|
||||
}
|
||||
catch (Exception e) {
|
||||
//ignore
|
Loading…
Reference in New Issue
Block a user