Python¶
Utilities¶
- lief.is_oat(*args) bool¶
- lief.is_oat(path: str) bool
- lief.is_oat(raw: collections.abc.Sequence[int]) bool
- lief.is_oat(path: str) bool
Overloaded function.
is_oat(binary: lief._lief.ELF.Binary) -> bool
Check if the
Binarygiven in parameter is an OATis_oat(path: str) -> bool
Check if the file given in parameter is an OAT
is_oat(raw: collections.abc.Sequence[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: collections.abc.Sequence[int]) int
- lief.OAT.version(file: str) int
Overloaded function.
version(binary: lief._lief.ELF.Binary) -> int
Return the OAT version of the
Binarygiven in parameterversion(file: str) -> int
Return the OAT version of the file given in parameter
version(raw: collections.abc.Sequence[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_VERSIONSassociated 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: collections.abc.Sequence[int]) lief._lief.OAT.Binary | None
- lief.OAT.parse(obj: str | io.IOBase | os.PathLike | bytes | list[int]) lief._lief.OAT.Binary | None
- lief.OAT.parse(oat_file: str, vdex_file: str) lief._lief.OAT.Binary | None
Overloaded function.
parse(oat_file: str) -> Optional[lief._lief.OAT.Binary]
Parse the given OAT file and return a
Binaryobjectparse(oat_file: str, vdex_file: str) -> Optional[lief._lief.OAT.Binary]
Parse the given OAT with its VDEX file and return a
Binaryobjectparse(raw: collections.abc.Sequence[int]) -> Optional[lief._lief.OAT.Binary]
Parse the given raw data and return a
Binaryobjectparse(obj: Union[str | io.IOBase | os.PathLike | bytes | list[int]]) -> Optional[lief._lief.OAT.Binary]
Binary¶
- class lief.OAT.Binary¶
Bases:
BinaryOAT binary representation
- property dex2dex_json_info str¶
- get_class(self, class_name: str) lief._lief.OAT.Class | None¶
- get_class(self, class_index: int) lief._lief.OAT.Class | None
Overloaded function.
get_class(self, class_name: str) -> lief._lief.OAT.Class | None
Return the
Classfrom its nameget_class(self, class_index: int) -> lief._lief.OAT.Class | None
Return the
Classfrom its index
- has_class(self, arg: str, /) bool¶
Check if the class with the given name is present in the current OAT binary
- property header lief.OAT.Header¶
Return the OAT
Header
Header¶
- class lief.OAT.Header(self)¶
Bases:
ObjectOAT Header representation
- property checksum int¶
Checksum of the OAT file
- class element_t¶
Bases:
object- property key lief.OAT.HEADER_KEYS¶
- property value str¶
- property executable_offset int¶
- get(self, key: lief._lief.OAT.HEADER_KEYS) str¶
- property i2c_code_bridge_offset int¶
- property i2i_bridge_offset int¶
- property image_file_location_oat_checksum int¶
- property image_file_location_oat_data_begin int¶
- property image_patch_delta int¶
- property instruction_set lief.OAT.INSTRUCTION_SETS¶
List of
INSTRUCTION_SETS
- property jni_dlsym_lookup_offset int¶
- property key_value_size int¶
- property key_values lief.OAT.Header.it_key_values_t¶
Configuration used for the
dex2oattransformation
- property keys list[lief.OAT.HEADER_KEYS]¶
List of
HEADER_KEYSpresent
- property magic list[int]¶
Magic number which shoud be
oat\x0A
- property nb_dex_files int¶
Number of
lief.DEX.Fileregistered in the current OAT
- property oat_dex_files_offset int¶
Offset to the raw
lief.OAT.DexfileWarning
This attribute is only relevant for OAT for which the version is above 131
- property quick_generic_jni_trampoline_offset int¶
- property quick_imt_conflict_trampoline_offset int¶
- property quick_resolution_trampoline_offset int¶
- property quick_to_interpreter_bridge_offset int¶
- set(self, key: lief._lief.OAT.HEADER_KEYS, value: str) lief._lief.OAT.Header¶
- property version int¶
Underlying version of the OAT file
DexFile¶
- class lief.OAT.DexFile(self)¶
Bases:
ObjectOAT DexFile representation
- property checksum int¶
Checksum of the underlying DEX file
- property dex_file lief.DEX.File | None¶
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.Fileis present
- property location str¶
Original location of the DEX file
Class¶
- class lief.OAT.Class(self)¶
Bases:
ObjectOAT 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.Classobject is associated with this OAT Class
- property index int¶
Index the DEX classes pool (
lief.DEX.File.classes)
- is_quickened(self, dex_method: lief._lief.DEX.Method) bool¶
- is_quickened(self, method_index: int) bool
Overloaded function.
is_quickened(self, dex_method: lief._lief.DEX.Method) -> bool
Check if the given
lief.DEX.Methodis compiled into native codeis_quickened(self, method_index: int) -> bool
Check if the Method at the given index is compiled into native code
- method_offsets_index(self, arg: lief._lief.DEX.Method, /) int¶
- 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:
ObjectOAT Method representation
- property dex_method lief.DEX.Method | None¶
Mirrored
Methodassociated with the OAT method (or None)
- 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 | None¶
Classassociated with the method (or None)
- property quick_code list[int]¶
Quick code associated with the method