Pro.DEX
— API for parsing Android DEX files¶
Disassembling¶
The following code example demonstrates how to disassemble the classes of an Android DEX file.
from Pro.Core import *
from Pro.DEX import *
def disassembleDEXClasses(fname):
c = createContainerFromFile(fname)
if c.isNull():
return
obj = DEXObject()
if not obj.Load(c):
return
classes = obj.Classes()
class_count = classes.Count()
for i in range(class_count):
out = NTTextBuffer()
obj.Disassemble(out, i)
print(out.buffer)
Method Enumeration¶
The following code example shows how to enumerate the methods in the classes of an Android DEX file.
from Pro.Core import *
from Pro.DEX import *
def enumerateDEXMethods(fname):
c = createContainerFromFile(fname)
if c.isNull():
return
obj = DEXObject()
if not obj.Load(c):
return
classes = obj.Classes()
class_count = classes.Count()
for i in range(class_count):
class_name = obj.ClassIndexToString(i, True)
print("class:", class_name)
cd = ClassData()
if obj.GetClassData(i, cd):
for it in (cd.direct_methods.iterator(), cd.virtual_methods.iterator()):
while it.hasNext():
m = it.next()
method_name = obj.MethodIndexToString(m.index)
print(" method:", method_name)
ci = CodeItem()
if obj.GetCodeItem(m.code_off, ci, False):
print(" code offset:", hex(ci.code_offset), "- code size (in words):", hex(ci.insns_size))
An example output of the code:
class: com.android.providers.applications.ApplicationLauncher
method: void <init>()
code offset: 0x14e0 - code size (in words): 0x4
method: void launchApplication(android.net.Uri)
code offset: 0x14f8 - code size (in words): 0x4b
method: void showSearchResults(java.lang.String)
code offset: 0x15ac - code size (in words): 0x1d
[...]
Module API¶
Pro.DEX module API.
Classes:
This class represents an annotation.
This class represents an annotation element.
List of
AnnotationElement
elements.Iterator class for
AnnotationElementList
.List of
Annotation
elements.
AnnotationListIt
(obj)Iterator class for
AnnotationList
.This class represents the annotations directory.
This class represents the catch clause of an exception.
List of
CatchData
elements.
CatchListIt
(obj)Iterator class for
CatchList
.This class contains the members of a class.
ClassDef
()This class represents a class definition.
CodeItem
()This class represents a code item.
This class represents an Android DEX file.
This class represents debug information.
List of
FieldData
elements.
EncodedFieldListIt
(obj)Iterator class for
EncodedFieldList
.List of
MethodData
elements.
EncodedMethodListIt
(obj)Iterator class for
EncodedMethodList
.This class represents the data of a field.
This class represents the data of a field id item.
This class represents a map list item.
This class represents the data of a method.
This class represents a method handle.
This class represents a method id item.
This class represents a prototype id item.
TryData
()This class represents a try clause.
TryList
()List of
TryData
elements.
TryListIt
(obj)Iterator class for
TryList
.Attributes:
Class access flag.
Class access flag.
Class access flag.
Class access flag.
Class access flag.
Class access flag.
Class access flag.
Class access flag.
Class access flag.
Class access flag.
Debug opcode.
Debug opcode.
Debug opcode.
Debug opcode.
Debug opcode.
Debug opcode.
Debug opcode.
Debug opcode.
Debug opcode.
Debug opcode.
Little-endian constant.
Field access flag.
Field access flag.
Field access flag.
Field access flag.
Field access flag.
Field access flag.
Field access flag.
Field access flag.
Field access flag.
Method access flag.
Method access flag.
Method access flag.
Method access flag.
Method access flag.
Method access flag.
Method access flag.
Method access flag.
Method access flag.
Method access flag.
Method access flag.
Method access flag.
Method access flag.
Method access flag.
Method handle type.
Method handle type.
Method handle type.
Method handle type.
Method handle type.
Method handle type.
Method handle type.
Method handle type.
Method handle type.
Default value of
TryData.catch_all_instr
.Big-endian constant.
Smali bytecode tag.
Smali bytecode tag.
Smali bytecode tag.
Smali bytecode tag.
Smali bytecode tag.
Smali bytecode tag.
Smali bytecode tag.
Smali bytecode tag.
Smali bytecode tag.
Smali bytecode tag.
Smali bytecode tag.
Annotations directory item type.
Annotation item type.
Annotation set item type.
Annotation set reference list type.
Call site id item type.
Class data item type.
Class definition item type.
Code item type.
Debug information item type.
Encoded array item type.
Field id item type.
Header item type.
Hidden API class data item type.
Map list type.
Method handle item type.
Method id item type.
Prototype id item type.
String data item type.
String id item type.
Type id item type.
Type list type.
Annotation value.
Array value.
Boolean value.
Byte value.
Character value.
Double value.
Enum value.
Field value.
Float value.
Integer value.
Long value.
Method value.
Method handle value.
Method type value.
Null value.
Short value.
String value.
Type value.
Build visibility.
Run-time visibility.
System visibility.
- class Annotation¶
This class represents an annotation.
See also
DEXObject.GetAnnotationSet()
.Attributes:
A
AnnotationElementList
list of annotation elements.The offset of the annotation.
The type index of the annotation.
The visibility of the annotation.
- elements¶
A
AnnotationElementList
list of annotation elements.See also
AnnotationElement
.
- offset¶
The offset of the annotation.
- type_idx¶
The type index of the annotation.
- visibility¶
The visibility of the annotation.
- class AnnotationElement¶
This class represents an annotation element.
See also
Annotation
.Attributes:
The name index of the element.
The offset of the element.
The size of the element.
The type of the element.
The offset of the value after the name index.
- name¶
The name index of the element.
- offset¶
The offset of the element.
- size¶
The size of the element.
- type¶
The type of the element.
See also
DEXObject.GetTypeName()
.
- value_offset¶
The offset of the value after the name index.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- class AnnotationElementList¶
List of
AnnotationElement
elements.Methods:
append
(value)Inserts
value
at the end of the vector.
at
(i)Returns the item at index position
i
in the vector.
clear
()Removes all the elements from the vector and releases the memory used by the vector.
contains
(value)Checks the presence of an element in the vector.
count
(value)Returns the number of occurrences of
value
in the vector.
indexOf
(value[, start])Searches for an element in the vector.
insert
(i, value)Inserts
value
at index positioni
in the vector.
isEmpty
()Checks whether the vector is empty.
iterator
()Creates an iterator for the vector.
reserve
(alloc)Reserve space for
alloc
elements.
resize
(size)Sets the size of the vector to
size
.
size
()Returns the number of items in the vector.
- append(value: Pro.DEX.AnnotationElement) → None¶
Inserts
value
at the end of the vector.
- Parameters
value (AnnotationElement) – The value to add to the list.
See also
insert()
.
- at(i: int) → Pro.DEX.AnnotationElement¶
Returns the item at index position
i
in the vector.i
must be a valid index position in the vector (i.e.,0 <= i < size()
).
- Parameters
i (int) – The index of the element to return.
- Returns
Returns the requested element.
- Return type
- clear() → None¶
Removes all the elements from the vector and releases the memory used by the vector.
- contains(value: Pro.DEX.AnnotationElement) → bool¶
Checks the presence of an element in the vector.
- Parameters
value (AnnotationElement) – The value to check for.
- Returns
Returns
True
if the vector contains an occurrence of value; otherwise returnsFalse
.- Return type
bool
- count(value: Pro.DEX.AnnotationElement) → int¶
Returns the number of occurrences of
value
in the vector.
- Parameters
value (AnnotationElement) – The value to count.
- Returns
Returns the number of occurrences.
- Return type
int
See also
indexOf()
andcontains()
.
- indexOf(value: Pro.DEX.AnnotationElement, start: int = 0) → int¶
Searches for an element in the vector.
- Parameters
value (AnnotationElement) – The value to search for.
start (int) – The start index.
- Returns
Returns the index position of the first occurrence of
value
in the vector. Returns-1
if no item was found.- Return type
int
See also
contains()
.
- insert(i: int, value: Pro.DEX.AnnotationElement) → None¶
Inserts
value
at index positioni
in the vector. Ifi
is0
, the value is prepended to the vector. Ifi
issize()
, the value is appended to the vector.
- Parameters
i (int) – The position at which to add the value.
value (AnnotationElement) – The value to add.
See also
append()
.
- isEmpty() → bool¶
Checks whether the vector is empty.
- Returns
Returns
True
if the vector contains no items; otherwise returnsFalse
.- Return type
bool
See also
size()
.
- iterator() → Pro.DEX.AnnotationElementListIt¶
Creates an iterator for the vector.
- Returns
Returns the iterator.
- Return type
- reserve(alloc: int) → None¶
Reserve space for
alloc
elements. Calling this method doesn’t change the size of the vector.
- Parameters
alloc (int) – The amount of elements to reserve space for.
- resize(size: int) → None¶
Sets the size of the vector to
size
. Ifsize
is greater than the current size, elements are added to the end; the new elements are initialized with a default-constructed value. Ifsize
is less than the current size, elements are removed from the end.
- Parameters
size (int) – The new size of the vector.
See also
size()
.
- class AnnotationElementListIt(obj: Pro.DEX.AnnotationElementList)¶
Iterator class for
AnnotationElementList
.
- Parameters
obj (AnnotationElementList) – The object to iterate over.
Methods:
hasNext
()Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.
next
()Returns the next item and advances the iterator by one position.
previous
()Returns the previous item and moves the iterator back by one position.
toBack
()Moves the iterator to the back of the container (after the last item).
toFront
()Moves the iterator to the front of the container (before the first item).
- hasNext() → bool¶
- Returns
Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.- Return type
bool
See also
hasPrevious()
andnext()
.
- hasPrevious() → bool¶
- Returns
Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.- Return type
bool
See also
hasNext()
andprevious()
.
- next() → Pro.DEX.AnnotationElement¶
- Returns
Returns the next item and advances the iterator by one position.
- Return type
See also
hasNext()
andprevious()
.
- previous() → Pro.DEX.AnnotationElement¶
- Returns
Returns the previous item and moves the iterator back by one position.
- Return type
See also
hasPrevious()
andnext()
.
- toBack() → None¶
Moves the iterator to the back of the container (after the last item).
See also
toFront()
andprevious()
.
- class AnnotationList¶
List of
Annotation
elements.Methods:
append
(value)Inserts
value
at the end of the vector.
at
(i)Returns the item at index position
i
in the vector.
clear
()Removes all the elements from the vector and releases the memory used by the vector.
contains
(value)Checks the presence of an element in the vector.
count
(value)Returns the number of occurrences of
value
in the vector.
indexOf
(value[, start])Searches for an element in the vector.
insert
(i, value)Inserts
value
at index positioni
in the vector.
isEmpty
()Checks whether the vector is empty.
iterator
()Creates an iterator for the vector.
reserve
(alloc)Reserve space for
alloc
elements.
resize
(size)Sets the size of the vector to
size
.
size
()Returns the number of items in the vector.
- append(value: Pro.DEX.Annotation) → None¶
Inserts
value
at the end of the vector.
- Parameters
value (Annotation) – The value to add to the list.
See also
insert()
.
- at(i: int) → Pro.DEX.Annotation¶
Returns the item at index position
i
in the vector.i
must be a valid index position in the vector (i.e.,0 <= i < size()
).
- Parameters
i (int) – The index of the element to return.
- Returns
Returns the requested element.
- Return type
- clear() → None¶
Removes all the elements from the vector and releases the memory used by the vector.
- contains(value: Pro.DEX.Annotation) → bool¶
Checks the presence of an element in the vector.
- Parameters
value (Annotation) – The value to check for.
- Returns
Returns
True
if the vector contains an occurrence of value; otherwise returnsFalse
.- Return type
bool
- count(value: Pro.DEX.Annotation) → int¶
Returns the number of occurrences of
value
in the vector.
- Parameters
value (Annotation) – The value to count.
- Returns
Returns the number of occurrences.
- Return type
int
See also
indexOf()
andcontains()
.
- indexOf(value: Pro.DEX.Annotation, start: int = 0) → int¶
Searches for an element in the vector.
- Parameters
value (Annotation) – The value to search for.
start (int) – The start index.
- Returns
Returns the index position of the first occurrence of
value
in the vector. Returns-1
if no item was found.- Return type
int
See also
contains()
.
- insert(i: int, value: Pro.DEX.Annotation) → None¶
Inserts
value
at index positioni
in the vector. Ifi
is0
, the value is prepended to the vector. Ifi
issize()
, the value is appended to the vector.
- Parameters
i (int) – The position at which to add the value.
value (Annotation) – The value to add.
See also
append()
.
- isEmpty() → bool¶
Checks whether the vector is empty.
- Returns
Returns
True
if the vector contains no items; otherwise returnsFalse
.- Return type
bool
See also
size()
.
- iterator() → Pro.DEX.AnnotationListIt¶
Creates an iterator for the vector.
- Returns
Returns the iterator.
- Return type
- reserve(alloc: int) → None¶
Reserve space for
alloc
elements. Calling this method doesn’t change the size of the vector.
- Parameters
alloc (int) – The amount of elements to reserve space for.
- resize(size: int) → None¶
Sets the size of the vector to
size
. Ifsize
is greater than the current size, elements are added to the end; the new elements are initialized with a default-constructed value. Ifsize
is less than the current size, elements are removed from the end.
- Parameters
size (int) – The new size of the vector.
See also
size()
.
- class AnnotationListIt(obj: Pro.DEX.AnnotationList)¶
Iterator class for
AnnotationList
.
- Parameters
obj (AnnotationList) – The object to iterate over.
Methods:
hasNext
()Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.
next
()Returns the next item and advances the iterator by one position.
previous
()Returns the previous item and moves the iterator back by one position.
toBack
()Moves the iterator to the back of the container (after the last item).
toFront
()Moves the iterator to the front of the container (before the first item).
- hasNext() → bool¶
- Returns
Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.- Return type
bool
See also
hasPrevious()
andnext()
.
- hasPrevious() → bool¶
- Returns
Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.- Return type
bool
See also
hasNext()
andprevious()
.
- next() → Pro.DEX.Annotation¶
- Returns
Returns the next item and advances the iterator by one position.
- Return type
See also
hasNext()
andprevious()
.
- previous() → Pro.DEX.Annotation¶
- Returns
Returns the previous item and moves the iterator back by one position.
- Return type
See also
hasPrevious()
andnext()
.
- toBack() → None¶
Moves the iterator to the back of the container (after the last item).
See also
toFront()
andprevious()
.
- class AnnotationsDirectory¶
This class represents the annotations directory.
See also
DEXObject.GetAnnotationsDirectory()
.Attributes:
The offset of class annotations.
The number of field annotations.
The offset of field annotations.
The number of method annotations.
The offset of method annotations.
The number of parameter annotations.
The offset of parameter annotations.
- class_offs¶
The offset of class annotations.
- field_count¶
The number of field annotations.
- field_offs¶
The offset of field annotations.
- method_count¶
The number of method annotations.
- method_offs¶
The offset of method annotations.
- param_count¶
The number of parameter annotations.
- params_offs¶
The offset of parameter annotations.
- CACC_ABSTRACT: Final[int]¶
Class access flag.
Declared abstract; must not be instantiated.
- CACC_ANNOTATION: Final[int]¶
Class access flag.
Declared as an annotation type.
- CACC_ENUM: Final[int]¶
Class access flag.
Declared as an enum type.
- CACC_FINAL: Final[int]¶
Class access flag.
Declared final; no subclasses allowed.
- CACC_INTERFACE: Final[int]¶
Class access flag.
Is an interface, not a class.
- CACC_PRIVATE: Final[int]¶
Class access flag.
Declared private; may not be accessed from outside its package.
- CACC_PROTECTED: Final[int]¶
Class access flag.
Declared protected; may be accessed from within its package.
- CACC_PUBLIC: Final[int]¶
Class access flag.
Declared public; may be accessed from outside its package.
- CACC_STATIC: Final[int]¶
Class access flag.
Declared static.
- CACC_SYNTHETIC: Final[int]¶
Class access flag.
Declared synthetic; not present in the source code.
- class CatchData¶
This class represents the catch clause of an exception.
Attributes:
The instruction offset for the catch clause.
The type index of the catch clause.
- instr¶
The instruction offset for the catch clause.
Note
This value must be multiplied by 2.
- type_idx¶
The type index of the catch clause.
See also
DEXObject.TypeIndexToString()
.
- class CatchList¶
List of
CatchData
elements.Methods:
append
(value)Inserts
value
at the end of the vector.
at
(i)Returns the item at index position
i
in the vector.
clear
()Removes all the elements from the vector and releases the memory used by the vector.
contains
(value)Checks the presence of an element in the vector.
count
(value)Returns the number of occurrences of
value
in the vector.
indexOf
(value[, start])Searches for an element in the vector.
insert
(i, value)Inserts
value
at index positioni
in the vector.
isEmpty
()Checks whether the vector is empty.
iterator
()Creates an iterator for the vector.
reserve
(alloc)Reserve space for
alloc
elements.
resize
(size)Sets the size of the vector to
size
.
size
()Returns the number of items in the vector.
- append(value: Pro.DEX.CatchData) → None¶
Inserts
value
at the end of the vector.
- Parameters
value (CatchData) – The value to add to the list.
See also
insert()
.
- at(i: int) → Pro.DEX.CatchData¶
Returns the item at index position
i
in the vector.i
must be a valid index position in the vector (i.e.,0 <= i < size()
).
- Parameters
i (int) – The index of the element to return.
- Returns
Returns the requested element.
- Return type
- clear() → None¶
Removes all the elements from the vector and releases the memory used by the vector.
- contains(value: Pro.DEX.CatchData) → bool¶
Checks the presence of an element in the vector.
- Parameters
value (CatchData) – The value to check for.
- Returns
Returns
True
if the vector contains an occurrence of value; otherwise returnsFalse
.- Return type
bool
- count(value: Pro.DEX.CatchData) → int¶
Returns the number of occurrences of
value
in the vector.
- Parameters
value (CatchData) – The value to count.
- Returns
Returns the number of occurrences.
- Return type
int
See also
indexOf()
andcontains()
.
- indexOf(value: Pro.DEX.CatchData, start: int = 0) → int¶
Searches for an element in the vector.
- Parameters
value (CatchData) – The value to search for.
start (int) – The start index.
- Returns
Returns the index position of the first occurrence of
value
in the vector. Returns-1
if no item was found.- Return type
int
See also
contains()
.
- insert(i: int, value: Pro.DEX.CatchData) → None¶
Inserts
value
at index positioni
in the vector. Ifi
is0
, the value is prepended to the vector. Ifi
issize()
, the value is appended to the vector.
- Parameters
i (int) – The position at which to add the value.
value (CatchData) – The value to add.
See also
append()
.
- isEmpty() → bool¶
Checks whether the vector is empty.
- Returns
Returns
True
if the vector contains no items; otherwise returnsFalse
.- Return type
bool
See also
size()
.
- iterator() → Pro.DEX.CatchListIt¶
Creates an iterator for the vector.
- Returns
Returns the iterator.
- Return type
- reserve(alloc: int) → None¶
Reserve space for
alloc
elements. Calling this method doesn’t change the size of the vector.
- Parameters
alloc (int) – The amount of elements to reserve space for.
- resize(size: int) → None¶
Sets the size of the vector to
size
. Ifsize
is greater than the current size, elements are added to the end; the new elements are initialized with a default-constructed value. Ifsize
is less than the current size, elements are removed from the end.
- Parameters
size (int) – The new size of the vector.
See also
size()
.
- class CatchListIt(obj: Pro.DEX.CatchList)¶
Iterator class for
CatchList
.
- Parameters
obj (CatchList) – The object to iterate over.
Methods:
hasNext
()Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.
next
()Returns the next item and advances the iterator by one position.
previous
()Returns the previous item and moves the iterator back by one position.
toBack
()Moves the iterator to the back of the container (after the last item).
toFront
()Moves the iterator to the front of the container (before the first item).
- hasNext() → bool¶
- Returns
Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.- Return type
bool
See also
hasPrevious()
andnext()
.
- hasPrevious() → bool¶
- Returns
Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.- Return type
bool
See also
hasNext()
andprevious()
.
- next() → Pro.DEX.CatchData¶
- Returns
Returns the next item and advances the iterator by one position.
- Return type
See also
hasNext()
andprevious()
.
- previous() → Pro.DEX.CatchData¶
- Returns
Returns the previous item and moves the iterator back by one position.
- Return type
See also
hasPrevious()
andnext()
.
- toBack() → None¶
Moves the iterator to the back of the container (after the last item).
See also
toFront()
andprevious()
.
- class ClassData¶
This class contains the members of a class.
See also
DEXObject.GetClassData()
.Attributes:
A
EncodedMethodList
list of direct methods.A
EncodedFieldList
list of instance fields.The size of the class.
A
EncodedFieldList
list of static fields.A
EncodedMethodList
list of virtual methods.
- direct_methods¶
A
EncodedMethodList
list of direct methods.See also
MethodData
.
- instance_fields¶
A
EncodedFieldList
list of instance fields.See also
FieldData
.
- size¶
The size of the class.
- static_fields¶
A
EncodedFieldList
list of static fields.See also
FieldData
.
- virtual_methods¶
A
EncodedMethodList
list of virtual methods.See also
MethodData
.
- class ClassDef¶
This class represents a class definition.
See also
DEXObject.GetClass()
.Attributes:
The access flags of the class (e.g.,
CACC_PUBLIC
).The annotations offset.
The class data offset.
The class type index.
The interfaces offset.
The source file index.
The static values offset.
The superclass type index.
- access_flags¶
The access flags of the class (e.g.,
CACC_PUBLIC
).
- annotations_off¶
The annotations offset.
- class_data_off¶
The class data offset.
- class_idx¶
The class type index.
See also
DEXObject.TypeIndexToString()
.
- interfaces_off¶
The interfaces offset.
- source_file_idx¶
The source file index.
See also
DEXObject.IndexToString()
.
- static_values_off¶
The static values offset.
- superclass_idx¶
The superclass type index.
See also
DEXObject.TypeIndexToString()
.
- class CodeItem¶
This class represents a code item.
See also
DEXObject.GetCodeItem()
.Attributes:
The offset of the catch clauses.
The offset of the code.
The debug information offset.
The number of words of incoming arguments.
The size of the code in 16-bit instructions.
The number of words of outgoing argument space.
The number of registers used by the code.
The size of the code item.
The offset of the try clauses.
The size of the try clauses.
- catches_offset¶
The offset of the catch clauses.
- code_offset¶
The offset of the code.
- debug_info_off¶
The debug information offset.
- ins_size¶
The number of words of incoming arguments.
- insns_size¶
The size of the code in 16-bit instructions.
- outs_size¶
The number of words of outgoing argument space.
- registers_size¶
The number of registers used by the code.
- size¶
The size of the code item.
- tries_offset¶
The offset of the try clauses.
- tries_size¶
The size of the try clauses.
- DBG_ADVANCE_LINE: Final[int]¶
Debug opcode.
- DBG_ADVANCE_PC: Final[int]¶
Debug opcode.
- DBG_END_LOCAL: Final[int]¶
Debug opcode.
- DBG_END_SEQUENCE: Final[int]¶
Debug opcode.
- DBG_RESTART_LOCAL: Final[int]¶
Debug opcode.
- DBG_SET_EPILOGUE_BEGIN: Final[int]¶
Debug opcode.
- DBG_SET_FILE: Final[int]¶
Debug opcode.
- DBG_SET_PROLOGUE_END: Final[int]¶
Debug opcode.
- DBG_START_LOCAL: Final[int]¶
Debug opcode.
- DBG_START_LOCAL_EXTENDED: Final[int]¶
Debug opcode.
- class DEXObject¶
Bases:
Pro.Core.CFFObject
This class represents an Android DEX file.
Methods:
Returns a list of class site structures.
ClassIndexToString
(i[, beautify])Converts a class index to its string representation.
Classes
()Returns a list of class definition structures.
Computes layout ranges for the file.
Demangle
(descr)Unmangles a type.
Disassemble
(out, token[, include_nested])Disassembles the specified class.
DisassembleMethod
(out, md[, addclass, curclass])Disassembles the specified method.
DumpCodeItem
(out, offset)Outputs a code item.
DumpNamelessValue
(out, offset_or_r[, …])Outputs a nameless value.
DumpValue
(out, offset_or_r[, with_type_info])Outputs a value.
FieldIndexToString
(i[, beautify, addclass, …])Converts a field index into its string representation.
GetAnnotationSet
(offset, al)Retrieves a list of annotations.
GetAnnotationsDirectory
(offset, ad)Retrieves the annotations directory.
GetArrayValues
(offset)Retrieves an array of values.
GetClass
(i, cd)Retrieves a class definition.
GetClassData
(i, cd)Retrieves the data of a class.
GetCodeItem
(offset, ci[, parse_catches])Retrieves a code item.
GetDebugInfo
(offset, di[, parse_bytecode])Retrieves debug information.
GetFieldIdItem
(i, fii)Retrieves a field id item.
Returns the number of field id items.
GetMapListItem
(i, mli)Retrieves a map list item.
GetMapListItemByType
(type, mli)Retrieves a map list item by its type.
Returns the number of map list items.
Retrieves the name of a map type.
GetMethodHandle
(i, mh)Retrieves a method handle.
GetMethodIdItem
(i, mii)Retrieves a method id item.
Returns the number of method id items.
GetProtoIdItem
(i, pii)Retrieves a proto id item.
Returns the number of proto id items.
GetTries
(ci, tl[, parse_catches])Retrieves try clauses for a code item.
GetTypeName
(t)Retrieves the name of a type.
Gets the name of a visibility.
Header
()Returns the main header of the Android DEX file.
Retrieves a string from its index.
LastCommonDot
(str1, str2)Retrieves the index of the last common dot between two input strings.
Returns a list of method handle structures.
MethodIndexToString
(i[, beautify, addclass, …])Converts a method index into its string representation.
ProtoIndexToString
(i[, name, beautify, …])Converts a prototype index into its string representation.
ReadMUTF8String
(offset, maxlen)Reads a MUTF8 string.
ReadSLEB128
(r)Reads a signed encoded integer.
ReadULEB128
(r)Reads an unsigned encoded integer.
Reads a P1 unsigned encoded integer.
SplitClassFromNS
(name)Splits a class name from its namespace.
TypeIndexToString
(i[, beautify, curclass])Converts a type index into its string representation.
Attributes:
Index string option: puts the return value in a comment.
Index string option: avoids the ‘return’ string in the comment.
- CallSites() → Pro.Core.CFFStruct¶
- Returns
Returns a list of class site structures.
- Return type
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- ClassIndexToString(i: int, beautify: bool = True) → str¶
Converts a class index to its string representation.
- Parameters
i (int) – The class index.
beautify (bool) – If
True
, beautifies the returned string.- Returns
Returns the string if successful; otherwise returns an empty string.
- Return type
str
- Classes() → Pro.Core.CFFStruct¶
- Returns
Returns a list of class definition structures.
- Return type
- ComputeLayoutRanges(r: NTRanges) → None¶
Computes layout ranges for the file.
- Parameters
r (NTRanges) – The instance of
Pro.Core.NTRanges
used to compute the layout.
- static Demangle(descr: str) → str¶
Unmangles a type.
Note
This method is used internally by
TypeIndexToString()
.
- Parameters
descr (str) – The mangled type.
- Returns
Returns the unmangled type.
- Return type
str
See also
TypeIndexToString()
.
- Disassemble(out: Pro.Core.NTTextStream, token: int, include_nested: bool = False) → None¶
Disassembles the specified class.
- Parameters
out (NTTextStream) – The output stream.
token (int) – The class index.
See also
DisassembleMethod()
.
- DisassembleMethod(out: Pro.Core.NTTextStream, md: Pro.DEX.MethodData, addclass: bool = False, curclass: str = str()) → None¶
Disassembles the specified method.
- Parameters
out (NTTextStream) – The output stream.
md (MethodData) – The method data.
addclass (bool) – If
True
, adds the name of the class.curclass (str) – The name of the current class.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
Disassemble()
.
- DumpCodeItem(out: Pro.Core.NTTextStream, offset: int) → None¶
Outputs a code item.
- Parameters
out (NTTextStream) – The output stream.
offset (int) – The offset of the code item.
See also
GetCodeItem()
.
- DumpNamelessValue(out: Pro.Core.NTTextStream, offset_or_r: Union[Pro.Core.CFFBuffer, int], with_type_info: bool = True) → None¶
Outputs a nameless value.
- Parameters
out (NTTextStream) – The output stream.
offset_or_r (Union[CFFBuffer, int]) – Either the offset of the nameless value or the
Pro.Core.CFFBuffer
instance.
- DumpValue(out: Pro.Core.NTTextStream, offset_or_r: Union[Pro.Core.CFFBuffer, int], with_type_info: bool = True) → None¶
Outputs a value.
- Parameters
out (NTTextStream) – The output stream.
offset_or_r (Union[CFFBuffer, int]) – Either the offset of the value or the
Pro.Core.CFFBuffer
instance.
- FieldIndexToString(i: int, beautify: bool = True, addclass: bool = False, curclass: str = str()) → str¶
Converts a field index into its string representation.
- Parameters
i (int) – The field index.
beautify (bool) – If
True
, beautifies the returned string.addclass (bool) – If
True
, adds the name of the class to the field name.curclass (str) – The name of the current class.
- Returns
Returns the string if successful; otherwise returns an empty string.
- Return type
str
- GetAnnotationSet(offset: int, al: Pro.DEX.AnnotationList) → bool¶
Retrieves a list of annotations.
- Parameters
offset (int) – The offset of the annotations.
al (AnnotationList) – The list of annotations to retrieve.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
Annotation
.
- GetAnnotationsDirectory(offset: int, ad: Pro.DEX.AnnotationsDirectory) → bool¶
Retrieves the annotations directory.
- Parameters
offset (int) – The offset of the annotations directory.
ad (AnnotationsDirectory) – The annotations directory to retrieve.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
AnnotationsDirectory
.
- GetArrayValues(offset: int) → Pro.Core.NTUIntVector¶
Retrieves an array of values.
- Parameters
offset (int) – The offset of the values.
- Returns
Returns the value array.
- Return type
- GetClass(i: int, cd: Pro.DEX.ClassDef) → bool¶
Retrieves a class definition.
- Parameters
i (int) – The index of the class.
cd (ClassDef) – The instance of the class definition to retrieve.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
ClassDef
.
- GetClassData(i: int, cd: Pro.DEX.ClassData) → bool¶
Retrieves the data of a class.
- Parameters
i (int) – The index of the class.
cd (ClassData) – The instance of the class data to retrieve.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
ClassData
.
- GetCodeItem(offset: int, ci: Pro.DEX.CodeItem, parse_catches: bool = False) → bool¶
Retrieves a code item.
- Parameters
offset (int) – The offset of the code item.
ci (CodeItem) – The instance of the code item to retrieve.
parse_catches (bool) – If
True
, retrieves catch clauses.- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
CodeItem
.
- GetDebugInfo(offset: int, di: Pro.DEX.DebugInfo, parse_bytecode: bool = False) → bool¶
Retrieves debug information.
- Parameters
offset (int) – The offset of the debug information.
di (DebugInfo) – The instance of the debug information to retrieve.
parse_bytecode (bool) – If
True
, parses the byte-code.- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
See also
DebugInfo
.
- GetFieldIdItem(i: int, fii: Pro.DEX.FieldIdItem) → bool¶
Retrieves a field id item.
- Parameters
i (int) – The index of the field id item to retrieve.
fii (FieldIdItem) – The instance of the field id item to retrieve.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
GetFieldIdItemCount()
.
- GetFieldIdItemCount() → int¶
- Returns
Returns the number of field id items.
- Return type
int
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
GetFieldIdItem()
.
- GetMapListItem(i: int, mli: Pro.DEX.MapListItem) → bool¶
Retrieves a map list item.
- Parameters
i (int) – The index of the map list item to retrieve.
mli (MapListItem) – The instance of the map list item to retrieve.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
GetMapListSize()
andGetMapListItemByType()
.
- GetMapListItemByType(type: int, mli: Pro.DEX.MapListItem) → bool¶
Retrieves a map list item by its type.
- Parameters
type (int) – The type of the map list item to retrieve.
mli (MapListItem) – The instance of the map list item to retrieve.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
GetMapListSize()
andGetMapListItem()
.
- GetMapListSize() → int¶
- Returns
Returns the number of map list items.
- Return type
int
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
GetMapListItem()
.
- static GetMapTypeName(t: int) → str¶
Retrieves the name of a map type.
- Parameters
t (int) – The map type.
- Returns
Returns the name of the map type if successful; otherwise returns
None
- Return type
str
- GetMethodHandle(i: int, mh: Pro.DEX.MethodHandle) → bool¶
Retrieves a method handle.
- Parameters
i (int) – The index of the method handle to retrieve.
mh (MethodHandle) – The instance of the method handle to retrieve.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
MethodHandles()
.
- GetMethodIdItem(i: int, mii: Pro.DEX.MethodIdItem) → bool¶
Retrieves a method id item.
- Parameters
i (int) – The index of the method id item to retrieve.
mii (MethodIdItem) – The instance of the method id item to retrieve.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
GetMethodIdItemCount()
.
- GetMethodIdItemCount() → int¶
- Returns
Returns the number of method id items.
- Return type
int
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
GetMethodIdItem()
.
- GetProtoIdItem(i: int, pii: Pro.DEX.ProtoIdItem) → bool¶
Retrieves a proto id item.
- Parameters
i (int) – The index of the method id item to retrieve.
pii (ProtoIdItem) – The instance of the proto id item to retrieve.
- Returns
Returns
True
if successful; otherwise returnsFalse
.- Return type
bool
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
GetProtoIdItemCount()
.
- GetProtoIdItemCount() → int¶
- Returns
Returns the number of proto id items.
- Return type
int
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
GetProtoIdItem()
.
- GetTries(ci: Pro.DEX.CodeItem, tl: Pro.DEX.TryList, parse_catches: bool = False) → bool¶
Retrieves try clauses for a code item.
- static GetTypeName(t: int) → str¶
Retrieves the name of a type.
- Parameters
t (int) – The type.
- Returns
Returns the name of the type if successful; otherwise returns
None
- Return type
str
- static GetVisibilityName(v: int) → str¶
Gets the name of a visibility.
- Parameters
v (int) – The visibility.
- Returns
Returns the name of the visibility if successful; otherwise returns
None
- Return type
str
- Header() → Pro.Core.CFFStruct¶
- Returns
Returns the main header of the Android DEX file.
- Return type
- IDXSO_FieldType: Final[int]¶
Index string option: puts the return value in a comment.
- IDXSO_ReturnComment: Final[int]¶
Index string option: avoids the ‘return’ string in the comment.
- IndexToString(i: int) → str¶
Retrieves a string from its index.
- Parameters
i (int) – The string index.
- Returns
Returns the string if successful; otherwise returns an empty string.
- Return type
str
- static LastCommonDot(str1: str, str2: str) → int¶
Retrieves the index of the last common dot between two input strings.
- Parameters
str1 (str) – The first input string.
str2 (str) – The second input string.
- Returns
Returns the index of the last common dot if successful; otherwise returns
-1
.- Return type
int
- MethodHandles() → Pro.Core.CFFStruct¶
- Returns
Returns a list of method handle structures.
- Return type
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- MethodIndexToString(i: int, beautify: bool = True, addclass: bool = False, curclass: str = str(), params_names: Pro.Core.NTUIntVector = NTUIntVector()) → str¶
Converts a method index into its string representation.
- Parameters
i (int) – The method index.
beautify (bool) – If
True
, beautifies the returned string.addclass (bool) – If
True
, adds the name of the class to the method name.curclass (str) – The name of the current class.
params_names (NTUIntVector) – The name indexes of the parameters.
- Returns
Returns the string if successful; otherwise returns an empty string.
- Return type
str
- ProtoIndexToString(i: int, name: str = str(), beautify: bool = True, curclass: str = str(), params_names: Pro.Core.NTUIntVector = NTUIntVector()) → str¶
Converts a prototype index into its string representation.
- Parameters
i (int) – The prototype index.
name (str) – The name of the prototype.
beautify (bool) – If
True
, beautifies the returned string.curclass (str) – The name of the current class.
params_names (NTUIntVector) – The name indexes of the parameters.
- Returns
Returns the string if successful; otherwise returns an empty string.
- Return type
str
- ReadMUTF8String(offset: int, maxlen: int) → tuple¶
Reads a MUTF8 string.
- Parameters
offset (int) – The offset of the string.
maxlen (int) – The maximum length of the string.
- Returns
Returns a tuple containing the string read and a boolean. The boolean value is
True
if successful; otherwise it isFalse
.- Return type
str
- ReadSLEB128(r: Pro.Core.CFFBuffer) → int¶
Reads a signed encoded integer.
- Parameters
r (CFFBuffer) – The
Pro.Core.CFFBuffer
instance.- Returns
Returns the integer read.
- Return type
int
See also
ReadULEB128()
andReadULEB128P1()
.
- ReadULEB128(r: Pro.Core.CFFBuffer) → int¶
Reads an unsigned encoded integer.
- Parameters
r (CFFBuffer) – The
Pro.Core.CFFBuffer
instance.- Returns
Returns the integer read.
- Return type
int
See also
ReadSLEB128()
andReadULEB128P1()
.
- ReadULEB128P1(r: Pro.Core.CFFBuffer) → int¶
Reads a P1 unsigned encoded integer.
- Parameters
r (CFFBuffer) – The
Pro.Core.CFFBuffer
instance.- Returns
Returns the integer read.
- Return type
int
See also
ReadSLEB128()
andReadULEB128()
.
- static SplitClassFromNS(name: str) → tuple¶
Splits a class name from its namespace.
- Parameters
name (str) – The input string.
- Returns
Returns the class name if successful; otherwise returns an empty string.
- Return type
str
- TypeIndexToString(i: int, beautify: bool = True, curclass: str = str()) → str¶
Converts a type index into its string representation.
- Parameters
i (int) – The type index.
beautify (bool) – If
True
, beautifies the returned string.- Returns
Returns the string if successful; otherwise returns an empty string.
- Return type
str
- class DebugInfo¶
This class represents debug information.
See also
DEXObject.GetDebugInfo()
.Attributes:
The offset of the byte-code.
The start line.
Array of parameter name indexes.
The size of the debug information.
- bytecode_offs¶
The offset of the byte-code.
- line_start¶
The start line.
- params_names¶
Array of parameter name indexes.
- size¶
The size of the debug information.
- ENDIAN_CONSTANT: Final[int]¶
Little-endian constant.
See also
REVERSE_ENDIAN_CONSTANT
.
- class EncodedFieldList¶
List of
FieldData
elements.Methods:
append
(value)Inserts
value
at the end of the vector.
at
(i)Returns the item at index position
i
in the vector.
clear
()Removes all the elements from the vector and releases the memory used by the vector.
contains
(value)Checks the presence of an element in the vector.
count
(value)Returns the number of occurrences of
value
in the vector.
indexOf
(value[, start])Searches for an element in the vector.
insert
(i, value)Inserts
value
at index positioni
in the vector.
isEmpty
()Checks whether the vector is empty.
iterator
()Creates an iterator for the vector.
reserve
(alloc)Reserve space for
alloc
elements.
resize
(size)Sets the size of the vector to
size
.
size
()Returns the number of items in the vector.
- append(value: Pro.DEX.FieldData) → None¶
Inserts
value
at the end of the vector.
- Parameters
value (FieldData) – The value to add to the list.
See also
insert()
.
- at(i: int) → Pro.DEX.FieldData¶
Returns the item at index position
i
in the vector.i
must be a valid index position in the vector (i.e.,0 <= i < size()
).
- Parameters
i (int) – The index of the element to return.
- Returns
Returns the requested element.
- Return type
- clear() → None¶
Removes all the elements from the vector and releases the memory used by the vector.
- contains(value: Pro.DEX.FieldData) → bool¶
Checks the presence of an element in the vector.
- Parameters
value (FieldData) – The value to check for.
- Returns
Returns
True
if the vector contains an occurrence of value; otherwise returnsFalse
.- Return type
bool
- count(value: Pro.DEX.FieldData) → int¶
Returns the number of occurrences of
value
in the vector.
- Parameters
value (FieldData) – The value to count.
- Returns
Returns the number of occurrences.
- Return type
int
See also
indexOf()
andcontains()
.
- indexOf(value: Pro.DEX.FieldData, start: int = 0) → int¶
Searches for an element in the vector.
- Parameters
value (FieldData) – The value to search for.
start (int) – The start index.
- Returns
Returns the index position of the first occurrence of
value
in the vector. Returns-1
if no item was found.- Return type
int
See also
contains()
.
- insert(i: int, value: Pro.DEX.FieldData) → None¶
Inserts
value
at index positioni
in the vector. Ifi
is0
, the value is prepended to the vector. Ifi
issize()
, the value is appended to the vector.
- Parameters
i (int) – The position at which to add the value.
value (FieldData) – The value to add.
See also
append()
.
- isEmpty() → bool¶
Checks whether the vector is empty.
- Returns
Returns
True
if the vector contains no items; otherwise returnsFalse
.- Return type
bool
See also
size()
.
- iterator() → Pro.DEX.EncodedFieldListIt¶
Creates an iterator for the vector.
- Returns
Returns the iterator.
- Return type
- reserve(alloc: int) → None¶
Reserve space for
alloc
elements. Calling this method doesn’t change the size of the vector.
- Parameters
alloc (int) – The amount of elements to reserve space for.
- resize(size: int) → None¶
Sets the size of the vector to
size
. Ifsize
is greater than the current size, elements are added to the end; the new elements are initialized with a default-constructed value. Ifsize
is less than the current size, elements are removed from the end.
- Parameters
size (int) – The new size of the vector.
See also
size()
.
- class EncodedFieldListIt(obj: Pro.DEX.EncodedFieldList)¶
Iterator class for
EncodedFieldList
.
- Parameters
obj (EncodedFieldList) – The object to iterate over.
Methods:
hasNext
()Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.
next
()Returns the next item and advances the iterator by one position.
previous
()Returns the previous item and moves the iterator back by one position.
toBack
()Moves the iterator to the back of the container (after the last item).
toFront
()Moves the iterator to the front of the container (before the first item).
- hasNext() → bool¶
- Returns
Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.- Return type
bool
See also
hasPrevious()
andnext()
.
- hasPrevious() → bool¶
- Returns
Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.- Return type
bool
See also
hasNext()
andprevious()
.
- next() → Pro.DEX.FieldData¶
- Returns
Returns the next item and advances the iterator by one position.
- Return type
See also
hasNext()
andprevious()
.
- previous() → Pro.DEX.FieldData¶
- Returns
Returns the previous item and moves the iterator back by one position.
- Return type
See also
hasPrevious()
andnext()
.
- toBack() → None¶
Moves the iterator to the back of the container (after the last item).
See also
toFront()
andprevious()
.
- class EncodedMethodList¶
List of
MethodData
elements.Methods:
append
(value)Inserts
value
at the end of the vector.
at
(i)Returns the item at index position
i
in the vector.
clear
()Removes all the elements from the vector and releases the memory used by the vector.
contains
(value)Checks the presence of an element in the vector.
count
(value)Returns the number of occurrences of
value
in the vector.
indexOf
(value[, start])Searches for an element in the vector.
insert
(i, value)Inserts
value
at index positioni
in the vector.
isEmpty
()Checks whether the vector is empty.
iterator
()Creates an iterator for the vector.
reserve
(alloc)Reserve space for
alloc
elements.
resize
(size)Sets the size of the vector to
size
.
size
()Returns the number of items in the vector.
- append(value: Pro.DEX.MethodData) → None¶
Inserts
value
at the end of the vector.
- Parameters
value (MethodData) – The value to add to the list.
See also
insert()
.
- at(i: int) → Pro.DEX.MethodData¶
Returns the item at index position
i
in the vector.i
must be a valid index position in the vector (i.e.,0 <= i < size()
).
- Parameters
i (int) – The index of the element to return.
- Returns
Returns the requested element.
- Return type
- clear() → None¶
Removes all the elements from the vector and releases the memory used by the vector.
- contains(value: Pro.DEX.MethodData) → bool¶
Checks the presence of an element in the vector.
- Parameters
value (MethodData) – The value to check for.
- Returns
Returns
True
if the vector contains an occurrence of value; otherwise returnsFalse
.- Return type
bool
- count(value: Pro.DEX.MethodData) → int¶
Returns the number of occurrences of
value
in the vector.
- Parameters
value (MethodData) – The value to count.
- Returns
Returns the number of occurrences.
- Return type
int
See also
indexOf()
andcontains()
.
- indexOf(value: Pro.DEX.MethodData, start: int = 0) → int¶
Searches for an element in the vector.
- Parameters
value (MethodData) – The value to search for.
start (int) – The start index.
- Returns
Returns the index position of the first occurrence of
value
in the vector. Returns-1
if no item was found.- Return type
int
See also
contains()
.
- insert(i: int, value: Pro.DEX.MethodData) → None¶
Inserts
value
at index positioni
in the vector. Ifi
is0
, the value is prepended to the vector. Ifi
issize()
, the value is appended to the vector.
- Parameters
i (int) – The position at which to add the value.
value (MethodData) – The value to add.
See also
append()
.
- isEmpty() → bool¶
Checks whether the vector is empty.
- Returns
Returns
True
if the vector contains no items; otherwise returnsFalse
.- Return type
bool
See also
size()
.
- iterator() → Pro.DEX.EncodedMethodListIt¶
Creates an iterator for the vector.
- Returns
Returns the iterator.
- Return type
- reserve(alloc: int) → None¶
Reserve space for
alloc
elements. Calling this method doesn’t change the size of the vector.
- Parameters
alloc (int) – The amount of elements to reserve space for.
- resize(size: int) → None¶
Sets the size of the vector to
size
. Ifsize
is greater than the current size, elements are added to the end; the new elements are initialized with a default-constructed value. Ifsize
is less than the current size, elements are removed from the end.
- Parameters
size (int) – The new size of the vector.
See also
size()
.
- class EncodedMethodListIt(obj: Pro.DEX.EncodedMethodList)¶
Iterator class for
EncodedMethodList
.
- Parameters
obj (EncodedMethodList) – The object to iterate over.
Methods:
hasNext
()Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.
next
()Returns the next item and advances the iterator by one position.
previous
()Returns the previous item and moves the iterator back by one position.
toBack
()Moves the iterator to the back of the container (after the last item).
toFront
()Moves the iterator to the front of the container (before the first item).
- hasNext() → bool¶
- Returns
Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.- Return type
bool
See also
hasPrevious()
andnext()
.
- hasPrevious() → bool¶
- Returns
Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.- Return type
bool
See also
hasNext()
andprevious()
.
- next() → Pro.DEX.MethodData¶
- Returns
Returns the next item and advances the iterator by one position.
- Return type
See also
hasNext()
andprevious()
.
- previous() → Pro.DEX.MethodData¶
- Returns
Returns the previous item and moves the iterator back by one position.
- Return type
See also
hasPrevious()
andnext()
.
- toBack() → None¶
Moves the iterator to the back of the container (after the last item).
See also
toFront()
andprevious()
.
- FACC_ENUM: Final[int]¶
Field access flag.
Declared as an element of an enum.
- FACC_FINAL: Final[int]¶
Field access flag.
Declared final; never directly assigned to after object construction.
- FACC_PRIVATE: Final[int]¶
Field access flag.
Declared private; usable only within the defining class.
- FACC_PROTECTED: Final[int]¶
Field access flag.
Declared protected; may be accessed within subclasses.
- FACC_PUBLIC: Final[int]¶
Field access flag.
Declared public; may be accessed from outside its package.
- FACC_STATIC: Final[int]¶
Field access flag.
Declared static.
- FACC_SYNTHETIC: Final[int]¶
Field access flag.
Declared synthetic; not present in the source code.
- FACC_TRANSIENT: Final[int]¶
Field access flag.
Declared transient; not written or read by a persistent object manager.
- FACC_VOLATILE: Final[int]¶
Field access flag.
Declared volatile; cannot be cached.
- class FieldData¶
This class represents the data of a field.
Attributes:
The access flags (e.g.,
FACC_PUBLIC
).The index of the field.
The offset of the data.
- access_flags¶
The access flags (e.g.,
FACC_PUBLIC
).
- index¶
The index of the field.
- offset¶
The offset of the data.
- class FieldIdItem¶
This class represents the data of a field id item.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
Attributes:
The index of the class.
The index of the name.
The index of the type.
- class_idx¶
The index of the class.
- name_idx¶
The index of the name.
- type_idx¶
The index of the type.
- MACC_ABSTRACT: Final[int]¶
Method access flag.
Declared abstract; no implementation is provided.
- MACC_BRIDGE: Final[int]¶
Method access flag.
A bridge method, generated by the compiler.
- MACC_CONSTRUCTOR: Final[int]¶
Method access flag.
A constructor method.
- MACC_DECLARED_SYNCHRONIZED: Final[int]¶
Method access flag.
Declared synchronized; invocation is wrapped by a monitor use.
- MACC_FINAL: Final[int]¶
Method access flag.
Declared final; no subclasses allowed.
- MACC_NATIVE: Final[int]¶
Method access flag.
Declared native; implemented in a language other than Java.
- MACC_PRIVATE: Final[int]¶
Method access flag.
Declared private; accessible only within the defining class.
- MACC_PROTECTED: Final[int]¶
Method access flag.
Declared protected; may be accessed within subclasses.
- MACC_PUBLIC: Final[int]¶
Method access flag.
Declared public; may be accessed from outside its package.
- MACC_STATIC: Final[int]¶
Method access flag.
Declared static.
- MACC_STRICT: Final[int]¶
Method access flag.
Declared strictfp; floating-point mode is FP-strict.
- MACC_SYNCHRONIZED: Final[int]¶
Method access flag.
Declared synchronized; invocation is wrapped by a monitor use.
- MACC_SYNTHETIC: Final[int]¶
Method access flag.
Declared synthetic; not present in the source code.
- MACC_VARARGS: Final[int]¶
Method access flag.
Declared with variable number of arguments.
- METHOD_HANDLE_TYPE_INSTANCE_GET: Final[int]¶
Method handle type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- METHOD_HANDLE_TYPE_INSTANCE_PUT: Final[int]¶
Method handle type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- METHOD_HANDLE_TYPE_INVOKE_CONSTRUCTOR: Final[int]¶
Method handle type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- METHOD_HANDLE_TYPE_INVOKE_DIRECT: Final[int]¶
Method handle type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- METHOD_HANDLE_TYPE_INVOKE_INSTANCE: Final[int]¶
Method handle type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- METHOD_HANDLE_TYPE_INVOKE_INTERFACE: Final[int]¶
Method handle type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- METHOD_HANDLE_TYPE_INVOKE_STATIC: Final[int]¶
Method handle type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- METHOD_HANDLE_TYPE_STATIC_GET: Final[int]¶
Method handle type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- METHOD_HANDLE_TYPE_STATIC_PUT: Final[int]¶
Method handle type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- class MapListItem¶
This class represents a map list item.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
Attributes:
The offset of the item.
The size of the item.
The type of the item.
- offset¶
The offset of the item.
- size¶
The size of the item.
- type¶
The type of the item.
- class MethodData¶
This class represents the data of a method.
Attributes:
The access flags (e.g.,
MACC_PUBLIC
).The offset of the code.
The index of the method.
The offset of the data.
- access_flags¶
The access flags (e.g.,
MACC_PUBLIC
).
- code_off¶
The offset of the code.
- index¶
The index of the method.
- offset¶
The offset of the data.
- class MethodHandle¶
This class represents a method handle.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
Attributes:
Either a field or method index.
If
True
,field_or_method_id
represents a field index; otherwise it represents a method index.The type of method handle (e.g.,
METHOD_HANDLE_TYPE_INSTANCE_GET
).
- field_or_method_id¶
Either a field or method index.
See also
is_field_id
.
- is_field_id¶
If
True
,field_or_method_id
represents a field index; otherwise it represents a method index.See also
field_or_method_id
.
- type¶
The type of method handle (e.g.,
METHOD_HANDLE_TYPE_INSTANCE_GET
).
- class MethodIdItem¶
This class represents a method id item.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
Attributes:
The index of the class.
The index of the name.
The index of the prototype.
- class_idx¶
The index of the class.
- name_idx¶
The index of the name.
- proto_idx¶
The index of the prototype.
- NO_INDEX: Final[int]¶
Default value of
TryData.catch_all_instr
.See also
TryData.catch_all_instr
.
- class ProtoIdItem¶
This class represents a prototype id item.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
Attributes:
The offset to the list of parameters.
The return type index.
The index to the shortened prototype string.
- parameters_offset¶
The offset to the list of parameters.
- return_type_idx¶
The return type index.
- shorty_idx¶
The index to the shortened prototype string.
- REVERSE_ENDIAN_CONSTANT: Final[int]¶
Big-endian constant.
See also
ENDIAN_CONSTANT
.
- SmaliTag_ClassDef: Final[int]¶
Smali bytecode tag.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
DEXObject.Disassemble()
.
- SmaliTag_ClassRef: Final[int]¶
Smali bytecode tag.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
DEXObject.Disassemble()
.
- SmaliTag_Instruction: Final[int]¶
Smali bytecode tag.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
DEXObject.Disassemble()
.
- SmaliTag_Invalid: Final[int]¶
Smali bytecode tag.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
DEXObject.Disassemble()
.
- SmaliTag_Label: Final[int]¶
Smali bytecode tag.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
DEXObject.Disassemble()
.
- SmaliTag_LabelJump: Final[int]¶
Smali bytecode tag.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
DEXObject.Disassemble()
.
- SmaliTag_MethodDef: Final[int]¶
Smali bytecode tag.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
DEXObject.Disassemble()
.
- SmaliTag_MethodRef: Final[int]¶
Smali bytecode tag.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
DEXObject.Disassemble()
.
- SmaliTag_Offset: Final[int]¶
Smali bytecode tag.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
DEXObject.Disassemble()
.
- SmaliTag_String: Final[int]¶
Smali bytecode tag.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
DEXObject.Disassemble()
.
- SmaliTag_TypeRef: Final[int]¶
Smali bytecode tag.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
See also
DEXObject.Disassemble()
.
- TYPE_ANNOTATIONS_DIRECTORY_ITEM: Final[int]¶
Annotations directory item type.
- TYPE_ANNOTATION_ITEM: Final[int]¶
Annotation item type.
- TYPE_ANNOTATION_SET_ITEM: Final[int]¶
Annotation set item type.
- TYPE_ANNOTATION_SET_REF_LIST: Final[int]¶
Annotation set reference list type.
- TYPE_CALL_SITE_ID_ITEM: Final[int]¶
Call site id item type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- TYPE_CLASS_DATA_ITEM: Final[int]¶
Class data item type.
- TYPE_CLASS_DEF_ITEM: Final[int]¶
Class definition item type.
- TYPE_CODE_ITEM: Final[int]¶
Code item type.
- TYPE_DEBUG_INFO_ITEM: Final[int]¶
Debug information item type.
- TYPE_ENCODED_ARRAY_ITEM: Final[int]¶
Encoded array item type.
- TYPE_FIELD_ID_ITEM: Final[int]¶
Field id item type.
- TYPE_HEADER_ITEM: Final[int]¶
Header item type.
- TYPE_HIDDENAPI_CLASS_DATA_ITEM: Final[int]¶
Hidden API class data item type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- TYPE_MAP_LIST: Final[int]¶
Map list type.
- TYPE_METHOD_HANDLE_ITEM: Final[int]¶
Method handle item type.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- TYPE_METHOD_ID_ITEM: Final[int]¶
Method id item type.
- TYPE_PROTO_ID_ITEM: Final[int]¶
Prototype id item type.
- TYPE_STRING_DATA_ITEM: Final[int]¶
String data item type.
- TYPE_STRING_ID_ITEM: Final[int]¶
String id item type.
- TYPE_TYPE_ID_ITEM: Final[int]¶
Type id item type.
- TYPE_TYPE_LIST: Final[int]¶
Type list type.
- class TryData¶
This class represents a try clause.
See also
DEXObject.GetTries()
.Attributes:
The offset of the catch all clause.
A
CatchList
list of catch clauses.The count of instruction contained in the try clause.
The offset of the handler.
The start instruction of the try clause.
- catch_all_instr¶
The offset of the catch all clause.
Note
This value must be multiplied by 2.
- count¶
The count of instruction contained in the try clause.
- handler_offset¶
The offset of the handler.
- start_instr¶
The start instruction of the try clause.
- class TryList¶
List of
TryData
elements.Methods:
append
(value)Inserts
value
at the end of the list.
at
(i)Returns the item at index position
i
in the list.
clear
()Removes all items from the list.
contains
(value)Checks the presence of an element in the list.
count
(value)Returns the number of occurrences of
value
in the list.
indexOf
(value[, start])Searches for an element in the list.
insert
(i, value)Inserts
value
at index positioni
in the list.
isEmpty
()Checks whether the list is empty.
iterator
()Creates an iterator for the list.
removeAll
(value)Removes all occurrences of
value
in the list and returns the number of entries removed.
removeAt
(i)Removes the item at index position
i
.
reserve
(alloc)Reserve space for
alloc
elements.
size
()Returns the number of items in the list.
takeAt
(i)Removes the item at index position
i
and returns it.
- append(value: Pro.DEX.TryData) → None¶
Inserts
value
at the end of the list.
- Parameters
value (TryData) – The value to add to the list.
See also
insert()
.
- at(i: int) → Pro.DEX.TryData¶
Returns the item at index position
i
in the list.i
must be a valid index position in the list (i.e.,0 <= i < size()
).
- Parameters
i (int) – The index of the element to return.
- Returns
Returns the requested element.
- Return type
- clear() → None¶
Removes all items from the list.
- contains(value: Pro.DEX.TryData) → bool¶
Checks the presence of an element in the list.
- Parameters
value (TryData) – The value to check for.
- Returns
Returns
True
if the list contains an occurrence ofvalue
; otherwise returnsFalse
.- Return type
bool
- count(value: Pro.DEX.TryData) → int¶
Returns the number of occurrences of
value
in the list.
- Parameters
value (TryData) – The value to count.
- Returns
Returns the number of occurrences.
- Return type
int
See also
indexOf()
andcontains()
.
- indexOf(value: Pro.DEX.TryData, start: int = 0) → int¶
Searches for an element in the list.
- Parameters
value (TryData) – The value to search for.
start (int) – The start index.
- Returns
Returns the index position of the first occurrence of
value
in the list. Returns-1
if no item was found.- Return type
int
See also
contains()
.
- insert(i: int, value: Pro.DEX.TryData) → None¶
Inserts
value
at index positioni
in the list. Ifi
is0
, the value is prepended to the list. Ifi
issize()
, the value is appended to the list.
- Parameters
i (int) – The position at which to add the value.
value (TryData) – The value to add.
See also
append()
andremoveAt()
.
- isEmpty() → bool¶
Checks whether the list is empty.
- Returns
Returns
True
if the list contains no items; otherwise returnsFalse
.- Return type
bool
See also
size()
.
- iterator() → Pro.DEX.TryListIt¶
Creates an iterator for the list.
- Returns
Returns the iterator.
- Return type
- removeAll(value: Pro.DEX.TryData) → int¶
Removes all occurrences of
value
in the list and returns the number of entries removed.
- Parameters
value (TryData) – The value to remove from the list.
- Returns
Returns the number of entries removed.
- Return type
int
See also
removeAt()
.
- removeAt(i: int) → None¶
Removes the item at index position
i
.i
must be a valid index position in the list (i.e.,0 <= i < size()
).
- Parameters
i (int) – The index of the item to remove.
See also
removeAll()
.
- reserve(alloc: int) → None¶
Reserve space for
alloc
elements. Calling this method doesn’t change the size of the list.
- Parameters
alloc (int) – The amount of elements to reserve space for.
- takeAt(i: int) → Pro.DEX.TryData¶
Removes the item at index position
i
and returns it.i
must be a valid index position in the list (i.e.,0 <= i < size()
).
- Parameters
i (int) – The index of the element to remove from the list.
- Returns
Returns the removed element. If you don’t use the return value,
removeAt()
is more efficient.- Return type
See also
removeAt()
.
- class TryListIt(obj: Pro.DEX.TryList)¶
Iterator class for
TryList
.
- Parameters
obj (TryList) – The object to iterate over.
Methods:
hasNext
()Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.
next
()Returns the next item and advances the iterator by one position.
previous
()Returns the previous item and moves the iterator back by one position.
toBack
()Moves the iterator to the back of the container (after the last item).
toFront
()Moves the iterator to the front of the container (before the first item).
- hasNext() → bool¶
- Returns
Returns
True
if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise returnsFalse
.- Return type
bool
See also
hasPrevious()
andnext()
.
- hasPrevious() → bool¶
- Returns
Returns
True
if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise returnsFalse
.- Return type
bool
See also
hasNext()
andprevious()
.
- next() → Pro.DEX.TryData¶
- Returns
Returns the next item and advances the iterator by one position.
- Return type
See also
hasNext()
andprevious()
.
- previous() → Pro.DEX.TryData¶
- Returns
Returns the previous item and moves the iterator back by one position.
- Return type
See also
hasPrevious()
andnext()
.
- toBack() → None¶
Moves the iterator to the back of the container (after the last item).
See also
toFront()
andprevious()
.
- VALUE_ANNOTATION: Final[int]¶
Annotation value.
- VALUE_ARRAY: Final[int]¶
Array value.
- VALUE_BOOLEAN: Final[int]¶
Boolean value.
- VALUE_BYTE: Final[int]¶
Byte value.
- VALUE_CHAR: Final[int]¶
Character value.
- VALUE_DOUBLE: Final[int]¶
Double value.
- VALUE_ENUM: Final[int]¶
Enum value.
- VALUE_FIELD: Final[int]¶
Field value.
- VALUE_FLOAT: Final[int]¶
Float value.
- VALUE_INT: Final[int]¶
Integer value.
- VALUE_LONG: Final[int]¶
Long value.
- VALUE_METHOD: Final[int]¶
Method value.
- VALUE_METHOD_HANDLE: Final[int]¶
Method handle value.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- VALUE_METHOD_TYPE: Final[int]¶
Method type value.
Available since Cerbero Suite 7.6 and Cerbero Engine 4.6.
- VALUE_NULL: Final[int]¶
Null value.
- VALUE_SHORT: Final[int]¶
Short value.
- VALUE_STRING: Final[int]¶
String value.
- VALUE_TYPE: Final[int]¶
Type value.
- VISIBILITY_BUILD: Final[int]¶
Build visibility.
- VISIBILITY_RUNTIME: Final[int]¶
Run-time visibility.
- VISIBILITY_SYSTEM: Final[int]¶
System visibility.