code stringlengths 66 870k | docstring stringlengths 19 26.7k | func_name stringlengths 1 138 | language stringclasses 1
value | repo stringlengths 7 68 | path stringlengths 5 324 | url stringlengths 46 389 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
def get_type(self) -> str:
"""
Return the type of the field
:returns: the type
"""
if self.type_idx_value is None:
self.type_idx_value = self.CM.get_type(self.type_idx)
return self.type_idx_value |
Return the type of the field
:returns: the type
| get_type | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_descriptor(self) -> str:
"""
Return the descriptor of the field
:returns: the desciptor
"""
if self.type_idx_value is None:
self.type_idx_value = self.CM.get_type(self.type_idx)
return self.type_idx_value |
Return the descriptor of the field
:returns: the desciptor
| get_descriptor | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_name(self) -> str:
"""
Return the name of the field
:returns: the name
"""
if self.name_idx_value is None:
self.name_idx_value = self.CM.get_string(self.name_idx)
return self.name_idx_value |
Return the name of the field
:returns: the name
| get_name | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def __init__(self, size:int, buff: BinaryIO, cm:ClassManager) -> None:
"""
:param buff: a string which represents a buff object of the list of `field_id_item`
:param cm: a `ClassManager` object
"""
self.offset = buff.tell()
self.field_id_items = [FieldIdItem(buff, cm) fo... |
:param buff: a string which represents a buff object of the list of `field_id_item`
:param cm: a `ClassManager` object
| __init__ | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def __init__(self, buff: BinaryIO, cm:ClassManager) -> None:
"""
:param buff: a string which represents a Buff object of the `method_id_item`
:param cm: a `ClassManager` object
"""
self.CM = cm
self.offset = buff.tell()
self.class_idx, self.proto_idx, self.name_i... |
:param buff: a string which represents a Buff object of the `method_id_item`
:param cm: a `ClassManager` object
| __init__ | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_class_name(self) -> str:
"""
Return the class name of the method
:returns: the class name
"""
if self.class_idx_value is None:
self.class_idx_value = self.CM.get_type(self.class_idx)
return self.class_idx_value |
Return the class name of the method
:returns: the class name
| get_class_name | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_proto(self) -> str:
"""
Return the prototype of the method
:returns: the prototype
"""
if self.proto_idx_value is None:
self.proto_idx_value = self.CM.get_proto(self.proto_idx)
return self.proto_idx_value |
Return the prototype of the method
:returns: the prototype
| get_proto | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_descriptor(self) -> str:
"""
Return the descriptor
:returns: the descriptor
"""
proto = self.get_proto()
return proto[0] + proto[1] |
Return the descriptor
:returns: the descriptor
| get_descriptor | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_real_descriptor(self) -> str:
"""
Return the real descriptor (i.e. without extra spaces)
:returns: the real descriptor, without extra spaces
"""
proto = self.get_proto()
return proto[0].replace(' ', '') + proto[1] |
Return the real descriptor (i.e. without extra spaces)
:returns: the real descriptor, without extra spaces
| get_real_descriptor | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_name(self) -> str:
"""
Return the name of the method
:returns: the name of the of method
"""
if self.name_idx_value is None:
self.name_idx_value = self.CM.get_string(self.name_idx)
return self.name_idx_value |
Return the name of the method
:returns: the name of the of method
| get_name | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def __init__(self, size:int, buff: BinaryIO, cm:ClassManager) -> None:
"""
:param buff: a string which represents a Buff object of the list of `method_id_item`
:param cm: a `ClassManager` object
"""
self.CM = cm
self.offset = buff.tell()
self.method_id_items = [... |
:param buff: a string which represents a Buff object of the list of `method_id_item`
:param cm: a `ClassManager` object
| __init__ | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def __init__(self, buff: BinaryIO, cm:ClassManager) -> None:
"""
:param buff: a string which represents a buff object of the `encoded_field`
:param cm: a `ClassManager` object
"""
self.CM = cm
self.offset = buff.tell()
self.field_idx_diff = readuleb128(cm, buff)
... |
:param buff: a string which represents a buff object of the `encoded_field`
:param cm: a `ClassManager` object
| __init__ | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_descriptor(self) -> str:
"""
Return the descriptor of the field
The descriptor of a field is the type of the field.
:returns: the descriptor
"""
if not self.loaded:
self.load()
return self.proto |
Return the descriptor of the field
The descriptor of a field is the type of the field.
:returns: the descriptor
| get_descriptor | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_access_flags_string(self) -> str:
"""
Return the access flags string of the field
:returns: the access flags
"""
if self.access_flags_string is None:
if self.get_access_flags() == 0:
# No access flags, i.e. Java defaults apply
... |
Return the access flags string of the field
:returns: the access flags
| get_access_flags_string | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def show(self) -> None:
"""
Display the information (with a pretty print) about the field
"""
bytecode._PrintSubBanner("Field Information")
bytecode._PrintDefault(
"{}->{} {} [access_flags={}]\n".format(
self.get_class_name(),
self.get_... |
Display the information (with a pretty print) about the field
| show | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def __init__(self, buff: BinaryIO, cm:ClassManager) -> None:
"""
:param buff: a string which represents a buff object of the `encoded_method`
:param cm: a `ClassManager` object
"""
self.CM = cm
self.offset = buff.tell()
self.method_idx_diff = readuleb128(
... |
:param buff: a string which represents a buff object of the `encoded_method`
:param cm: a `ClassManager` object
| __init__ | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_access_flags_string(self) -> str:
"""
Return the access flags string of the method
A description of all access flags can be found here:
https://source.android.com/devices/tech/dalvik/dex-format#access-flags
:returns: the access flags
"""
if self.access_f... |
Return the access flags string of the method
A description of all access flags can be found here:
https://source.android.com/devices/tech/dalvik/dex-format#access-flags
:returns: the access flags
| get_access_flags_string | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_locals(self) -> int:
"""
Get the number of local registers used by the method
This number is equal to the number of registers minus the number of parameters minus 1.
:returns: number of local registers
"""
ret = self.proto.split(')')
params = ret[0][1:].... |
Get the number of local registers used by the method
This number is equal to the number of registers minus the number of parameters minus 1.
:returns: number of local registers
| get_locals | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_information(self) -> dict[str, Union[str, tuple[int, int], list]]:
"""
Get brief information about the method's register use,
parameters and return type.
The resulting dictionary has the form:
>>> {
>>> registers: (start, end),
>>> para... |
Get brief information about the method's register use,
parameters and return type.
The resulting dictionary has the form:
>>> {
>>> registers: (start, end),
>>> params: [(reg_1, type_1), (reg_2, type_2), ..., (reg_n, type_n)],
>>> retur... | get_information | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def each_params_by_register(self, nb: int, proto: str) -> None:
"""
From the Dalvik Bytecode documentation:
> The N arguments to a method land in the last N registers
> of the method's invocation frame, in order.
> Wide arguments consume two registers.
> Instance methods... |
From the Dalvik Bytecode documentation:
> The N arguments to a method land in the last N registers
> of the method's invocation frame, in order.
> Wide arguments consume two registers.
> Instance methods are passed a this reference as their first argument.
This method ... | each_params_by_register | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_short_string(self) -> str:
"""
Return a shorter formatted String which encodes this method.
The returned name has the form:
<classname> <methodname> ([arguments ...])<returntype>
* All Class names are condensed to the actual name (no package).
* Access flags are ... |
Return a shorter formatted String which encodes this method.
The returned name has the form:
<classname> <methodname> ([arguments ...])<returntype>
* All Class names are condensed to the actual name (no package).
* Access flags are not returned.
* <init> and <clinit> ar... | get_short_string | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def show_info(self) -> None:
"""
Display the basic information about the method
"""
bytecode._PrintSubBanner("Method Information")
bytecode._PrintDefault(
"{}->{}{} [access_flags={}]\n".format(
self.get_class_name(),
self.get_name(),
... |
Display the basic information about the method
| show_info | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def show(self) -> None:
"""
Display the information (with a pretty print) about the method
"""
self.show_info()
self.show_notes()
if self.CM.get_analysis():
self.CM.get_analysis().methods[self].show()
else:
if self.code:
se... |
Display the information (with a pretty print) about the method
| show | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def show_notes(self) -> None:
"""
Display the notes about the method
"""
if self.notes:
bytecode._PrintSubBanner("Notes")
for i in self.notes:
bytecode._PrintNote(i)
bytecode._PrintSubBanner() |
Display the notes about the method
| show_notes | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_length(self) -> int:
"""
Return the length of the associated code of the method
:returns: the length of the source code
"""
if self.code is not None:
return self.code.get_length()
return 0 |
Return the length of the associated code of the method
:returns: the length of the source code
| get_length | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_code(self) -> Union[DalvikCode, None]:
"""
Return the code object associated to the method
:returns: the `DalvikCode` object or None if no Code
"""
if not self.loaded:
self.load()
return self.code |
Return the code object associated to the method
:returns: the `DalvikCode` object or None if no Code
| get_code | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_instructions(self) -> Iterator[Instruction]:
"""
Get the instructions
:returns: a generator of each `Instruction` (or a cached list of instructions if you have setup instructions)
"""
if self.get_code() is None:
return []
return self.get_code().get_bc... |
Get the instructions
:returns: a generator of each `Instruction` (or a cached list of instructions if you have setup instructions)
| get_instructions | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_instructions_idx(self) -> Iterator[tuple[int, Instruction]]:
"""
Iterate over all instructions of the method, but also return the current index.
This is the same as using [get_instructions][androguard.core.dex.EncodedMethod.get_instructions] and adding the instruction length
to a... |
Iterate over all instructions of the method, but also return the current index.
This is the same as using [get_instructions][androguard.core.dex.EncodedMethod.get_instructions] and adding the instruction length
to a variable each time.
:returns: iterator over index and instructions
... | get_instructions_idx | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def set_instructions(self, instructions: list[Instruction]) -> None:
"""
Set the instructions
:param instructions: the list of `Instructions`
"""
if self.code is None:
return []
return self.code.get_bc().set_instructions(instructions) |
Set the instructions
:param instructions: the list of `Instructions`
| set_instructions | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_instruction(
self, idx, off: Union[int, None] = None
) -> Iterator[Instruction]:
"""
Get a particular instruction by using (default) the index of the address if specified
:param idx: index of the instruction (the position in the list of the instruction)
:param off: a... |
Get a particular instruction by using (default) the index of the address if specified
:param idx: index of the instruction (the position in the list of the instruction)
:param off: address of the instruction
:returns: a generator of `Instructions`
| get_instruction | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_debug(self) -> DebugInfoItem:
"""
Return the debug object associated to this method
:returns: `DebugInfoItem` object
"""
if self.get_code() is None:
return None
return self.get_code().get_debug() |
Return the debug object associated to this method
:returns: `DebugInfoItem` object
| get_debug | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_descriptor(self) -> str:
"""
Return the descriptor of the method
A method descriptor will have the form `(A A A ...)R`
Where A are the arguments to the method and R is the return type.
Basic types will have the short form, i.e. I for integer, V for void
and class ... |
Return the descriptor of the method
A method descriptor will have the form `(A A A ...)R`
Where A are the arguments to the method and R is the return type.
Basic types will have the short form, i.e. I for integer, V for void
and class types will be named like a classname, e.g. `... | get_descriptor | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_name(self) -> str:
"""
Return the name of the method
:returns: the name
"""
if not self.loaded:
self.load()
return self.name |
Return the name of the method
:returns: the name
| get_name | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def add_inote(
self, msg: str, idx: int, off: Union[int, None] = None
) -> None:
"""
Add a message to a specific instruction by using (default) the index of the address if specified
:param msg: the message
:param idx: index of the instruction (the position in the list of the... |
Add a message to a specific instruction by using (default) the index of the address if specified
:param msg: the message
:param idx: index of the instruction (the position in the list of the instruction)
:param off: address of the instruction
| add_inote | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def __init__(self, buff: BinaryIO, cm:ClassManager) -> None:
"""
:param buff: a string which represents a Buff object of the `class_data_item`
:param cm: a `ClassManager` object
"""
self.CM = cm
self.offset = buff.tell()
self.static_fields_size = readuleb128(cm,... |
:param buff: a string which represents a Buff object of the `class_data_item`
:param cm: a `ClassManager` object
| __init__ | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_methods(self) -> list[EncodedMethod]:
"""
Return direct and virtual methods
:returns: a list of `EncodedMethod` objects
"""
return [x for x in self.direct_methods] + [
x for x in self.virtual_methods
] |
Return direct and virtual methods
:returns: a list of `EncodedMethod` objects
| get_methods | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_fields(self) -> list[EncodedField]:
"""
Return static and instance fields
:returns: a list of `EncodedField` objects
"""
return [x for x in self.static_fields] + [
x for x in self.instance_fields
] |
Return static and instance fields
:returns: a list of `EncodedField` objects
| get_fields | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def __init__(self, buff: BinaryIO, cm:ClassManager) -> None:
"""
:param buff: a string which represents a Buff object of the `class_def_item`
:param cm: a `ClassManager` object
"""
self.CM = cm
self.offset = buff.tell()
(
self.class_idx,
s... |
:param buff: a string which represents a Buff object of the `class_def_item`
:param cm: a `ClassManager` object
| __init__ | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_methods(self) -> list[EncodedMethod]:
"""
Return all [EncodedMethods][androguard.core.dex.EncodedMethod] of this class
:returns: a list of `EncodedMethod` objects
"""
if self.class_data_item is not None:
return self.class_data_item.get_methods()
retur... |
Return all [EncodedMethods][androguard.core.dex.EncodedMethod] of this class
:returns: a list of `EncodedMethod` objects
| get_methods | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_fields(self) -> list[EncodedField]:
"""
Return all [EncodedFields][androguard.core.dex.EncodedField] of this class
:returns: a list of `EncodedField` objects
"""
if self.class_data_item is not None:
return self.class_data_item.get_fields()
return [] |
Return all [EncodedFields][androguard.core.dex.EncodedField] of this class
:returns: a list of `EncodedField` objects
| get_fields | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def _get_annotation_type_ids(self) -> list[EncodedAnnotation]:
"""
Get the [EncodedAnnotation][androguard.core.dex.EncodedAnnotation] from this class
:returns: list of `EncodedAnnotation` objects
"""
if self.annotations_directory_item is None:
return []
annot... |
Get the [EncodedAnnotation][androguard.core.dex.EncodedAnnotation] from this class
:returns: list of `EncodedAnnotation` objects
| _get_annotation_type_ids | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_annotations(self) -> list[str]:
"""
Returns the class names of the annotations of this class.
For example, if the class is marked as `@Deprecated`, this will return
`['Ljava/lang/Deprecated;']`.
:returns: list of class names
"""
return [
self... |
Returns the class names of the annotations of this class.
For example, if the class is marked as `@Deprecated`, this will return
`['Ljava/lang/Deprecated;']`.
:returns: list of class names
| get_annotations | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_access_flags_string(self) -> str:
"""
Return the access flags string of the class
:returns: the access flag string
"""
if self.access_flags_string is None:
self.access_flags_string = get_access_flags_string(
self.get_access_flags()
... |
Return the access flags string of the class
:returns: the access flag string
| get_access_flags_string | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_class_idx(self, idx: int) -> ClassDefItem:
"""return the associated `ClassDefItem` from the `class_def` list given an index
:param idx: the index
:return: the `ClassDefItem` object , or `None` if not found
"""
for i in self.class_def:
if i.get_class_idx() == ... | return the associated `ClassDefItem` from the `class_def` list given an index
:param idx: the index
:return: the `ClassDefItem` object , or `None` if not found
| get_class_idx | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_method(
self, name_class: str, name_method: str
) -> list[EncodedMethod]:
"""return a list of of `EncodedMethod` objects given a class name and method name
:param name_class: the name of the class
:param name_method: the name of the method
:return: a list of `Encoded... | return a list of of `EncodedMethod` objects given a class name and method name
:param name_class: the name of the class
:param name_method: the name of the method
:return: a list of `EncodedMethod` objects
| get_method | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_kind(cm: ClassManager, kind: int, value: int) -> str:
"""
Return the value of the 'kind' argument
:param cm: a ClassManager object
:param kind: the type of the 'kind' argument
:param value: the value of the 'kind' argument
:returns: string
"""
if kind == Kind.METH:
meth... |
Return the value of the 'kind' argument
:param cm: a ClassManager object
:param kind: the type of the 'kind' argument
:param value: the value of the 'kind' argument
:returns: string
| get_kind | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_kind(self) -> int:
"""
Return the 'kind' argument of the instruction
This is the type of the argument, i.e. in which kind of table you have
to look up the argument in the `ClassManager`
:returns: the kind
"""
if self.OP >= 0xF2FF:
return DALV... |
Return the 'kind' argument of the instruction
This is the type of the argument, i.e. in which kind of table you have
to look up the argument in the `ClassManager`
:returns: the kind
| get_kind | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_name(self) -> str:
"""
Return the mnemonic of the instruction
:returns: the mnemonic
"""
if self.OP >= 0xF2FF:
return DALVIK_OPCODES_OPTIMIZED[self.OP][1][0]
return DALVIK_OPCODES_FORMAT[self.OP][1][0] |
Return the mnemonic of the instruction
:returns: the mnemonic
| get_name | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_hex(self) -> str:
"""
Returns a HEX String, separated by spaces every byte
The hex string contains the raw bytes of the instruction,
including the opcode and all arguments.
:returns: the hex string
"""
s = binascii.hexlify(self.get_raw()).decode('ascii')... |
Returns a HEX String, separated by spaces every byte
The hex string contains the raw bytes of the instruction,
including the opcode and all arguments.
:returns: the hex string
| get_hex | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def disasm(self) -> str:
"""Some small line for disassembly view"""
s = binascii.hexlify(self.get_raw()).decode('ascii')
byteview = " ".join(s[i : i + 4] for i in range(0, len(s), 4))
return '{:24s} {:24s} {}'.format(
byteview, self.get_name(), self.get_output()
) | Some small line for disassembly view | disasm | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_output(self, idx: int = -1) -> str:
"""
Return an additional output of the instruction
:returns: additional output of the instruction
"""
buff = ""
data = self.get_data()
buff += repr(data) + " | "
for i in range(0, len(data)):
buff ... |
Return an additional output of the instruction
:returns: additional output of the instruction
| get_output | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def show_buff(self, pos: int) -> str:
"""
Return the display of the instruction
:returns: display string
"""
buff = self.get_name() + " "
for i in range(0, len(self.data)):
buff += "\\x%02x" % self.data[i]
return buff |
Return the display of the instruction
:returns: display string
| show_buff | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_hex(self) -> str:
"""
Returns a HEX String, separated by spaces every byte
"""
s = binascii.hexlify(self.get_raw()).decode("ascii")
return " ".join(s[i : i + 2] for i in range(0, len(s), 2)) |
Returns a HEX String, separated by spaces every byte
| get_hex | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_hex(self) -> str:
"""
Returns a HEX String, separated by spaces every byte
:returns: hex string
"""
s = binascii.hexlify(self.get_raw()).decode('ascii')
return " ".join(s[i : i + 2] for i in range(0, len(s), 2)) |
Returns a HEX String, separated by spaces every byte
:returns: hex string
| get_hex | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_output(self, idx: int = -1) -> str:
"""
Return an additional output of the instruction
:returns: additional output string
"""
return " ".join(
"%x" % (self.first_key + i) for i in range(0, len(self.targets))
) |
Return an additional output of the instruction
:returns: additional output string
| get_output | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_instruction(
cm: ClassManager, op_value: int, buff: bytearray
) -> Instruction:
"""
Return the [Instruction][androguard.core.dex.Instruction] for the given opcode
:param cm: `ClassManager` to propagate to `Instruction`
:param op_value: integer value of the instruction
:param buff: Bytec... |
Return the [Instruction][androguard.core.dex.Instruction] for the given opcode
:param cm: `ClassManager` to propagate to `Instruction`
:param op_value: integer value of the instruction
:param buff: Bytecode starting with the `instruction`
:raises InvalidInstruction: if instruction is invalid
:... | get_instruction | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_optimized_instruction(
cm: ClassManager, op_value: int, buff: bytearray
) -> Instruction:
"""Return the [Instruction][androguard.core.dex.Instruction] for the given optimized opcode
:param cm: `ClassManager` to propagate to `Instruction`
:param op_value: integer value of the instruction
:pa... | Return the [Instruction][androguard.core.dex.Instruction] for the given optimized opcode
:param cm: `ClassManager` to propagate to `Instruction`
:param op_value: integer value of the instruction
:param buff: Bytecode starting with the `instruction`
:raises InvalidInstruction: if instruction is invalid
... | get_optimized_instruction | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_instructions(
cm: ClassManager, size: int, insn: bytearray, idx: int
) -> Iterator[Instruction]:
"""
Yields all instructions for the given bytecode sequence.
If unknown/corrupt/unused instructions are encountered,
the loop will stop and an error is written to the logg... |
Yields all instructions for the given bytecode sequence.
If unknown/corrupt/unused instructions are encountered,
the loop will stop and an error is written to the logger.
That means that the bytecode read might be corrupt
or was crafted in this way, to break parsers.
:... | get_instructions | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def set_insn(self, insn: bytes) -> None:
"""
Set a new raw buffer to disassemble
:param insn: the buffer
"""
self.insn = insn
self.size = len(self.insn) |
Set a new raw buffer to disassemble
:param insn: the buffer
| set_insn | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_instructions(self) -> Iterator[Instruction]:
"""
Return an iterator over [Instruction][androguard.core.dex.Instruction]
:returns: a generator of each `Instruction` (or a cached list of instructions if you have setup instructions)
"""
# it is possible to a cache for instr... |
Return an iterator over [Instruction][androguard.core.dex.Instruction]
:returns: a generator of each `Instruction` (or a cached list of instructions if you have setup instructions)
| get_instructions | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_instruction(
self, idx: int, off: Union[int, None] = None
) -> Instruction:
"""
Get a particular instruction by using (default) the index of the address if specified
:param idx: index of the instruction (the position in the list of the instruction)
:param off: addres... |
Get a particular instruction by using (default) the index of the address if specified
:param idx: index of the instruction (the position in the list of the instruction)
:param off: address of the instruction
:returns: an `Instruction` object
| get_instruction | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def off_to_pos(self, off: int) -> int:
"""
Get the position of an instruction by using the address
:param off: address of the instruction
:returns: the offset
"""
idx = 0
nb = 0
for i in self.get_instructions():
if idx == off:
... |
Get the position of an instruction by using the address
:param off: address of the instruction
:returns: the offset
| off_to_pos | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_ins_off(self, off: int) -> Instruction:
"""
Get a particular instruction by using the address
:param off: address of the instruction
:returns: an `Instruction` object
"""
idx = 0
for i in self.get_instructions():
if idx == off:
... |
Get a particular instruction by using the address
:param off: address of the instruction
:returns: an `Instruction` object
| get_ins_off | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def show(self) -> None:
"""
Display (with a pretty print) this object
"""
off = 0
for n, i in enumerate(self.get_instructions()):
print(
"{:8d} (0x{:08x}) {:04x} {:30} {}".format(
n,
off,
i.ge... |
Display (with a pretty print) this object
| show | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_raw(self) -> bytearray:
"""
Return the raw buffer of this object
:returns: buffer bytearray
"""
buff = bytearray()
for i in self.get_instructions():
buff += i.get_raw()
return buff |
Return the raw buffer of this object
:returns: buffer bytearray
| get_raw | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_raw(self) -> bytearray:
"""
Get the reconstructed code as bytearray
:returns: code bytearray
"""
code_raw = self.code.get_raw()
self.insns_size = (len(code_raw) // 2) + (len(code_raw) % 2)
buff = bytearray()
buff += (
self.CM.packer["... |
Get the reconstructed code as bytearray
:returns: code bytearray
| get_raw | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def __init__(self, buff: bytes, cm: ClassManager) -> None:
"""
Implementation of a map_item, which occours in a map_list
https://source.android.com/devices/tech/dalvik/dex-format#map-item
"""
self.CM = cm
self.buff = buff
self.off = buff.tell()
self.typ... |
Implementation of a map_item, which occours in a map_list
https://source.android.com/devices/tech/dalvik/dex-format#map-item
| __init__ | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def parse(self) -> None:
"""parse this map_item by parsing its potential [TypeMapItem][androguard.core.dex.dex_types.TypeMapItem] type and cast it appropriately."""
logger.debug("Starting parsing map_item '{}'".format(self.type.name))
started_at = time.time()
# Not all items are aligned... | parse this map_item by parsing its potential [TypeMapItem][androguard.core.dex.dex_types.TypeMapItem] type and cast it appropriately. | parse | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def __init__(self, vm: DEX) -> None:
"""
:param DEX vm: the VM to create a `ClassManager` for
"""
self.vm = vm
self.buff = vm
self.analysis_dex = None
self.decompiler_ob = None
self.__packer = None
self.__manage_item = {}
self.__manage_i... |
:param DEX vm: the VM to create a `ClassManager` for
| __init__ | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_string(self, idx: int) -> str:
"""
Return a string from the string table at index `idx`
If string is hooked, the hooked string is returned.
:param idx: index in the string section
:returns: string entry
"""
if idx in self.hook_strings:
retur... |
Return a string from the string table at index `idx`
If string is hooked, the hooked string is returned.
:param idx: index in the string section
:returns: string entry
| get_string | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_raw_string(self, idx: int) -> str:
"""
Return the (unprocessed) string from the string table at index `idx`.
:param idx: the index in the string section
"""
try:
off = self.__manage_item[TypeMapItem.STRING_ID_ITEM][
idx
].get_strin... |
Return the (unprocessed) string from the string table at index `idx`.
:param idx: the index in the string section
| get_raw_string | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_type(self, idx: int) -> str:
"""
Return the resolved type name based on the index
This returns the string associated with the type.
:param int idx:
:returns: the type name
"""
_type = self.get_type_ref(idx)
if _type == -1:
return "AG:... |
Return the resolved type name based on the index
This returns the string associated with the type.
:param int idx:
:returns: the type name
| get_type | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_item_type(self, ttype: TypeMapItem) -> object:
"""
Get a particular item type
:param ttype: a `TypeMapItem` enum which represents the desired type
:returns: `None` or the item object
"""
for i in self.map_item:
if i.get_type() == ttype:
... |
Get a particular item type
:param ttype: a `TypeMapItem` enum which represents the desired type
:returns: `None` or the item object
| get_item_type | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def show(self) -> None:
"""
Print with a pretty display the MapList object
"""
bytecode._Print("MAP_LIST SIZE", self.size)
for i in self.map_item:
if i.item != self:
# FIXME this does not work for CodeItems!
# as we do not have the meth... |
Print with a pretty display the MapList object
| show | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def _flush(self) -> None:
"""
Flush all caches
Might be used after classes, methods or fields are added.
"""
self.classes_names = None
self.__cache_methods = None
self.__cached_methods_idx = None
self.__cache_fields = None
# cache methods and fiel... |
Flush all caches
Might be used after classes, methods or fields are added.
| _flush | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def save(self) -> bytes:
"""
Return the dex (with the modifications) into raw format (fix checksums)
(beta: do not use !)
:returns: bytes
"""
l = []
h = {}
s = {}
h_r = {}
idx = 0
for i in self.map_list.get_obj():
leng... |
Return the dex (with the modifications) into raw format (fix checksums)
(beta: do not use !)
:returns: bytes
| save | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def fix_checksums(self, buff: bytes) -> bytes:
"""
Fix a dex format buffer by setting all checksums
:returns: bytes
"""
signature = hashlib.sha1(buff[32:]).digest()
buff = buff[:12] + signature + buff[32:]
checksum = zlib.adler32(buff[12:])
buff = buff[... |
Fix a dex format buffer by setting all checksums
:returns: bytes
| fix_checksums | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_classes_names(self, update: bool = False) -> list[str]:
"""
Return the names of classes
:param update: `True` indicates to recompute the list. Maybe needed after using a MyClass.set_name().
:returns: a list of string names
"""
if self.classes_names is None or upd... |
Return the names of classes
:param update: `True` indicates to recompute the list. Maybe needed after using a MyClass.set_name().
:returns: a list of string names
| get_classes_names | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_classes(self) -> list[ClassDefItem]:
"""
Return all classes
:returns: a list of `ClassDefItem` objects
"""
if self.classes:
return self.classes.class_def
else:
# There is a rare case that the DEX has no classes
return [] |
Return all classes
:returns: a list of `ClassDefItem` objects
| get_classes | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_class(self, name: str) -> Union[ClassDefItem, None]:
"""
Return a specific class
:param name: the name of the class
:returns: a `ClassDefItem`
"""
for i in self.get_classes():
if i.get_name() == name:
return i
return None |
Return a specific class
:param name: the name of the class
:returns: a `ClassDefItem`
| get_class | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_field(self, name: str) -> list[FieldIdItem]:
"""get field id item by name
:param name: the name of the field (a python string regexp)
:returns: the list of matching `FieldIdItem` objects
"""
prog = re.compile(name)
l = []
for i in self.get_fields():
... | get field id item by name
:param name: the name of the field (a python string regexp)
:returns: the list of matching `FieldIdItem` objects
| get_field | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_fields(self) -> list[FieldIdItem]:
"""
Return a list of field items
:returns: a list of `FieldIdItem` objects
"""
try:
return self.fields.gets()
except AttributeError:
return [] |
Return a list of field items
:returns: a list of `FieldIdItem` objects
| get_fields | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_encoded_field(self, name: str) -> list[EncodedField]:
"""
Return a list all fields which corresponds to the regexp
:param name: the name of the field (a python string regexp)
:returns: a list with all `EncodedField` objects
"""
# TODO could use a generator here
... |
Return a list all fields which corresponds to the regexp
:param name: the name of the field (a python string regexp)
:returns: a list with all `EncodedField` objects
| get_encoded_field | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_encoded_fields(self) -> list[EncodedField]:
"""
Return all field objects
:returns: a list of `EncodedField` objects
"""
if self.__cache_all_fields is None:
self.__cache_all_fields = []
for i in self.get_classes():
for j in i.get_fi... |
Return all field objects
:returns: a list of `EncodedField` objects
| get_encoded_fields | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_method(self, name: str) -> list[MethodIdItem]:
"""get method id item by name
:param name: the name of the field (a python string regexp)
:returns: the list of matching `MethodIdItem` objects
"""
prog = re.compile(name)
l = []
for i in self.get_methods():
... | get method id item by name
:param name: the name of the field (a python string regexp)
:returns: the list of matching `MethodIdItem` objects
| get_method | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_methods(self) -> list[MethodIdItem]:
"""
Return a list of method items
:returns: a list of `MethodIdItem` objects
"""
try:
return self.methods.gets()
except AttributeError:
return [] |
Return a list of method items
:returns: a list of `MethodIdItem` objects
| get_methods | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_encoded_method(self, name: str) -> list[EncodedMethod]:
"""
Return a list all encoded methods whose name corresponds to the regexp
:param name: the name of the method (a python string regexp)
:returns: a list with all `EncodedMethod` objects
"""
prog = re.compil... |
Return a list all encoded methods whose name corresponds to the regexp
:param name: the name of the method (a python string regexp)
:returns: a list with all `EncodedMethod` objects
| get_encoded_method | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_encoded_methods(self) -> list[EncodedMethod]:
"""
Return all encoded method objects
:returns: a list of `EncodedMethod` objects
"""
if self.__cache_all_methods is None:
self.__cache_all_methods = []
for i in self.get_classes():
for... |
Return all encoded method objects
:returns: a list of `EncodedMethod` objects
| get_encoded_methods | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_encoded_method_by_idx(
self, idx: int
) -> Union[EncodedMethod, None]:
"""
Return a specific encoded method by using an index
:param idx: the index of the method
:returns: `None` or an `EncodedMethod` object
"""
if self.__cached_methods_idx is None:
... |
Return a specific encoded method by using an index
:param idx: the index of the method
:returns: `None` or an `EncodedMethod` object
| get_encoded_method_by_idx | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_encoded_method_descriptor(
self, class_name: str, method_name: str, descriptor: str
) -> Union[EncodedMethod, None]:
"""
Return the specific encoded method given a class name, method name, and descriptor
:param class_name: the class name of the method
:param method_n... |
Return the specific encoded method given a class name, method name, and descriptor
:param class_name: the class name of the method
:param method_name: the name of the method
:param descriptor: the descriptor of the method
:returns: `None` or a `EncodedMethod` object
| get_encoded_method_descriptor | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_encoded_methods_class_method(
self, class_name: str, method_name: str
) -> Union[EncodedMethod, None]:
"""
Return the specific encoded methods of the class
:param class_name: the class name of the method
:param method_name: the name of the method
:returns: `... |
Return the specific encoded methods of the class
:param class_name: the class name of the method
:param method_name: the name of the method
:returns: `None` or a `EncodedMethod` object
| get_encoded_methods_class_method | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_encoded_methods_class(
self, class_name: str
) -> list[EncodedMethod]:
"""
Return all encoded methods of a specific class by class name
:param class_name: the class name
:returns: a list with `EncodedMethod` objects
"""
l = []
for i in self.g... |
Return all encoded methods of a specific class by class name
:param class_name: the class name
:returns: a list with `EncodedMethod` objects
| get_encoded_methods_class | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_encoded_fields_class(self, class_name: str) -> list[EncodedField]:
"""
Return all encoded fields of a specific class by class name
:param class_name: the class name
:returns: a list with `EncodedField` objects
"""
l = []
for i in self.get_encoded_fields(... |
Return all encoded fields of a specific class by class name
:param class_name: the class name
:returns: a list with `EncodedField` objects
| get_encoded_fields_class | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_encoded_field_descriptor(
self, class_name: str, field_name: str, descriptor: str
) -> EncodedField:
"""
Return the specific encoded field given a class name, field name, and descriptor
:param class_name: the class name of the field
:param field_name: the name of the... |
Return the specific encoded field given a class name, field name, and descriptor
:param class_name: the class name of the field
:param field_name: the name of the field
:param descriptor: the descriptor of the field
:returns: `None` or a `EncodedField` object
| get_encoded_field_descriptor | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_strings(self) -> list[str]:
"""
Return all strings
The strings will have escaped surrogates, if only a single high or low surrogate is found.
Complete surrogates are put together into the representing 32bit character.
:returns: a list with all strings used in the format... |
Return all strings
The strings will have escaped surrogates, if only a single high or low surrogate is found.
Complete surrogates are put together into the representing 32bit character.
:returns: a list with all strings used in the format (types, names ...)
| get_strings | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def get_regex_strings(
self, regular_expressions: str
) -> Union[list[str], None]:
"""
Return all target strings matched the regex
:param regular_expressions: the python regex string
:returns: a list of strings matching the regex expression
"""
str_list = []... |
Return all target strings matched the regex
:param regular_expressions: the python regex string
:returns: a list of strings matching the regex expression
| get_regex_strings | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def create_python_export(self) -> None:
"""
Export classes/methods/fields' names in the python namespace
"""
logger.debug("Exporting Python objects")
setattr(self, "C", ExportObject())
for _class in self.get_classes():
self._create_python_export_class(_class) |
Export classes/methods/fields' names in the python namespace
| create_python_export | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def disassemble(self, offset: int, size: int) -> Iterator[Instruction]:
"""
Disassembles a given offset in the DEX file
:param offset: offset to disassemble in the file (from the beginning of the file)
:param size:
:returns: iterator over `Instruction`s at the given offset
... |
Disassembles a given offset in the DEX file
:param offset: offset to disassemble in the file (from the beginning of the file)
:param size:
:returns: iterator over `Instruction`s at the given offset
| disassemble | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def _get_class_hierarchy(self) -> Node:
"""
Constructs a tree out of all the classes.
The classes are added to this tree by their superclass.
:returns: the root `Node` of the tree
"""
# Contains the class names as well as their running number
ids = dict()
... |
Constructs a tree out of all the classes.
The classes are added to this tree by their superclass.
:returns: the root `Node` of the tree
| _get_class_hierarchy | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
def list_classes_hierarchy(self) -> dict[str, list[dict[str, list]]]:
"""
Get a tree structure of the classes.
The parent is always the superclass.
You can use `pprint.pprint` to print the
dictionary in a pretty way.
:returns: a tree in dictionary format where the key i... |
Get a tree structure of the classes.
The parent is always the superclass.
You can use `pprint.pprint` to print the
dictionary in a pretty way.
:returns: a tree in dictionary format where the key is the class name and the value is a list of dictionaries containing a child class... | list_classes_hierarchy | python | androguard/androguard | androguard/core/dex/__init__.py | https://github.com/androguard/androguard/blob/master/androguard/core/dex/__init__.py | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.