OAT

Utilities

lief.is_oat(*args) bool
lief.is_oat(path: str) bool
lief.is_oat(raw: list[int]) bool

Overloaded function.

  1. is_oat(binary: lief._lief.ELF.Binary) -> bool

Check if the Binary given in parameter is an OAT

  1. is_oat(path: str) -> bool

Check if the file given in parameter is an OAT

  1. is_oat(raw: list[int]) -> bool

Check if the raw data given in parameter is an OAT

lief.OAT.version(*args) int
lief.OAT.version(file: str) int
lief.OAT.version(raw: list[int]) int

Overloaded function.

  1. version(binary: lief._lief.ELF.Binary) -> int

Return the OAT version of the Binary given in parameter

  1. version(file: str) -> int

Return the OAT version of the file given in parameter

  1. version(raw: list[int]) -> int

Return the OAT version of the raw data given in parameter

lief.OAT.android_version(arg: int) lief.Android.ANDROID_VERSIONS

Return the ANDROID_VERSIONS associated with the given OAT version


Parser

lief.OAT.parse(*args) lief.OAT.Binary | None
lief.OAT.parse(oat_file: str, vdex_file: str) lief._lief.OAT.Binary | None
lief.OAT.parse(raw: list[int]) lief._lief.OAT.Binary | None
lief.OAT.parse(obj: io.IOBase | os.PathLike) lief._lief.OAT.Binary | None

Overloaded function.

  1. parse(oat_file: str) -> Optional[lief._lief.OAT.Binary]

Parse the given OAT file and return a Binary object

  1. parse(oat_file: str, vdex_file: str) -> Optional[lief._lief.OAT.Binary]

Parse the given OAT with its VDEX file and return a Binary object

  1. parse(raw: list[int]) -> Optional[lief._lief.OAT.Binary]

Parse the given raw data and return a Binary object


Binary

class lief.OAT.Binary

Bases: Binary

OAT binary representation

property classes lief.OAT.Binary.it_classes

Return an iterator over Class

property dex2dex_json_info str
property dex_files lief.OAT.Binary.it_dex_files

Return an iterator over File

get_class(*args) lief.OAT.Class

Overloaded function.

  1. get_class(self, class_name: str) -> lief._lief.OAT.Class

Return the Class from its name

  1. get_class(self, class_index: int) -> lief._lief.OAT.Class

Return the Class from its index

property has_class bool

Check if the class if the given name is present in the current OAT binary

property header lief.OAT.Header

Return the OAT Header

class it_classes

Bases: object

Iterator over lief._lief.OAT.Class

class it_dex_files

Bases: object

Iterator over lief._lief.DEX.File

class it_methods

Bases: object

Iterator over lief._lief.OAT.Method

class it_oat_dex_files

Bases: object

Iterator over lief._lief.OAT.DexFile

property methods lief.OAT.Binary.it_methods

Return an iterator over Method

property oat_dex_files lief.OAT.Binary.it_oat_dex_files

Return an iterator over DexFile



DexFile

class lief.OAT.DexFile(self)

Bases: Object

OAT DexFile representation

property checksum int

Checksum of the underlying DEX file

property dex_file lief.DEX.File

Associated lief.DEX.File

property dex_offset int

Offset to the raw lief.DEX.File

property has_dex_file bool

Check if the lief.DEX.File is present

property location str

Original location of the DEX file


Class

class lief.OAT.Class(self)

Bases: Object

OAT Class representation

property bitmap list[int]

Bitmap information used to quickly find which methods are optimized

property fullname str

Class mangled name (e.g. Lcom/android/MyActivity;)

has_dex_class(self) bool

True if a lief.DEX.Class object is associated with this OAT Class

property index int

Index the DEX classes pool (lief.DEX.File.classes)

is_quickened(*args) bool

Overloaded function.

  1. is_quickened(self, dex_method: lief._lief.DEX.Method) -> bool

Check if the given lief.DEX.Method is compiled into native code

  1. is_quickened(self, method_index: int) -> bool

Check if the Method at the given index is compiled into native code

class it_methods

Bases: object

Iterator over lief._lief.OAT.Method

method_offsets_index(self, arg: int) int
property methods lief.OAT.Class.it_methods

Iterator over lief.OAT.Method

property status lief.OAT.OAT_CLASS_STATUS

Class OAT_CLASS_STATUS

property type lief.OAT.OAT_CLASS_TYPES

