partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
APK.get_attribute_value
Return the attribute value in xml files which matches the tag name and the specific attribute :param str tag_name: specify the tag name :param str attribute: specify the attribute :param bool format_value: specify if the value needs to be formatted with packagename
androguard/core/bytecodes/apk.py
def get_attribute_value( self, tag_name, attribute, format_value=False, **attribute_filter ): """ Return the attribute value in xml files which matches the tag name and the specific attribute :param str tag_name: specify the tag name :param str attribute: specify the attribu...
def get_attribute_value( self, tag_name, attribute, format_value=False, **attribute_filter ): """ Return the attribute value in xml files which matches the tag name and the specific attribute :param str tag_name: specify the tag name :param str attribute: specify the attribu...
[ "Return", "the", "attribute", "value", "in", "xml", "files", "which", "matches", "the", "tag", "name", "and", "the", "specific", "attribute" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L912-L926
[ "def", "get_attribute_value", "(", "self", ",", "tag_name", ",", "attribute", ",", "format_value", "=", "False", ",", "*", "*", "attribute_filter", ")", ":", "for", "value", "in", "self", ".", "get_all_attribute_value", "(", "tag_name", ",", "attribute", ",", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_value_from_tag
Return the value of the android prefixed attribute in a specific tag. This function will always try to get the attribute with a android: prefix first, and will try to return the attribute without the prefix, if the attribute could not be found. This is useful for some broken AndroidManifest.xml...
androguard/core/bytecodes/apk.py
def get_value_from_tag(self, tag, attribute): """ Return the value of the android prefixed attribute in a specific tag. This function will always try to get the attribute with a android: prefix first, and will try to return the attribute without the prefix, if the attribute could not be...
def get_value_from_tag(self, tag, attribute): """ Return the value of the android prefixed attribute in a specific tag. This function will always try to get the attribute with a android: prefix first, and will try to return the attribute without the prefix, if the attribute could not be...
[ "Return", "the", "value", "of", "the", "android", "prefixed", "attribute", "in", "a", "specific", "tag", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L928-L970
[ "def", "get_value_from_tag", "(", "self", ",", "tag", ",", "attribute", ")", ":", "# TODO: figure out if both android:name and name tag exist which one to give preference:", "# currently we give preference for the namespace one and fallback to the un-namespaced", "value", "=", "tag", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.find_tags
Return a list of all the matched tags in all available xml :param str tag: specify the tag name
androguard/core/bytecodes/apk.py
def find_tags(self, tag_name, **attribute_filter): """ Return a list of all the matched tags in all available xml :param str tag: specify the tag name """ all_tags = [ self.find_tags_from_xml( i, tag_name, **attribute_filter ) ...
def find_tags(self, tag_name, **attribute_filter): """ Return a list of all the matched tags in all available xml :param str tag: specify the tag name """ all_tags = [ self.find_tags_from_xml( i, tag_name, **attribute_filter ) ...
[ "Return", "a", "list", "of", "all", "the", "matched", "tags", "in", "all", "available", "xml" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L972-L984
[ "def", "find_tags", "(", "self", ",", "tag_name", ",", "*", "*", "attribute_filter", ")", ":", "all_tags", "=", "[", "self", ".", "find_tags_from_xml", "(", "i", ",", "tag_name", ",", "*", "*", "attribute_filter", ")", "for", "i", "in", "self", ".", "x...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.find_tags_from_xml
Return a list of all the matched tags in a specific xml w :param str xml_name: specify from which xml to pick the tag from :param str tag_name: specify the tag name
androguard/core/bytecodes/apk.py
def find_tags_from_xml( self, xml_name, tag_name, **attribute_filter ): """ Return a list of all the matched tags in a specific xml w :param str xml_name: specify from which xml to pick the tag from :param str tag_name: specify the tag name """ xml = s...
def find_tags_from_xml( self, xml_name, tag_name, **attribute_filter ): """ Return a list of all the matched tags in a specific xml w :param str xml_name: specify from which xml to pick the tag from :param str tag_name: specify the tag name """ xml = s...
[ "Return", "a", "list", "of", "all", "the", "matched", "tags", "in", "a", "specific", "xml", "w", ":", "param", "str", "xml_name", ":", "specify", "from", "which", "xml", "to", "pick", "the", "tag", "from", ":", "param", "str", "tag_name", ":", "specify...
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L986-L1009
[ "def", "find_tags_from_xml", "(", "self", ",", "xml_name", ",", "tag_name", ",", "*", "*", "attribute_filter", ")", ":", "xml", "=", "self", ".", "xml", "[", "xml_name", "]", "if", "xml", "is", "None", ":", "return", "[", "]", "if", "xml", ".", "tag"...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.is_tag_matched
r""" Return true if the attributes matches in attribute filter. An attribute filter is a dictionary containing: {attribute_name: value}. This function will return True if and only if all attributes have the same value. This function allows to set the dictionary via kwargs, thus you can ...
androguard/core/bytecodes/apk.py
def is_tag_matched(self, tag, **attribute_filter): r""" Return true if the attributes matches in attribute filter. An attribute filter is a dictionary containing: {attribute_name: value}. This function will return True if and only if all attributes have the same value. This func...
def is_tag_matched(self, tag, **attribute_filter): r""" Return true if the attributes matches in attribute filter. An attribute filter is a dictionary containing: {attribute_name: value}. This function will return True if and only if all attributes have the same value. This func...
[ "r", "Return", "true", "if", "the", "attributes", "matches", "in", "attribute", "filter", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1011-L1036
[ "def", "is_tag_matched", "(", "self", ",", "tag", ",", "*", "*", "attribute_filter", ")", ":", "if", "len", "(", "attribute_filter", ")", "<=", "0", ":", "return", "True", "for", "attr", ",", "value", "in", "attribute_filter", ".", "items", "(", ")", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_main_activities
Return names of the main activities These values are read from the AndroidManifest.xml :rtype: a set of str
androguard/core/bytecodes/apk.py
def get_main_activities(self): """ Return names of the main activities These values are read from the AndroidManifest.xml :rtype: a set of str """ x = set() y = set() for i in self.xml: if self.xml[i] is None: continue ...
def get_main_activities(self): """ Return names of the main activities These values are read from the AndroidManifest.xml :rtype: a set of str """ x = set() y = set() for i in self.xml: if self.xml[i] is None: continue ...
[ "Return", "names", "of", "the", "main", "activities" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1038-L1080
[ "def", "get_main_activities", "(", "self", ")", ":", "x", "=", "set", "(", ")", "y", "=", "set", "(", ")", "for", "i", "in", "self", ".", "xml", ":", "if", "self", ".", "xml", "[", "i", "]", "is", "None", ":", "continue", "activities_and_aliases", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_main_activity
Return the name of the main activity This value is read from the AndroidManifest.xml :rtype: str
androguard/core/bytecodes/apk.py
def get_main_activity(self): """ Return the name of the main activity This value is read from the AndroidManifest.xml :rtype: str """ activities = self.get_main_activities() if len(activities) > 0: return self._format_value(activities.pop()) ...
def get_main_activity(self): """ Return the name of the main activity This value is read from the AndroidManifest.xml :rtype: str """ activities = self.get_main_activities() if len(activities) > 0: return self._format_value(activities.pop()) ...
[ "Return", "the", "name", "of", "the", "main", "activity" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1082-L1093
[ "def", "get_main_activity", "(", "self", ")", ":", "activities", "=", "self", ".", "get_main_activities", "(", ")", "if", "len", "(", "activities", ")", ">", "0", ":", "return", "self", ".", "_format_value", "(", "activities", ".", "pop", "(", ")", ")", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_intent_filters
Find intent filters for a given item and name. Intent filter are attached to activities, services or receivers. You can search for the intent filters of such items and get a dictionary of all attached actions and intent categories. :param itemtype: the type of parent item to look for, ...
androguard/core/bytecodes/apk.py
def get_intent_filters(self, itemtype, name): """ Find intent filters for a given item and name. Intent filter are attached to activities, services or receivers. You can search for the intent filters of such items and get a dictionary of all attached actions and intent categorie...
def get_intent_filters(self, itemtype, name): """ Find intent filters for a given item and name. Intent filter are attached to activities, services or receivers. You can search for the intent filters of such items and get a dictionary of all attached actions and intent categorie...
[ "Find", "intent", "filters", "for", "a", "given", "item", "and", "name", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1127-L1159
[ "def", "get_intent_filters", "(", "self", ",", "itemtype", ",", "name", ")", ":", "d", "=", "{", "\"action\"", ":", "[", "]", ",", "\"category\"", ":", "[", "]", "}", "for", "i", "in", "self", ".", "xml", ":", "# TODO: this can probably be solved using a s...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_uses_implied_permission_list
Return all permissions implied by the target SDK or other permissions. :rtype: list of string
androguard/core/bytecodes/apk.py
def get_uses_implied_permission_list(self): """ Return all permissions implied by the target SDK or other permissions. :rtype: list of string """ target_sdk_version = self.get_effective_target_sdk_version() READ_CALL_LOG = 'android.permission.READ_CALL_LOG' ...
def get_uses_implied_permission_list(self): """ Return all permissions implied by the target SDK or other permissions. :rtype: list of string """ target_sdk_version = self.get_effective_target_sdk_version() READ_CALL_LOG = 'android.permission.READ_CALL_LOG' ...
[ "Return", "all", "permissions", "implied", "by", "the", "target", "SDK", "or", "other", "permissions", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1178-L1221
[ "def", "get_uses_implied_permission_list", "(", "self", ")", ":", "target_sdk_version", "=", "self", ".", "get_effective_target_sdk_version", "(", ")", "READ_CALL_LOG", "=", "'android.permission.READ_CALL_LOG'", "READ_CONTACTS", "=", "'android.permission.READ_CONTACTS'", "READ_...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_details_permissions
Return permissions with details. THis can only return details about the permission, if the permission is defined in the AOSP. :rtype: dict of {permission: [protectionLevel, label, description]}
androguard/core/bytecodes/apk.py
def get_details_permissions(self): """ Return permissions with details. THis can only return details about the permission, if the permission is defined in the AOSP. :rtype: dict of {permission: [protectionLevel, label, description]} """ l = {} for i in ...
def get_details_permissions(self): """ Return permissions with details. THis can only return details about the permission, if the permission is defined in the AOSP. :rtype: dict of {permission: [protectionLevel, label, description]} """ l = {} for i in ...
[ "Return", "permissions", "with", "details", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1223-L1242
[ "def", "get_details_permissions", "(", "self", ")", ":", "l", "=", "{", "}", "for", "i", "in", "self", ".", "permissions", ":", "if", "i", "in", "self", ".", "permission_module", ":", "x", "=", "self", ".", "permission_module", "[", "i", "]", "l", "[...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_requested_aosp_permissions
Returns requested permissions declared within AOSP project. This includes several other permissions as well, which are in the platform apps. :rtype: list of str
androguard/core/bytecodes/apk.py
def get_requested_aosp_permissions(self): """ Returns requested permissions declared within AOSP project. This includes several other permissions as well, which are in the platform apps. :rtype: list of str """ aosp_permissions = [] all_permissions = self.get_pe...
def get_requested_aosp_permissions(self): """ Returns requested permissions declared within AOSP project. This includes several other permissions as well, which are in the platform apps. :rtype: list of str """ aosp_permissions = [] all_permissions = self.get_pe...
[ "Returns", "requested", "permissions", "declared", "within", "AOSP", "project", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1258-L1271
[ "def", "get_requested_aosp_permissions", "(", "self", ")", ":", "aosp_permissions", "=", "[", "]", "all_permissions", "=", "self", ".", "get_permissions", "(", ")", "for", "perm", "in", "all_permissions", ":", "if", "perm", "in", "list", "(", "self", ".", "p...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_requested_aosp_permissions_details
Returns requested aosp permissions with details. :rtype: dictionary
androguard/core/bytecodes/apk.py
def get_requested_aosp_permissions_details(self): """ Returns requested aosp permissions with details. :rtype: dictionary """ l = {} for i in self.permissions: try: l[i] = self.permission_module[i] except KeyError: ...
def get_requested_aosp_permissions_details(self): """ Returns requested aosp permissions with details. :rtype: dictionary """ l = {} for i in self.permissions: try: l[i] = self.permission_module[i] except KeyError: ...
[ "Returns", "requested", "aosp", "permissions", "with", "details", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1273-L1286
[ "def", "get_requested_aosp_permissions_details", "(", "self", ")", ":", "l", "=", "{", "}", "for", "i", "in", "self", ".", "permissions", ":", "try", ":", "l", "[", "i", "]", "=", "self", ".", "permission_module", "[", "i", "]", "except", "KeyError", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_requested_third_party_permissions
Returns list of requested permissions not declared within AOSP project. :rtype: list of strings
androguard/core/bytecodes/apk.py
def get_requested_third_party_permissions(self): """ Returns list of requested permissions not declared within AOSP project. :rtype: list of strings """ third_party_permissions = [] all_permissions = self.get_permissions() for perm in all_permissions: ...
def get_requested_third_party_permissions(self): """ Returns list of requested permissions not declared within AOSP project. :rtype: list of strings """ third_party_permissions = [] all_permissions = self.get_permissions() for perm in all_permissions: ...
[ "Returns", "list", "of", "requested", "permissions", "not", "declared", "within", "AOSP", "project", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1288-L1299
[ "def", "get_requested_third_party_permissions", "(", "self", ")", ":", "third_party_permissions", "=", "[", "]", "all_permissions", "=", "self", ".", "get_permissions", "(", ")", "for", "perm", "in", "all_permissions", ":", "if", "perm", "not", "in", "list", "("...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_effective_target_sdk_version
Return the effective targetSdkVersion, always returns int > 0. If the targetSdkVersion is not set, it defaults to 1. This is set based on defaults as defined in: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html :rtype: int
androguard/core/bytecodes/apk.py
def get_effective_target_sdk_version(self): """ Return the effective targetSdkVersion, always returns int > 0. If the targetSdkVersion is not set, it defaults to 1. This is set based on defaults as defined in: https://developer.android.com/guide/topics/manifest/...
def get_effective_target_sdk_version(self): """ Return the effective targetSdkVersion, always returns int > 0. If the targetSdkVersion is not set, it defaults to 1. This is set based on defaults as defined in: https://developer.android.com/guide/topics/manifest/...
[ "Return", "the", "effective", "targetSdkVersion", "always", "returns", "int", ">", "0", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1341-L1357
[ "def", "get_effective_target_sdk_version", "(", "self", ")", ":", "target_sdk_version", "=", "self", ".", "get_target_sdk_version", "(", ")", "if", "not", "target_sdk_version", ":", "target_sdk_version", "=", "self", ".", "get_min_sdk_version", "(", ")", "try", ":",...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_certificate_der
Return the DER coded X.509 certificate from the signature file. :param filename: Signature filename in APK :returns: DER coded X.509 certificate as binary
androguard/core/bytecodes/apk.py
def get_certificate_der(self, filename): """ Return the DER coded X.509 certificate from the signature file. :param filename: Signature filename in APK :returns: DER coded X.509 certificate as binary """ pkcs7message = self.get_file(filename) pkcs7obj = cms.Cont...
def get_certificate_der(self, filename): """ Return the DER coded X.509 certificate from the signature file. :param filename: Signature filename in APK :returns: DER coded X.509 certificate as binary """ pkcs7message = self.get_file(filename) pkcs7obj = cms.Cont...
[ "Return", "the", "DER", "coded", "X", ".", "509", "certificate", "from", "the", "signature", "file", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1408-L1419
[ "def", "get_certificate_der", "(", "self", ",", "filename", ")", ":", "pkcs7message", "=", "self", ".", "get_file", "(", "filename", ")", "pkcs7obj", "=", "cms", ".", "ContentInfo", ".", "load", "(", "pkcs7message", ")", "cert", "=", "pkcs7obj", "[", "'con...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_certificate
Return a X.509 certificate object by giving the name in the apk file :param filename: filename of the signature file in the APK :returns: a :class:`Certificate` certificate
androguard/core/bytecodes/apk.py
def get_certificate(self, filename): """ Return a X.509 certificate object by giving the name in the apk file :param filename: filename of the signature file in the APK :returns: a :class:`Certificate` certificate """ cert = self.get_certificate_der(filename) cer...
def get_certificate(self, filename): """ Return a X.509 certificate object by giving the name in the apk file :param filename: filename of the signature file in the APK :returns: a :class:`Certificate` certificate """ cert = self.get_certificate_der(filename) cer...
[ "Return", "a", "X", ".", "509", "certificate", "object", "by", "giving", "the", "name", "in", "the", "apk", "file" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1421-L1431
[ "def", "get_certificate", "(", "self", ",", "filename", ")", ":", "cert", "=", "self", ".", "get_certificate_der", "(", "filename", ")", "certificate", "=", "x509", ".", "Certificate", ".", "load", "(", "cert", ")", "return", "certificate" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.new_zip
Create a new zip file :param filename: the output filename of the zip :param deleted_files: a regex pattern to remove specific file :param new_files: a dictionnary of new files :type filename: string :type deleted_files: None or a string :type ne...
androguard/core/bytecodes/apk.py
def new_zip(self, filename, deleted_files=None, new_files={}): """ Create a new zip file :param filename: the output filename of the zip :param deleted_files: a regex pattern to remove specific file :param new_files: a dictionnary of new files :type ...
def new_zip(self, filename, deleted_files=None, new_files={}): """ Create a new zip file :param filename: the output filename of the zip :param deleted_files: a regex pattern to remove specific file :param new_files: a dictionnary of new files :type ...
[ "Create", "a", "new", "zip", "file" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1433-L1472
[ "def", "new_zip", "(", "self", ",", "filename", ",", "deleted_files", "=", "None", ",", "new_files", "=", "{", "}", ")", ":", "zout", "=", "zipfile", ".", "ZipFile", "(", "filename", ",", "'w'", ")", "for", "item", "in", "self", ".", "zip", ".", "i...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.parse_signatures_or_digests
Parse digests
androguard/core/bytecodes/apk.py
def parse_signatures_or_digests(self, digest_bytes): """ Parse digests """ if not len(digest_bytes): return [] digests = [] block = io.BytesIO(digest_bytes) data_len = self.read_uint32_le(block) while block.tell() < data_len: algorithm_...
def parse_signatures_or_digests(self, digest_bytes): """ Parse digests """ if not len(digest_bytes): return [] digests = [] block = io.BytesIO(digest_bytes) data_len = self.read_uint32_le(block) while block.tell() < data_len: algorithm_...
[ "Parse", "digests" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1555-L1573
[ "def", "parse_signatures_or_digests", "(", "self", ",", "digest_bytes", ")", ":", "if", "not", "len", "(", "digest_bytes", ")", ":", "return", "[", "]", "digests", "=", "[", "]", "block", "=", "io", ".", "BytesIO", "(", "digest_bytes", ")", "data_len", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.parse_v3_signing_block
Parse the V2 signing block and extract all features
androguard/core/bytecodes/apk.py
def parse_v3_signing_block(self): """ Parse the V2 signing block and extract all features """ self._v3_signing_data = [] # calling is_signed_v3 should also load the signature, if any if not self.is_signed_v3(): return block_bytes = self._v2_blocks[s...
def parse_v3_signing_block(self): """ Parse the V2 signing block and extract all features """ self._v3_signing_data = [] # calling is_signed_v3 should also load the signature, if any if not self.is_signed_v3(): return block_bytes = self._v2_blocks[s...
[ "Parse", "the", "V2", "signing", "block", "and", "extract", "all", "features" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1657-L1754
[ "def", "parse_v3_signing_block", "(", "self", ")", ":", "self", ".", "_v3_signing_data", "=", "[", "]", "# calling is_signed_v3 should also load the signature, if any", "if", "not", "self", ".", "is_signed_v3", "(", ")", ":", "return", "block_bytes", "=", "self", "....
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.parse_v2_signing_block
Parse the V2 signing block and extract all features
androguard/core/bytecodes/apk.py
def parse_v2_signing_block(self): """ Parse the V2 signing block and extract all features """ self._v2_signing_data = [] # calling is_signed_v2 should also load the signature if not self.is_signed_v2(): return block_bytes = self._v2_blocks[self._APK...
def parse_v2_signing_block(self): """ Parse the V2 signing block and extract all features """ self._v2_signing_data = [] # calling is_signed_v2 should also load the signature if not self.is_signed_v2(): return block_bytes = self._v2_blocks[self._APK...
[ "Parse", "the", "V2", "signing", "block", "and", "extract", "all", "features" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1756-L1836
[ "def", "parse_v2_signing_block", "(", "self", ")", ":", "self", ".", "_v2_signing_data", "=", "[", "]", "# calling is_signed_v2 should also load the signature", "if", "not", "self", ".", "is_signed_v2", "(", ")", ":", "return", "block_bytes", "=", "self", ".", "_v...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_public_keys_der_v3
Return a list of DER coded X.509 public keys from the v3 signature block
androguard/core/bytecodes/apk.py
def get_public_keys_der_v3(self): """ Return a list of DER coded X.509 public keys from the v3 signature block """ if self._v3_signing_data == None: self.parse_v3_signing_block() public_keys = [] for signer in self._v3_signing_data: public_keys....
def get_public_keys_der_v3(self): """ Return a list of DER coded X.509 public keys from the v3 signature block """ if self._v3_signing_data == None: self.parse_v3_signing_block() public_keys = [] for signer in self._v3_signing_data: public_keys....
[ "Return", "a", "list", "of", "DER", "coded", "X", ".", "509", "public", "keys", "from", "the", "v3", "signature", "block" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1838-L1851
[ "def", "get_public_keys_der_v3", "(", "self", ")", ":", "if", "self", ".", "_v3_signing_data", "==", "None", ":", "self", ".", "parse_v3_signing_block", "(", ")", "public_keys", "=", "[", "]", "for", "signer", "in", "self", ".", "_v3_signing_data", ":", "pub...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_public_keys_der_v2
Return a list of DER coded X.509 public keys from the v3 signature block
androguard/core/bytecodes/apk.py
def get_public_keys_der_v2(self): """ Return a list of DER coded X.509 public keys from the v3 signature block """ if self._v2_signing_data == None: self.parse_v2_signing_block() public_keys = [] for signer in self._v2_signing_data: public_keys....
def get_public_keys_der_v2(self): """ Return a list of DER coded X.509 public keys from the v3 signature block """ if self._v2_signing_data == None: self.parse_v2_signing_block() public_keys = [] for signer in self._v2_signing_data: public_keys....
[ "Return", "a", "list", "of", "DER", "coded", "X", ".", "509", "public", "keys", "from", "the", "v3", "signature", "block" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1853-L1866
[ "def", "get_public_keys_der_v2", "(", "self", ")", ":", "if", "self", ".", "_v2_signing_data", "==", "None", ":", "self", ".", "parse_v2_signing_block", "(", ")", "public_keys", "=", "[", "]", "for", "signer", "in", "self", ".", "_v2_signing_data", ":", "pub...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_certificates_der_v3
Return a list of DER coded X.509 certificates from the v3 signature block
androguard/core/bytecodes/apk.py
def get_certificates_der_v3(self): """ Return a list of DER coded X.509 certificates from the v3 signature block """ if self._v3_signing_data == None: self.parse_v3_signing_block() certs = [] for signed_data in [signer.signed_data for signer in self._v3_sign...
def get_certificates_der_v3(self): """ Return a list of DER coded X.509 certificates from the v3 signature block """ if self._v3_signing_data == None: self.parse_v3_signing_block() certs = [] for signed_data in [signer.signed_data for signer in self._v3_sign...
[ "Return", "a", "list", "of", "DER", "coded", "X", ".", "509", "certificates", "from", "the", "v3", "signature", "block" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1868-L1881
[ "def", "get_certificates_der_v3", "(", "self", ")", ":", "if", "self", ".", "_v3_signing_data", "==", "None", ":", "self", ".", "parse_v3_signing_block", "(", ")", "certs", "=", "[", "]", "for", "signed_data", "in", "[", "signer", ".", "signed_data", "for", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_certificates_der_v2
Return a list of DER coded X.509 certificates from the v3 signature block
androguard/core/bytecodes/apk.py
def get_certificates_der_v2(self): """ Return a list of DER coded X.509 certificates from the v3 signature block """ if self._v2_signing_data == None: self.parse_v2_signing_block() certs = [] for signed_data in [signer.signed_data for signer in self._v2_sign...
def get_certificates_der_v2(self): """ Return a list of DER coded X.509 certificates from the v3 signature block """ if self._v2_signing_data == None: self.parse_v2_signing_block() certs = [] for signed_data in [signer.signed_data for signer in self._v2_sign...
[ "Return", "a", "list", "of", "DER", "coded", "X", ".", "509", "certificates", "from", "the", "v3", "signature", "block" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1883-L1896
[ "def", "get_certificates_der_v2", "(", "self", ")", ":", "if", "self", ".", "_v2_signing_data", "==", "None", ":", "self", ".", "parse_v2_signing_block", "(", ")", "certs", "=", "[", "]", "for", "signed_data", "in", "[", "signer", ".", "signed_data", "for", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_certificates_v1
Return a list of :class:`asn1crypto.x509.Certificate` which are found in the META-INF folder (v1 signing). Note that we simply extract all certificates regardless of the signer. Therefore this is just a list of all certificates found in all signers.
androguard/core/bytecodes/apk.py
def get_certificates_v1(self): """ Return a list of :class:`asn1crypto.x509.Certificate` which are found in the META-INF folder (v1 signing). Note that we simply extract all certificates regardless of the signer. Therefore this is just a list of all certificates found in all sign...
def get_certificates_v1(self): """ Return a list of :class:`asn1crypto.x509.Certificate` which are found in the META-INF folder (v1 signing). Note that we simply extract all certificates regardless of the signer. Therefore this is just a list of all certificates found in all sign...
[ "Return", "a", "list", "of", ":", "class", ":", "asn1crypto", ".", "x509", ".", "Certificate", "which", "are", "found", "in", "the", "META", "-", "INF", "folder", "(", "v1", "signing", ")", ".", "Note", "that", "we", "simply", "extract", "all", "certif...
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1930-L1941
[ "def", "get_certificates_v1", "(", "self", ")", ":", "certs", "=", "[", "]", "for", "x", "in", "self", ".", "get_signature_names", "(", ")", ":", "certs", ".", "append", "(", "x509", ".", "Certificate", ".", "load", "(", "self", ".", "get_certificate_der...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_certificates
Return a list of unique :class:`asn1crypto.x509.Certificate` which are found in v1, v2 and v3 signing Note that we simply extract all certificates regardless of the signer. Therefore this is just a list of all certificates found in all signers.
androguard/core/bytecodes/apk.py
def get_certificates(self): """ Return a list of unique :class:`asn1crypto.x509.Certificate` which are found in v1, v2 and v3 signing Note that we simply extract all certificates regardless of the signer. Therefore this is just a list of all certificates found in all signers. ...
def get_certificates(self): """ Return a list of unique :class:`asn1crypto.x509.Certificate` which are found in v1, v2 and v3 signing Note that we simply extract all certificates regardless of the signer. Therefore this is just a list of all certificates found in all signers. ...
[ "Return", "a", "list", "of", "unique", ":", "class", ":", "asn1crypto", ".", "x509", ".", "Certificate", "which", "are", "found", "in", "v1", "v2", "and", "v3", "signing", "Note", "that", "we", "simply", "extract", "all", "certificates", "regardless", "of"...
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1943-L1956
[ "def", "get_certificates", "(", "self", ")", ":", "fps", "=", "[", "]", "certs", "=", "[", "]", "for", "x", "in", "self", ".", "get_certificates_v1", "(", ")", "+", "self", ".", "get_certificates_v2", "(", ")", "+", "self", ".", "get_certificates_v3", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_signature_names
Return a list of the signature file names (v1 Signature / JAR Signature) :rtype: List of filenames matching a Signature
androguard/core/bytecodes/apk.py
def get_signature_names(self): """ Return a list of the signature file names (v1 Signature / JAR Signature) :rtype: List of filenames matching a Signature """ signature_expr = re.compile(r"^(META-INF/)(.*)(\.RSA|\.EC|\.DSA)$") signatures = [] for i in se...
def get_signature_names(self): """ Return a list of the signature file names (v1 Signature / JAR Signature) :rtype: List of filenames matching a Signature """ signature_expr = re.compile(r"^(META-INF/)(.*)(\.RSA|\.EC|\.DSA)$") signatures = [] for i in se...
[ "Return", "a", "list", "of", "the", "signature", "file", "names", "(", "v1", "Signature", "/", "JAR", "Signature", ")" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1968-L1985
[ "def", "get_signature_names", "(", "self", ")", ":", "signature_expr", "=", "re", ".", "compile", "(", "r\"^(META-INF/)(.*)(\\.RSA|\\.EC|\\.DSA)$\"", ")", "signatures", "=", "[", "]", "for", "i", "in", "self", ".", "get_files", "(", ")", ":", "if", "signature_...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
APK.get_signatures
Return a list of the data of the signature files. Only v1 / JAR Signing. :rtype: list of bytes
androguard/core/bytecodes/apk.py
def get_signatures(self): """ Return a list of the data of the signature files. Only v1 / JAR Signing. :rtype: list of bytes """ signature_expr = re.compile(r"^(META-INF/)(.*)(\.RSA|\.EC|\.DSA)$") signature_datas = [] for i in self.get_files(): ...
def get_signatures(self): """ Return a list of the data of the signature files. Only v1 / JAR Signing. :rtype: list of bytes """ signature_expr = re.compile(r"^(META-INF/)(.*)(\.RSA|\.EC|\.DSA)$") signature_datas = [] for i in self.get_files(): ...
[ "Return", "a", "list", "of", "the", "data", "of", "the", "signature", "files", ".", "Only", "v1", "/", "JAR", "Signing", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/apk.py#L1999-L2013
[ "def", "get_signatures", "(", "self", ")", ":", "signature_expr", "=", "re", ".", "compile", "(", "r\"^(META-INF/)(.*)(\\.RSA|\\.EC|\\.DSA)$\"", ")", "signature_datas", "=", "[", "]", "for", "i", "in", "self", ".", "get_files", "(", ")", ":", "if", "signature_...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
method2dot
Export analysis method to dot format :param mx: :class:`~androguard.core.analysis.analysis.MethodAnalysis` :param colors: dict of colors to use, if colors is None the default colors are used :returns: a string which contains the dot graph
androguard/core/bytecode.py
def method2dot(mx, colors=None): """ Export analysis method to dot format :param mx: :class:`~androguard.core.analysis.analysis.MethodAnalysis` :param colors: dict of colors to use, if colors is None the default colors are used :returns: a string which contains the dot graph """ if not co...
def method2dot(mx, colors=None): """ Export analysis method to dot format :param mx: :class:`~androguard.core.analysis.analysis.MethodAnalysis` :param colors: dict of colors to use, if colors is None the default colors are used :returns: a string which contains the dot graph """ if not co...
[ "Export", "analysis", "method", "to", "dot", "format" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L173-L349
[ "def", "method2dot", "(", "mx", ",", "colors", "=", "None", ")", ":", "if", "not", "colors", ":", "colors", "=", "{", "\"true_branch\"", ":", "\"green\"", ",", "\"false_branch\"", ":", "\"red\"", ",", "\"default_branch\"", ":", "\"purple\"", ",", "\"jump_bra...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
method2format
Export method to a specific file format @param output : output filename @param _format : format type (png, jpg ...) (default : png) @param mx : specify the MethodAnalysis object @param raw : use directly a dot raw buffer if None
androguard/core/bytecode.py
def method2format(output, _format="png", mx=None, raw=None): """ Export method to a specific file format @param output : output filename @param _format : format type (png, jpg ...) (default : png) @param mx : specify the MethodAnalysis object @param raw : use directly a dot raw buffer if None ...
def method2format(output, _format="png", mx=None, raw=None): """ Export method to a specific file format @param output : output filename @param _format : format type (png, jpg ...) (default : png) @param mx : specify the MethodAnalysis object @param raw : use directly a dot raw buffer if None ...
[ "Export", "method", "to", "a", "specific", "file", "format" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L352-L387
[ "def", "method2format", "(", "output", ",", "_format", "=", "\"png\"", ",", "mx", "=", "None", ",", "raw", "=", "None", ")", ":", "# pydot is optional!", "import", "pydot", "buff", "=", "\"digraph {\\n\"", "buff", "+=", "\"graph [rankdir=TB]\\n\"", "buff", "+=...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
method2png
Export method to a png file format :param output: output filename :type output: string :param mx: specify the MethodAnalysis object :type mx: :class:`MethodAnalysis` object :param raw: use directly a dot raw buffer :type raw: string
androguard/core/bytecode.py
def method2png(output, mx, raw=False): """ Export method to a png file format :param output: output filename :type output: string :param mx: specify the MethodAnalysis object :type mx: :class:`MethodAnalysis` object :param raw: use directly a dot raw buffer :type raw: string """ ...
def method2png(output, mx, raw=False): """ Export method to a png file format :param output: output filename :type output: string :param mx: specify the MethodAnalysis object :type mx: :class:`MethodAnalysis` object :param raw: use directly a dot raw buffer :type raw: string """ ...
[ "Export", "method", "to", "a", "png", "file", "format" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L390-L405
[ "def", "method2png", "(", "output", ",", "mx", ",", "raw", "=", "False", ")", ":", "buff", "=", "raw", "if", "not", "raw", ":", "buff", "=", "method2dot", "(", "mx", ")", "method2format", "(", "output", ",", "\"png\"", ",", "mx", ",", "buff", ")" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
method2jpg
Export method to a jpg file format :param output: output filename :type output: string :param mx: specify the MethodAnalysis object :type mx: :class:`MethodAnalysis` object :param raw: use directly a dot raw buffer (optional) :type raw: string
androguard/core/bytecode.py
def method2jpg(output, mx, raw=False): """ Export method to a jpg file format :param output: output filename :type output: string :param mx: specify the MethodAnalysis object :type mx: :class:`MethodAnalysis` object :param raw: use directly a dot raw buffer (optional) :type raw: string ...
def method2jpg(output, mx, raw=False): """ Export method to a jpg file format :param output: output filename :type output: string :param mx: specify the MethodAnalysis object :type mx: :class:`MethodAnalysis` object :param raw: use directly a dot raw buffer (optional) :type raw: string ...
[ "Export", "method", "to", "a", "jpg", "file", "format" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L408-L423
[ "def", "method2jpg", "(", "output", ",", "mx", ",", "raw", "=", "False", ")", ":", "buff", "=", "raw", "if", "not", "raw", ":", "buff", "=", "method2dot", "(", "mx", ")", "method2format", "(", "output", ",", "\"jpg\"", ",", "mx", ",", "buff", ")" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
vm2json
Get a JSON representation of a DEX file :param vm: :class:`~androguard.core.bytecodes.dvm.DalvikVMFormat` :return:
androguard/core/bytecode.py
def vm2json(vm): """ Get a JSON representation of a DEX file :param vm: :class:`~androguard.core.bytecodes.dvm.DalvikVMFormat` :return: """ d = {"name": "root", "children": []} for _class in vm.get_classes(): c_class = {"name": _class.get_name(), "children": []} for method...
def vm2json(vm): """ Get a JSON representation of a DEX file :param vm: :class:`~androguard.core.bytecodes.dvm.DalvikVMFormat` :return: """ d = {"name": "root", "children": []} for _class in vm.get_classes(): c_class = {"name": _class.get_name(), "children": []} for method...
[ "Get", "a", "JSON", "representation", "of", "a", "DEX", "file" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L426-L445
[ "def", "vm2json", "(", "vm", ")", ":", "d", "=", "{", "\"name\"", ":", "\"root\"", ",", "\"children\"", ":", "[", "]", "}", "for", "_class", "in", "vm", ".", "get_classes", "(", ")", ":", "c_class", "=", "{", "\"name\"", ":", "_class", ".", "get_na...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
object_to_bytes
Convert a object to a bytearray or call get_raw() of the object if no useful type was found.
androguard/core/bytecode.py
def object_to_bytes(obj): """ Convert a object to a bytearray or call get_raw() of the object if no useful type was found. """ if isinstance(obj, str): return bytearray(obj, "UTF-8") elif isinstance(obj, bool): return bytearray() elif isinstance(obj, int): return pack...
def object_to_bytes(obj): """ Convert a object to a bytearray or call get_raw() of the object if no useful type was found. """ if isinstance(obj, str): return bytearray(obj, "UTF-8") elif isinstance(obj, bool): return bytearray() elif isinstance(obj, int): return pack...
[ "Convert", "a", "object", "to", "a", "bytearray", "or", "call", "get_raw", "()", "of", "the", "object", "if", "no", "useful", "type", "was", "found", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L650-L666
[ "def", "object_to_bytes", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "str", ")", ":", "return", "bytearray", "(", "obj", ",", "\"UTF-8\"", ")", "elif", "isinstance", "(", "obj", ",", "bool", ")", ":", "return", "bytearray", "(", ")", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
FormatClassToPython
Transform a typed class name into a form which can be used as a python attribute example:: >>> FormatClassToPython('Lfoo/bar/foo/Barfoo$InnerClass;') 'Lfoo_bar_foo_Barfoo_InnerClass' :param i: classname to transform :rtype: str
androguard/core/bytecode.py
def FormatClassToPython(i): """ Transform a typed class name into a form which can be used as a python attribute example:: >>> FormatClassToPython('Lfoo/bar/foo/Barfoo$InnerClass;') 'Lfoo_bar_foo_Barfoo_InnerClass' :param i: classname to transform :rtype: str """ i = i...
def FormatClassToPython(i): """ Transform a typed class name into a form which can be used as a python attribute example:: >>> FormatClassToPython('Lfoo/bar/foo/Barfoo$InnerClass;') 'Lfoo_bar_foo_Barfoo_InnerClass' :param i: classname to transform :rtype: str """ i = i...
[ "Transform", "a", "typed", "class", "name", "into", "a", "form", "which", "can", "be", "used", "as", "a", "python", "attribute" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L874-L891
[ "def", "FormatClassToPython", "(", "i", ")", ":", "i", "=", "i", "[", ":", "-", "1", "]", "i", "=", "i", ".", "replace", "(", "\"/\"", ",", "\"_\"", ")", "i", "=", "i", ".", "replace", "(", "\"$\"", ",", "\"_\"", ")", "return", "i" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
get_package_class_name
Return package and class name in a java variant from a typed variant name. If no package could be found, the package is an empty string. example:: >>> get_package_class_name('Ljava/lang/Object;') ('java.lang', 'Object') :param name: the name :rtype: tuple :return:
androguard/core/bytecode.py
def get_package_class_name(name): """ Return package and class name in a java variant from a typed variant name. If no package could be found, the package is an empty string. example:: >>> get_package_class_name('Ljava/lang/Object;') ('java.lang', 'Object') :param name: the name ...
def get_package_class_name(name): """ Return package and class name in a java variant from a typed variant name. If no package could be found, the package is an empty string. example:: >>> get_package_class_name('Ljava/lang/Object;') ('java.lang', 'Object') :param name: the name ...
[ "Return", "package", "and", "class", "name", "in", "a", "java", "variant", "from", "a", "typed", "variant", "name", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L894-L919
[ "def", "get_package_class_name", "(", "name", ")", ":", "if", "name", "[", "0", "]", "!=", "'L'", "and", "name", "[", "-", "1", "]", "!=", "';'", ":", "raise", "ValueError", "(", "\"The name '{}' does not look like a typed name!\"", ".", "format", "(", "name...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
FormatNameToPython
Transform a (method) name into a form which can be used as a python attribute example:: >>> FormatNameToPython('<clinit>') 'clinit' :param i: name to transform :rtype: str
androguard/core/bytecode.py
def FormatNameToPython(i): """ Transform a (method) name into a form which can be used as a python attribute example:: >>> FormatNameToPython('<clinit>') 'clinit' :param i: name to transform :rtype: str """ i = i.replace("<", "") i = i.replace(">", "") i = i.r...
def FormatNameToPython(i): """ Transform a (method) name into a form which can be used as a python attribute example:: >>> FormatNameToPython('<clinit>') 'clinit' :param i: name to transform :rtype: str """ i = i.replace("<", "") i = i.replace(">", "") i = i.r...
[ "Transform", "a", "(", "method", ")", "name", "into", "a", "form", "which", "can", "be", "used", "as", "a", "python", "attribute" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L922-L940
[ "def", "FormatNameToPython", "(", "i", ")", ":", "i", "=", "i", ".", "replace", "(", "\"<\"", ",", "\"\"", ")", "i", "=", "i", ".", "replace", "(", "\">\"", ",", "\"\"", ")", "i", "=", "i", ".", "replace", "(", "\"$\"", ",", "\"_\"", ")", "retu...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
FormatDescriptorToPython
Format a descriptor into a form which can be used as a python attribute example:: >>> FormatDescriptorToPython('(Ljava/lang/Long; Ljava/lang/Long; Z Z)V') 'Ljava_lang_LongLjava_lang_LongZZV :param i: name to transform :rtype: str
androguard/core/bytecode.py
def FormatDescriptorToPython(i): """ Format a descriptor into a form which can be used as a python attribute example:: >>> FormatDescriptorToPython('(Ljava/lang/Long; Ljava/lang/Long; Z Z)V') 'Ljava_lang_LongLjava_lang_LongZZV :param i: name to transform :rtype: str """ i...
def FormatDescriptorToPython(i): """ Format a descriptor into a form which can be used as a python attribute example:: >>> FormatDescriptorToPython('(Ljava/lang/Long; Ljava/lang/Long; Z Z)V') 'Ljava_lang_LongLjava_lang_LongZZV :param i: name to transform :rtype: str """ i...
[ "Format", "a", "descriptor", "into", "a", "form", "which", "can", "be", "used", "as", "a", "python", "attribute" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L943-L964
[ "def", "FormatDescriptorToPython", "(", "i", ")", ":", "i", "=", "i", ".", "replace", "(", "\"/\"", ",", "\"_\"", ")", "i", "=", "i", ".", "replace", "(", "\";\"", ",", "\"\"", ")", "i", "=", "i", ".", "replace", "(", "\"[\"", ",", "\"\"", ")", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
BuffHandle.read_b
Read bytes with length `size` without incrementing the current offset :param int size: length to read in bytes :rtype: bytearray
androguard/core/bytecode.py
def read_b(self, size): """ Read bytes with length `size` without incrementing the current offset :param int size: length to read in bytes :rtype: bytearray """ return self.__buff[self.__idx:self.__idx + size]
def read_b(self, size): """ Read bytes with length `size` without incrementing the current offset :param int size: length to read in bytes :rtype: bytearray """ return self.__buff[self.__idx:self.__idx + size]
[ "Read", "bytes", "with", "length", "size", "without", "incrementing", "the", "current", "offset" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L754-L761
[ "def", "read_b", "(", "self", ",", "size", ")", ":", "return", "self", ".", "__buff", "[", "self", ".", "__idx", ":", "self", ".", "__idx", "+", "size", "]" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
BuffHandle.readat
Read all bytes from the start of `off` until the end of the buffer This method can be used to determine a checksum of a buffer from a given point on. :param int off: starting offset :rtype: bytearray
androguard/core/bytecode.py
def readat(self, off): """ Read all bytes from the start of `off` until the end of the buffer This method can be used to determine a checksum of a buffer from a given point on. :param int off: starting offset :rtype: bytearray """ if isinstance(off, SV):...
def readat(self, off): """ Read all bytes from the start of `off` until the end of the buffer This method can be used to determine a checksum of a buffer from a given point on. :param int off: starting offset :rtype: bytearray """ if isinstance(off, SV):...
[ "Read", "all", "bytes", "from", "the", "start", "of", "off", "until", "the", "end", "of", "the", "buffer" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L780-L793
[ "def", "readat", "(", "self", ",", "off", ")", ":", "if", "isinstance", "(", "off", ",", "SV", ")", ":", "off", "=", "off", ".", "value", "return", "self", ".", "__buff", "[", "off", ":", "]" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
BuffHandle.read
Read from the current offset a total number of `size` bytes and increment the offset by `size` :param int size: length of bytes to read :rtype: bytearray
androguard/core/bytecode.py
def read(self, size): """ Read from the current offset a total number of `size` bytes and increment the offset by `size` :param int size: length of bytes to read :rtype: bytearray """ if isinstance(size, SV): size = size.value buff = self.__b...
def read(self, size): """ Read from the current offset a total number of `size` bytes and increment the offset by `size` :param int size: length of bytes to read :rtype: bytearray """ if isinstance(size, SV): size = size.value buff = self.__b...
[ "Read", "from", "the", "current", "offset", "a", "total", "number", "of", "size", "bytes", "and", "increment", "the", "offset", "by", "size" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L795-L809
[ "def", "read", "(", "self", ",", "size", ")", ":", "if", "isinstance", "(", "size", ",", "SV", ")", ":", "size", "=", "size", ".", "value", "buff", "=", "self", ".", "__buff", "[", "self", ".", "__idx", ":", "self", ".", "__idx", "+", "size", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
BuffHandle.save
Save the current buffer to `filename` Exisiting files with the same name will be overwritten. :param str filename: the name of the file to save to
androguard/core/bytecode.py
def save(self, filename): """ Save the current buffer to `filename` Exisiting files with the same name will be overwritten. :param str filename: the name of the file to save to """ with open(filename, "wb") as fd: fd.write(self.__buff)
def save(self, filename): """ Save the current buffer to `filename` Exisiting files with the same name will be overwritten. :param str filename: the name of the file to save to """ with open(filename, "wb") as fd: fd.write(self.__buff)
[ "Save", "the", "current", "buffer", "to", "filename" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecode.py#L835-L844
[ "def", "save", "(", "self", ",", "filename", ")", ":", "with", "open", "(", "filename", ",", "\"wb\"", ")", "as", "fd", ":", "fd", ".", "write", "(", "self", ".", "__buff", ")" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
read_null_terminated_string
Read a null terminated string from a file-like object. :param f: file-like object :rtype: bytearray
androguard/core/bytecodes/dvm.py
def read_null_terminated_string(f): """ Read a null terminated string from a file-like object. :param f: file-like object :rtype: bytearray """ x = bytearray() while True: z = f.read(1) if ord(z) == 0: return x else: x.append(ord(z))
def read_null_terminated_string(f): """ Read a null terminated string from a file-like object. :param f: file-like object :rtype: bytearray """ x = bytearray() while True: z = f.read(1) if ord(z) == 0: return x else: x.append(ord(z))
[ "Read", "a", "null", "terminated", "string", "from", "a", "file", "-", "like", "object", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L97-L110
[ "def", "read_null_terminated_string", "(", "f", ")", ":", "x", "=", "bytearray", "(", ")", "while", "True", ":", "z", "=", "f", ".", "read", "(", "1", ")", "if", "ord", "(", "z", ")", "==", "0", ":", "return", "x", "else", ":", "x", ".", "appen...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
get_access_flags_string
Transform an access flag field to the corresponding string :param value: the value of the access flags :type value: int :rtype: string
androguard/core/bytecodes/dvm.py
def get_access_flags_string(value): """ Transform an access flag field to the corresponding string :param value: the value of the access flags :type value: int :rtype: string """ flags = [] for k, v in ACCESS_FLAGS.items(): if (k & value) == k: flags.append(v) ...
def get_access_flags_string(value): """ Transform an access flag field to the corresponding string :param value: the value of the access flags :type value: int :rtype: string """ flags = [] for k, v in ACCESS_FLAGS.items(): if (k & value) == k: flags.append(v) ...
[ "Transform", "an", "access", "flag", "field", "to", "the", "corresponding", "string" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L113-L127
[ "def", "get_access_flags_string", "(", "value", ")", ":", "flags", "=", "[", "]", "for", "k", ",", "v", "in", "ACCESS_FLAGS", ".", "items", "(", ")", ":", "if", "(", "k", "&", "value", ")", "==", "k", ":", "flags", ".", "append", "(", "v", ")", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
readsleb128
Read a signed LEB128 at the current position of the buffer. :param buff: a file like object :return: decoded sLEB128
androguard/core/bytecodes/dvm.py
def readsleb128(buff): """ Read a signed LEB128 at the current position of the buffer. :param buff: a file like object :return: decoded sLEB128 """ result = 0 shift = 0 for x in range(0, 5): cur = get_byte(buff) result |= (cur & 0x7f) << shift shift += 7 ...
def readsleb128(buff): """ Read a signed LEB128 at the current position of the buffer. :param buff: a file like object :return: decoded sLEB128 """ result = 0 shift = 0 for x in range(0, 5): cur = get_byte(buff) result |= (cur & 0x7f) << shift shift += 7 ...
[ "Read", "a", "signed", "LEB128", "at", "the", "current", "position", "of", "the", "buffer", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L241-L264
[ "def", "readsleb128", "(", "buff", ")", ":", "result", "=", "0", "shift", "=", "0", "for", "x", "in", "range", "(", "0", ",", "5", ")", ":", "cur", "=", "get_byte", "(", "buff", ")", "result", "|=", "(", "cur", "&", "0x7f", ")", "<<", "shift", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
determineNext
Determine the next offsets inside the bytecode of an :class:`EncodedMethod`. The offsets are calculated in number of bytes from the start of the method. Note, that offsets inside the bytecode are denoted in 16bit units but this method returns actual bytes! Offsets inside the opcode are counted from the beg...
androguard/core/bytecodes/dvm.py
def determineNext(i, cur_idx, m): """ Determine the next offsets inside the bytecode of an :class:`EncodedMethod`. The offsets are calculated in number of bytes from the start of the method. Note, that offsets inside the bytecode are denoted in 16bit units but this method returns actual bytes! Offs...
def determineNext(i, cur_idx, m): """ Determine the next offsets inside the bytecode of an :class:`EncodedMethod`. The offsets are calculated in number of bytes from the start of the method. Note, that offsets inside the bytecode are denoted in 16bit units but this method returns actual bytes! Offs...
[ "Determine", "the", "next", "offsets", "inside", "the", "bytecode", "of", "an", ":", "class", ":", "EncodedMethod", ".", "The", "offsets", "are", "calculated", "in", "number", "of", "bytes", "from", "the", "start", "of", "the", "method", ".", "Note", "that...
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L321-L385
[ "def", "determineNext", "(", "i", ",", "cur_idx", ",", "m", ")", ":", "op_value", "=", "i", ".", "get_op_value", "(", ")", "if", "(", "op_value", "==", "0x27", ")", "or", "(", "0x0e", "<=", "op_value", "<=", "0x11", ")", ":", "# throw + return*", "re...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
determineException
Returns try-catch handler inside the method. :param vm: a :class:`~DalvikVMFormat` :param m: a :class:`~EncodedMethod` :return:
androguard/core/bytecodes/dvm.py
def determineException(vm, m): """ Returns try-catch handler inside the method. :param vm: a :class:`~DalvikVMFormat` :param m: a :class:`~EncodedMethod` :return: """ # no exceptions ! if m.get_code().get_tries_size() <= 0: return [] h_off = {} handler_catch_list = m.g...
def determineException(vm, m): """ Returns try-catch handler inside the method. :param vm: a :class:`~DalvikVMFormat` :param m: a :class:`~EncodedMethod` :return: """ # no exceptions ! if m.get_code().get_tries_size() <= 0: return [] h_off = {} handler_catch_list = m.g...
[ "Returns", "try", "-", "catch", "handler", "inside", "the", "method", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L388-L443
[ "def", "determineException", "(", "vm", ",", "m", ")", ":", "# no exceptions !", "if", "m", ".", "get_code", "(", ")", ".", "get_tries_size", "(", ")", "<=", "0", ":", "return", "[", "]", "h_off", "=", "{", "}", "handler_catch_list", "=", "m", ".", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
get_kind
Return the value of the 'kind' argument :param cm: a ClassManager object :type cm: :class:`ClassManager` :param kind: the type of the 'kind' argument :type kind: int :param value: the value of the 'kind' argument :type value: int :rtype: string
androguard/core/bytecodes/dvm.py
def get_kind(cm, kind, value): """ Return the value of the 'kind' argument :param cm: a ClassManager object :type cm: :class:`ClassManager` :param kind: the type of the 'kind' argument :type kind: int :param value: the value of the 'kind' argument :type value: int :rtype: string ...
def get_kind(cm, kind, value): """ Return the value of the 'kind' argument :param cm: a ClassManager object :type cm: :class:`ClassManager` :param kind: the type of the 'kind' argument :type kind: int :param value: the value of the 'kind' argument :type value: int :rtype: string ...
[ "Return", "the", "value", "of", "the", "kind", "argument" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L3991-L4041
[ "def", "get_kind", "(", "cm", ",", "kind", ",", "value", ")", ":", "if", "kind", "==", "KIND_METH", ":", "method", "=", "cm", ".", "get_method_ref", "(", "value", ")", "class_name", "=", "method", ".", "get_class_name", "(", ")", "name", "=", "method",...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
StringDataItem.get_unicode
Returns an Unicode String This is the actual string. Beware that some strings might be not decodeable with usual UTF-16 decoder, as they use surrogates that are not supported by python.
androguard/core/bytecodes/dvm.py
def get_unicode(self): """ Returns an Unicode String This is the actual string. Beware that some strings might be not decodeable with usual UTF-16 decoder, as they use surrogates that are not supported by python. """ s = mutf8.decode(self.data) if len(s) !...
def get_unicode(self): """ Returns an Unicode String This is the actual string. Beware that some strings might be not decodeable with usual UTF-16 decoder, as they use surrogates that are not supported by python. """ s = mutf8.decode(self.data) if len(s) !...
[ "Returns", "an", "Unicode", "String", "This", "is", "the", "actual", "string", ".", "Beware", "that", "some", "strings", "might", "be", "not", "decodeable", "with", "usual", "UTF", "-", "16", "decoder", "as", "they", "use", "surrogates", "that", "are", "no...
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L1890-L1902
[ "def", "get_unicode", "(", "self", ")", ":", "s", "=", "mutf8", ".", "decode", "(", "self", ".", "data", ")", "if", "len", "(", "s", ")", "!=", "self", ".", "utf16_size", ":", "raise", "ValueError", "(", "\"UTF16 Length does not match!\"", ")", "# Return...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
StringDataItem.get
Returns a printable string. In this case, all lonely surrogates are escaped, thus are represented in the string as 6 characters: \\ud853 Valid surrogates are encoded as 32bit values, ie. \U00024f5c.
androguard/core/bytecodes/dvm.py
def get(self): """ Returns a printable string. In this case, all lonely surrogates are escaped, thus are represented in the string as 6 characters: \\ud853 Valid surrogates are encoded as 32bit values, ie. \U00024f5c. """ s = mutf8.decode(self.data) if len...
def get(self): """ Returns a printable string. In this case, all lonely surrogates are escaped, thus are represented in the string as 6 characters: \\ud853 Valid surrogates are encoded as 32bit values, ie. \U00024f5c. """ s = mutf8.decode(self.data) if len...
[ "Returns", "a", "printable", "string", ".", "In", "this", "case", "all", "lonely", "surrogates", "are", "escaped", "thus", "are", "represented", "in", "the", "string", "as", "6", "characters", ":", "\\\\", "ud853", "Valid", "surrogates", "are", "encoded", "a...
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L1904-L1915
[ "def", "get", "(", "self", ")", ":", "s", "=", "mutf8", ".", "decode", "(", "self", ".", "data", ")", "if", "len", "(", "s", ")", "!=", "self", ".", "utf16_size", ":", "raise", "ValueError", "(", "\"UTF16 Length does not match!\"", ")", "# log.debug(\"De...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
FieldIdItem.get_class_name
Return the class name of the field :rtype: string
androguard/core/bytecodes/dvm.py
def get_class_name(self): """ Return the class name of the field :rtype: string """ if self.class_idx_value is None: self.class_idx_value = self.CM.get_type(self.class_idx) return self.class_idx_value
def get_class_name(self): """ Return the class name of the field :rtype: string """ 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", "field" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L2294-L2303
[ "def", "get_class_name", "(", "self", ")", ":", "if", "self", ".", "class_idx_value", "is", "None", ":", "self", ".", "class_idx_value", "=", "self", ".", "CM", ".", "get_type", "(", "self", ".", "class_idx", ")", "return", "self", ".", "class_idx_value" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
MethodIdItem.get_proto
Return the prototype of the method :rtype: string
androguard/core/bytecodes/dvm.py
def get_proto(self): """ Return the prototype of the method :rtype: string """ if self.proto_idx_value is None: self.proto_idx_value = self.CM.get_proto(self.proto_idx) return self.proto_idx_value
def get_proto(self): """ Return the prototype of the method :rtype: string """ 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" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L2471-L2480
[ "def", "get_proto", "(", "self", ")", ":", "if", "self", ".", "proto_idx_value", "is", "None", ":", "self", ".", "proto_idx_value", "=", "self", ".", "CM", ".", "get_proto", "(", "self", ".", "proto_idx", ")", "return", "self", ".", "proto_idx_value" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
EncodedField.show
Display the information (with a pretty print) about the field
androguard/core/bytecodes/dvm.py
def show(self): """ 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_name(), self.get_descriptor(), ...
def show(self): """ 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_name(), self.get_descriptor(), ...
[ "Display", "the", "information", "(", "with", "a", "pretty", "print", ")", "about", "the", "field" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L2790-L2802
[ "def", "show", "(", "self", ")", ":", "bytecode", ".", "_PrintSubBanner", "(", "\"Field Information\"", ")", "bytecode", ".", "_PrintDefault", "(", "\"{}->{} {} [access_flags={}]\\n\"", ".", "format", "(", "self", ".", "get_class_name", "(", ")", ",", "self", "....
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
EncodedMethod.each_params_by_register
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 will prin...
androguard/core/bytecodes/dvm.py
def each_params_by_register(self, nb, proto): """ 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...
def each_params_by_register(self, nb, proto): """ 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...
[ "From", "the", "Dalvik", "Bytecode", "documentation", ":" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L2957-L2986
[ "def", "each_params_by_register", "(", "self", ",", "nb", ",", "proto", ")", ":", "bytecode", ".", "_PrintSubBanner", "(", "\"Params\"", ")", "ret", "=", "proto", ".", "split", "(", "')'", ")", "params", "=", "ret", "[", "0", "]", "[", "1", ":", "]",...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
EncodedMethod.get_short_string
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> are NOT rep...
androguard/core/bytecodes/dvm.py
def get_short_string(self): """ 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 ret...
def get_short_string(self): """ 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 ret...
[ "Return", "a", "shorter", "formatted", "String", "which", "encodes", "this", "method", ".", "The", "returned", "name", "has", "the", "form", ":", "<classname", ">", "<methodname", ">", "(", "[", "arguments", "...", "]", ")", "<returntype", ">" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L2998-L3033
[ "def", "get_short_string", "(", "self", ")", ":", "def", "_fmt_classname", "(", "cls", ")", ":", "arr", "=", "\"\"", "# Test for arrays", "while", "cls", ".", "startswith", "(", "\"[\"", ")", ":", "arr", "+=", "\"[\"", "cls", "=", "cls", "[", "1", ":",...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
EncodedMethod.show
Display the information (with a pretty print) about the method
androguard/core/bytecodes/dvm.py
def show(self): """ Display the information (with a pretty print) about the method """ self.show_info() self.show_notes() if self.code: self.each_params_by_register(self.code.get_registers_size(), self.get_descriptor()) self.code.show()
def show(self): """ Display the information (with a pretty print) about the method """ self.show_info() self.show_notes() if self.code: self.each_params_by_register(self.code.get_registers_size(), self.get_descriptor()) self.code.show()
[ "Display", "the", "information", "(", "with", "a", "pretty", "print", ")", "about", "the", "method" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L3044-L3052
[ "def", "show", "(", "self", ")", ":", "self", ".", "show_info", "(", ")", "self", ".", "show_notes", "(", ")", "if", "self", ".", "code", ":", "self", ".", "each_params_by_register", "(", "self", ".", "code", ".", "get_registers_size", "(", ")", ",", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
EncodedMethod.show_notes
Display the notes about the method
androguard/core/bytecodes/dvm.py
def show_notes(self): """ Display the notes about the method """ if self.notes: bytecode._PrintSubBanner("Notes") for i in self.notes: bytecode._PrintNote(i) bytecode._PrintSubBanner()
def show_notes(self): """ 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" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L3054-L3062
[ "def", "show_notes", "(", "self", ")", ":", "if", "self", ".", "notes", ":", "bytecode", ".", "_PrintSubBanner", "(", "\"Notes\"", ")", "for", "i", "in", "self", ".", "notes", ":", "bytecode", ".", "_PrintNote", "(", "i", ")", "bytecode", ".", "_PrintS...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
EncodedMethod.get_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) :type idx: int :param off: address of the instruction :type off: int :rtype: an :class:`Instruction` object
androguard/core/bytecodes/dvm.py
def get_instruction(self, idx, off=None): """ 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) :type idx: int :param off: address of the instruction :t...
def get_instruction(self, idx, off=None): """ 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) :type idx: int :param off: address of the instruction :t...
[ "Get", "a", "particular", "instruction", "by", "using", "(", "default", ")", "the", "index", "of", "the", "address", "if", "specified" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L3123-L3136
[ "def", "get_instruction", "(", "self", ",", "idx", ",", "off", "=", "None", ")", ":", "if", "self", ".", "code", "is", "not", "None", ":", "return", "self", ".", "code", ".", "get_bc", "(", ")", ".", "get_instruction", "(", "idx", ",", "off", ")", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
ClassDataItem.get_methods
Return direct and virtual methods :rtype: a list of :class:`EncodedMethod` objects
androguard/core/bytecodes/dvm.py
def get_methods(self): """ Return direct and virtual methods :rtype: a list of :class:`EncodedMethod` objects """ return [x for x in self.direct_methods] + [x for x in self.virtual_methods]
def get_methods(self): """ Return direct and virtual methods :rtype: a list of :class:`EncodedMethod` objects """ return [x for x in self.direct_methods] + [x for x in self.virtual_methods]
[ "Return", "direct", "and", "virtual", "methods" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L3345-L3353
[ "def", "get_methods", "(", "self", ")", ":", "return", "[", "x", "for", "x", "in", "self", ".", "direct_methods", "]", "+", "[", "x", "for", "x", "in", "self", ".", "virtual_methods", "]" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
ClassDataItem.get_fields
Return static and instance fields :rtype: a list of :class:`EncodedField` objects
androguard/core/bytecodes/dvm.py
def get_fields(self): """ Return static and instance fields :rtype: a list of :class:`EncodedField` objects """ return [x for x in self.static_fields] + [x for x in self.instance_fields]
def get_fields(self): """ Return static and instance fields :rtype: a list of :class:`EncodedField` objects """ return [x for x in self.static_fields] + [x for x in self.instance_fields]
[ "Return", "static", "and", "instance", "fields" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L3355-L3362
[ "def", "get_fields", "(", "self", ")", ":", "return", "[", "x", "for", "x", "in", "self", ".", "static_fields", "]", "+", "[", "x", "for", "x", "in", "self", ".", "instance_fields", "]" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
EncodedCatchHandler.get_raw
:rtype: bytearray
androguard/core/bytecodes/dvm.py
def get_raw(self): """ :rtype: bytearray """ buff = bytearray() buff += writesleb128(self.size) for i in self.handlers: buff += i.get_raw() if self.size <= 0: buff += writeuleb128(self.catch_all_addr) return buff
def get_raw(self): """ :rtype: bytearray """ buff = bytearray() buff += writesleb128(self.size) for i in self.handlers: buff += i.get_raw() if self.size <= 0: buff += writeuleb128(self.catch_all_addr) return buff
[ ":", "rtype", ":", "bytearray" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L3882-L3894
[ "def", "get_raw", "(", "self", ")", ":", "buff", "=", "bytearray", "(", ")", "buff", "+=", "writesleb128", "(", "self", ".", "size", ")", "for", "i", "in", "self", ".", "handlers", ":", "buff", "+=", "i", ".", "get_raw", "(", ")", "if", "self", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
EncodedCatchHandlerList.get_raw
:rtype: bytearray
androguard/core/bytecodes/dvm.py
def get_raw(self): """ :rtype: bytearray """ buff = bytearray() buff += self.get_obj() for i in self.list: buff += i.get_raw() return buff
def get_raw(self): """ :rtype: bytearray """ buff = bytearray() buff += self.get_obj() for i in self.list: buff += i.get_raw() return buff
[ ":", "rtype", ":", "bytearray" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L3956-L3964
[ "def", "get_raw", "(", "self", ")", ":", "buff", "=", "bytearray", "(", ")", "buff", "+=", "self", ".", "get_obj", "(", ")", "for", "i", "in", "self", ".", "list", ":", "buff", "+=", "i", ".", "get_raw", "(", ")", "return", "buff" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
Instruction.get_kind
Return the 'kind' argument of the instruction :rtype: int
androguard/core/bytecodes/dvm.py
def get_kind(self): """ Return the 'kind' argument of the instruction :rtype: int """ if self.OP > 0xff: if self.OP >= 0xf2ff: return DALVIK_OPCODES_OPTIMIZED[self.OP][1][1] return DALVIK_OPCODES_EXTENDED_WIDTH[self.OP][1][1] retur...
def get_kind(self): """ Return the 'kind' argument of the instruction :rtype: int """ if self.OP > 0xff: if self.OP >= 0xf2ff: return DALVIK_OPCODES_OPTIMIZED[self.OP][1][1] return DALVIK_OPCODES_EXTENDED_WIDTH[self.OP][1][1] retur...
[ "Return", "the", "kind", "argument", "of", "the", "instruction" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L4049-L4059
[ "def", "get_kind", "(", "self", ")", ":", "if", "self", ".", "OP", ">", "0xff", ":", "if", "self", ".", "OP", ">=", "0xf2ff", ":", "return", "DALVIK_OPCODES_OPTIMIZED", "[", "self", ".", "OP", "]", "[", "1", "]", "[", "1", "]", "return", "DALVIK_OP...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
Instruction.get_name
Return the name of the instruction :rtype: string
androguard/core/bytecodes/dvm.py
def get_name(self): """ Return the name of the instruction :rtype: string """ if self.OP > 0xff: if self.OP >= 0xf2ff: return DALVIK_OPCODES_OPTIMIZED[self.OP][1][0] return DALVIK_OPCODES_EXTENDED_WIDTH[self.OP][1][0] return DALVIK...
def get_name(self): """ Return the name of the instruction :rtype: string """ if self.OP > 0xff: if self.OP >= 0xf2ff: return DALVIK_OPCODES_OPTIMIZED[self.OP][1][0] return DALVIK_OPCODES_EXTENDED_WIDTH[self.OP][1][0] return DALVIK...
[ "Return", "the", "name", "of", "the", "instruction" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L4061-L4071
[ "def", "get_name", "(", "self", ")", ":", "if", "self", ".", "OP", ">", "0xff", ":", "if", "self", ".", "OP", ">=", "0xf2ff", ":", "return", "DALVIK_OPCODES_OPTIMIZED", "[", "self", ".", "OP", "]", "[", "1", "]", "[", "0", "]", "return", "DALVIK_OP...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
Instruction.show
Print the instruction
androguard/core/bytecodes/dvm.py
def show(self, idx): """ Print the instruction """ print(self.get_name() + " " + self.get_output(idx), end=' ')
def show(self, idx): """ Print the instruction """ print(self.get_name() + " " + self.get_output(idx), end=' ')
[ "Print", "the", "instruction" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L4089-L4093
[ "def", "show", "(", "self", ",", "idx", ")", ":", "print", "(", "self", ".", "get_name", "(", ")", "+", "\" \"", "+", "self", ".", "get_output", "(", "idx", ")", ",", "end", "=", "' '", ")" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
FillArrayData.show_buff
Return the display of the instruction :rtype: string
androguard/core/bytecodes/dvm.py
def show_buff(self, pos): """ Return the display of the instruction :rtype: string """ buff = self.get_name() + " " for i in range(0, len(self.data)): buff += "\\x%02x" % self.data[i] return buff
def show_buff(self, pos): """ Return the display of the instruction :rtype: 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" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L4286-L4296
[ "def", "show_buff", "(", "self", ",", "pos", ")", ":", "buff", "=", "self", ".", "get_name", "(", ")", "+", "\" \"", "for", "i", "in", "range", "(", "0", ",", "len", "(", "self", ".", "data", ")", ")", ":", "buff", "+=", "\"\\\\x%02x\"", "%", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
FillArrayData.get_hex
Returns a HEX String, separated by spaces every byte
androguard/core/bytecodes/dvm.py
def get_hex(self): """ 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))
def get_hex(self): """ 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" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L4316-L4322
[ "def", "get_hex", "(", "self", ")", ":", "s", "=", "binascii", ".", "hexlify", "(", "self", ".", "get_raw", "(", ")", ")", ".", "decode", "(", "\"ascii\"", ")", "return", "\" \"", ".", "join", "(", "s", "[", "i", ":", "i", "+", "2", "]", "for",...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
PackedSwitch.get_keys
Return the keys of the instruction :rtype: a list of long
androguard/core/bytecodes/dvm.py
def get_keys(self): """ Return the keys of the instruction :rtype: a list of long """ return [(self.first_key + i) for i in range(0, len(self.targets))]
def get_keys(self): """ Return the keys of the instruction :rtype: a list of long """ return [(self.first_key + i) for i in range(0, len(self.targets))]
[ "Return", "the", "keys", "of", "the", "instruction" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L4509-L4515
[ "def", "get_keys", "(", "self", ")", ":", "return", "[", "(", "self", ".", "first_key", "+", "i", ")", "for", "i", "in", "range", "(", "0", ",", "len", "(", "self", ".", "targets", ")", ")", "]" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
PackedSwitch.get_output
Return an additional output of the instruction :rtype: string
androguard/core/bytecodes/dvm.py
def get_output(self, idx=-1): """ Return an additional output of the instruction :rtype: string """ return " ".join("%x" % (self.first_key + i) for i in range(0, len(self.targets)))
def get_output(self, idx=-1): """ Return an additional output of the instruction :rtype: string """ return " ".join("%x" % (self.first_key + i) for i in range(0, len(self.targets)))
[ "Return", "an", "additional", "output", "of", "the", "instruction" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L4528-L4536
[ "def", "get_output", "(", "self", ",", "idx", "=", "-", "1", ")", ":", "return", "\" \"", ".", "join", "(", "\"%x\"", "%", "(", "self", ".", "first_key", "+", "i", ")", "for", "i", "in", "range", "(", "0", ",", "len", "(", "self", ".", "targets...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
PackedSwitch.show_buff
Return the display of the instruction :rtype: string
androguard/core/bytecodes/dvm.py
def show_buff(self, pos): """ Return the display of the instruction :rtype: string """ buff = self.get_name() + " " buff += "%x:" % self.first_key for i in self.targets: buff += " %x" % i return buff
def show_buff(self, pos): """ Return the display of the instruction :rtype: string """ buff = self.get_name() + " " buff += "%x:" % self.first_key for i in self.targets: buff += " %x" % i return buff
[ "Return", "the", "display", "of", "the", "instruction" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L4557-L4569
[ "def", "show_buff", "(", "self", ",", "pos", ")", ":", "buff", "=", "self", ".", "get_name", "(", ")", "+", "\" \"", "buff", "+=", "\"%x:\"", "%", "self", ".", "first_key", "for", "i", "in", "self", ".", "targets", ":", "buff", "+=", "\" %x\"", "%"...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DCode.set_insn
Set a new raw buffer to disassemble :param insn: the buffer :type insn: string
androguard/core/bytecodes/dvm.py
def set_insn(self, insn): """ Set a new raw buffer to disassemble :param insn: the buffer :type insn: string """ self.insn = insn self.size = len(self.insn)
def set_insn(self, insn): """ Set a new raw buffer to disassemble :param insn: the buffer :type insn: string """ self.insn = insn self.size = len(self.insn)
[ "Set", "a", "new", "raw", "buffer", "to", "disassemble" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L6502-L6510
[ "def", "set_insn", "(", "self", ",", "insn", ")", ":", "self", ".", "insn", "=", "insn", "self", ".", "size", "=", "len", "(", "self", ".", "insn", ")" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DCode.get_instructions
Get the instructions :rtype: a generator of each :class:`Instruction` (or a cached list of instructions if you have setup instructions)
androguard/core/bytecodes/dvm.py
def get_instructions(self): """ Get the instructions :rtype: a generator of each :class:`Instruction` (or a cached list of instructions if you have setup instructions) """ # it is possible to a cache for instructions (avoid a new disasm) if self.cached_instructions is No...
def get_instructions(self): """ Get the instructions :rtype: a generator of each :class:`Instruction` (or a cached list of instructions if you have setup instructions) """ # it is possible to a cache for instructions (avoid a new disasm) if self.cached_instructions is No...
[ "Get", "the", "instructions" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L6535-L6549
[ "def", "get_instructions", "(", "self", ")", ":", "# it is possible to a cache for instructions (avoid a new disasm)", "if", "self", ".", "cached_instructions", "is", "None", ":", "lsa", "=", "LinearSweepAlgorithm", "(", ")", "ins", "=", "lsa", ".", "get_instructions", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DCode.add_inote
Add a message to a specific instruction by using (default) the index of the address if specified :param msg: the message :type msg: string :param idx: index of the instruction (the position in the list of the instruction) :type idx: int :param off: address of the instruction ...
androguard/core/bytecodes/dvm.py
def add_inote(self, msg, idx, off=None): """ Add a message to a specific instruction by using (default) the index of the address if specified :param msg: the message :type msg: string :param idx: index of the instruction (the position in the list of the instruction) :typ...
def add_inote(self, msg, idx, off=None): """ Add a message to a specific instruction by using (default) the index of the address if specified :param msg: the message :type msg: string :param idx: index of the instruction (the position in the list of the instruction) :typ...
[ "Add", "a", "message", "to", "a", "specific", "instruction", "by", "using", "(", "default", ")", "the", "index", "of", "the", "address", "if", "specified" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L6551-L6568
[ "def", "add_inote", "(", "self", ",", "msg", ",", "idx", ",", "off", "=", "None", ")", ":", "if", "off", "is", "not", "None", ":", "idx", "=", "self", ".", "off_to_pos", "(", "off", ")", "if", "idx", "not", "in", "self", ".", "notes", ":", "sel...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DCode.get_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) :type idx: int :param off: address of the instruction :type off: int :rtype: an :class:`Instruction` object
androguard/core/bytecodes/dvm.py
def get_instruction(self, idx, off=None): """ 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) :type idx: int :param off: address of the instruction :t...
def get_instruction(self, idx, off=None): """ 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) :type idx: int :param off: address of the instruction :t...
[ "Get", "a", "particular", "instruction", "by", "using", "(", "default", ")", "the", "index", "of", "the", "address", "if", "specified" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L6570-L6585
[ "def", "get_instruction", "(", "self", ",", "idx", ",", "off", "=", "None", ")", ":", "if", "off", "is", "not", "None", ":", "idx", "=", "self", ".", "off_to_pos", "(", "off", ")", "if", "self", ".", "cached_instructions", "is", "None", ":", "self", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DCode.off_to_pos
Get the position of an instruction by using the address :param off: address of the instruction :type off: int :rtype: int
androguard/core/bytecodes/dvm.py
def off_to_pos(self, off): """ Get the position of an instruction by using the address :param off: address of the instruction :type off: int :rtype: int """ idx = 0 nb = 0 for i in self.get_instructions(): if idx == off: ...
def off_to_pos(self, off): """ Get the position of an instruction by using the address :param off: address of the instruction :type off: int :rtype: int """ idx = 0 nb = 0 for i in self.get_instructions(): if idx == off: ...
[ "Get", "the", "position", "of", "an", "instruction", "by", "using", "the", "address" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L6587-L6603
[ "def", "off_to_pos", "(", "self", ",", "off", ")", ":", "idx", "=", "0", "nb", "=", "0", "for", "i", "in", "self", ".", "get_instructions", "(", ")", ":", "if", "idx", "==", "off", ":", "return", "nb", "nb", "+=", "1", "idx", "+=", "i", ".", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DCode.get_ins_off
Get a particular instruction by using the address :param off: address of the instruction :type off: int :rtype: an :class:`Instruction` object
androguard/core/bytecodes/dvm.py
def get_ins_off(self, off): """ Get a particular instruction by using the address :param off: address of the instruction :type off: int :rtype: an :class:`Instruction` object """ idx = 0 for i in self.get_instructions(): if idx == off: ...
def get_ins_off(self, off): """ Get a particular instruction by using the address :param off: address of the instruction :type off: int :rtype: an :class:`Instruction` object """ idx = 0 for i in self.get_instructions(): if idx == off: ...
[ "Get", "a", "particular", "instruction", "by", "using", "the", "address" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L6605-L6619
[ "def", "get_ins_off", "(", "self", ",", "off", ")", ":", "idx", "=", "0", "for", "i", "in", "self", ".", "get_instructions", "(", ")", ":", "if", "idx", "==", "off", ":", "return", "i", "idx", "+=", "i", ".", "get_length", "(", ")", "return", "No...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DCode.show
Display (with a pretty print) this object
androguard/core/bytecodes/dvm.py
def show(self): """ 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.get_op_value(), i.get_name(), i.get_output(self.idx))) off += i.get_length()
def show(self): """ 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.get_op_value(), i.get_name(), i.get_output(self.idx))) off += i.get_length()
[ "Display", "(", "with", "a", "pretty", "print", ")", "this", "object" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L6621-L6628
[ "def", "show", "(", "self", ")", ":", "off", "=", "0", "for", "n", ",", "i", "in", "enumerate", "(", "self", ".", "get_instructions", "(", ")", ")", ":", "print", "(", "\"{:8d} (0x{:08x}) {:04x} {:30} {}\"", ".", "format", "(", "n", ",", "off", ",", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DCode.get_raw
Return the raw buffer of this object :rtype: bytearray
androguard/core/bytecodes/dvm.py
def get_raw(self): """ Return the raw buffer of this object :rtype: bytearray """ buff = bytearray() for i in self.get_instructions(): buff += i.get_raw() return buff
def get_raw(self): """ Return the raw buffer of this object :rtype: bytearray """ buff = bytearray() for i in self.get_instructions(): buff += i.get_raw() return buff
[ "Return", "the", "raw", "buffer", "of", "this", "object" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L6630-L6639
[ "def", "get_raw", "(", "self", ")", ":", "buff", "=", "bytearray", "(", ")", "for", "i", "in", "self", ".", "get_instructions", "(", ")", ":", "buff", "+=", "i", ".", "get_raw", "(", ")", "return", "buff" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikCode.get_raw
Get the reconstructed code as bytearray :rtype: bytearray
androguard/core/bytecodes/dvm.py
def get_raw(self): """ Get the reconstructed code as bytearray :rtype: bytearray """ code_raw = self.code.get_raw() self.insns_size = (len(code_raw) // 2) + (len(code_raw) % 2) buff = bytearray() buff += pack("<H", self.registers_size) + \ ...
def get_raw(self): """ Get the reconstructed code as bytearray :rtype: bytearray """ code_raw = self.code.get_raw() self.insns_size = (len(code_raw) // 2) + (len(code_raw) % 2) buff = bytearray() buff += pack("<H", self.registers_size) + \ ...
[ "Get", "the", "reconstructed", "code", "as", "bytearray" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L6851-L6877
[ "def", "get_raw", "(", "self", ")", ":", "code_raw", "=", "self", ".", "code", ".", "get_raw", "(", ")", "self", ".", "insns_size", "=", "(", "len", "(", "code_raw", ")", "//", "2", ")", "+", "(", "len", "(", "code_raw", ")", "%", "2", ")", "bu...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
ClassManager.get_string
Return a string from the string table at index `idx` :param int idx: index in the string section
androguard/core/bytecodes/dvm.py
def get_string(self, idx): """ Return a string from the string table at index `idx` :param int idx: index in the string section """ if idx in self.hook_strings: return self.hook_strings[idx] try: off = self.__manage_item[TypeMapItem.STRING_ID_ITE...
def get_string(self, idx): """ Return a string from the string table at index `idx` :param int idx: index in the string section """ if idx in self.hook_strings: return self.hook_strings[idx] try: off = self.__manage_item[TypeMapItem.STRING_ID_ITE...
[ "Return", "a", "string", "from", "the", "string", "table", "at", "index", "idx" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L7277-L7301
[ "def", "get_string", "(", "self", ",", "idx", ")", ":", "if", "idx", "in", "self", ".", "hook_strings", ":", "return", "self", ".", "hook_strings", "[", "idx", "]", "try", ":", "off", "=", "self", ".", "__manage_item", "[", "TypeMapItem", ".", "STRING_...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
ClassManager.get_raw_string
Return the (unprocessed) string from the string table at index `idx`. :param int idx: the index in the string section
androguard/core/bytecodes/dvm.py
def get_raw_string(self, idx): """ Return the (unprocessed) string from the string table at index `idx`. :param int idx: the index in the string section """ try: off = self.__manage_item[TypeMapItem.STRING_ID_ITEM][idx].get_string_data_off() except IndexError...
def get_raw_string(self, idx): """ Return the (unprocessed) string from the string table at index `idx`. :param int idx: the index in the string section """ try: off = self.__manage_item[TypeMapItem.STRING_ID_ITEM][idx].get_string_data_off() except IndexError...
[ "Return", "the", "(", "unprocessed", ")", "string", "from", "the", "string", "table", "at", "index", "idx", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L7303-L7319
[ "def", "get_raw_string", "(", "self", ",", "idx", ")", ":", "try", ":", "off", "=", "self", ".", "__manage_item", "[", "TypeMapItem", ".", "STRING_ID_ITEM", "]", "[", "idx", "]", ".", "get_string_data_off", "(", ")", "except", "IndexError", ":", "log", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
ClassManager.get_type
Return the resolved type name based on the index This returns the string associated with the type. :param int idx: :return: the type name :rtype: str
androguard/core/bytecodes/dvm.py
def get_type(self, idx): """ Return the resolved type name based on the index This returns the string associated with the type. :param int idx: :return: the type name :rtype: str """ _type = self.get_type_ref(idx) if _type == -1: retu...
def get_type(self, idx): """ Return the resolved type name based on the index This returns the string associated with the type. :param int idx: :return: the type name :rtype: str """ _type = self.get_type_ref(idx) if _type == -1: retu...
[ "Return", "the", "resolved", "type", "name", "based", "on", "the", "index" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L7328-L7341
[ "def", "get_type", "(", "self", ",", "idx", ")", ":", "_type", "=", "self", ".", "get_type_ref", "(", "idx", ")", "if", "_type", "==", "-", "1", ":", "return", "\"AG:ITI: invalid type\"", "return", "self", ".", "get_string", "(", "_type", ")" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
MapList.show
Print with a pretty display the MapList object
androguard/core/bytecodes/dvm.py
def show(self): """ 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 method analy...
def show(self): """ 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 method analy...
[ "Print", "with", "a", "pretty", "display", "the", "MapList", "object" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L7550-L7559
[ "def", "show", "(", "self", ")", ":", "bytecode", ".", "_Print", "(", "\"MAP_LIST SIZE\"", ",", "self", ".", "size", ")", "for", "i", "in", "self", ".", "map_item", ":", "if", "i", ".", "item", "!=", "self", ":", "# FIXME this does not work for CodeItems!"...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat._flush
Flush all caches Might be used after classes, methods or fields are added.
androguard/core/bytecodes/dvm.py
def _flush(self): """ 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 fields as we...
def _flush(self): """ 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 fields as we...
[ "Flush", "all", "caches", "Might", "be", "used", "after", "classes", "methods", "or", "fields", "are", "added", "." ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L7637-L7649
[ "def", "_flush", "(", "self", ")", ":", "self", ".", "classes_names", "=", "None", "self", ".", "__cache_methods", "=", "None", "self", ".", "__cached_methods_idx", "=", "None", "self", ".", "__cache_fields", "=", "None", "# cache methods and fields as well, other...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_classes_names
Return the names of classes :param update: True indicates to recompute the list. Maybe needed after using a MyClass.set_name(). :rtype: a list of string
androguard/core/bytecodes/dvm.py
def get_classes_names(self, update=False): """ Return the names of classes :param update: True indicates to recompute the list. Maybe needed after using a MyClass.set_name(). :rtype: a list of string """ if self.classes_names is None or update: ...
def get_classes_names(self, update=False): """ Return the names of classes :param update: True indicates to recompute the list. Maybe needed after using a MyClass.set_name(). :rtype: a list of string """ if self.classes_names is None or update: ...
[ "Return", "the", "names", "of", "classes" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L7905-L7915
[ "def", "get_classes_names", "(", "self", ",", "update", "=", "False", ")", ":", "if", "self", ".", "classes_names", "is", "None", "or", "update", ":", "self", ".", "classes_names", "=", "[", "i", ".", "get_name", "(", ")", "for", "i", "in", "self", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_class
Return a specific class :param name: the name of the class :rtype: a :class:`ClassDefItem` object
androguard/core/bytecodes/dvm.py
def get_class(self, name): """ Return a specific class :param name: the name of the class :rtype: a :class:`ClassDefItem` object """ for i in self.get_classes(): if i.get_name() == name: return i return None
def get_class(self, name): """ Return a specific class :param name: the name of the class :rtype: a :class:`ClassDefItem` object """ for i in self.get_classes(): if i.get_name() == name: return i return None
[ "Return", "a", "specific", "class" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L7929-L7940
[ "def", "get_class", "(", "self", ",", "name", ")", ":", "for", "i", "in", "self", ".", "get_classes", "(", ")", ":", "if", "i", ".", "get_name", "(", ")", "==", "name", ":", "return", "i", "return", "None" ]
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_method
Return a list all methods which corresponds to the regexp :param name: the name of the method (a python regexp) :rtype: a list with all :class:`EncodedMethod` objects
androguard/core/bytecodes/dvm.py
def get_method(self, name): """ Return a list all methods which corresponds to the regexp :param name: the name of the method (a python regexp) :rtype: a list with all :class:`EncodedMethod` objects """ # TODO could use a generator here prog = re.compile(name) ...
def get_method(self, name): """ Return a list all methods which corresponds to the regexp :param name: the name of the method (a python regexp) :rtype: a list with all :class:`EncodedMethod` objects """ # TODO could use a generator here prog = re.compile(name) ...
[ "Return", "a", "list", "all", "methods", "which", "corresponds", "to", "the", "regexp" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L7942-L7957
[ "def", "get_method", "(", "self", ",", "name", ")", ":", "# TODO could use a generator here", "prog", "=", "re", ".", "compile", "(", "name", ")", "l", "=", "[", "]", "for", "i", "in", "self", ".", "get_classes", "(", ")", ":", "for", "j", "in", "i",...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_field
Return a list all fields which corresponds to the regexp :param name: the name of the field (a python regexp) :rtype: a list with all :class:`EncodedField` objects
androguard/core/bytecodes/dvm.py
def get_field(self, name): """ Return a list all fields which corresponds to the regexp :param name: the name of the field (a python regexp) :rtype: a list with all :class:`EncodedField` objects """ # TODO could use a generator here prog = re.compile(name) ...
def get_field(self, name): """ Return a list all fields which corresponds to the regexp :param name: the name of the field (a python regexp) :rtype: a list with all :class:`EncodedField` objects """ # TODO could use a generator here prog = re.compile(name) ...
[ "Return", "a", "list", "all", "fields", "which", "corresponds", "to", "the", "regexp" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L7959-L7974
[ "def", "get_field", "(", "self", ",", "name", ")", ":", "# TODO could use a generator here", "prog", "=", "re", ".", "compile", "(", "name", ")", "l", "=", "[", "]", "for", "i", "in", "self", ".", "get_classes", "(", ")", ":", "for", "j", "in", "i", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_fields
Return all field objects :rtype: a list of :class:`EncodedField` objects
androguard/core/bytecodes/dvm.py
def get_fields(self): """ Return all field objects :rtype: a list of :class:`EncodedField` objects """ if self.__cache_all_fields is None: self.__cache_all_fields = [] for i in self.get_classes(): for j in i.get_fields(): ...
def get_fields(self): """ Return all field objects :rtype: a list of :class:`EncodedField` objects """ if self.__cache_all_fields is None: self.__cache_all_fields = [] for i in self.get_classes(): for j in i.get_fields(): ...
[ "Return", "all", "field", "objects" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L7987-L7998
[ "def", "get_fields", "(", "self", ")", ":", "if", "self", ".", "__cache_all_fields", "is", "None", ":", "self", ".", "__cache_all_fields", "=", "[", "]", "for", "i", "in", "self", ".", "get_classes", "(", ")", ":", "for", "j", "in", "i", ".", "get_fi...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_methods
Return all method objects :rtype: a list of :class:`EncodedMethod` objects
androguard/core/bytecodes/dvm.py
def get_methods(self): """ Return all method objects :rtype: a list of :class:`EncodedMethod` objects """ if self.__cache_all_methods is None: self.__cache_all_methods = [] for i in self.get_classes(): for j in i.get_methods(): ...
def get_methods(self): """ Return all method objects :rtype: a list of :class:`EncodedMethod` objects """ if self.__cache_all_methods is None: self.__cache_all_methods = [] for i in self.get_classes(): for j in i.get_methods(): ...
[ "Return", "all", "method", "objects" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L8000-L8011
[ "def", "get_methods", "(", "self", ")", ":", "if", "self", ".", "__cache_all_methods", "is", "None", ":", "self", ".", "__cache_all_methods", "=", "[", "]", "for", "i", "in", "self", ".", "get_classes", "(", ")", ":", "for", "j", "in", "i", ".", "get...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_method_by_idx
Return a specific method by using an index :param idx: the index of the method :type idx: int :rtype: None or an :class:`EncodedMethod` object
androguard/core/bytecodes/dvm.py
def get_method_by_idx(self, idx): """ Return a specific method by using an index :param idx: the index of the method :type idx: int :rtype: None or an :class:`EncodedMethod` object """ if self.__cached_methods_idx is None: self.__cached_methods_idx = ...
def get_method_by_idx(self, idx): """ Return a specific method by using an index :param idx: the index of the method :type idx: int :rtype: None or an :class:`EncodedMethod` object """ if self.__cached_methods_idx is None: self.__cached_methods_idx = ...
[ "Return", "a", "specific", "method", "by", "using", "an", "index", ":", "param", "idx", ":", "the", "index", "of", "the", "method", ":", "type", "idx", ":", "int" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L8021-L8038
[ "def", "get_method_by_idx", "(", "self", ",", "idx", ")", ":", "if", "self", ".", "__cached_methods_idx", "is", "None", ":", "self", ".", "__cached_methods_idx", "=", "{", "}", "for", "i", "in", "self", ".", "get_classes", "(", ")", ":", "for", "j", "i...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_method_descriptor
Return the specific method :param class_name: the class name of the method :type class_name: string :param method_name: the name of the method :type method_name: string :param descriptor: the descriptor of the method :type descriptor: string :rtype: None or a :c...
androguard/core/bytecodes/dvm.py
def get_method_descriptor(self, class_name, method_name, descriptor): """ Return the specific method :param class_name: the class name of the method :type class_name: string :param method_name: the name of the method :type method_name: string :param descriptor: t...
def get_method_descriptor(self, class_name, method_name, descriptor): """ Return the specific method :param class_name: the class name of the method :type class_name: string :param method_name: the name of the method :type method_name: string :param descriptor: t...
[ "Return", "the", "specific", "method" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L8040-L8062
[ "def", "get_method_descriptor", "(", "self", ",", "class_name", ",", "method_name", ",", "descriptor", ")", ":", "key", "=", "class_name", "+", "method_name", "+", "descriptor", "if", "self", ".", "__cache_methods", "is", "None", ":", "self", ".", "__cache_met...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_methods_descriptor
Return the specific methods of the class :param class_name: the class name of the method :type class_name: string :param method_name: the name of the method :type method_name: string :rtype: None or a :class:`EncodedMethod` object
androguard/core/bytecodes/dvm.py
def get_methods_descriptor(self, class_name, method_name): """ Return the specific methods of the class :param class_name: the class name of the method :type class_name: string :param method_name: the name of the method :type method_name: string :rtype: None or ...
def get_methods_descriptor(self, class_name, method_name): """ Return the specific methods of the class :param class_name: the class name of the method :type class_name: string :param method_name: the name of the method :type method_name: string :rtype: None or ...
[ "Return", "the", "specific", "methods", "of", "the", "class" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L8064-L8082
[ "def", "get_methods_descriptor", "(", "self", ",", "class_name", ",", "method_name", ")", ":", "l", "=", "[", "]", "for", "i", "in", "self", ".", "get_classes", "(", ")", ":", "if", "i", ".", "get_name", "(", ")", "==", "class_name", ":", "for", "j",...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_methods_class
Return all methods of a specific class :param class_name: the class name :type class_name: string :rtype: a list with :class:`EncodedMethod` objects
androguard/core/bytecodes/dvm.py
def get_methods_class(self, class_name): """ Return all methods of a specific class :param class_name: the class name :type class_name: string :rtype: a list with :class:`EncodedMethod` objects """ l = [] for i in self.get_classes(): for j in...
def get_methods_class(self, class_name): """ Return all methods of a specific class :param class_name: the class name :type class_name: string :rtype: a list with :class:`EncodedMethod` objects """ l = [] for i in self.get_classes(): for j in...
[ "Return", "all", "methods", "of", "a", "specific", "class" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L8084-L8099
[ "def", "get_methods_class", "(", "self", ",", "class_name", ")", ":", "l", "=", "[", "]", "for", "i", "in", "self", ".", "get_classes", "(", ")", ":", "for", "j", "in", "i", ".", "get_methods", "(", ")", ":", "if", "class_name", "==", "j", ".", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_fields_class
Return all fields of a specific class :param class_name: the class name :type class_name: string :rtype: a list with :class:`EncodedField` objects
androguard/core/bytecodes/dvm.py
def get_fields_class(self, class_name): """ Return all fields of a specific class :param class_name: the class name :type class_name: string :rtype: a list with :class:`EncodedField` objects """ l = [] for i in self.get_classes(): for j in i....
def get_fields_class(self, class_name): """ Return all fields of a specific class :param class_name: the class name :type class_name: string :rtype: a list with :class:`EncodedField` objects """ l = [] for i in self.get_classes(): for j in i....
[ "Return", "all", "fields", "of", "a", "specific", "class" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L8101-L8116
[ "def", "get_fields_class", "(", "self", ",", "class_name", ")", ":", "l", "=", "[", "]", "for", "i", "in", "self", ".", "get_classes", "(", ")", ":", "for", "j", "in", "i", ".", "get_fields", "(", ")", ":", "if", "class_name", "==", "j", ".", "ge...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_field_descriptor
Return the specific field :param class_name: the class name of the field :type class_name: string :param field_name: the name of the field :type field_name: string :param descriptor: the descriptor of the field :type descriptor: string :rtype: None or a :class:`...
androguard/core/bytecodes/dvm.py
def get_field_descriptor(self, class_name, field_name, descriptor): """ Return the specific field :param class_name: the class name of the field :type class_name: string :param field_name: the name of the field :type field_name: string :param descriptor: the desc...
def get_field_descriptor(self, class_name, field_name, descriptor): """ Return the specific field :param class_name: the class name of the field :type class_name: string :param field_name: the name of the field :type field_name: string :param descriptor: the desc...
[ "Return", "the", "specific", "field" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L8118-L8141
[ "def", "get_field_descriptor", "(", "self", ",", "class_name", ",", "field_name", ",", "descriptor", ")", ":", "key", "=", "class_name", "+", "field_name", "+", "descriptor", "if", "self", ".", "__cache_fields", "is", "None", ":", "self", ".", "__cache_fields"...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.get_regex_strings
Return all target strings matched the regex :param regular_expressions: the python regex :type regular_expressions: string :rtype: a list of strings matching the regex expression
androguard/core/bytecodes/dvm.py
def get_regex_strings(self, regular_expressions): """ Return all target strings matched the regex :param regular_expressions: the python regex :type regular_expressions: string :rtype: a list of strings matching the regex expression """ str_list = [] if ...
def get_regex_strings(self, regular_expressions): """ Return all target strings matched the regex :param regular_expressions: the python regex :type regular_expressions: string :rtype: a list of strings matching the regex expression """ str_list = [] if ...
[ "Return", "all", "target", "strings", "matched", "the", "regex" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L8175-L8190
[ "def", "get_regex_strings", "(", "self", ",", "regular_expressions", ")", ":", "str_list", "=", "[", "]", "if", "regular_expressions", ".", "count", "is", "None", ":", "return", "None", "for", "i", "in", "self", ".", "get_strings", "(", ")", ":", "if", "...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.create_python_export
Export classes/methods/fields' names in the python namespace
androguard/core/bytecodes/dvm.py
def create_python_export(self): """ Export classes/methods/fields' names in the python namespace """ setattr(self, "C", ExportObject()) for _class in self.get_classes(): self._create_python_export_class(_class)
def create_python_export(self): """ Export classes/methods/fields' names in the python namespace """ 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" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L8200-L8207
[ "def", "create_python_export", "(", "self", ")", ":", "setattr", "(", "self", ",", "\"C\"", ",", "ExportObject", "(", ")", ")", "for", "_class", "in", "self", ".", "get_classes", "(", ")", ":", "self", ".", "_create_python_export_class", "(", "_class", ")"...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
DalvikVMFormat.disassemble
Disassembles a given offset in the DEX file :param offset: offset to disassemble in the file (from the beginning of the file) :type offset: int :param size: :type size:
androguard/core/bytecodes/dvm.py
def disassemble(self, offset, size): """ Disassembles a given offset in the DEX file :param offset: offset to disassemble in the file (from the beginning of the file) :type offset: int :param size: :type size: """ for i in DCode( self.CM, ...
def disassemble(self, offset, size): """ Disassembles a given offset in the DEX file :param offset: offset to disassemble in the file (from the beginning of the file) :type offset: int :param size: :type size: """ for i in DCode( self.CM, ...
[ "Disassembles", "a", "given", "offset", "in", "the", "DEX", "file" ]
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/core/bytecodes/dvm.py#L8281-L8293
[ "def", "disassemble", "(", "self", ",", "offset", ",", "size", ")", ":", "for", "i", "in", "DCode", "(", "self", ".", "CM", ",", "offset", ",", "size", ",", "self", ".", "get_buff", "(", ")", "[", "offset", ":", "offset", "+", "size", "]", ")", ...
984c0d981be2950cf0451e484f7b0d4d53bc4911
train
classdot2class
Convert a path such as 'android.support.v4.app.ActivityCompat' into a string 'Landroid/support/v4/app/ActivityCompat' so we can change name of a class by d.CLASS_Landroid_support_v4_app_ActivityCompat.set_name(new_name)
androguard/gui/helpers.py
def classdot2class(path): """ Convert a path such as 'android.support.v4.app.ActivityCompat' into a string 'Landroid/support/v4/app/ActivityCompat' so we can change name of a class by d.CLASS_Landroid_support_v4_app_ActivityCompat.set_name(new_name) """ if path[0] == 'L' and path[-1] == ';':...
def classdot2class(path): """ Convert a path such as 'android.support.v4.app.ActivityCompat' into a string 'Landroid/support/v4/app/ActivityCompat' so we can change name of a class by d.CLASS_Landroid_support_v4_app_ActivityCompat.set_name(new_name) """ if path[0] == 'L' and path[-1] == ';':...
[ "Convert", "a", "path", "such", "as", "android", ".", "support", ".", "v4", ".", "app", ".", "ActivityCompat", "into", "a", "string", "Landroid", "/", "support", "/", "v4", "/", "app", "/", "ActivityCompat", "so", "we", "can", "change", "name", "of", "...
androguard/androguard
python
https://github.com/androguard/androguard/blob/984c0d981be2950cf0451e484f7b0d4d53bc4911/androguard/gui/helpers.py#L67-L77
[ "def", "classdot2class", "(", "path", ")", ":", "if", "path", "[", "0", "]", "==", "'L'", "and", "path", "[", "-", "1", "]", "==", "';'", ":", "log", ".", "debug", "(", "\"WARNING: %s already a Lclass; name\"", "%", "path", ")", "return", "path", "new_...
984c0d981be2950cf0451e484f7b0d4d53bc4911