Information (OAT_CLASS_TYPES) about how methods are optimized


Method

class lief.OAT.Method(self)

Bases: Object

OAT Method representation

property dex_method lief.DEX.Method

Mirrored Method associated with the OAT method (or None)

property has_dex_method bool

Check if a Method is associated with the OAT method

property is_compiled bool

True if the optimization is native

property is_dex2dex_optimized bool

True if the optimization is DEX

property name str

Method’s name

property oat_class lief.OAT.Class

Class associated with the method (or None)

property quick_code list[int]

Quick code associated with the method


Enums

OAT Class types

class lief.OAT.OAT_CLASS_TYPES

Bases: object

ALL_COMPILED = lief._lief.OAT.OAT_CLASS_TYPES.ALL_COMPILED
NONE_COMPILED = lief._lief.OAT.OAT_CLASS_TYPES.NONE_COMPILED
SOME_COMPILED = lief._lief.OAT.OAT_CLASS_TYPES.SOME_COMPILED

OAT Class Status

class lief.OAT.OAT_CLASS_STATUS

Bases: object

ERROR = lief._lief.OAT.OAT_CLASS_STATUS.ERROR
IDX = lief._lief.OAT.OAT_CLASS_STATUS.IDX
INITIALIZED = lief._lief.OAT.OAT_CLASS_STATUS.INITIALIZED
INITIALIZING = lief._lief.OAT.OAT_CLASS_STATUS.INITIALIZING
LOADED = lief._lief.OAT.OAT_CLASS_STATUS.LOADED
NOTREADY = lief._lief.OAT.OAT_CLASS_STATUS.NOTREADY
RESOLVED = lief._lief.OAT.OAT_CLASS_STATUS.RESOLVED
RESOLVING = lief._lief.OAT.OAT_CLASS_STATUS.RESOLVING
RETIRED = lief._lief.OAT.OAT_CLASS_STATUS.RETIRED
VERIFICATION_AT_RUNTIME = lief._lief.OAT.OAT_CLASS_STATUS.VERIFICATION_AT_RUNTIME
VERIFIED = lief._lief.OAT.OAT_CLASS_STATUS.VERIFIED
VERIFYING = lief._lief.OAT.OAT_CLASS_STATUS.VERIFYING
VERIFYING_AT_RUNTIME = lief._lief.OAT.OAT_CLASS_STATUS.VERIFYING_AT_RUNTIME

Header Keys

class lief.OAT.HEADER_KEYS

Bases: object

BOOT_CLASS_PATH = lief._lief.OAT.HEADER_KEYS.BOOT_CLASS_PATH
CLASS_PATH = lief._lief.OAT.HEADER_KEYS.CLASS_PATH
COMPILER_FILTER = lief._lief.OAT.HEADER_KEYS.COMPILER_FILTER
CONCURRENT_COPYING = lief._lief.OAT.HEADER_KEYS.CONCURRENT_COPYING
DEBUGGABLE = lief._lief.OAT.HEADER_KEYS.DEBUGGABLE
DEX2OAT_CMD_LINE = lief._lief.OAT.HEADER_KEYS.DEX2OAT_CMD_LINE
DEX2OAT_HOST = lief._lief.OAT.HEADER_KEYS.DEX2OAT_HOST
HAS_PATCH_INFO = lief._lief.OAT.HEADER_KEYS.HAS_PATCH_INFO
IMAGE_LOCATION = lief._lief.OAT.HEADER_KEYS.IMAGE_LOCATION
NATIVE_DEBUGGABLE = lief._lief.OAT.HEADER_KEYS.NATIVE_DEBUGGABLE
PIC = lief._lief.OAT.HEADER_KEYS.PIC

Instruction sets

class lief.OAT.INSTRUCTION_SETS

Bases: object

ARM = lief._lief.OAT.INSTRUCTION_SETS.ARM
ARM_64 = lief._lief.OAT.INSTRUCTION_SETS.ARM_64
MIPS = lief._lief.OAT.INSTRUCTION_SETS.MIPS
MIPS_64 = lief._lief.OAT.INSTRUCTION_SETS.MIPS_64
NONE = lief._lief.OAT.INSTRUCTION_SETS.NONE
THUMB2 = lief._lief.OAT.INSTRUCTION_SETS.THUMB2
X86 = lief._lief.OAT.INSTRUCTION_SETS.X86
X86_64 = lief._lief.OAT.INSTRUCTION_SETS.X86_64