{"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/utils\/flask_simpleldap\/__init__.py","language":"python","identifier":"LDAP.init_app","parameters":"(app)","argument_list":"","return_statement":"","docstring":"Initialize the `app` for use with this :class:`~LDAP`. This is\n called automatically if `app` is passed to :meth:`~LDAP.__init__`.\n\n :param flask.Flask app: the application to configure for use with\n this :class:`~LDAP`","docstring_summary":"Initialize the `app` for use with this :class:`~LDAP`. This is\n called automatically if `app` is passed to :meth:`~LDAP.__init__`.","docstring_tokens":["Initialize","the","app","for","use","with","this",":","class",":","~LDAP",".","This","is","called","automatically","if","app","is","passed","to",":","meth",":","~LDAP",".","__init__","."],"function":"def init_app(app):\n \"\"\"Initialize the `app` for use with this :class:`~LDAP`. This is\n called automatically if `app` is passed to :meth:`~LDAP.__init__`.\n\n :param flask.Flask app: the application to configure for use with\n this :class:`~LDAP`\n \"\"\"\n app.config.setdefault('LDAP_HOST', 'localhost')\n app.config.setdefault('LDAP_PORT', 389)\n app.config.setdefault('LDAP_SCHEMA', 'ldap')\n app.config.setdefault('LDAP_USERNAME', None)\n app.config.setdefault('LDAP_PASSWORD', None)\n app.config.setdefault('LDAP_TIMEOUT', 10)\n app.config.setdefault('LDAP_USE_SSL', False)\n app.config.setdefault('LDAP_USE_TLS', False)\n app.config.setdefault('LDAP_REQUIRE_CERT', False)\n app.config.setdefault('LDAP_CERT_PATH', '\/path\/to\/cert')\n app.config.setdefault('LDAP_BASE_DN', None)\n app.config.setdefault('LDAP_OBJECTS_DN', 'distinguishedName')\n app.config.setdefault('LDAP_USER_FIELDS', [])\n app.config.setdefault('LDAP_USER_OBJECT_FILTER',\n '(&(objectclass=Person)(userPrincipalName=%s))')\n app.config.setdefault('LDAP_USER_GROUPS_FIELD', 'memberOf')\n app.config.setdefault('LDAP_GROUP_FIELDS', [])\n app.config.setdefault('LDAP_GROUP_OBJECT_FILTER',\n '(&(objectclass=Group)(userPrincipalName=%s))')\n app.config.setdefault('LDAP_GROUP_MEMBERS_FIELD', 'member')\n app.config.setdefault('LDAP_LOGIN_VIEW', 'login')\n app.config.setdefault('LDAP_REALM_NAME', 'LDAP authentication')\n app.config.setdefault('LDAP_OPENLDAP', False)\n app.config.setdefault('LDAP_GROUP_MEMBER_FILTER', '*')\n app.config.setdefault('LDAP_GROUP_MEMBER_FILTER_FIELD', '*')\n app.config.setdefault('LDAP_CUSTOM_OPTIONS', None)\n\n if app.config['LDAP_USE_SSL'] or app.config['LDAP_USE_TLS']:\n ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT,\n ldap.OPT_X_TLS_NEVER)\n\n if app.config['LDAP_REQUIRE_CERT']:\n ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT,\n ldap.OPT_X_TLS_DEMAND)\n ldap.set_option(ldap.OPT_X_TLS_CACERTFILE,\n current_app.config['LDAP_CERT_PATH'])\n\n for option in ['USERNAME', 'PASSWORD', 'BASE_DN']:\n if app.config['LDAP_{0}'.format(option)] is None:\n raise LDAPException('LDAP_{0} cannot be None!'.format(option))","function_tokens":["def","init_app","(","app",")",":","app",".","config",".","setdefault","(","'LDAP_HOST'",",","'localhost'",")","app",".","config",".","setdefault","(","'LDAP_PORT'",",","389",")","app",".","config",".","setdefault","(","'LDAP_SCHEMA'",",","'ldap'",")","app",".","config",".","setdefault","(","'LDAP_USERNAME'",",","None",")","app",".","config",".","setdefault","(","'LDAP_PASSWORD'",",","None",")","app",".","config",".","setdefault","(","'LDAP_TIMEOUT'",",","10",")","app",".","config",".","setdefault","(","'LDAP_USE_SSL'",",","False",")","app",".","config",".","setdefault","(","'LDAP_USE_TLS'",",","False",")","app",".","config",".","setdefault","(","'LDAP_REQUIRE_CERT'",",","False",")","app",".","config",".","setdefault","(","'LDAP_CERT_PATH'",",","'\/path\/to\/cert'",")","app",".","config",".","setdefault","(","'LDAP_BASE_DN'",",","None",")","app",".","config",".","setdefault","(","'LDAP_OBJECTS_DN'",",","'distinguishedName'",")","app",".","config",".","setdefault","(","'LDAP_USER_FIELDS'",",","[","]",")","app",".","config",".","setdefault","(","'LDAP_USER_OBJECT_FILTER'",",","'(&(objectclass=Person)(userPrincipalName=%s))'",")","app",".","config",".","setdefault","(","'LDAP_USER_GROUPS_FIELD'",",","'memberOf'",")","app",".","config",".","setdefault","(","'LDAP_GROUP_FIELDS'",",","[","]",")","app",".","config",".","setdefault","(","'LDAP_GROUP_OBJECT_FILTER'",",","'(&(objectclass=Group)(userPrincipalName=%s))'",")","app",".","config",".","setdefault","(","'LDAP_GROUP_MEMBERS_FIELD'",",","'member'",")","app",".","config",".","setdefault","(","'LDAP_LOGIN_VIEW'",",","'login'",")","app",".","config",".","setdefault","(","'LDAP_REALM_NAME'",",","'LDAP authentication'",")","app",".","config",".","setdefault","(","'LDAP_OPENLDAP'",",","False",")","app",".","config",".","setdefault","(","'LDAP_GROUP_MEMBER_FILTER'",",","'*'",")","app",".","config",".","setdefault","(","'LDAP_GROUP_MEMBER_FILTER_FIELD'",",","'*'",")","app",".","config",".","setdefault","(","'LDAP_CUSTOM_OPTIONS'",",","None",")","if","app",".","config","[","'LDAP_USE_SSL'","]","or","app",".","config","[","'LDAP_USE_TLS'","]",":","ldap",".","set_option","(","ldap",".","OPT_X_TLS_REQUIRE_CERT",",","ldap",".","OPT_X_TLS_NEVER",")","if","app",".","config","[","'LDAP_REQUIRE_CERT'","]",":","ldap",".","set_option","(","ldap",".","OPT_X_TLS_REQUIRE_CERT",",","ldap",".","OPT_X_TLS_DEMAND",")","ldap",".","set_option","(","ldap",".","OPT_X_TLS_CACERTFILE",",","current_app",".","config","[","'LDAP_CERT_PATH'","]",")","for","option","in","[","'USERNAME'",",","'PASSWORD'",",","'BASE_DN'","]",":","if","app",".","config","[","'LDAP_{0}'",".","format","(","option",")","]","is","None",":","raise","LDAPException","(","'LDAP_{0} cannot be None!'",".","format","(","option",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/utils\/flask_simpleldap\/__init__.py#L28-L74"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/utils\/flask_simpleldap\/__init__.py","language":"python","identifier":"LDAP.initialize","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Initialize a connection to the LDAP server.\n\n :return: LDAP connection object.","docstring_summary":"Initialize a connection to the LDAP server.","docstring_tokens":["Initialize","a","connection","to","the","LDAP","server","."],"function":"def initialize(self):\n \"\"\"Initialize a connection to the LDAP server.\n\n :return: LDAP connection object.\n \"\"\"\n\n try:\n conn = ldap.initialize('{0}:\/\/{1}:{2}'.format(\n current_app.config['LDAP_SCHEMA'],\n current_app.config['LDAP_HOST'],\n current_app.config['LDAP_PORT']))\n conn.set_option(ldap.OPT_NETWORK_TIMEOUT,\n current_app.config['LDAP_TIMEOUT'])\n conn = self._set_custom_options(conn)\n conn.protocol_version = ldap.VERSION3\n if current_app.config['LDAP_USE_TLS']:\n conn.start_tls_s()\n return conn\n except ldap.LDAPError as e:\n raise LDAPException(self.error(e.args))","function_tokens":["def","initialize","(","self",")",":","try",":","conn","=","ldap",".","initialize","(","'{0}:\/\/{1}:{2}'",".","format","(","current_app",".","config","[","'LDAP_SCHEMA'","]",",","current_app",".","config","[","'LDAP_HOST'","]",",","current_app",".","config","[","'LDAP_PORT'","]",")",")","conn",".","set_option","(","ldap",".","OPT_NETWORK_TIMEOUT",",","current_app",".","config","[","'LDAP_TIMEOUT'","]",")","conn","=","self",".","_set_custom_options","(","conn",")","conn",".","protocol_version","=","ldap",".","VERSION3","if","current_app",".","config","[","'LDAP_USE_TLS'","]",":","conn",".","start_tls_s","(",")","return","conn","except","ldap",".","LDAPError","as","e",":","raise","LDAPException","(","self",".","error","(","e",".","args",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/utils\/flask_simpleldap\/__init__.py#L85-L104"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/utils\/flask_simpleldap\/__init__.py","language":"python","identifier":"LDAP.bind","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Attempts to bind to the LDAP server using the credentials of the\n service account.\n\n :return: Bound LDAP connection object if successful or ``None`` if\n unsuccessful.","docstring_summary":"Attempts to bind to the LDAP server using the credentials of the\n service account.","docstring_tokens":["Attempts","to","bind","to","the","LDAP","server","using","the","credentials","of","the","service","account","."],"function":"def bind(self):\n \"\"\"Attempts to bind to the LDAP server using the credentials of the\n service account.\n\n :return: Bound LDAP connection object if successful or ``None`` if\n unsuccessful.\n \"\"\"\n\n conn = self.initialize\n try:\n conn.simple_bind_s(\n current_app.config['LDAP_USERNAME'],\n current_app.config['LDAP_PASSWORD'])\n return conn\n except ldap.LDAPError as e:\n raise LDAPException(self.error(e.args))","function_tokens":["def","bind","(","self",")",":","conn","=","self",".","initialize","try",":","conn",".","simple_bind_s","(","current_app",".","config","[","'LDAP_USERNAME'","]",",","current_app",".","config","[","'LDAP_PASSWORD'","]",")","return","conn","except","ldap",".","LDAPError","as","e",":","raise","LDAPException","(","self",".","error","(","e",".","args",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/utils\/flask_simpleldap\/__init__.py#L107-L122"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/utils\/flask_simpleldap\/__init__.py","language":"python","identifier":"LDAP.bind_user","parameters":"(self, username, password)","argument_list":"","return_statement":"","docstring":"Attempts to bind a user to the LDAP server using the credentials\n supplied.\n\n .. note::\n\n Many LDAP servers will grant anonymous access if ``password`` is\n the empty string, causing this method to return :obj:`True` no\n matter what username is given. If you want to use this method to\n validate a username and password, rather than actually connecting\n to the LDAP server as a particular user, make sure ``password`` is\n not empty.\n\n :param str username: The username to attempt to bind with.\n :param str password: The password of the username we're attempting to\n bind with.\n :return: Returns ``True`` if successful or ``None`` if the credentials\n are invalid.","docstring_summary":"Attempts to bind a user to the LDAP server using the credentials\n supplied.","docstring_tokens":["Attempts","to","bind","a","user","to","the","LDAP","server","using","the","credentials","supplied","."],"function":"def bind_user(self, username, password):\n \"\"\"Attempts to bind a user to the LDAP server using the credentials\n supplied.\n\n .. note::\n\n Many LDAP servers will grant anonymous access if ``password`` is\n the empty string, causing this method to return :obj:`True` no\n matter what username is given. If you want to use this method to\n validate a username and password, rather than actually connecting\n to the LDAP server as a particular user, make sure ``password`` is\n not empty.\n\n :param str username: The username to attempt to bind with.\n :param str password: The password of the username we're attempting to\n bind with.\n :return: Returns ``True`` if successful or ``None`` if the credentials\n are invalid.\n \"\"\"\n user_dn = self.get_object_details(user=username, dn_only=True)\n if user_dn is None:\n return\n try:\n conn = self.initialize\n _user_dn = user_dn.decode('utf-8') \\\n if isinstance(user_dn, bytes) else user_dn\n conn.simple_bind_s(_user_dn, password)\n return True\n except ldap.LDAPError:\n return","function_tokens":["def","bind_user","(","self",",","username",",","password",")",":","user_dn","=","self",".","get_object_details","(","user","=","username",",","dn_only","=","True",")","if","user_dn","is","None",":","return","try",":","conn","=","self",".","initialize","_user_dn","=","user_dn",".","decode","(","'utf-8'",")","if","isinstance","(","user_dn",",","bytes",")","else","user_dn","conn",".","simple_bind_s","(","_user_dn",",","password",")","return","True","except","ldap",".","LDAPError",":","return"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/utils\/flask_simpleldap\/__init__.py#L124-L153"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/utils\/flask_simpleldap\/__init__.py","language":"python","identifier":"LDAP.get_object_details","parameters":"(self, user=None, group=None, query_filter=None,\n dn_only=False)","argument_list":"","return_statement":"","docstring":"Returns a ``dict`` with the object's (user or group) details.\n\n :param str user: Username of the user object you want details for.\n :param str group: Name of the group object you want details for.\n :param str query_filter: If included, will be used to query object.\n :param bool dn_only: If we should only retrieve the object's\n distinguished name or not. Default: ``False``.","docstring_summary":"Returns a ``dict`` with the object's (user or group) details.","docstring_tokens":["Returns","a","dict","with","the","object","s","(","user","or","group",")","details","."],"function":"def get_object_details(self, user=None, group=None, query_filter=None,\n dn_only=False):\n \"\"\"Returns a ``dict`` with the object's (user or group) details.\n\n :param str user: Username of the user object you want details for.\n :param str group: Name of the group object you want details for.\n :param str query_filter: If included, will be used to query object.\n :param bool dn_only: If we should only retrieve the object's\n distinguished name or not. Default: ``False``.\n \"\"\"\n query = None\n fields = None\n if user is not None:\n if not dn_only:\n fields = current_app.config['LDAP_USER_FIELDS']\n query_filter = query_filter or \\\n current_app.config['LDAP_USER_OBJECT_FILTER']\n query = ldap_filter.filter_format(query_filter, (user,))\n elif group is not None:\n if not dn_only:\n fields = current_app.config['LDAP_GROUP_FIELDS']\n query_filter = query_filter or \\\n current_app.config['LDAP_GROUP_OBJECT_FILTER']\n query = ldap_filter.filter_format(query_filter, (group,))\n conn = self.bind\n try:\n records = conn.search_s(current_app.config['LDAP_BASE_DN'],\n ldap.SCOPE_SUBTREE, query, fields)\n conn.unbind_s()\n result = {}\n if records:\n if dn_only:\n if current_app.config['LDAP_OPENLDAP']:\n if records:\n return records[0][0]\n else:\n if current_app.config['LDAP_OBJECTS_DN'] \\\n in records[0][1]:\n dn = records[0][1][\n current_app.config['LDAP_OBJECTS_DN']]\n return dn[0]\n for k, v in list(records[0][1].items()):\n result[k] = v\n return result\n except ldap.LDAPError as e:\n raise LDAPException(self.error(e.args))","function_tokens":["def","get_object_details","(","self",",","user","=","None",",","group","=","None",",","query_filter","=","None",",","dn_only","=","False",")",":","query","=","None","fields","=","None","if","user","is","not","None",":","if","not","dn_only",":","fields","=","current_app",".","config","[","'LDAP_USER_FIELDS'","]","query_filter","=","query_filter","or","current_app",".","config","[","'LDAP_USER_OBJECT_FILTER'","]","query","=","ldap_filter",".","filter_format","(","query_filter",",","(","user",",",")",")","elif","group","is","not","None",":","if","not","dn_only",":","fields","=","current_app",".","config","[","'LDAP_GROUP_FIELDS'","]","query_filter","=","query_filter","or","current_app",".","config","[","'LDAP_GROUP_OBJECT_FILTER'","]","query","=","ldap_filter",".","filter_format","(","query_filter",",","(","group",",",")",")","conn","=","self",".","bind","try",":","records","=","conn",".","search_s","(","current_app",".","config","[","'LDAP_BASE_DN'","]",",","ldap",".","SCOPE_SUBTREE",",","query",",","fields",")","conn",".","unbind_s","(",")","result","=","{","}","if","records",":","if","dn_only",":","if","current_app",".","config","[","'LDAP_OPENLDAP'","]",":","if","records",":","return","records","[","0","]","[","0","]","else",":","if","current_app",".","config","[","'LDAP_OBJECTS_DN'","]","in","records","[","0","]","[","1","]",":","dn","=","records","[","0","]","[","1","]","[","current_app",".","config","[","'LDAP_OBJECTS_DN'","]","]","return","dn","[","0","]","for","k",",","v","in","list","(","records","[","0","]","[","1","]",".","items","(",")",")",":","result","[","k","]","=","v","return","result","except","ldap",".","LDAPError","as","e",":","raise","LDAPException","(","self",".","error","(","e",".","args",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/utils\/flask_simpleldap\/__init__.py#L155-L200"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/utils\/flask_simpleldap\/__init__.py","language":"python","identifier":"LDAP.get_user_groups","parameters":"(self, user)","argument_list":"","return_statement":"","docstring":"Returns a ``list`` with the user's groups or ``None`` if\n unsuccessful.\n\n :param str user: User we want groups for.","docstring_summary":"Returns a ``list`` with the user's groups or ``None`` if\n unsuccessful.","docstring_tokens":["Returns","a","list","with","the","user","s","groups","or","None","if","unsuccessful","."],"function":"def get_user_groups(self, user):\n \"\"\"Returns a ``list`` with the user's groups or ``None`` if\n unsuccessful.\n\n :param str user: User we want groups for.\n \"\"\"\n\n conn = self.bind\n try:\n if current_app.config['LDAP_OPENLDAP']:\n fields = \\\n [str(current_app.config['LDAP_GROUP_MEMBER_FILTER_FIELD'])]\n records = conn.search_s(\n current_app.config['LDAP_BASE_DN'], ldap.SCOPE_SUBTREE,\n ldap_filter.filter_format(\n current_app.config['LDAP_GROUP_MEMBER_FILTER'],\n (self.get_object_details(user, dn_only=True),)),\n fields)\n else:\n records = conn.search_s(\n current_app.config['LDAP_BASE_DN'], ldap.SCOPE_SUBTREE,\n ldap_filter.filter_format(\n current_app.config['LDAP_USER_OBJECT_FILTER'],\n (user,)),\n [current_app.config['LDAP_USER_GROUPS_FIELD']])\n\n conn.unbind_s()\n if records:\n if current_app.config['LDAP_OPENLDAP']:\n group_member_filter = \\\n current_app.config['LDAP_GROUP_MEMBER_FILTER_FIELD']\n groups = [record[1][group_member_filter][0].decode(\n 'utf-8') for record in records]\n return groups\n else:\n if current_app.config['LDAP_USER_GROUPS_FIELD'] in \\\n records[0][1]:\n groups = records[0][1][\n current_app.config['LDAP_USER_GROUPS_FIELD']]\n result = [re.findall(b'(?:cn=|CN=)(.*?),', group)[0]\n for group in groups]\n result = [r.decode('utf-8') for r in result]\n return result\n except ldap.LDAPError as e:\n raise LDAPException(self.error(e.args))","function_tokens":["def","get_user_groups","(","self",",","user",")",":","conn","=","self",".","bind","try",":","if","current_app",".","config","[","'LDAP_OPENLDAP'","]",":","fields","=","[","str","(","current_app",".","config","[","'LDAP_GROUP_MEMBER_FILTER_FIELD'","]",")","]","records","=","conn",".","search_s","(","current_app",".","config","[","'LDAP_BASE_DN'","]",",","ldap",".","SCOPE_SUBTREE",",","ldap_filter",".","filter_format","(","current_app",".","config","[","'LDAP_GROUP_MEMBER_FILTER'","]",",","(","self",".","get_object_details","(","user",",","dn_only","=","True",")",",",")",")",",","fields",")","else",":","records","=","conn",".","search_s","(","current_app",".","config","[","'LDAP_BASE_DN'","]",",","ldap",".","SCOPE_SUBTREE",",","ldap_filter",".","filter_format","(","current_app",".","config","[","'LDAP_USER_OBJECT_FILTER'","]",",","(","user",",",")",")",",","[","current_app",".","config","[","'LDAP_USER_GROUPS_FIELD'","]","]",")","conn",".","unbind_s","(",")","if","records",":","if","current_app",".","config","[","'LDAP_OPENLDAP'","]",":","group_member_filter","=","current_app",".","config","[","'LDAP_GROUP_MEMBER_FILTER_FIELD'","]","groups","=","[","record","[","1","]","[","group_member_filter","]","[","0","]",".","decode","(","'utf-8'",")","for","record","in","records","]","return","groups","else",":","if","current_app",".","config","[","'LDAP_USER_GROUPS_FIELD'","]","in","records","[","0","]","[","1","]",":","groups","=","records","[","0","]","[","1","]","[","current_app",".","config","[","'LDAP_USER_GROUPS_FIELD'","]","]","result","=","[","re",".","findall","(","b'(?:cn=|CN=)(.*?),'",",","group",")","[","0","]","for","group","in","groups","]","result","=","[","r",".","decode","(","'utf-8'",")","for","r","in","result","]","return","result","except","ldap",".","LDAPError","as","e",":","raise","LDAPException","(","self",".","error","(","e",".","args",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/utils\/flask_simpleldap\/__init__.py#L202-L246"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/utils\/flask_simpleldap\/__init__.py","language":"python","identifier":"LDAP.get_group_members","parameters":"(self, group)","argument_list":"","return_statement":"","docstring":"Returns a ``list`` with the group's members or ``None`` if\n unsuccessful.\n\n :param str group: Group we want users for.","docstring_summary":"Returns a ``list`` with the group's members or ``None`` if\n unsuccessful.","docstring_tokens":["Returns","a","list","with","the","group","s","members","or","None","if","unsuccessful","."],"function":"def get_group_members(self, group):\n \"\"\"Returns a ``list`` with the group's members or ``None`` if\n unsuccessful.\n\n :param str group: Group we want users for.\n \"\"\"\n\n conn = self.bind\n try:\n records = conn.search_s(\n current_app.config['LDAP_BASE_DN'], ldap.SCOPE_SUBTREE,\n ldap_filter.filter_format(\n current_app.config['LDAP_GROUP_OBJECT_FILTER'], (group,)),\n [current_app.config['LDAP_GROUP_MEMBERS_FIELD']])\n conn.unbind_s()\n if records:\n if current_app.config['LDAP_GROUP_MEMBERS_FIELD'] in \\\n records[0][1]:\n members = records[0][1][\n current_app.config['LDAP_GROUP_MEMBERS_FIELD']]\n members = [m.decode('utf-8') for m in members]\n return members\n except ldap.LDAPError as e:\n raise LDAPException(self.error(e.args))","function_tokens":["def","get_group_members","(","self",",","group",")",":","conn","=","self",".","bind","try",":","records","=","conn",".","search_s","(","current_app",".","config","[","'LDAP_BASE_DN'","]",",","ldap",".","SCOPE_SUBTREE",",","ldap_filter",".","filter_format","(","current_app",".","config","[","'LDAP_GROUP_OBJECT_FILTER'","]",",","(","group",",",")",")",",","[","current_app",".","config","[","'LDAP_GROUP_MEMBERS_FIELD'","]","]",")","conn",".","unbind_s","(",")","if","records",":","if","current_app",".","config","[","'LDAP_GROUP_MEMBERS_FIELD'","]","in","records","[","0","]","[","1","]",":","members","=","records","[","0","]","[","1","]","[","current_app",".","config","[","'LDAP_GROUP_MEMBERS_FIELD'","]","]","members","=","[","m",".","decode","(","'utf-8'",")","for","m","in","members","]","return","members","except","ldap",".","LDAPError","as","e",":","raise","LDAPException","(","self",".","error","(","e",".","args",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/utils\/flask_simpleldap\/__init__.py#L248-L271"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/utils\/flask_simpleldap\/__init__.py","language":"python","identifier":"LDAP.login_required","parameters":"(func)","argument_list":"","return_statement":"return wrapped","docstring":"When applied to a view function, any unauthenticated requests will\n be redirected to the view named in LDAP_LOGIN_VIEW. Authenticated\n requests do NOT require membership from a specific group.\n\n The login view is responsible for asking for credentials, checking\n them, and setting ``flask.g.user`` to the name of the authenticated\n user if the credentials are acceptable.\n\n :param func: The view function to decorate.","docstring_summary":"When applied to a view function, any unauthenticated requests will\n be redirected to the view named in LDAP_LOGIN_VIEW. Authenticated\n requests do NOT require membership from a specific group.","docstring_tokens":["When","applied","to","a","view","function","any","unauthenticated","requests","will","be","redirected","to","the","view","named","in","LDAP_LOGIN_VIEW",".","Authenticated","requests","do","NOT","require","membership","from","a","specific","group","."],"function":"def login_required(func):\n \"\"\"When applied to a view function, any unauthenticated requests will\n be redirected to the view named in LDAP_LOGIN_VIEW. Authenticated\n requests do NOT require membership from a specific group.\n\n The login view is responsible for asking for credentials, checking\n them, and setting ``flask.g.user`` to the name of the authenticated\n user if the credentials are acceptable.\n\n :param func: The view function to decorate.\n \"\"\"\n\n @wraps(func)\n def wrapped(*args, **kwargs):\n if g.user is None:\n next_path=request.full_path or request.path\n if next_path == '\/?':\n return redirect(\n url_for(current_app.config['LDAP_LOGIN_VIEW']))\n return redirect(url_for(current_app.config['LDAP_LOGIN_VIEW'],\n next=next_path))\n return func(*args, **kwargs)\n\n return wrapped","function_tokens":["def","login_required","(","func",")",":","@","wraps","(","func",")","def","wrapped","(","*","args",",","*","*","kwargs",")",":","if","g",".","user","is","None",":","next_path","=","request",".","full_path","or","request",".","path","if","next_path","==","'\/?'",":","return","redirect","(","url_for","(","current_app",".","config","[","'LDAP_LOGIN_VIEW'","]",")",")","return","redirect","(","url_for","(","current_app",".","config","[","'LDAP_LOGIN_VIEW'","]",",","next","=","next_path",")",")","return","func","(","*","args",",","*","*","kwargs",")","return","wrapped"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/utils\/flask_simpleldap\/__init__.py#L282-L305"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/utils\/flask_simpleldap\/__init__.py","language":"python","identifier":"LDAP.group_required","parameters":"(groups=None)","argument_list":"","return_statement":"return wrapper","docstring":"When applied to a view function, any unauthenticated requests will\n be redirected to the view named in LDAP_LOGIN_VIEW. Authenticated\n requests are only permitted if they belong to one of the listed groups.\n\n The login view is responsible for asking for credentials, checking\n them, and setting ``flask.g.user`` to the name of the authenticated\n user and ``flask.g.ldap_groups`` to the authenticated user's groups\n if the credentials are acceptable.\n\n :param list groups: List of groups that should be able to access the\n view function.","docstring_summary":"When applied to a view function, any unauthenticated requests will\n be redirected to the view named in LDAP_LOGIN_VIEW. Authenticated\n requests are only permitted if they belong to one of the listed groups.","docstring_tokens":["When","applied","to","a","view","function","any","unauthenticated","requests","will","be","redirected","to","the","view","named","in","LDAP_LOGIN_VIEW",".","Authenticated","requests","are","only","permitted","if","they","belong","to","one","of","the","listed","groups","."],"function":"def group_required(groups=None):\n \"\"\"When applied to a view function, any unauthenticated requests will\n be redirected to the view named in LDAP_LOGIN_VIEW. Authenticated\n requests are only permitted if they belong to one of the listed groups.\n\n The login view is responsible for asking for credentials, checking\n them, and setting ``flask.g.user`` to the name of the authenticated\n user and ``flask.g.ldap_groups`` to the authenticated user's groups\n if the credentials are acceptable.\n\n :param list groups: List of groups that should be able to access the\n view function.\n \"\"\"\n\n def wrapper(func):\n @wraps(func)\n def wrapped(*args, **kwargs):\n if g.user is None:\n return redirect(\n url_for(current_app.config['LDAP_LOGIN_VIEW'],\n next=request.full_path or request.path))\n match = [group for group in groups if group in g.ldap_groups]\n if not match:\n abort(401)\n\n return func(*args, **kwargs)\n\n return wrapped\n\n return wrapper","function_tokens":["def","group_required","(","groups","=","None",")",":","def","wrapper","(","func",")",":","@","wraps","(","func",")","def","wrapped","(","*","args",",","*","*","kwargs",")",":","if","g",".","user","is","None",":","return","redirect","(","url_for","(","current_app",".","config","[","'LDAP_LOGIN_VIEW'","]",",","next","=","request",".","full_path","or","request",".","path",")",")","match","=","[","group","for","group","in","groups","if","group","in","g",".","ldap_groups","]","if","not","match",":","abort","(","401",")","return","func","(","*","args",",","*","*","kwargs",")","return","wrapped","return","wrapper"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/utils\/flask_simpleldap\/__init__.py#L308-L337"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/utils\/flask_simpleldap\/__init__.py","language":"python","identifier":"LDAP.basic_auth_required","parameters":"(self, func)","argument_list":"","return_statement":"return wrapped","docstring":"When applied to a view function, any unauthenticated requests are\n asked to authenticate via HTTP's standard Basic Authentication system.\n Requests with credentials are checked with :meth:`.bind_user()`.\n\n The user's browser will typically show them the contents of\n LDAP_REALM_NAME as a prompt for which username and password to enter.\n\n If the request's credentials are accepted by the LDAP server, the\n username is stored in ``flask.g.ldap_username`` and the password in\n ``flask.g.ldap_password``.\n\n :param func: The view function to decorate.","docstring_summary":"When applied to a view function, any unauthenticated requests are\n asked to authenticate via HTTP's standard Basic Authentication system.\n Requests with credentials are checked with :meth:`.bind_user()`.","docstring_tokens":["When","applied","to","a","view","function","any","unauthenticated","requests","are","asked","to","authenticate","via","HTTP","s","standard","Basic","Authentication","system",".","Requests","with","credentials","are","checked","with",":","meth",":",".","bind_user","()","."],"function":"def basic_auth_required(self, func):\n \"\"\"When applied to a view function, any unauthenticated requests are\n asked to authenticate via HTTP's standard Basic Authentication system.\n Requests with credentials are checked with :meth:`.bind_user()`.\n\n The user's browser will typically show them the contents of\n LDAP_REALM_NAME as a prompt for which username and password to enter.\n\n If the request's credentials are accepted by the LDAP server, the\n username is stored in ``flask.g.ldap_username`` and the password in\n ``flask.g.ldap_password``.\n\n :param func: The view function to decorate.\n \"\"\"\n\n def make_auth_required_response():\n response = make_response('Unauthorized', 401)\n response.www_authenticate.set_basic(\n current_app.config['LDAP_REALM_NAME'])\n return response\n\n @wraps(func)\n def wrapped(*args, **kwargs):\n if request.authorization is None:\n req_username = None\n req_password = None\n else:\n req_username = request.authorization.username\n req_password = request.authorization.password\n # Many LDAP servers will grant you anonymous access if you log in\n # with an empty password, even if you supply a non-anonymous user\n # ID, causing .bind_user() to return True. Therefore, only accept\n # non-empty passwords.\n if req_username in ['', None] or req_password in ['', None]:\n current_app.logger.debug('Got a request without auth data')\n return make_auth_required_response()\n\n if not self.bind_user(req_username, req_password):\n current_app.logger.debug('User {0!r} gave wrong '\n 'password'.format(req_username))\n return make_auth_required_response()\n\n g.ldap_username = req_username\n g.ldap_password = req_password\n\n return func(*args, **kwargs)\n\n return wrapped","function_tokens":["def","basic_auth_required","(","self",",","func",")",":","def","make_auth_required_response","(",")",":","response","=","make_response","(","'Unauthorized'",",","401",")","response",".","www_authenticate",".","set_basic","(","current_app",".","config","[","'LDAP_REALM_NAME'","]",")","return","response","@","wraps","(","func",")","def","wrapped","(","*","args",",","*","*","kwargs",")",":","if","request",".","authorization","is","None",":","req_username","=","None","req_password","=","None","else",":","req_username","=","request",".","authorization",".","username","req_password","=","request",".","authorization",".","password","# Many LDAP servers will grant you anonymous access if you log in","# with an empty password, even if you supply a non-anonymous user","# ID, causing .bind_user() to return True. Therefore, only accept","# non-empty passwords.","if","req_username","in","[","''",",","None","]","or","req_password","in","[","''",",","None","]",":","current_app",".","logger",".","debug","(","'Got a request without auth data'",")","return","make_auth_required_response","(",")","if","not","self",".","bind_user","(","req_username",",","req_password",")",":","current_app",".","logger",".","debug","(","'User {0!r} gave wrong '","'password'",".","format","(","req_username",")",")","return","make_auth_required_response","(",")","g",".","ldap_username","=","req_username","g",".","ldap_password","=","req_password","return","func","(","*","args",",","*","*","kwargs",")","return","wrapped"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/utils\/flask_simpleldap\/__init__.py#L339-L386"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/BrowserHistory\/BrowserHistory_ELK.py","language":"python","identifier":"convert_timestamp","parameters":"(timestamp, browser_name=None, tz='utc')","argument_list":"","return_statement":"return str(date)","docstring":"Helper function to convert different timestamps formats into date strings or POSIX timestamp.\n\t\t:param timestamp: Timestamp\n\t\t:return: POSIX timestamp (UTC)","docstring_summary":"Helper function to convert different timestamps formats into date strings or POSIX timestamp.\n\t\t:param timestamp: Timestamp\n\t\t:return: POSIX timestamp (UTC)","docstring_tokens":["Helper","function","to","convert","different","timestamps","formats","into","date","strings","or","POSIX","timestamp",".",":","param","timestamp",":","Timestamp",":","return",":","POSIX","timestamp","(","UTC",")"],"function":"def convert_timestamp(timestamp, browser_name=None, tz='utc'):\n\t\t\"\"\"Helper function to convert different timestamps formats into date strings or POSIX timestamp.\n\t\t:param timestamp: Timestamp\n\t\t:return: POSIX timestamp (UTC)\n\t\t\"\"\"\n\t\tif browser_name == 'Chrome':\n\t\t\tdate = datetime(1601, 1, 1) + timedelta(microseconds=timestamp)\n\t\telif browser_name == 'IE11':\n\t\t\tdate = datetime(1601, 1, 1) + timedelta(microseconds=timestamp * 0.1)\n\t\telif browser_name == 'Safari':\n\t\t\tdate = datetime(2001, 1, 1) + timedelta(seconds=timestamp)\n\t\telif browser_name == 'Firefox':\n\t\t\tdate = datetime.fromtimestamp(timestamp \/ 1000000)\n\t\telse:\n\t\t\tdate = datetime.fromtimestamp(timestamp)\n\t\treturn str(date)","function_tokens":["def","convert_timestamp","(","timestamp",",","browser_name","=","None",",","tz","=","'utc'",")",":","if","browser_name","==","'Chrome'",":","date","=","datetime","(","1601",",","1",",","1",")","+","timedelta","(","microseconds","=","timestamp",")","elif","browser_name","==","'IE11'",":","date","=","datetime","(","1601",",","1",",","1",")","+","timedelta","(","microseconds","=","timestamp","*","0.1",")","elif","browser_name","==","'Safari'",":","date","=","datetime","(","2001",",","1",",","1",")","+","timedelta","(","seconds","=","timestamp",")","elif","browser_name","==","'Firefox'",":","date","=","datetime",".","fromtimestamp","(","timestamp","\/","1000000",")","else",":","date","=","datetime",".","fromtimestamp","(","timestamp",")","return","str","(","date",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/BrowserHistory\/BrowserHistory_ELK.py#L60-L75"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/BrowserHistory\/BrowserHistory_ELK.py","language":"python","identifier":"extract_webcachev01_dat","parameters":"(file_path)","argument_list":"","return_statement":"return visits","docstring":"Extracts data from WebCacheVxx.dat.","docstring_summary":"Extracts data from WebCacheVxx.dat.","docstring_tokens":["Extracts","data","from","WebCacheVxx",".","dat","."],"function":"def extract_webcachev01_dat(file_path):\n\t\"\"\"Extracts data from WebCacheVxx.dat.\n\t\"\"\"\n\tvisits = []\n\tesedb_file = pyesedb.file()\n\twith open(file_path, \"rb\") as f:\n\t\tesedb_file.open_file_object(f) # read the file \n\t\tcontainers_table = esedb_file.get_table_by_name(\"Containers\") # look for tables \"Containers\"\n\t\tif containers_table is None:\n\t\t\tesedb_file.close()\n\t\t\treturn visits\n\t\t\t\n\t\tfor i in range(0, containers_table.get_number_of_records()):\n\t\t\tif containers_table.get_record(i).get_value_data_as_string(8) == 'History': # only look for History containers\n\t\t\t\tcontainer_id = containers_table.get_record(i).get_value_data_as_integer(0)\n\t\t\t\thistory_table = esedb_file.get_table_by_name(\"Container_\" + str(container_id)) # get the container by its ID \n\t\t\t\tfor j in range(0, history_table.get_number_of_records()):\t# for each record in the container table\n\t\t\t\t\t\trecord = {}\n\t\t\t\t\t\tfor v in range(0 , history_table.get_record(j).get_number_of_values()): # for each value in the record\n\t\t\t\t\t\t\tcolumn_name = history_table.get_record(j).get_column_name(v) # get the current column name\n\t\t\t\t\t\t\tcolumn_type = history_table.get_record(j).get_column_type(v) # get the current column type number\n\n\t\t\t\t\t\t\tif column_type == 12 :\t# column is string\n\t\t\t\t\t\t\t\trecord[column_name] = history_table.get_record(j).get_value_data_as_string(v)\n\n\t\t\t\t\t\t\telif column_type == 15 or column_type == 14: # column is int\n\t\t\t\t\t\t\t\tif column_name in [\"SyncTime\" , \"CreationTime\" , \"ExpiryTime\" , \"ModifiedTime\" , \"AccessedTime\"]:\n\t\t\t\t\t\t\t\t\trecord[column_name] = convert_timestamp( history_table.get_record(j).get_value_data_as_integer(v) , browser_name='IE11', tz='utc')\n\t\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\t\trecord[column_name] = history_table.get_record(j).get_value_data_as_integer(v)\n\n\t\t\t\t\t\t\telif column_type == 11: # column is hex\n\t\t\t\t\t\t\t\tif history_table.get_record(j).get_value_data(v) is not None:\n\t\t\t\t\t\t\t\t\th = [ord(x) for x in history_table.get_record(j).get_value_data(v)]\n\t\t\t\t\t\t\t\t\trecord[column_name] = ''.join('{:02x} '.format(x) for x in h)\n\t\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\t\trecord[column_name] = history_table.get_record(j).get_value_data(v)\n\n\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\trecord[column_name] = history_table.get_record(j).get_value_data(v)\n\t\t\t\t\t\t \n\t\t\t\t\t\trecord[\"@timestamp\"] = record[\"AccessedTime\"].replace(\" \" , \"T\")\n\t\t\t\t\t\trecord[\"browser_name\"] = \"Internet Explorer\"\n\t\t\t\t\t\trecord[\"type\"] = \"visits\"\n\t\t\t\t\t\tlink = record['Url'].split('@' , 1)\n\t\t\t\t\t\tif len(link) == 1:\n\t\t\t\t\t\t\trecord['link'] = link[0]\n\t\t\t\t\t\telse:\n\t\t\t\t\t\t\trecord['link'] = link[1]\n\t\t\t\t\t\t\n\t\t\t\t\t\trecord['time'] = record['AccessedTime']\n\n\t\t\t\t\t\tfor k in record.keys():\n\t\t\t\t\t\t\tif k in [\"UrlHash\" , \"Type\"]:\n\t\t\t\t\t\t\t\trecord[k] = str(record[k])\n\t\t\t\t\t\t\tif record[k] is None:\n\t\t\t\t\t\t\t\trecord[k] = \"None\"\n\t\t\t\t\t\tvisits.append(record)\n\n\t\tesedb_file.close()\n\n\treturn visits","function_tokens":["def","extract_webcachev01_dat","(","file_path",")",":","visits","=","[","]","esedb_file","=","pyesedb",".","file","(",")","with","open","(","file_path",",","\"rb\"",")","as","f",":","esedb_file",".","open_file_object","(","f",")","# read the file ","containers_table","=","esedb_file",".","get_table_by_name","(","\"Containers\"",")","# look for tables \"Containers\"","if","containers_table","is","None",":","esedb_file",".","close","(",")","return","visits","for","i","in","range","(","0",",","containers_table",".","get_number_of_records","(",")",")",":","if","containers_table",".","get_record","(","i",")",".","get_value_data_as_string","(","8",")","==","'History'",":","# only look for History containers","container_id","=","containers_table",".","get_record","(","i",")",".","get_value_data_as_integer","(","0",")","history_table","=","esedb_file",".","get_table_by_name","(","\"Container_\"","+","str","(","container_id",")",")","# get the container by its ID ","for","j","in","range","(","0",",","history_table",".","get_number_of_records","(",")",")",":","# for each record in the container table","record","=","{","}","for","v","in","range","(","0",",","history_table",".","get_record","(","j",")",".","get_number_of_values","(",")",")",":","# for each value in the record","column_name","=","history_table",".","get_record","(","j",")",".","get_column_name","(","v",")","# get the current column name","column_type","=","history_table",".","get_record","(","j",")",".","get_column_type","(","v",")","# get the current column type number","if","column_type","==","12",":","# column is string","record","[","column_name","]","=","history_table",".","get_record","(","j",")",".","get_value_data_as_string","(","v",")","elif","column_type","==","15","or","column_type","==","14",":","# column is int","if","column_name","in","[","\"SyncTime\"",",","\"CreationTime\"",",","\"ExpiryTime\"",",","\"ModifiedTime\"",",","\"AccessedTime\"","]",":","record","[","column_name","]","=","convert_timestamp","(","history_table",".","get_record","(","j",")",".","get_value_data_as_integer","(","v",")",",","browser_name","=","'IE11'",",","tz","=","'utc'",")","else",":","record","[","column_name","]","=","history_table",".","get_record","(","j",")",".","get_value_data_as_integer","(","v",")","elif","column_type","==","11",":","# column is hex","if","history_table",".","get_record","(","j",")",".","get_value_data","(","v",")","is","not","None",":","h","=","[","ord","(","x",")","for","x","in","history_table",".","get_record","(","j",")",".","get_value_data","(","v",")","]","record","[","column_name","]","=","''",".","join","(","'{:02x} '",".","format","(","x",")","for","x","in","h",")","else",":","record","[","column_name","]","=","history_table",".","get_record","(","j",")",".","get_value_data","(","v",")","else",":","record","[","column_name","]","=","history_table",".","get_record","(","j",")",".","get_value_data","(","v",")","record","[","\"@timestamp\"","]","=","record","[","\"AccessedTime\"","]",".","replace","(","\" \"",",","\"T\"",")","record","[","\"browser_name\"","]","=","\"Internet Explorer\"","record","[","\"type\"","]","=","\"visits\"","link","=","record","[","'Url'","]",".","split","(","'@'",",","1",")","if","len","(","link",")","==","1",":","record","[","'link'","]","=","link","[","0","]","else",":","record","[","'link'","]","=","link","[","1","]","record","[","'time'","]","=","record","[","'AccessedTime'","]","for","k","in","record",".","keys","(",")",":","if","k","in","[","\"UrlHash\"",",","\"Type\"","]",":","record","[","k","]","=","str","(","record","[","k","]",")","if","record","[","k","]","is","None",":","record","[","k","]","=","\"None\"","visits",".","append","(","record",")","esedb_file",".","close","(",")","return","visits"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/BrowserHistory\/BrowserHistory_ELK.py#L80-L141"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser.py","language":"python","identifier":"date_safe","parameters":"(d)","argument_list":"","return_statement":"","docstring":"From a Python datetime object, return a corresponding Unix timestamp\n or the epoch timestamp if the datetime object doesn't make sense\n Arguments:\n - `d`: A Python datetime object\n Throws:","docstring_summary":"From a Python datetime object, return a corresponding Unix timestamp\n or the epoch timestamp if the datetime object doesn't make sense\n Arguments:\n - `d`: A Python datetime object\n Throws:","docstring_tokens":["From","a","Python","datetime","object","return","a","corresponding","Unix","timestamp","or","the","epoch","timestamp","if","the","datetime","object","doesn","t","make","sense","Arguments",":","-","d",":","A","Python","datetime","object","Throws",":"],"function":"def date_safe(d):\n \"\"\"\n From a Python datetime object, return a corresponding Unix timestamp\n or the epoch timestamp if the datetime object doesn't make sense\n Arguments:\n - `d`: A Python datetime object\n Throws:\n \"\"\"\n try:\n return int(calendar.timegm(d.timetuple()))\n except (ValueError, OverflowError):\n return int(calendar.timegm(datetime.datetime(1970, 1, 1, 0, 0, 0).timetuple()))","function_tokens":["def","date_safe","(","d",")",":","try",":","return","int","(","calendar",".","timegm","(","d",".","timetuple","(",")",")",")","except","(","ValueError",",","OverflowError",")",":","return","int","(","calendar",".","timegm","(","datetime",".","datetime","(","1970",",","1",",","1",",","0",",","0",",","0",")",".","timetuple","(",")",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser.py#L36-L47"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser.py","language":"python","identifier":"get_shellbags","parameters":"(shell_key)","argument_list":"","return_statement":"return shellbags","docstring":"Given a python-registry RegistryKey object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `shell_key`: A python-registry Registry object.\n Throws:","docstring_summary":"Given a python-registry RegistryKey object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `shell_key`: A python-registry Registry object.\n Throws:","docstring_tokens":["Given","a","python","-","registry","RegistryKey","object","look","for","and","return","a","list","of","shellbag","items",".","A","shellbag","item","is","a","dict","with","the","keys","(","mtime","atime","crtime","path",")",".","Arguments",":","-","shell_key",":","A","python","-","registry","Registry","object",".","Throws",":"],"function":"def get_shellbags(shell_key):\n \"\"\"\n Given a python-registry RegistryKey object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `shell_key`: A python-registry Registry object.\n Throws:\n \"\"\"\n shellbags = []\n bagmru_key = shell_key.subkey(\"BagMRU\")\n bags_key = shell_key.subkey(\"Bags\")\n def shellbag_rec(key, bag_prefix, path_prefix):\n \"\"\"\n Function to recursively parse the BagMRU Registry key structure.\n Arguments:\n `key`: The current 'BagsMRU' key to recurse into.\n `bag_prefix`: A string containing the current subkey path of\n the relevant 'Bags' key. It will look something like '1\\\\2\\\\3\\\\4'.\n `path_prefix` A string containing the current human-readable,\n file system path so far constructed.\n Throws:\n \"\"\"\n try:\n \n # First, consider the current key, and extract shellbag items\n slot = key.value(\"NodeSlot\").value()\n for bag in bags_key.subkey(str(slot)).subkeys():\n for value in [value for value in bag.values() if\n \"ItemPos\" in value.name()]:\n buf = value.value()\n\n block = SHITEMLIST(buf, 0x0, False)\n offset = 0x10\n\n while True:\n offset += 0x8\n size = block.unpack_word(offset)\n if size == 0:\n break\n elif size < 0x15:\n pass\n else:\n item = block.get_item(offset)\n if path_prefix.encode(\"ascii\",\"replace\") == \"\":\n continue\n\n sb = {\n 'path' : path_prefix.encode(\"ascii\",\"replace\"),\n 'mtime' : date_safe_str(item.m_date()),\n 'atime' : date_safe_str(item.a_date()),\n 'crtime' : date_safe_str(item.cr_date()),\n 'key_path' : (key.path() + \"\\\\\" + value.name()).encode(\"ascii\",\"replace\"),\n '@timestamp' : date_safe_str(key.timestamp())\n }\n \n shellbags.append(sb)\n \n offset += size\n except Registry.RegistryValueNotFoundException:\n #g_logger.warning(\"Registry.RegistryValueNotFoundException\")\n #print(\"Registry.RegistryValueNotFoundException\")\n pass\n except Registry.RegistryKeyNotFoundException:\n #g_logger.warning(\"Registry.RegistryKeyNotFoundException\")\n #print(\"Registry.RegistryKeyNotFoundException\")\n pass\n \n \n # Next, recurse into each BagMRU key\n for value in [value for value in key.values()\n if re.match(\"\\d+\", value.name())]:\n path = \"\"\n try: # TODO(wb): removeme\n l = SHITEMLIST(value.value(), 0, False)\n for item in l.items():\n # assume there is only one entry in the value, or take the last\n # as the path component\n path = path_prefix + \"\\\\\" + item.name()\n shellbags.append({\n \"path\": path.encode(\"ascii\",\"replace\"),\n \"mtime\": date_safe_str(item.m_date()),\n \"atime\": date_safe_str(item.a_date()),\n \"crtime\": date_safe_str(item.cr_date()),\n \"key_path\": (key.path() + \"\\\\\" + value.name()).encode(\"ascii\",\"replace\"),\n \"@timestamp\": date_safe_str(key.timestamp())\n })\n except OverrunBufferException:\n print key.path()\n print value.name()\n raise\n\n shellbag_rec(key.subkey(value.name()),\n bag_prefix + \"\\\\\" + value.name(),\n path)\n\n shellbag_rec(bagmru_key, \"\", \"\")\n return shellbags","function_tokens":["def","get_shellbags","(","shell_key",")",":","shellbags","=","[","]","bagmru_key","=","shell_key",".","subkey","(","\"BagMRU\"",")","bags_key","=","shell_key",".","subkey","(","\"Bags\"",")","def","shellbag_rec","(","key",",","bag_prefix",",","path_prefix",")",":","\"\"\"\n Function to recursively parse the BagMRU Registry key structure.\n Arguments:\n `key`: The current 'BagsMRU' key to recurse into.\n `bag_prefix`: A string containing the current subkey path of\n the relevant 'Bags' key. It will look something like '1\\\\2\\\\3\\\\4'.\n `path_prefix` A string containing the current human-readable,\n file system path so far constructed.\n Throws:\n \"\"\"","try",":","# First, consider the current key, and extract shellbag items","slot","=","key",".","value","(","\"NodeSlot\"",")",".","value","(",")","for","bag","in","bags_key",".","subkey","(","str","(","slot",")",")",".","subkeys","(",")",":","for","value","in","[","value","for","value","in","bag",".","values","(",")","if","\"ItemPos\"","in","value",".","name","(",")","]",":","buf","=","value",".","value","(",")","block","=","SHITEMLIST","(","buf",",","0x0",",","False",")","offset","=","0x10","while","True",":","offset","+=","0x8","size","=","block",".","unpack_word","(","offset",")","if","size","==","0",":","break","elif","size","<","0x15",":","pass","else",":","item","=","block",".","get_item","(","offset",")","if","path_prefix",".","encode","(","\"ascii\"",",","\"replace\"",")","==","\"\"",":","continue","sb","=","{","'path'",":","path_prefix",".","encode","(","\"ascii\"",",","\"replace\"",")",",","'mtime'",":","date_safe_str","(","item",".","m_date","(",")",")",",","'atime'",":","date_safe_str","(","item",".","a_date","(",")",")",",","'crtime'",":","date_safe_str","(","item",".","cr_date","(",")",")",",","'key_path'",":","(","key",".","path","(",")","+","\"\\\\\"","+","value",".","name","(",")",")",".","encode","(","\"ascii\"",",","\"replace\"",")",",","'@timestamp'",":","date_safe_str","(","key",".","timestamp","(",")",")","}","shellbags",".","append","(","sb",")","offset","+=","size","except","Registry",".","RegistryValueNotFoundException",":","#g_logger.warning(\"Registry.RegistryValueNotFoundException\")","#print(\"Registry.RegistryValueNotFoundException\")","pass","except","Registry",".","RegistryKeyNotFoundException",":","#g_logger.warning(\"Registry.RegistryKeyNotFoundException\")","#print(\"Registry.RegistryKeyNotFoundException\")","pass","# Next, recurse into each BagMRU key","for","value","in","[","value","for","value","in","key",".","values","(",")","if","re",".","match","(","\"\\d+\"",",","value",".","name","(",")",")","]",":","path","=","\"\"","try",":","# TODO(wb): removeme","l","=","SHITEMLIST","(","value",".","value","(",")",",","0",",","False",")","for","item","in","l",".","items","(",")",":","# assume there is only one entry in the value, or take the last","# as the path component","path","=","path_prefix","+","\"\\\\\"","+","item",".","name","(",")","shellbags",".","append","(","{","\"path\"",":","path",".","encode","(","\"ascii\"",",","\"replace\"",")",",","\"mtime\"",":","date_safe_str","(","item",".","m_date","(",")",")",",","\"atime\"",":","date_safe_str","(","item",".","a_date","(",")",")",",","\"crtime\"",":","date_safe_str","(","item",".","cr_date","(",")",")",",","\"key_path\"",":","(","key",".","path","(",")","+","\"\\\\\"","+","value",".","name","(",")",")",".","encode","(","\"ascii\"",",","\"replace\"",")",",","\"@timestamp\"",":","date_safe_str","(","key",".","timestamp","(",")",")","}",")","except","OverrunBufferException",":","print","key",".","path","(",")","print","value",".","name","(",")","raise","shellbag_rec","(","key",".","subkey","(","value",".","name","(",")",")",",","bag_prefix","+","\"\\\\\"","+","value",".","name","(",")",",","path",")","shellbag_rec","(","bagmru_key",",","\"\"",",","\"\"",")","return","shellbags"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser.py#L80-L177"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser.py","language":"python","identifier":"get_all_shellbags","parameters":"(reg)","argument_list":"","return_statement":"return shellbags","docstring":"Given a python-registry Registry object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `reg`: A python-registry Registry object.\n Throws:","docstring_summary":"Given a python-registry Registry object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `reg`: A python-registry Registry object.\n Throws:","docstring_tokens":["Given","a","python","-","registry","Registry","object","look","for","and","return","a","list","of","shellbag","items",".","A","shellbag","item","is","a","dict","with","the","keys","(","mtime","atime","crtime","path",")",".","Arguments",":","-","reg",":","A","python","-","registry","Registry","object",".","Throws",":"],"function":"def get_all_shellbags(reg):\n \"\"\"\n Given a python-registry Registry object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `reg`: A python-registry Registry object.\n Throws:\n \"\"\"\n \n shellbags = []\n paths = [\n # xp\n \"Software\\\\Microsoft\\\\Windows\\\\Shell\",\n \"Software\\\\Microsoft\\\\Windows\\\\ShellNoRoam\",\n # win7\n \"Local Settings\\\\Software\\\\Microsoft\\\\Windows\\\\ShellNoRoam\",\n \"Local Settings\\\\Software\\\\Microsoft\\\\Windows\\\\Shell\",\n ]\n\n for path in paths:\n try:\n \n shell_key = reg.open(path)\n new = get_shellbags(shell_key)\n shellbags.extend(new)\n except Registry.RegistryKeyNotFoundException:\n pass\n except Exception:\n\t print(sys.exc_info())\n # g_logger.exception(\"Unhandled exception while parsing %s\" % path)\n print(\"Unhandled exception while parsing %s\" % path)\n\n return shellbags","function_tokens":["def","get_all_shellbags","(","reg",")",":","shellbags","=","[","]","paths","=","[","# xp","\"Software\\\\Microsoft\\\\Windows\\\\Shell\"",",","\"Software\\\\Microsoft\\\\Windows\\\\ShellNoRoam\"",",","# win7","\"Local Settings\\\\Software\\\\Microsoft\\\\Windows\\\\ShellNoRoam\"",",","\"Local Settings\\\\Software\\\\Microsoft\\\\Windows\\\\Shell\"",",","]","for","path","in","paths",":","try",":","shell_key","=","reg",".","open","(","path",")","new","=","get_shellbags","(","shell_key",")","shellbags",".","extend","(","new",")","except","Registry",".","RegistryKeyNotFoundException",":","pass","except","Exception",":","print","(","sys",".","exc_info","(",")",")","# g_logger.exception(\"Unhandled exception while parsing %s\" % path)","print","(","\"Unhandled exception while parsing %s\"","%","path",")","return","shellbags"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser.py#L180-L213"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser.py","language":"python","identifier":"print_shellbag_bodyfile","parameters":"(m, a, cr, path, fail_note=None)","argument_list":"","return_statement":"","docstring":"Given the MAC timestamps and a path, print a Bodyfile v3 string entry\n formatted with the data. We print instead of returning so we can handle\n cases where the implicit string encoding conversion takes place as\n things are written to STDOUT.\n Arguments:\n - `m`: A Python datetime object representing the modified date.\n - `a`: A Python datetime object representing the accessed date.\n - `cr`: A Python datetime object representing the created date.\n - `path`: A string with the entry path.\n - `fail_note`: An alternate path to print if an encoding error\n is encountered.\n Throws:","docstring_summary":"Given the MAC timestamps and a path, print a Bodyfile v3 string entry\n formatted with the data. We print instead of returning so we can handle\n cases where the implicit string encoding conversion takes place as\n things are written to STDOUT.\n Arguments:\n - `m`: A Python datetime object representing the modified date.\n - `a`: A Python datetime object representing the accessed date.\n - `cr`: A Python datetime object representing the created date.\n - `path`: A string with the entry path.\n - `fail_note`: An alternate path to print if an encoding error\n is encountered.\n Throws:","docstring_tokens":["Given","the","MAC","timestamps","and","a","path","print","a","Bodyfile","v3","string","entry","formatted","with","the","data",".","We","print","instead","of","returning","so","we","can","handle","cases","where","the","implicit","string","encoding","conversion","takes","place","as","things","are","written","to","STDOUT",".","Arguments",":","-","m",":","A","Python","datetime","object","representing","the","modified","date",".","-","a",":","A","Python","datetime","object","representing","the","accessed","date",".","-","cr",":","A","Python","datetime","object","representing","the","created","date",".","-","path",":","A","string","with","the","entry","path",".","-","fail_note",":","An","alternate","path","to","print","if","an","encoding","error","is","encountered",".","Throws",":"],"function":"def print_shellbag_bodyfile(m, a, cr, path, fail_note=None):\n \"\"\"\n Given the MAC timestamps and a path, print a Bodyfile v3 string entry\n formatted with the data. We print instead of returning so we can handle\n cases where the implicit string encoding conversion takes place as\n things are written to STDOUT.\n Arguments:\n - `m`: A Python datetime object representing the modified date.\n - `a`: A Python datetime object representing the accessed date.\n - `cr`: A Python datetime object representing the created date.\n - `path`: A string with the entry path.\n - `fail_note`: An alternate path to print if an encoding error\n is encountered.\n Throws:\n \"\"\"\n modified = date_safe(m)\n accessed = date_safe(a)\n created = date_safe(cr)\n changed = int(calendar.timegm(datetime.datetime.min.timetuple()))\n try:\n print u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\" % \\\n (path, modified, accessed, changed, created)\n except UnicodeDecodeError:\n print u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\" % \\\n (fail_note, modified, accessed, changed, created)\n except UnicodeEncodeError:\n print u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\" % \\\n (fail_note, modified, accessed, changed, created)","function_tokens":["def","print_shellbag_bodyfile","(","m",",","a",",","cr",",","path",",","fail_note","=","None",")",":","modified","=","date_safe","(","m",")","accessed","=","date_safe","(","a",")","created","=","date_safe","(","cr",")","changed","=","int","(","calendar",".","timegm","(","datetime",".","datetime",".","min",".","timetuple","(",")",")",")","try",":","print","u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\"","%","(","path",",","modified",",","accessed",",","changed",",","created",")","except","UnicodeDecodeError",":","print","u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\"","%","(","fail_note",",","modified",",","accessed",",","changed",",","created",")","except","UnicodeEncodeError",":","print","u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\"","%","(","fail_note",",","modified",",","accessed",",","changed",",","created",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser.py#L236-L263"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser.py","language":"python","identifier":"ShellbagException.__init__","parameters":"(self, value)","argument_list":"","return_statement":"","docstring":"Constructor.\n Arguments:\n - `value`: A string description.","docstring_summary":"Constructor.\n Arguments:\n - `value`: A string description.","docstring_tokens":["Constructor",".","Arguments",":","-","value",":","A","string","description","."],"function":"def __init__(self, value):\n \"\"\"\n Constructor.\n Arguments:\n - `value`: A string description.\n \"\"\"\n super(ShellbagException, self).__init__()\n self._value = value","function_tokens":["def","__init__","(","self",",","value",")",":","super","(","ShellbagException",",","self",")",".","__init__","(",")","self",".","_value","=","value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser.py#L62-L69"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser_bak.py","language":"python","identifier":"date_safe","parameters":"(d)","argument_list":"","return_statement":"","docstring":"From a Python datetime object, return a corresponding Unix timestamp\n or the epoch timestamp if the datetime object doesn't make sense\n Arguments:\n - `d`: A Python datetime object\n Throws:","docstring_summary":"From a Python datetime object, return a corresponding Unix timestamp\n or the epoch timestamp if the datetime object doesn't make sense\n Arguments:\n - `d`: A Python datetime object\n Throws:","docstring_tokens":["From","a","Python","datetime","object","return","a","corresponding","Unix","timestamp","or","the","epoch","timestamp","if","the","datetime","object","doesn","t","make","sense","Arguments",":","-","d",":","A","Python","datetime","object","Throws",":"],"function":"def date_safe(d):\n \"\"\"\n From a Python datetime object, return a corresponding Unix timestamp\n or the epoch timestamp if the datetime object doesn't make sense\n Arguments:\n - `d`: A Python datetime object\n Throws:\n \"\"\"\n try:\n return int(calendar.timegm(d.timetuple()))\n except (ValueError, OverflowError):\n return int(calendar.timegm(datetime.datetime(1970, 1, 1, 0, 0, 0).timetuple()))","function_tokens":["def","date_safe","(","d",")",":","try",":","return","int","(","calendar",".","timegm","(","d",".","timetuple","(",")",")",")","except","(","ValueError",",","OverflowError",")",":","return","int","(","calendar",".","timegm","(","datetime",".","datetime","(","1970",",","1",",","1",",","0",",","0",",","0",")",".","timetuple","(",")",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser_bak.py#L36-L47"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser_bak.py","language":"python","identifier":"get_shellbags","parameters":"(shell_key)","argument_list":"","return_statement":"return shellbags","docstring":"Given a python-registry RegistryKey object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `shell_key`: A python-registry Registry object.\n Throws:","docstring_summary":"Given a python-registry RegistryKey object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `shell_key`: A python-registry Registry object.\n Throws:","docstring_tokens":["Given","a","python","-","registry","RegistryKey","object","look","for","and","return","a","list","of","shellbag","items",".","A","shellbag","item","is","a","dict","with","the","keys","(","mtime","atime","crtime","path",")",".","Arguments",":","-","shell_key",":","A","python","-","registry","Registry","object",".","Throws",":"],"function":"def get_shellbags(shell_key):\n \"\"\"\n Given a python-registry RegistryKey object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `shell_key`: A python-registry Registry object.\n Throws:\n \"\"\"\n shellbags = []\n bagmru_key = shell_key.subkey(\"BagMRU\")\n bags_key = shell_key.subkey(\"Bags\")\n\n def shellbag_rec(key, bag_prefix, path_prefix):\n \"\"\"\n Function to recursively parse the BagMRU Registry key structure.\n Arguments:\n `key`: The current 'BagsMRU' key to recurse into.\n `bag_prefix`: A string containing the current subkey path of\n the relevant 'Bags' key. It will look something like '1\\\\2\\\\3\\\\4'.\n `path_prefix` A string containing the current human-readable,\n file system path so far constructed.\n Throws:\n \"\"\"\n try:\n # First, consider the current key, and extract shellbag items\n slot = key.value(\"NodeSlot\").value()\n for bag in bags_key.subkey(str(slot)).subkeys():\n for value in [value for value in bag.values() if\n \"ItemPos\" in value.name()]:\n buf = value.value()\n\n block = SHITEMLIST(buf, 0x0, False)\n offset = 0x10\n\n while True:\n offset += 0x8\n size = block.unpack_word(offset)\n if size == 0:\n break\n elif size < 0x15:\n pass\n else:\n item = block.get_item(offset)\n shellbags.append({\n \"path\": path.encode(\"ascii\",\"replace\"),\n \"mtime\": str(item.m_date()),\n \"atime\": str(item.a_date()),\n \"crtime\": str(item.cr_date()),\n \"key_path\": (key.path() + \"\\\\\" + value.name()).encode(\"ascii\",\"replace\"),\n \"@timestamp\": str(key.timestamp())\n })\n offset += size\n except Registry.RegistryValueNotFoundException:\n g_logger.warning(\"Registry.RegistryValueNotFoundException\")\n pass\n except Registry.RegistryKeyNotFoundException:\n g_logger.warning(\"Registry.RegistryKeyNotFoundException\")\n pass\n except:\n g_logger.warning(\"Unexpected error %s\" % sys.exc_info()[0])\n\n # Next, recurse into each BagMRU key\n for value in [value for value in key.values()\n if re.match(\"\\d+\", value.name())]:\n path = \"\"\n try: # TODO(wb): removeme\n l = SHITEMLIST(value.value(), 0, False)\n for item in l.items():\n # assume there is only one entry in the value, or take the last\n # as the path component\n path = path_prefix + \"\\\\\" + item.name()\n shellbags.append({\n \"path\": path.encode(\"ascii\",\"replace\"),\n \"mtime\": str(item.m_date()),\n \"atime\": str(item.a_date()),\n \"crtime\": str(item.cr_date()),\n \"key_path\": (key.path() + \"\\\\\" + value.name()).encode(\"ascii\",\"replace\"),\n \"@timestamp\": str(key.timestamp())\n })\n except OverrunBufferException:\n print key.path()\n print value.name()\n raise\n\n shellbag_rec(key.subkey(value.name()),\n bag_prefix + \"\\\\\" + value.name(),\n path)\n\n shellbag_rec(bagmru_key, \"\", \"\")\n return shellbags","function_tokens":["def","get_shellbags","(","shell_key",")",":","shellbags","=","[","]","bagmru_key","=","shell_key",".","subkey","(","\"BagMRU\"",")","bags_key","=","shell_key",".","subkey","(","\"Bags\"",")","def","shellbag_rec","(","key",",","bag_prefix",",","path_prefix",")",":","\"\"\"\n Function to recursively parse the BagMRU Registry key structure.\n Arguments:\n `key`: The current 'BagsMRU' key to recurse into.\n `bag_prefix`: A string containing the current subkey path of\n the relevant 'Bags' key. It will look something like '1\\\\2\\\\3\\\\4'.\n `path_prefix` A string containing the current human-readable,\n file system path so far constructed.\n Throws:\n \"\"\"","try",":","# First, consider the current key, and extract shellbag items","slot","=","key",".","value","(","\"NodeSlot\"",")",".","value","(",")","for","bag","in","bags_key",".","subkey","(","str","(","slot",")",")",".","subkeys","(",")",":","for","value","in","[","value","for","value","in","bag",".","values","(",")","if","\"ItemPos\"","in","value",".","name","(",")","]",":","buf","=","value",".","value","(",")","block","=","SHITEMLIST","(","buf",",","0x0",",","False",")","offset","=","0x10","while","True",":","offset","+=","0x8","size","=","block",".","unpack_word","(","offset",")","if","size","==","0",":","break","elif","size","<","0x15",":","pass","else",":","item","=","block",".","get_item","(","offset",")","shellbags",".","append","(","{","\"path\"",":","path",".","encode","(","\"ascii\"",",","\"replace\"",")",",","\"mtime\"",":","str","(","item",".","m_date","(",")",")",",","\"atime\"",":","str","(","item",".","a_date","(",")",")",",","\"crtime\"",":","str","(","item",".","cr_date","(",")",")",",","\"key_path\"",":","(","key",".","path","(",")","+","\"\\\\\"","+","value",".","name","(",")",")",".","encode","(","\"ascii\"",",","\"replace\"",")",",","\"@timestamp\"",":","str","(","key",".","timestamp","(",")",")","}",")","offset","+=","size","except","Registry",".","RegistryValueNotFoundException",":","g_logger",".","warning","(","\"Registry.RegistryValueNotFoundException\"",")","pass","except","Registry",".","RegistryKeyNotFoundException",":","g_logger",".","warning","(","\"Registry.RegistryKeyNotFoundException\"",")","pass","except",":","g_logger",".","warning","(","\"Unexpected error %s\"","%","sys",".","exc_info","(",")","[","0","]",")","# Next, recurse into each BagMRU key","for","value","in","[","value","for","value","in","key",".","values","(",")","if","re",".","match","(","\"\\d+\"",",","value",".","name","(",")",")","]",":","path","=","\"\"","try",":","# TODO(wb): removeme","l","=","SHITEMLIST","(","value",".","value","(",")",",","0",",","False",")","for","item","in","l",".","items","(",")",":","# assume there is only one entry in the value, or take the last","# as the path component","path","=","path_prefix","+","\"\\\\\"","+","item",".","name","(",")","shellbags",".","append","(","{","\"path\"",":","path",".","encode","(","\"ascii\"",",","\"replace\"",")",",","\"mtime\"",":","str","(","item",".","m_date","(",")",")",",","\"atime\"",":","str","(","item",".","a_date","(",")",")",",","\"crtime\"",":","str","(","item",".","cr_date","(",")",")",",","\"key_path\"",":","(","key",".","path","(",")","+","\"\\\\\"","+","value",".","name","(",")",")",".","encode","(","\"ascii\"",",","\"replace\"",")",",","\"@timestamp\"",":","str","(","key",".","timestamp","(",")",")","}",")","except","OverrunBufferException",":","print","key",".","path","(",")","print","value",".","name","(",")","raise","shellbag_rec","(","key",".","subkey","(","value",".","name","(",")",")",",","bag_prefix","+","\"\\\\\"","+","value",".","name","(",")",",","path",")","shellbag_rec","(","bagmru_key",",","\"\"",",","\"\"",")","return","shellbags"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser_bak.py#L81-L171"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser_bak.py","language":"python","identifier":"get_all_shellbags","parameters":"(reg)","argument_list":"","return_statement":"return shellbags","docstring":"Given a python-registry Registry object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `reg`: A python-registry Registry object.\n Throws:","docstring_summary":"Given a python-registry Registry object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `reg`: A python-registry Registry object.\n Throws:","docstring_tokens":["Given","a","python","-","registry","Registry","object","look","for","and","return","a","list","of","shellbag","items",".","A","shellbag","item","is","a","dict","with","the","keys","(","mtime","atime","crtime","path",")",".","Arguments",":","-","reg",":","A","python","-","registry","Registry","object",".","Throws",":"],"function":"def get_all_shellbags(reg):\n \"\"\"\n Given a python-registry Registry object, look for and return a\n list of shellbag items. A shellbag item is a dict with the keys\n (mtime, atime, crtime, path).\n Arguments:\n - `reg`: A python-registry Registry object.\n Throws:\n \"\"\"\n shellbags = []\n paths = [\n # xp\n \"Software\\\\Microsoft\\\\Windows\\\\Shell\",\n \"Software\\\\Microsoft\\\\Windows\\\\ShellNoRoam\",\n # win7\n \"Local Settings\\\\Software\\\\Microsoft\\\\Windows\\\\ShellNoRoam\",\n \"Local Settings\\\\Software\\\\Microsoft\\\\Windows\\\\Shell\",\n ]\n\n for path in paths:\n try:\n shell_key = reg.open(path)\n new = get_shellbags(shell_key)\n shellbags.extend(new)\n except Registry.RegistryKeyNotFoundException:\n pass\n except Exception:\n g_logger.exception(\"Unhandled exception while parsing %s\" % path)\n\n return shellbags","function_tokens":["def","get_all_shellbags","(","reg",")",":","shellbags","=","[","]","paths","=","[","# xp","\"Software\\\\Microsoft\\\\Windows\\\\Shell\"",",","\"Software\\\\Microsoft\\\\Windows\\\\ShellNoRoam\"",",","# win7","\"Local Settings\\\\Software\\\\Microsoft\\\\Windows\\\\ShellNoRoam\"",",","\"Local Settings\\\\Software\\\\Microsoft\\\\Windows\\\\Shell\"",",","]","for","path","in","paths",":","try",":","shell_key","=","reg",".","open","(","path",")","new","=","get_shellbags","(","shell_key",")","shellbags",".","extend","(","new",")","except","Registry",".","RegistryKeyNotFoundException",":","pass","except","Exception",":","g_logger",".","exception","(","\"Unhandled exception while parsing %s\"","%","path",")","return","shellbags"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser_bak.py#L174-L203"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser_bak.py","language":"python","identifier":"print_shellbag_bodyfile","parameters":"(m, a, cr, path, fail_note=None)","argument_list":"","return_statement":"","docstring":"Given the MAC timestamps and a path, print a Bodyfile v3 string entry\n formatted with the data. We print instead of returning so we can handle\n cases where the implicit string encoding conversion takes place as\n things are written to STDOUT.\n Arguments:\n - `m`: A Python datetime object representing the modified date.\n - `a`: A Python datetime object representing the accessed date.\n - `cr`: A Python datetime object representing the created date.\n - `path`: A string with the entry path.\n - `fail_note`: An alternate path to print if an encoding error\n is encountered.\n Throws:","docstring_summary":"Given the MAC timestamps and a path, print a Bodyfile v3 string entry\n formatted with the data. We print instead of returning so we can handle\n cases where the implicit string encoding conversion takes place as\n things are written to STDOUT.\n Arguments:\n - `m`: A Python datetime object representing the modified date.\n - `a`: A Python datetime object representing the accessed date.\n - `cr`: A Python datetime object representing the created date.\n - `path`: A string with the entry path.\n - `fail_note`: An alternate path to print if an encoding error\n is encountered.\n Throws:","docstring_tokens":["Given","the","MAC","timestamps","and","a","path","print","a","Bodyfile","v3","string","entry","formatted","with","the","data",".","We","print","instead","of","returning","so","we","can","handle","cases","where","the","implicit","string","encoding","conversion","takes","place","as","things","are","written","to","STDOUT",".","Arguments",":","-","m",":","A","Python","datetime","object","representing","the","modified","date",".","-","a",":","A","Python","datetime","object","representing","the","accessed","date",".","-","cr",":","A","Python","datetime","object","representing","the","created","date",".","-","path",":","A","string","with","the","entry","path",".","-","fail_note",":","An","alternate","path","to","print","if","an","encoding","error","is","encountered",".","Throws",":"],"function":"def print_shellbag_bodyfile(m, a, cr, path, fail_note=None):\n \"\"\"\n Given the MAC timestamps and a path, print a Bodyfile v3 string entry\n formatted with the data. We print instead of returning so we can handle\n cases where the implicit string encoding conversion takes place as\n things are written to STDOUT.\n Arguments:\n - `m`: A Python datetime object representing the modified date.\n - `a`: A Python datetime object representing the accessed date.\n - `cr`: A Python datetime object representing the created date.\n - `path`: A string with the entry path.\n - `fail_note`: An alternate path to print if an encoding error\n is encountered.\n Throws:\n \"\"\"\n modified = date_safe(m)\n accessed = date_safe(a)\n created = date_safe(cr)\n changed = int(calendar.timegm(datetime.datetime.min.timetuple()))\n try:\n print u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\" % \\\n (path, modified, accessed, changed, created)\n except UnicodeDecodeError:\n print u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\" % \\\n (fail_note, modified, accessed, changed, created)\n except UnicodeEncodeError:\n print u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\" % \\\n (fail_note, modified, accessed, changed, created)","function_tokens":["def","print_shellbag_bodyfile","(","m",",","a",",","cr",",","path",",","fail_note","=","None",")",":","modified","=","date_safe","(","m",")","accessed","=","date_safe","(","a",")","created","=","date_safe","(","cr",")","changed","=","int","(","calendar",".","timegm","(","datetime",".","datetime",".","min",".","timetuple","(",")",")",")","try",":","print","u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\"","%","(","path",",","modified",",","accessed",",","changed",",","created",")","except","UnicodeDecodeError",":","print","u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\"","%","(","fail_note",",","modified",",","accessed",",","changed",",","created",")","except","UnicodeEncodeError",":","print","u\"0|%s (Shellbag)|0|0|0|0|0|%s|%s|%s|%s\"","%","(","fail_note",",","modified",",","accessed",",","changed",",","created",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser_bak.py#L226-L253"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser_bak.py","language":"python","identifier":"ShellbagException.__init__","parameters":"(self, value)","argument_list":"","return_statement":"","docstring":"Constructor.\n Arguments:\n - `value`: A string description.","docstring_summary":"Constructor.\n Arguments:\n - `value`: A string description.","docstring_tokens":["Constructor",".","Arguments",":","-","value",":","A","string","description","."],"function":"def __init__(self, value):\n \"\"\"\n Constructor.\n Arguments:\n - `value`: A string description.\n \"\"\"\n super(ShellbagException, self).__init__()\n self._value = value","function_tokens":["def","__init__","(","self",",","value",")",":","super","(","ShellbagException",",","self",")",".","__init__","(",")","self",".","_value","=","value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/shellbags_Custom_parser_bak.py#L63-L70"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/BinaryParser.py","language":"python","identifier":"dosdate","parameters":"(dosdate, dostime)","argument_list":"","return_statement":"","docstring":"`dosdate`: 2 bytes, little endian.\n `dostime`: 2 bytes, little endian.\n returns: datetime.datetime or datetime.datetime.min on error","docstring_summary":"`dosdate`: 2 bytes, little endian.\n `dostime`: 2 bytes, little endian.\n returns: datetime.datetime or datetime.datetime.min on error","docstring_tokens":["dosdate",":","2","bytes","little","endian",".","dostime",":","2","bytes","little","endian",".","returns",":","datetime",".","datetime","or","datetime",".","datetime",".","min","on","error"],"function":"def dosdate(dosdate, dostime):\n \"\"\"\n `dosdate`: 2 bytes, little endian.\n `dostime`: 2 bytes, little endian.\n returns: datetime.datetime or datetime.datetime.min on error\n \"\"\"\n try:\n t = ord(dosdate[1]) << 8\n t |= ord(dosdate[0])\n day = t & 0b0000000000011111\n month = (t & 0b0000000111100000) >> 5\n year = (t & 0b1111111000000000) >> 9\n year += 1980\n\n t = ord(dostime[1]) << 8\n t |= ord(dostime[0])\n sec = t & 0b0000000000011111\n sec *= 2\n minute = (t & 0b0000011111100000) >> 5\n hour = (t & 0b1111100000000000) >> 11\n\n return datetime.datetime(year, month, day, hour, minute, sec)\n except:\n return datetime.datetime.min","function_tokens":["def","dosdate","(","dosdate",",","dostime",")",":","try",":","t","=","ord","(","dosdate","[","1","]",")","<<","8","t","|=","ord","(","dosdate","[","0","]",")","day","=","t","&","0b0000000000011111","month","=","(","t","&","0b0000000111100000",")",">>","5","year","=","(","t","&","0b1111111000000000",")",">>","9","year","+=","1980","t","=","ord","(","dostime","[","1","]",")","<<","8","t","|=","ord","(","dostime","[","0","]",")","sec","=","t","&","0b0000000000011111","sec","*=","2","minute","=","(","t","&","0b0000011111100000",")",">>","5","hour","=","(","t","&","0b1111100000000000",")",">>","11","return","datetime",".","datetime","(","year",",","month",",","day",",","hour",",","minute",",","sec",")","except",":","return","datetime",".","datetime",".","min"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/BinaryParser.py#L11-L34"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/BinaryParser.py","language":"python","identifier":"align","parameters":"(offset, alignment)","argument_list":"","return_statement":"return offset + (alignment - (offset % alignment))","docstring":"Return the offset aligned to the nearest greater given alignment\n Arguments:\n - `offset`: An integer\n - `alignment`: An integer","docstring_summary":"Return the offset aligned to the nearest greater given alignment\n Arguments:\n - `offset`: An integer\n - `alignment`: An integer","docstring_tokens":["Return","the","offset","aligned","to","the","nearest","greater","given","alignment","Arguments",":","-","offset",":","An","integer","-","alignment",":","An","integer"],"function":"def align(offset, alignment):\n \"\"\"\n Return the offset aligned to the nearest greater given alignment\n Arguments:\n - `offset`: An integer\n - `alignment`: An integer\n \"\"\"\n if offset % alignment == 0:\n return offset\n return offset + (alignment - (offset % alignment))","function_tokens":["def","align","(","offset",",","alignment",")",":","if","offset","%","alignment","==","0",":","return","offset","return","offset","+","(","alignment","-","(","offset","%","alignment",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/BinaryParser.py#L37-L46"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/BinaryParser.py","language":"python","identifier":"ParseException.__init__","parameters":"(self, value)","argument_list":"","return_statement":"","docstring":"Constructor.\n Arguments:\n - `value`: A string description.","docstring_summary":"Constructor.\n Arguments:\n - `value`: A string description.","docstring_tokens":["Constructor",".","Arguments",":","-","value",":","A","string","description","."],"function":"def __init__(self, value):\n \"\"\"\n Constructor.\n Arguments:\n - `value`: A string description.\n \"\"\"\n super(ParseException, self).__init__(value)","function_tokens":["def","__init__","(","self",",","value",")",":","super","(","ParseException",",","self",")",".","__init__","(","value",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/BinaryParser.py#L54-L60"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/BinaryParser.py","language":"python","identifier":"Block.__init__","parameters":"(self, buf, offset, parent)","argument_list":"","return_statement":"","docstring":"Constructor.\n Arguments:\n - `buf`: Byte string containing binary data.\n - `offset`: The offset into the buffer at which the block starts.\n - `parent`: The parent block, which links to this block.","docstring_summary":"Constructor.\n Arguments:\n - `buf`: Byte string containing binary data.\n - `offset`: The offset into the buffer at which the block starts.\n - `parent`: The parent block, which links to this block.","docstring_tokens":["Constructor",".","Arguments",":","-","buf",":","Byte","string","containing","binary","data",".","-","offset",":","The","offset","into","the","buffer","at","which","the","block","starts",".","-","parent",":","The","parent","block","which","links","to","this","block","."],"function":"def __init__(self, buf, offset, parent):\n \"\"\"\n Constructor.\n Arguments:\n - `buf`: Byte string containing binary data.\n - `offset`: The offset into the buffer at which the block starts.\n - `parent`: The parent block, which links to this block.\n \"\"\"\n self._buf = buf\n self._offset = offset\n self._parent = parent","function_tokens":["def","__init__","(","self",",","buf",",","offset",",","parent",")",":","self",".","_buf","=","buf","self",".","_offset","=","offset","self",".","_parent","=","parent"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/BinaryParser.py#L90-L100"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/BinaryParser.py","language":"python","identifier":"Block._prepare_fields","parameters":"(self, fields=False)","argument_list":"","return_statement":"","docstring":"Declaratively add fields to this block.\n self._fields should contain a list of tuples (\"type\", \"name\", offset).\n This method will dynamically add corresponding offset and unpacker methods\n to this block.\n Arguments:\n - `fields`: (Optional) A list of tuples to add. Otherwise,\n self._fields is used.","docstring_summary":"Declaratively add fields to this block.\n self._fields should contain a list of tuples (\"type\", \"name\", offset).\n This method will dynamically add corresponding offset and unpacker methods\n to this block.\n Arguments:\n - `fields`: (Optional) A list of tuples to add. Otherwise,\n self._fields is used.","docstring_tokens":["Declaratively","add","fields","to","this","block",".","self",".","_fields","should","contain","a","list","of","tuples","(","type","name","offset",")",".","This","method","will","dynamically","add","corresponding","offset","and","unpacker","methods","to","this","block",".","Arguments",":","-","fields",":","(","Optional",")","A","list","of","tuples","to","add",".","Otherwise","self",".","_fields","is","used","."],"function":"def _prepare_fields(self, fields=False):\n \"\"\"\n Declaratively add fields to this block.\n self._fields should contain a list of tuples (\"type\", \"name\", offset).\n This method will dynamically add corresponding offset and unpacker methods\n to this block.\n Arguments:\n - `fields`: (Optional) A list of tuples to add. Otherwise,\n self._fields is used.\n \"\"\"\n for field in fields:\n def handler():\n f = getattr(self, \"unpack_\" + field[0])\n return f(*(field[2:]))\n setattr(self, field[1], handler)\n debug_payload = handler()\n if isinstance(debug_payload, six.text_type):\n debug_payload = debug_payload.encode('utf8')\n else:\n debug_payload = str(debug_payload)\n debug_payload = binascii.hexlify(debug_payload)\n g_logger.debug(\"(%s) %s\\t@ %s\\t: %s\" % (field[0].upper(),\n field[1],\n hex(self.absolute_offset(field[2])),\n debug_payload))\n setattr(self, \"_off_\" + field[1], field[2])","function_tokens":["def","_prepare_fields","(","self",",","fields","=","False",")",":","for","field","in","fields",":","def","handler","(",")",":","f","=","getattr","(","self",",","\"unpack_\"","+","field","[","0","]",")","return","f","(","*","(","field","[","2",":","]",")",")","setattr","(","self",",","field","[","1","]",",","handler",")","debug_payload","=","handler","(",")","if","isinstance","(","debug_payload",",","six",".","text_type",")",":","debug_payload","=","debug_payload",".","encode","(","'utf8'",")","else",":","debug_payload","=","str","(","debug_payload",")","debug_payload","=","binascii",".","hexlify","(","debug_payload",")","g_logger",".","debug","(","\"(%s) %s\\t@ %s\\t: %s\"","%","(","field","[","0","]",".","upper","(",")",",","field","[","1","]",",","hex","(","self",".","absolute_offset","(","field","[","2","]",")",")",",","debug_payload",")",")","setattr","(","self",",","\"_off_\"","+","field","[","1","]",",","field","[","2","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/BinaryParser.py#L108-L133"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/BinaryParser.py","language":"python","identifier":"Block.declare_field","parameters":"(self, type, name, offset, length=False)","argument_list":"","return_statement":"","docstring":"A shortcut to add a field.\n Arguments:\n - `type`: A string. Should be one of the unpack_* types.\n - `name`: A string.\n - `offset`: A number.\n - `length`: (Optional) A number.","docstring_summary":"A shortcut to add a field.\n Arguments:\n - `type`: A string. Should be one of the unpack_* types.\n - `name`: A string.\n - `offset`: A number.\n - `length`: (Optional) A number.","docstring_tokens":["A","shortcut","to","add","a","field",".","Arguments",":","-","type",":","A","string",".","Should","be","one","of","the","unpack_","*","types",".","-","name",":","A","string",".","-","offset",":","A","number",".","-","length",":","(","Optional",")","A","number","."],"function":"def declare_field(self, type, name, offset, length=False):\n \"\"\"\n A shortcut to add a field.\n Arguments:\n - `type`: A string. Should be one of the unpack_* types.\n - `name`: A string.\n - `offset`: A number.\n - `length`: (Optional) A number.\n \"\"\"\n if length:\n self._prepare_fields([(type, name, offset, length)])\n else:\n self._prepare_fields([(type, name, offset)])","function_tokens":["def","declare_field","(","self",",","type",",","name",",","offset",",","length","=","False",")",":","if","length",":","self",".","_prepare_fields","(","[","(","type",",","name",",","offset",",","length",")","]",")","else",":","self",".","_prepare_fields","(","[","(","type",",","name",",","offset",")","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/shellbags\/BinaryParser.py#L135-L147"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/shellbags\/BinaryParser.py","language":"python","identifier":"Block.unpack_byte","parameters":"(self, offset)","argument_list":"","return_statement":"","docstring":"Returns a little-endian unsigned byte from the relative offset.\n Arguments:\n - `offset`: The relative offset from the start of the block.\n Throws:\n - `OverrunBufferException`","docstring_summary":"Returns a little-endian unsigned byte from the relative offset.\n Arguments:\n - `offset`: The relative offset from the start of the block.\n Throws:\n - `OverrunBufferException`","docstring_tokens":["Returns","a","little","-","endian","unsigned","byte","from","the","relative","offset",".","Arguments",":","-","offset",":","The","relative","offset","from","the","start","of","the","block",".","Throws",":","-","OverrunBufferException"],"function":"def unpack_byte(self, offset):\n \"\"\"\n Returns a little-endian unsigned byte from the relative offset.\n Arguments:\n - `offset`: The relative offset from the start of the block.\n Throws:\n - `OverrunBufferException`\n \"\"\"\n o = self._offset + offset\n try:\n return struct.unpack_from(\"\"\n \"(?P.*?)<\/AdditionalProductCodes>\"\n \"(?P.*?)<\/CompanyName>\"\n \"(?P.*?)<\/ExplorerFileName>\"\n \"(?P.*?)<\/FileDescription>\"\n \"(?P.*?)<\/FilePropertiesHash>\"\n \"(?P.*?)<\/FileSize>(?P.*?)\"\n \"<\/FileVersion>(?P.*?)<\/FolderPath>\"\n \"(?P.*?)<\/LastUsedTime>\"\n \"(?P.*?)<\/LastUserName>\"\n \"(?P.*?)<\/msiDisplayName>\"\n \"(?P.*?)<\/msiPublisher>\"\n \"(?P.*?)<\/msiVersion>\"\n \"(?P.*?)<\/OriginalFileName>\"\n \"(?P.*?)<\/ProductCode>\"\n \"(?P.*?)<\/ProductLanguage>\"\n \"(?P.*?)<\/ProductName>\"\n \"(?P.*?)<\/ProductVersion>\"\n \"(?P.*?)<\/SoftwarePropertiesHash>\"\n \"<\/CCM_RecentlyUsedApps>\")\n\n # MO to match CCM_RUA data from string header to end\n ccm_nulldel_carve_mo = re.compile(\n \"CCM_RecentlyUsedApps\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\")\n\n # MO to match CCM_RUA data from GUID header to end\n ccm_nulldel_full_mo = re.compile(\n \"(?P{}|{})\".format(CCM_RUA_GUID_VISTA_UTF16, CCM_RUA_GUID_XP_UTF16)\n + \"(?P[.\\x00-\\xFF]{20,250})CCM_RecentlyUsedApps\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\\x00\\x00\"\n \"(?P[^\\x00]*)\")\n\n\n\n # For each line that may contain a CCM_RUA record, determine the type of\n # record and parse appropriately\n lst =[]\n for ccm_data in all_ccm_data_set:\n\n #Determine what type of match we have: null full, null carve, or XML\n ccm_nulldel_full_match = re.search(ccm_nulldel_full_mo, ccm_data)\n ccm_nulldel_carve_match = re.search(ccm_nulldel_carve_mo, ccm_data)\n ccm_xml_match = re.search(ccm_xml_mo, ccm_data)\n\n # Parse the matched data depending on the identified format\n if ccm_nulldel_full_match:\n lst.append(parse_null_delimited_record(ccm_nulldel_full_match, True))\n\n elif ccm_nulldel_carve_match:\n lst.append(parse_null_delimited_record(ccm_nulldel_carve_match, False))\n\n elif ccm_xml_match:\n lst.append(parse_xml_record(ccm_xml_match))\n\n else:\n # Ignore instances of the CCM RUA tag that are not usually followed\n # by actual records\n if (\n \"CCM_RecentlyUsedApps\\x00\\x00AdditionalProductCode\" in ccm_data or\n \"CCM_RecentlyUsedApps\\x00\\x00\\\\\\\\.\\\\root\\\\\" in ccm_data or\n \"CCM_RecentlyUsedApps\\x00\\x00AAInstProv\" in ccm_data or\n \"class CCM_RecentlyUsedApps\" in ccm_data or\n \"instance of InventoryDataItem\" in ccm_data or\n \"<\/CCM_RecentlyUsedApps>\" in ccm_data or\n '\"CCM_RecentlyUsedApps\"' in ccm_data or\n (\"CCM_RecentlyUsedApps>\" in ccm_data and\n \"<\/CCM_RecentlyUsedApps>\" not in ccm_data)):\n pass\n else:\n# logging.warn(\"Potentially missed line:\\n\")\n# logging.warn(\"{}\\n\\n\".format(ccm_data).replace(\"\\\\x00\", \" \"))\n pass\n return lst","function_tokens":["def","main","(","filepath",")",":","all_ccm_data_set","=","find_ccm_rua_data","(","filepath",")","ccm_xml_mo","=","re",".","compile","(","\"\"","\"(?P.*?)<\/AdditionalProductCodes>\"","\"(?P.*?)<\/CompanyName>\"","\"(?P.*?)<\/ExplorerFileName>\"","\"(?P.*?)<\/FileDescription>\"","\"(?P.*?)<\/FilePropertiesHash>\"","\"(?P.*?)<\/FileSize>(?P.*?)\"","\"<\/FileVersion>(?P.*?)<\/FolderPath>\"","\"(?P.*?)<\/LastUsedTime>\"","\"(?P.*?)<\/LastUserName>\"","\"(?P.*?)<\/msiDisplayName>\"","\"(?P.*?)<\/msiPublisher>\"","\"(?P.*?)<\/msiVersion>\"","\"(?P.*?)<\/OriginalFileName>\"","\"(?P.*?)<\/ProductCode>\"","\"(?P.*?)<\/ProductLanguage>\"","\"(?P.*?)<\/ProductName>\"","\"(?P.*?)<\/ProductVersion>\"","\"(?P.*?)<\/SoftwarePropertiesHash>\"","\"<\/CCM_RecentlyUsedApps>\"",")","# MO to match CCM_RUA data from string header to end","ccm_nulldel_carve_mo","=","re",".","compile","(","\"CCM_RecentlyUsedApps\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\"",")","# MO to match CCM_RUA data from GUID header to end","ccm_nulldel_full_mo","=","re",".","compile","(","\"(?P{}|{})\"",".","format","(","CCM_RUA_GUID_VISTA_UTF16",",","CCM_RUA_GUID_XP_UTF16",")","+","\"(?P[.\\x00-\\xFF]{20,250})CCM_RecentlyUsedApps\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\\x00\\x00\"","\"(?P[^\\x00]*)\"",")","# For each line that may contain a CCM_RUA record, determine the type of","# record and parse appropriately","lst","=","[","]","for","ccm_data","in","all_ccm_data_set",":","#Determine what type of match we have: null full, null carve, or XML","ccm_nulldel_full_match","=","re",".","search","(","ccm_nulldel_full_mo",",","ccm_data",")","ccm_nulldel_carve_match","=","re",".","search","(","ccm_nulldel_carve_mo",",","ccm_data",")","ccm_xml_match","=","re",".","search","(","ccm_xml_mo",",","ccm_data",")","# Parse the matched data depending on the identified format","if","ccm_nulldel_full_match",":","lst",".","append","(","parse_null_delimited_record","(","ccm_nulldel_full_match",",","True",")",")","elif","ccm_nulldel_carve_match",":","lst",".","append","(","parse_null_delimited_record","(","ccm_nulldel_carve_match",",","False",")",")","elif","ccm_xml_match",":","lst",".","append","(","parse_xml_record","(","ccm_xml_match",")",")","else",":","# Ignore instances of the CCM RUA tag that are not usually followed","# by actual records","if","(","\"CCM_RecentlyUsedApps\\x00\\x00AdditionalProductCode\"","in","ccm_data","or","\"CCM_RecentlyUsedApps\\x00\\x00\\\\\\\\.\\\\root\\\\\"","in","ccm_data","or","\"CCM_RecentlyUsedApps\\x00\\x00AAInstProv\"","in","ccm_data","or","\"class CCM_RecentlyUsedApps\"","in","ccm_data","or","\"instance of InventoryDataItem\"","in","ccm_data","or","\"<\/CCM_RecentlyUsedApps>\"","in","ccm_data","or","'\"CCM_RecentlyUsedApps\"'","in","ccm_data","or","(","\"CCM_RecentlyUsedApps>\"","in","ccm_data","and","\"<\/CCM_RecentlyUsedApps>\"","not","in","ccm_data",")",")",":","pass","else",":","# logging.warn(\"Potentially missed line:\\n\")","# logging.warn(\"{}\\n\\n\".format(ccm_data).replace(\"\\\\x00\", \" \"))","pass","return","lst"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/RUA\/rua.py#L236-L347"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/RUA\/rua.py","language":"python","identifier":"parse_null_delimited_record","parameters":"(ccm_nulldel_match, full_tf)","argument_list":"","return_statement":"return json.loads(json.dumps(app))","docstring":"Parse records delimited by \\x00\\x00","docstring_summary":"Parse records delimited by \\x00\\x00","docstring_tokens":["Parse","records","delimited","by","\\","x00","\\","x00"],"function":"def parse_null_delimited_record(ccm_nulldel_match, full_tf):\n \"\"\"Parse records delimited by \\x00\\x00\"\"\"\n dic ={}\n # If this a full record (not carved), we will try to parse the headers\n if full_tf:\n header_data = \"{}{}\".format(\n ccm_nulldel_match.group(\"GUID\"),\n ccm_nulldel_match.group(\"rua_header\"))\n\n #if a standard GUID header is in the begininning of the header\n if (\n CCM_RUA_GUID_VISTA_UTF16 in header_data or\n CCM_RUA_GUID_XP_UTF16 in header_data):\n\n #Determine the type of record based on the header\n if CCM_RUA_GUID_VISTA_UTF16 in header_data:\n dic['record_type'] = \"Vista+_Full_NullDelim\"\n elif CCM_RUA_GUID_XP_UTF16 in header_data:\n dic['record_type'] = \"XP_Full_NullDelim\"\n\n # Find timestamps, file size, and launch count in the header\n # header == data from GUID header to \"CCM_RecentlyUsedApps\"\n header_data_mo = re.compile(\n \"(?P{}|{})\".format(CCM_RUA_GUID_VISTA_UTF16, CCM_RUA_GUID_XP_UTF16)\n + \"(?P[\\x00-\\xFF]{8})(?P[\\x00-\\xFF]{8})\"\n \"(?P[\\x00-\\xFF]{34})(?P[\\x00-\\xFF]{4})\"\n \"(?P[\\x00-\\xFF]{20})(?P[\\x00-\\xFF]{4})\")\n\n header_data_match = re.search(header_data_mo, header_data)\n\n # Parse timestamps from header and convert to human readable format\n timestamp_1_bin = header_data_match.group(\"timestamp_1\")\n timestamp_2_bin = header_data_match.group(\"timestamp_2\")\n\n timestamp_1_nano = struct.unpack(\"{}|{})\"",".","format","(","CCM_RUA_GUID_VISTA_UTF16",",","CCM_RUA_GUID_XP_UTF16",")","+","\"(?P[\\x00-\\xFF]{8})(?P[\\x00-\\xFF]{8})\"","\"(?P[\\x00-\\xFF]{34})(?P[\\x00-\\xFF]{4})\"","\"(?P[\\x00-\\xFF]{20})(?P[\\x00-\\xFF]{4})\"",")","header_data_match","=","re",".","search","(","header_data_mo",",","header_data",")","# Parse timestamps from header and convert to human readable format","timestamp_1_bin","=","header_data_match",".","group","(","\"timestamp_1\"",")","timestamp_2_bin","=","header_data_match",".","group","(","\"timestamp_2\"",")","timestamp_1_nano","=","struct",".","unpack","(","\"= 8:\n\t\t\tsubauthority_count = ord(sid[1])\n\t\t\tidentifier_authority = struct.unpack(\">H\", sid[2:4])[0]\n\t\t\tidentifier_authority <<= 32\n\t\t\tidentifier_authority |= struct.unpack(\">L\", sid[4:8])[0]\n\t\t\tsid_components.append(identifier_authority)\n\t\t\tstart = 8\n\t\t\t#print subauthority_count.encode('hex')\n\t\t\tfor i in range( subauthority_count ):\n\t\t\t\tauthority = sid[start:start + 4]\n\t\t\t\tif not authority:\n\t\t\t\t\tbreak\n\t\t\t\tif len(authority) < 4:\n\t\t\t\t\traise ValueError(\"In binary SID '%s', component %d has been truncated. \"\n\t\t\t\t\t\t\t\t\t\"Expected 4 bytes, found %d: (%s)\",\n\t\t\t\t\t\t\t\t\t\",\".join([str(ord(c)) for c in sid]), i,\n\t\t\t\t\t\t\t\t\tlen(authority), authority)\n\t\t\t\tsid_components.append(struct.unpack(\"=","8",":","subauthority_count","=","ord","(","sid","[","1","]",")","identifier_authority","=","struct",".","unpack","(","\">H\"",",","sid","[","2",":","4","]",")","[","0","]","identifier_authority","<<=","32","identifier_authority","|=","struct",".","unpack","(","\">L\"",",","sid","[","4",":","8","]",")","[","0","]","sid_components",".","append","(","identifier_authority",")","start","=","8","#print subauthority_count.encode('hex')","for","i","in","range","(","subauthority_count",")",":","authority","=","sid","[","start",":","start","+","4","]","if","not","authority",":","break","if","len","(","authority",")","<","4",":","raise","ValueError","(","\"In binary SID '%s', component %d has been truncated. \"","\"Expected 4 bytes, found %d: (%s)\"",",","\",\"",".","join","(","[","str","(","ord","(","c",")",")","for","c","in","sid","]",")",",","i",",","len","(","authority",")",",","authority",")","sid_components",".","append","(","struct",".","unpack","(","\" 1 and not args.hex_dump:\n progress(i, total, status='Dumping Hex')\n\n data = file.read(16)\n hexa = ' '.join(['{:02x}'.format(i) for i in data])\n line = ''.join([31 < i < 127 and chr(i) or '.' for i in data])\n res.append(' {:08x} {:47} {}'.format(length, hexa, line))\n\n if (time.time() - hextime) > 1 and not args.hex_dump:\n print('\\n')\n\n if pcap:\n packet.write('\\n'.join(res))\n packet.write('\\n\\n')\n\n return '\\n'.join(res)\n\n else:\n return '\\n'.join(res)+'\\n\\n'","function_tokens":["def","hexdump","(","buf",",","pcap","=","False",")",":","total","=","len","(","buf",")","file","=","io",".","BytesIO","(","buf",")","res","=","[","]","hextime","=","time",".","time","(",")","for","length","in","range","(","0",",","len","(","buf",")",",","16",")",":","i","=","file",".","tell","(",")","if","(","time",".","time","(",")","-","hextime",")",">","1","and","not","args",".","hex_dump",":","progress","(","i",",","total",",","status","=","'Dumping Hex'",")","data","=","file",".","read","(","16",")","hexa","=","' '",".","join","(","[","'{:02x}'",".","format","(","i",")","for","i","in","data","]",")","line","=","''",".","join","(","[","31","<","i","<","127","and","chr","(","i",")","or","'.'","for","i","in","data","]",")","res",".","append","(","' {:08x} {:47} {}'",".","format","(","length",",","hexa",",","line",")",")","if","(","time",".","time","(",")","-","hextime",")",">","1","and","not","args",".","hex_dump",":","print","(","'\\n'",")","if","pcap",":","packet",".","write","(","'\\n'",".","join","(","res",")",")","packet",".","write","(","'\\n\\n'",")","return","'\\n'",".","join","(","res",")","else",":","return","'\\n'",".","join","(","res",")","+","'\\n\\n'"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/SDDL3\/SEPparser.py#L3001-L3029"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/SDDL3\/SDDL3.py","language":"python","identifier":"TranslateSid","parameters":"(sid_string)","argument_list":"","return_statement":"","docstring":"Translate a SID string to an account name.\n\n Args:\n sid_string: a SID in string form\n\n Returns:\n A string with the account name if the name resolves.\n None if the name is not found.","docstring_summary":"Translate a SID string to an account name.","docstring_tokens":["Translate","a","SID","string","to","an","account","name","."],"function":"def TranslateSid(sid_string):\n \"\"\"Translate a SID string to an account name.\n\n Args:\n sid_string: a SID in string form\n\n Returns:\n A string with the account name if the name resolves.\n None if the name is not found.\n \"\"\"\n if os.name == 'nt':\n try:\n account = LookupAccountSid(None, GetBinarySid(sid_string))\n except:\n account = None\n\n if account:\n if len(account[1]):\n return account[1] + '\\\\' + account[0]\n else:\n return account[0]","function_tokens":["def","TranslateSid","(","sid_string",")",":","if","os",".","name","==","'nt'",":","try",":","account","=","LookupAccountSid","(","None",",","GetBinarySid","(","sid_string",")",")","except",":","account","=","None","if","account",":","if","len","(","account","[","1","]",")",":","return","account","[","1","]","+","'\\\\'","+","account","[","0","]","else",":","return","account","[","0","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/SDDL3\/SDDL3.py#L214-L234"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/SDDL3\/SDDL3.py","language":"python","identifier":"SortAceByTrustee","parameters":"(x, y)","argument_list":"","return_statement":"return cmp(x.trustee, y.trustee)","docstring":"Custom sorting function to sort SDDL.ACE objects by trustee.\n\n Args:\n x: first object being compared\n y: second object being compared\n\n Returns:\n The results of a cmp() between the objects.","docstring_summary":"Custom sorting function to sort SDDL.ACE objects by trustee.","docstring_tokens":["Custom","sorting","function","to","sort","SDDL",".","ACE","objects","by","trustee","."],"function":"def SortAceByTrustee(x, y):\n \"\"\"Custom sorting function to sort SDDL.ACE objects by trustee.\n\n Args:\n x: first object being compared\n y: second object being compared\n\n Returns:\n The results of a cmp() between the objects.\n \"\"\"\n return cmp(x.trustee, y.trustee)","function_tokens":["def","SortAceByTrustee","(","x",",","y",")",":","return","cmp","(","x",".","trustee",",","y",".","trustee",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/SDDL3\/SDDL3.py#L237-L247"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/SDDL3\/SDDL3.py","language":"python","identifier":"AccessFromHex","parameters":"(hex)","argument_list":"","return_statement":"return rights","docstring":"Convert a hex access rights specifier to it's string equivalent.\n\n Args:\n hex: The hexadecimal string to be converted\n\n Returns:\n A string containing the converted access rights","docstring_summary":"Convert a hex access rights specifier to it's string equivalent.","docstring_tokens":["Convert","a","hex","access","rights","specifier","to","it","s","string","equivalent","."],"function":"def AccessFromHex(hex):\n \"\"\"Convert a hex access rights specifier to it's string equivalent.\n\n Args:\n hex: The hexadecimal string to be converted\n\n Returns:\n A string containing the converted access rights\n \"\"\"\n hex = int(hex, 16)\n rights = \"\"\n\n for spec in ACCESS_HEX.items():\n if hex & spec[0]:\n rights += spec[1]\n\n return rights","function_tokens":["def","AccessFromHex","(","hex",")",":","hex","=","int","(","hex",",","16",")","rights","=","\"\"","for","spec","in","ACCESS_HEX",".","items","(",")",":","if","hex","&","spec","[","0","]",":","rights","+=","spec","[","1","]","return","rights"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/SDDL3\/SDDL3.py#L250-L266"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/SDDL3\/SDDL3.py","language":"python","identifier":"ACE.__init__","parameters":"(self, ace_string)","argument_list":"","return_statement":"","docstring":"Initializes the SDDL::ACE object.\n\n Args:\n ace_string: a string representing a single access control entry\n access_constants: a dictionary of access constants for translation\n\n Raises:\n InvalidAceStringError: If the ace string provided doesn't appear to be\n valid.","docstring_summary":"Initializes the SDDL::ACE object.","docstring_tokens":["Initializes","the","SDDL","::","ACE","object","."],"function":"def __init__(self, ace_string):\n \"\"\"Initializes the SDDL::ACE object.\n\n Args:\n ace_string: a string representing a single access control entry\n access_constants: a dictionary of access constants for translation\n\n Raises:\n InvalidAceStringError: If the ace string provided doesn't appear to be\n valid.\n \"\"\"\n self.ace_string = ace_string\n self.flags = []\n self.perms = []\n fields = ace_string.split(';')\n\n if len(fields) != 6:\n raise InvalidAceStringError\n\n if (ACE_TYPE[fields[0]]):\n self.ace_type = ACE_TYPE[fields[0]]\n else:\n self.ace_type = fields[0]\n\n for flag in re.findall(re_const, fields[1]):\n if ACE_FLAGS[flag]:\n self.flags.append(ACE_FLAGS[flag])\n else:\n self.flags.append(flag)\n\n if fields[2][0:2] == '0x': # If specified in hex\n fields[2] = AccessFromHex(fields[2])\n\n for perm in re.findall(re_const, fields[2]):\n if ACCESS[perm]:\n self.perms.append(ACCESS[perm])\n else:\n self.perms.append(perm)\n\n self.perms.sort()\n self.object_type = fields[3]\n self.inherited_type = fields[4]\n self.sid = fields[5]\n self.trustee = None\n\n if TRUSTEE.__contains__(fields[5]):\n self.trustee = TRUSTEE[fields[5]]\n \n if os.name == 'nt':\n if not self.trustee:\n self.trustee = TranslateSid(fields[5])\n\n if not self.trustee:\n self.trustee = 'Unknown or invalid SID.'","function_tokens":["def","__init__","(","self",",","ace_string",")",":","self",".","ace_string","=","ace_string","self",".","flags","=","[","]","self",".","perms","=","[","]","fields","=","ace_string",".","split","(","';'",")","if","len","(","fields",")","!=","6",":","raise","InvalidAceStringError","if","(","ACE_TYPE","[","fields","[","0","]","]",")",":","self",".","ace_type","=","ACE_TYPE","[","fields","[","0","]","]","else",":","self",".","ace_type","=","fields","[","0","]","for","flag","in","re",".","findall","(","re_const",",","fields","[","1","]",")",":","if","ACE_FLAGS","[","flag","]",":","self",".","flags",".","append","(","ACE_FLAGS","[","flag","]",")","else",":","self",".","flags",".","append","(","flag",")","if","fields","[","2","]","[","0",":","2","]","==","'0x'",":","# If specified in hex","fields","[","2","]","=","AccessFromHex","(","fields","[","2","]",")","for","perm","in","re",".","findall","(","re_const",",","fields","[","2","]",")",":","if","ACCESS","[","perm","]",":","self",".","perms",".","append","(","ACCESS","[","perm","]",")","else",":","self",".","perms",".","append","(","perm",")","self",".","perms",".","sort","(",")","self",".","object_type","=","fields","[","3","]","self",".","inherited_type","=","fields","[","4","]","self",".","sid","=","fields","[","5","]","self",".","trustee","=","None","if","TRUSTEE",".","__contains__","(","fields","[","5","]",")",":","self",".","trustee","=","TRUSTEE","[","fields","[","5","]","]","if","os",".","name","==","'nt'",":","if","not","self",".","trustee",":","self",".","trustee","=","TranslateSid","(","fields","[","5","]",")","if","not","self",".","trustee",":","self",".","trustee","=","'Unknown or invalid SID.'"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/SDDL3\/SDDL3.py#L272-L325"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/SDDL3\/SDDL3.py","language":"python","identifier":"SDDL.__init__","parameters":"(self, sddl_string, target=None)","argument_list":"","return_statement":"","docstring":"Initializes the SDDL object.\n\n Args:\n input_string: The SDDL string representation of the ACL\n target: Some values of the SDDL string change their meaning depending\n on the type of object they describe.\n Note: The only supported type right now is 'service'\n\n Raises:\n SDDLInvalidStringError: if the string doesn't appear to be valid","docstring_summary":"Initializes the SDDL object.","docstring_tokens":["Initializes","the","SDDL","object","."],"function":"def __init__(self, sddl_string, target=None):\n \"\"\"Initializes the SDDL object.\n\n Args:\n input_string: The SDDL string representation of the ACL\n target: Some values of the SDDL string change their meaning depending\n on the type of object they describe.\n Note: The only supported type right now is 'service'\n\n Raises:\n SDDLInvalidStringError: if the string doesn't appear to be valid\n \"\"\"\n self.target = target\n self.sddl_string = sddl_string\n self.sddl_type = None\n self.sddl_dacl = None\n self.sddl_sacl = None\n self.acl = []\n self.dacl = []\n self.sacl = []\n self.dacl_flags = []\n self.sacl_flags = []\n sddl_owner_part = re.search(re_owner, sddl_string)\n sddl_group_part = re.search(re_group, sddl_string)\n sddl_acl_part = re.search(re_acl, sddl_string)\n sddl_dacl_part = re.search(re_dacl, sddl_string)\n sddl_sacl_part = re.search(re_sacl, sddl_string)\n self.ACCESS = ACCESS\n self.group_sid = None\n self.group_account = None\n self.owner_sid = None\n self.owner_account = None\n\n if self.target == 'service':\n self.ACCESS['CC'] = 'Query Configuration'\n self.ACCESS['DC'] = 'Change Configuration'\n self.ACCESS['LC'] = 'Query State'\n self.ACCESS['SW'] = 'Enumerate Dependencies'\n self.ACCESS['RP'] = 'Start'\n self.ACCESS['WP'] = 'Stop'\n self.ACCESS['DT'] = 'Pause'\n self.ACCESS['LO'] = 'Interrogate'\n self.ACCESS['CR'] = 'User Defined'\n self.ACCESS['SD'] = 'Delete'\n self.ACCESS['RC'] = 'Read the Security Descriptor'\n self.ACCESS['WD'] = 'Change Permissions'\n self.ACCESS['WO'] = 'Change Owner'\n\n for match in (sddl_owner_part, sddl_group_part, sddl_dacl_part, sddl_sacl_part):\n try:\n part = match.group()\n sddl_prefix = re.match(re_type, part).group()\n except:\n part = ''\n pass\n# sddl_prefix = re.match(re_type, part).group()\n \n if (sddl_prefix == 'D'):\n self.sddl_dacl = SDDL_TYPE[sddl_prefix]\n dacl_flags = re.search(re_acl_flags, part)\n if dacl_flags is not None:\n for flag in re.findall(re_flags, dacl_flags.group(1)):\n if ACL_FLAGS[flag]:\n self.dacl_flags.append(ACL_FLAGS[flag])\n for perms in re.findall(re_perms, part):\n self.dacl.append(ACE(perms))\n \n elif (sddl_prefix == 'S'):\n self.sddl_sacl = SDDL_TYPE[sddl_prefix]\n sacl_flags = re.search(re_acl_flags, part)\n if sacl_flags is not None:\n for flag in re.findall(re_flags, sacl_flags.group(1)):\n if ACL_FLAGS[flag]:\n self.sacl_flags.append(ACL_FLAGS[flag])\n for perms in re.findall(re_perms, part):\n self.sacl.append(ACE(perms))\n\n elif (sddl_prefix == 'G'):\n self.group_sid = re.search(re_non_acl, part).group()\n\n if self.group_sid in TRUSTEE:\n self.group_account = TRUSTEE[self.group_sid]\n else:\n if os.name == 'nt':\n self.group_account = TranslateSid(self.group_sid)\n\n if not self.group_account:\n self.group_account = 'Unknown'\n\n elif (sddl_prefix == 'O'):\n self.owner_sid = re.search(re_non_acl, part).group()\n\n if self.owner_sid in TRUSTEE:\n self.owner_account = TRUSTEE[self.owner_sid]\n else:\n if os.name == 'nt':\n self.owner_account = TranslateSid(self.owner_sid)\n\n if not self.owner_account:\n self.owner_account = 'Unknown'\n\n else:\n raise InvalidSddlStringError","function_tokens":["def","__init__","(","self",",","sddl_string",",","target","=","None",")",":","self",".","target","=","target","self",".","sddl_string","=","sddl_string","self",".","sddl_type","=","None","self",".","sddl_dacl","=","None","self",".","sddl_sacl","=","None","self",".","acl","=","[","]","self",".","dacl","=","[","]","self",".","sacl","=","[","]","self",".","dacl_flags","=","[","]","self",".","sacl_flags","=","[","]","sddl_owner_part","=","re",".","search","(","re_owner",",","sddl_string",")","sddl_group_part","=","re",".","search","(","re_group",",","sddl_string",")","sddl_acl_part","=","re",".","search","(","re_acl",",","sddl_string",")","sddl_dacl_part","=","re",".","search","(","re_dacl",",","sddl_string",")","sddl_sacl_part","=","re",".","search","(","re_sacl",",","sddl_string",")","self",".","ACCESS","=","ACCESS","self",".","group_sid","=","None","self",".","group_account","=","None","self",".","owner_sid","=","None","self",".","owner_account","=","None","if","self",".","target","==","'service'",":","self",".","ACCESS","[","'CC'","]","=","'Query Configuration'","self",".","ACCESS","[","'DC'","]","=","'Change Configuration'","self",".","ACCESS","[","'LC'","]","=","'Query State'","self",".","ACCESS","[","'SW'","]","=","'Enumerate Dependencies'","self",".","ACCESS","[","'RP'","]","=","'Start'","self",".","ACCESS","[","'WP'","]","=","'Stop'","self",".","ACCESS","[","'DT'","]","=","'Pause'","self",".","ACCESS","[","'LO'","]","=","'Interrogate'","self",".","ACCESS","[","'CR'","]","=","'User Defined'","self",".","ACCESS","[","'SD'","]","=","'Delete'","self",".","ACCESS","[","'RC'","]","=","'Read the Security Descriptor'","self",".","ACCESS","[","'WD'","]","=","'Change Permissions'","self",".","ACCESS","[","'WO'","]","=","'Change Owner'","for","match","in","(","sddl_owner_part",",","sddl_group_part",",","sddl_dacl_part",",","sddl_sacl_part",")",":","try",":","part","=","match",".","group","(",")","sddl_prefix","=","re",".","match","(","re_type",",","part",")",".","group","(",")","except",":","part","=","''","pass","# sddl_prefix = re.match(re_type, part).group()","if","(","sddl_prefix","==","'D'",")",":","self",".","sddl_dacl","=","SDDL_TYPE","[","sddl_prefix","]","dacl_flags","=","re",".","search","(","re_acl_flags",",","part",")","if","dacl_flags","is","not","None",":","for","flag","in","re",".","findall","(","re_flags",",","dacl_flags",".","group","(","1",")",")",":","if","ACL_FLAGS","[","flag","]",":","self",".","dacl_flags",".","append","(","ACL_FLAGS","[","flag","]",")","for","perms","in","re",".","findall","(","re_perms",",","part",")",":","self",".","dacl",".","append","(","ACE","(","perms",")",")","elif","(","sddl_prefix","==","'S'",")",":","self",".","sddl_sacl","=","SDDL_TYPE","[","sddl_prefix","]","sacl_flags","=","re",".","search","(","re_acl_flags",",","part",")","if","sacl_flags","is","not","None",":","for","flag","in","re",".","findall","(","re_flags",",","sacl_flags",".","group","(","1",")",")",":","if","ACL_FLAGS","[","flag","]",":","self",".","sacl_flags",".","append","(","ACL_FLAGS","[","flag","]",")","for","perms","in","re",".","findall","(","re_perms",",","part",")",":","self",".","sacl",".","append","(","ACE","(","perms",")",")","elif","(","sddl_prefix","==","'G'",")",":","self",".","group_sid","=","re",".","search","(","re_non_acl",",","part",")",".","group","(",")","if","self",".","group_sid","in","TRUSTEE",":","self",".","group_account","=","TRUSTEE","[","self",".","group_sid","]","else",":","if","os",".","name","==","'nt'",":","self",".","group_account","=","TranslateSid","(","self",".","group_sid",")","if","not","self",".","group_account",":","self",".","group_account","=","'Unknown'","elif","(","sddl_prefix","==","'O'",")",":","self",".","owner_sid","=","re",".","search","(","re_non_acl",",","part",")",".","group","(",")","if","self",".","owner_sid","in","TRUSTEE",":","self",".","owner_account","=","TRUSTEE","[","self",".","owner_sid","]","else",":","if","os",".","name","==","'nt'",":","self",".","owner_account","=","TranslateSid","(","self",".","owner_sid",")","if","not","self",".","owner_account",":","self",".","owner_account","=","'Unknown'","else",":","raise","InvalidSddlStringError"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/SDDL3\/SDDL3.py#L331-L433"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/vol_Parser.py","language":"python","identifier":"PrintedProgress.__call__","parameters":"(self, progress: Union[int, float], description: str = None)","argument_list":"","return_statement":"","docstring":"A simple function for providing text-based feedback.\n\n .. warning:: Only for development use.\n\n Args:\n progress: Percentage of progress of the current procedure","docstring_summary":"A simple function for providing text-based feedback.","docstring_tokens":["A","simple","function","for","providing","text","-","based","feedback","."],"function":"def __call__(self, progress: Union[int, float], description: str = None):\n \"\"\"A simple function for providing text-based feedback.\n\n .. warning:: Only for development use.\n\n Args:\n progress: Percentage of progress of the current procedure\n \"\"\"\n message = \"\\rProgress: {0: 7.2f}\\t\\t{1:}\".format(round(progress, 2), description or '')\n message_len = len(message)\n self._max_message_len = max([self._max_message_len, message_len])","function_tokens":["def","__call__","(","self",",","progress",":","Union","[","int",",","float","]",",","description",":","str","=","None",")",":","message","=","\"\\rProgress: {0: 7.2f}\\t\\t{1:}\"",".","format","(","round","(","progress",",","2",")",",","description","or","''",")","message_len","=","len","(","message",")","self",".","_max_message_len","=","max","(","[","self",".","_max_message_len",",","message_len","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/vol_Parser.py#L63-L73"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/__init__.py","language":"python","identifier":"WarningFindSpec.find_spec","parameters":"(fullname: str, path, target = None)","argument_list":"","return_statement":"","docstring":"Mock find_spec method that just checks the name, this must go\n first.","docstring_summary":"Mock find_spec method that just checks the name, this must go\n first.","docstring_tokens":["Mock","find_spec","method","that","just","checks","the","name","this","must","go","first","."],"function":"def find_spec(fullname: str, path, target = None):\n \"\"\"Mock find_spec method that just checks the name, this must go\n first.\"\"\"\n if fullname.startswith(\"volatility.framework.plugins.\"):\n warning = \"Please do not use the volatility.framework.plugins namespace directly, only use volatility.plugins\"\n # Pyinstaller uses walk_packages to import, but needs to read the modules to figure out dependencies\n # As such, we only print the warning when directly imported rather than from within walk_packages\n if inspect.stack()[-2].function != 'walk_packages':\n raise Warning(warning)","function_tokens":["def","find_spec","(","fullname",":","str",",","path",",","target","=","None",")",":","if","fullname",".","startswith","(","\"volatility.framework.plugins.\"",")",":","warning","=","\"Please do not use the volatility.framework.plugins namespace directly, only use volatility.plugins\"","# Pyinstaller uses walk_packages to import, but needs to read the modules to figure out dependencies","# As such, we only print the warning when directly imported rather than from within walk_packages","if","inspect",".","stack","(",")","[","-","2","]",".","function","!=","'walk_packages'",":","raise","Warning","(","warning",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/__init__.py#L35-L43"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py","language":"python","identifier":"main","parameters":"()","argument_list":"","return_statement":"","docstring":"A convenience function for constructing and running the\n :class:`CommandLine`'s run method.","docstring_summary":"A convenience function for constructing and running the\n :class:`CommandLine`'s run method.","docstring_tokens":["A","convenience","function","for","constructing","and","running","the",":","class",":","CommandLine","s","run","method","."],"function":"def main():\n \"\"\"A convenience function for constructing and running the\n :class:`CommandLine`'s run method.\"\"\"\n CommandLine().run()","function_tokens":["def","main","(",")",":","CommandLine","(",")",".","run","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py#L580-L583"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py","language":"python","identifier":"PrintedProgress.__call__","parameters":"(self, progress: Union[int, float], description: str = None)","argument_list":"","return_statement":"","docstring":"A simple function for providing text-based feedback.\n\n .. warning:: Only for development use.\n\n Args:\n progress: Percentage of progress of the current procedure","docstring_summary":"A simple function for providing text-based feedback.","docstring_tokens":["A","simple","function","for","providing","text","-","based","feedback","."],"function":"def __call__(self, progress: Union[int, float], description: str = None):\n \"\"\"A simple function for providing text-based feedback.\n\n .. warning:: Only for development use.\n\n Args:\n progress: Percentage of progress of the current procedure\n \"\"\"\n message = \"\\rProgress: {0: 7.2f}\\t\\t{1:}\".format(round(progress, 2), description or '')\n message_len = len(message)\n self._max_message_len = max([self._max_message_len, message_len])\n sys.stderr.write(message + (' ' * (self._max_message_len - message_len)) + '\\r')","function_tokens":["def","__call__","(","self",",","progress",":","Union","[","int",",","float","]",",","description",":","str","=","None",")",":","message","=","\"\\rProgress: {0: 7.2f}\\t\\t{1:}\"",".","format","(","round","(","progress",",","2",")",",","description","or","''",")","message_len","=","len","(","message",")","self",".","_max_message_len","=","max","(","[","self",".","_max_message_len",",","message_len","]",")","sys",".","stderr",".","write","(","message","+","(","' '","*","(","self",".","_max_message_len","-","message_len",")",")","+","'\\r'",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py#L50-L61"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py","language":"python","identifier":"CommandLine.run","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Executes the command line module, taking the system arguments,\n determining the plugin to run and then running it.","docstring_summary":"Executes the command line module, taking the system arguments,\n determining the plugin to run and then running it.","docstring_tokens":["Executes","the","command","line","module","taking","the","system","arguments","determining","the","plugin","to","run","and","then","running","it","."],"function":"def run(self):\n \"\"\"Executes the command line module, taking the system arguments,\n determining the plugin to run and then running it.\"\"\"\n\n volatility.framework.require_interface_version(2, 0, 0)\n\n renderers = dict([(x.name.lower(), x) for x in framework.class_subclasses(text_renderer.CLIRenderer)])\n\n parser = volargparse.HelpfulArgParser(add_help = False,\n prog = self.CLI_NAME,\n description = \"An open-source memory forensics framework\")\n parser.add_argument(\n \"-h\",\n \"--help\",\n action = \"help\",\n default = argparse.SUPPRESS,\n help = \"Show this help message and exit, for specific plugin options use '{} --help'\".format(\n parser.prog))\n parser.add_argument(\"-c\",\n \"--config\",\n help = \"Load the configuration from a json file\",\n default = None,\n type = str)\n parser.add_argument(\"--parallelism\",\n help = \"Enables parallelism (defaults to processes if no argument given)\",\n nargs = '?',\n choices = ['processes', 'threads', 'off'],\n const = 'processes',\n default = None,\n type = str)\n parser.add_argument(\"-e\",\n \"--extend\",\n help = \"Extend the configuration with a new (or changed) setting\",\n default = None,\n action = 'append')\n parser.add_argument(\"-p\",\n \"--plugin-dirs\",\n help = \"Semi-colon separated list of paths to find plugins\",\n default = \"\",\n type = str)\n parser.add_argument(\"-s\",\n \"--symbol-dirs\",\n help = \"Semi-colon separated list of paths to find symbols\",\n default = \"\",\n type = str)\n parser.add_argument(\"-v\", \"--verbosity\", help = \"Increase output verbosity\", default = 0, action = \"count\")\n parser.add_argument(\"-l\",\n \"--log\",\n help = \"Log output to a file as well as the console\",\n default = None,\n type = str)\n parser.add_argument(\"-o\",\n \"--output-dir\",\n help = \"Directory in which to output any generated files\",\n default = os.getcwd(),\n type = str)\n parser.add_argument(\"-q\", \"--quiet\", help = \"Remove progress feedback\", default = False, action = 'store_true')\n parser.add_argument(\"-r\",\n \"--renderer\",\n metavar = 'RENDERER',\n help = \"Determines how to render the output ({})\".format(\", \".join(list(renderers))),\n default = \"quick\",\n choices = list(renderers))\n parser.add_argument(\"-f\",\n \"--file\",\n metavar = 'FILE',\n default = None,\n type = str,\n help = \"Shorthand for --single-location=file:\/\/ if single-location is not defined\")\n parser.add_argument(\"--write-config\",\n help = \"Write configuration JSON file out to config.json\",\n default = False,\n action = 'store_true')\n parser.add_argument(\"--clear-cache\",\n help = \"Clears out all short-term cached items\",\n default = False,\n action = 'store_true')\n\n # We have to filter out help, otherwise parse_known_args will trigger the help message before having\n # processed the plugin choice or had the plugin subparser added.\n known_args = [arg for arg in sys.argv if arg != '--help' and arg != '-h']\n partial_args, _ = parser.parse_known_args(known_args)\n\n banner_output = sys.stdout\n if renderers[partial_args.renderer].structured_output:\n banner_output = sys.stderr\n banner_output.write(\"Volatility 3 Framework {}\\n\".format(constants.PACKAGE_VERSION))\n\n if partial_args.plugin_dirs:\n volatility.plugins.__path__ = [os.path.abspath(p)\n for p in partial_args.plugin_dirs.split(\";\")] + constants.PLUGINS_PATH\n\n if partial_args.symbol_dirs:\n volatility.symbols.__path__ = [os.path.abspath(p)\n for p in partial_args.symbol_dirs.split(\";\")] + constants.SYMBOL_BASEPATHS\n\n if partial_args.log:\n file_logger = logging.FileHandler(partial_args.log)\n file_logger.setLevel(1)\n file_formatter = logging.Formatter(datefmt = '%y-%m-%d %H:%M:%S',\n fmt = '%(asctime)s %(name)-12s %(levelname)-8s %(message)s')\n file_logger.setFormatter(file_formatter)\n vollog.addHandler(file_logger)\n vollog.info(\"Logging started\")\n if partial_args.verbosity < 3:\n console.setLevel(30 - (partial_args.verbosity * 10))\n else:\n console.setLevel(10 - (partial_args.verbosity - 2))\n\n vollog.info(\"Volatility plugins path: {}\".format(volatility.plugins.__path__))\n vollog.info(\"Volatility symbols path: {}\".format(volatility.symbols.__path__))\n\n # Set the PARALLELISM\n if partial_args.parallelism == 'processes':\n constants.PARALLELISM = constants.Parallelism.Multiprocessing\n elif partial_args.parallelism == 'threads':\n constants.PARALLELISM = constants.Parallelism.Threading\n else:\n constants.PARALLELISM = constants.Parallelism.Off\n\n if partial_args.clear_cache:\n framework.clear_cache()\n\n # Do the initialization\n ctx = contexts.Context() # Construct a blank context\n failures = framework.import_files(volatility.plugins,\n True) # Will not log as console's default level is WARNING\n if failures:\n parser.epilog = \"The following plugins could not be loaded (use -vv to see why): \" + \\\n \", \".join(sorted(failures))\n vollog.info(parser.epilog)\n automagics = automagic.available(ctx)\n\n plugin_list = framework.list_plugins()\n\n seen_automagics = set()\n chosen_configurables_list = {}\n for amagic in automagics:\n if amagic in seen_automagics:\n continue\n seen_automagics.add(amagic)\n if isinstance(amagic, interfaces.configuration.ConfigurableInterface):\n self.populate_requirements_argparse(parser, amagic.__class__)\n\n subparser = parser.add_subparsers(title = \"Plugins\",\n dest = \"plugin\",\n description = \"For plugin specific options, run '{} --help'\".format(\n self.CLI_NAME),\n action = volargparse.HelpfulSubparserAction)\n for plugin in sorted(plugin_list):\n plugin_parser = subparser.add_parser(plugin, help = plugin_list[plugin].__doc__)\n self.populate_requirements_argparse(plugin_parser, plugin_list[plugin])\n\n ###\n # PASS TO UI\n ###\n # Hand the plugin requirements over to the CLI (us) and let it construct the config tree\n\n # Run the argparser\n args = parser.parse_args()\n if args.plugin is None:\n parser.error(\"Please select a plugin to run\")\n\n vollog.log(constants.LOGLEVEL_VVV, \"Cache directory used: {}\".format(constants.CACHE_PATH))\n\n plugin = plugin_list[args.plugin]\n chosen_configurables_list[args.plugin] = plugin\n base_config_path = \"plugins\"\n plugin_config_path = interfaces.configuration.path_join(base_config_path, plugin.__name__)\n\n # Special case the -f argument because people use is so frequently\n # It has to go here so it can be overridden by single-location if it's defined\n # NOTE: This will *BREAK* if LayerStacker, or the automagic configuration system, changes at all\n ###\n if args.file:\n file_name = os.path.abspath(args.file)\n if not os.path.exists(file_name):\n vollog.log(logging.INFO, \"File does not exist: {}\".format(file_name))\n else:\n single_location = \"file:\" + request.pathname2url(file_name)\n ctx.config['automagic.LayerStacker.single_location'] = single_location\n\n # UI fills in the config, here we load it from the config file and do it before we process the CL parameters\n if args.config:\n with open(args.config, \"r\") as f:\n json_val = json.load(f)\n ctx.config.splice(plugin_config_path, interfaces.configuration.HierarchicalDict(json_val))\n\n # It should be up to the UI to determine which automagics to run, so this is before BACK TO THE FRAMEWORK\n automagics = automagic.choose_automagic(automagics, plugin)\n for amagic in automagics:\n chosen_configurables_list[amagic.__class__.__name__] = amagic\n\n if ctx.config.get('automagic.LayerStacker.stackers', None) is None:\n ctx.config['automagic.LayerStacker.stackers'] = stacker.choose_os_stackers(plugin)\n self.output_dir = args.output_dir\n\n self.populate_config(ctx, chosen_configurables_list, args, plugin_config_path)\n\n if args.extend:\n for extension in args.extend:\n if '=' not in extension:\n raise ValueError(\"Invalid extension (extensions must be of the format \\\"conf.path.value='value'\\\")\")\n address, value = extension[:extension.find('=')], json.loads(extension[extension.find('=') + 1:])\n ctx.config[address] = value\n\n ###\n # BACK TO THE FRAMEWORK\n ###\n constructed = None\n try:\n progress_callback = PrintedProgress()\n if args.quiet:\n progress_callback = MuteProgress()\n\n constructed = plugins.construct_plugin(ctx, automagics, plugin, base_config_path, progress_callback,\n self.file_handler_class_factory())\n\n if args.write_config:\n vollog.debug(\"Writing out configuration data to config.json\")\n with open(\"config.json\", \"w\") as f:\n json.dump(dict(constructed.build_configuration()), f, sort_keys = True, indent = 2)\n except exceptions.UnsatisfiedException as excp:\n self.process_unsatisfied_exceptions(excp)\n parser.exit(1, \"Unable to validate the plugin requirements: {}\\n\".format([x for x in excp.unsatisfied]))\n\n try:\n # Construct and run the plugin\n if constructed:\n renderers[args.renderer]().render(constructed.run())\n except (exceptions.VolatilityException) as excp:\n self.process_exceptions(excp)","function_tokens":["def","run","(","self",")",":","volatility",".","framework",".","require_interface_version","(","2",",","0",",","0",")","renderers","=","dict","(","[","(","x",".","name",".","lower","(",")",",","x",")","for","x","in","framework",".","class_subclasses","(","text_renderer",".","CLIRenderer",")","]",")","parser","=","volargparse",".","HelpfulArgParser","(","add_help","=","False",",","prog","=","self",".","CLI_NAME",",","description","=","\"An open-source memory forensics framework\"",")","parser",".","add_argument","(","\"-h\"",",","\"--help\"",",","action","=","\"help\"",",","default","=","argparse",".","SUPPRESS",",","help","=","\"Show this help message and exit, for specific plugin options use '{} --help'\"",".","format","(","parser",".","prog",")",")","parser",".","add_argument","(","\"-c\"",",","\"--config\"",",","help","=","\"Load the configuration from a json file\"",",","default","=","None",",","type","=","str",")","parser",".","add_argument","(","\"--parallelism\"",",","help","=","\"Enables parallelism (defaults to processes if no argument given)\"",",","nargs","=","'?'",",","choices","=","[","'processes'",",","'threads'",",","'off'","]",",","const","=","'processes'",",","default","=","None",",","type","=","str",")","parser",".","add_argument","(","\"-e\"",",","\"--extend\"",",","help","=","\"Extend the configuration with a new (or changed) setting\"",",","default","=","None",",","action","=","'append'",")","parser",".","add_argument","(","\"-p\"",",","\"--plugin-dirs\"",",","help","=","\"Semi-colon separated list of paths to find plugins\"",",","default","=","\"\"",",","type","=","str",")","parser",".","add_argument","(","\"-s\"",",","\"--symbol-dirs\"",",","help","=","\"Semi-colon separated list of paths to find symbols\"",",","default","=","\"\"",",","type","=","str",")","parser",".","add_argument","(","\"-v\"",",","\"--verbosity\"",",","help","=","\"Increase output verbosity\"",",","default","=","0",",","action","=","\"count\"",")","parser",".","add_argument","(","\"-l\"",",","\"--log\"",",","help","=","\"Log output to a file as well as the console\"",",","default","=","None",",","type","=","str",")","parser",".","add_argument","(","\"-o\"",",","\"--output-dir\"",",","help","=","\"Directory in which to output any generated files\"",",","default","=","os",".","getcwd","(",")",",","type","=","str",")","parser",".","add_argument","(","\"-q\"",",","\"--quiet\"",",","help","=","\"Remove progress feedback\"",",","default","=","False",",","action","=","'store_true'",")","parser",".","add_argument","(","\"-r\"",",","\"--renderer\"",",","metavar","=","'RENDERER'",",","help","=","\"Determines how to render the output ({})\"",".","format","(","\", \"",".","join","(","list","(","renderers",")",")",")",",","default","=","\"quick\"",",","choices","=","list","(","renderers",")",")","parser",".","add_argument","(","\"-f\"",",","\"--file\"",",","metavar","=","'FILE'",",","default","=","None",",","type","=","str",",","help","=","\"Shorthand for --single-location=file:\/\/ if single-location is not defined\"",")","parser",".","add_argument","(","\"--write-config\"",",","help","=","\"Write configuration JSON file out to config.json\"",",","default","=","False",",","action","=","'store_true'",")","parser",".","add_argument","(","\"--clear-cache\"",",","help","=","\"Clears out all short-term cached items\"",",","default","=","False",",","action","=","'store_true'",")","# We have to filter out help, otherwise parse_known_args will trigger the help message before having","# processed the plugin choice or had the plugin subparser added.","known_args","=","[","arg","for","arg","in","sys",".","argv","if","arg","!=","'--help'","and","arg","!=","'-h'","]","partial_args",",","_","=","parser",".","parse_known_args","(","known_args",")","banner_output","=","sys",".","stdout","if","renderers","[","partial_args",".","renderer","]",".","structured_output",":","banner_output","=","sys",".","stderr","banner_output",".","write","(","\"Volatility 3 Framework {}\\n\"",".","format","(","constants",".","PACKAGE_VERSION",")",")","if","partial_args",".","plugin_dirs",":","volatility",".","plugins",".","__path__","=","[","os",".","path",".","abspath","(","p",")","for","p","in","partial_args",".","plugin_dirs",".","split","(","\";\"",")","]","+","constants",".","PLUGINS_PATH","if","partial_args",".","symbol_dirs",":","volatility",".","symbols",".","__path__","=","[","os",".","path",".","abspath","(","p",")","for","p","in","partial_args",".","symbol_dirs",".","split","(","\";\"",")","]","+","constants",".","SYMBOL_BASEPATHS","if","partial_args",".","log",":","file_logger","=","logging",".","FileHandler","(","partial_args",".","log",")","file_logger",".","setLevel","(","1",")","file_formatter","=","logging",".","Formatter","(","datefmt","=","'%y-%m-%d %H:%M:%S'",",","fmt","=","'%(asctime)s %(name)-12s %(levelname)-8s %(message)s'",")","file_logger",".","setFormatter","(","file_formatter",")","vollog",".","addHandler","(","file_logger",")","vollog",".","info","(","\"Logging started\"",")","if","partial_args",".","verbosity","<","3",":","console",".","setLevel","(","30","-","(","partial_args",".","verbosity","*","10",")",")","else",":","console",".","setLevel","(","10","-","(","partial_args",".","verbosity","-","2",")",")","vollog",".","info","(","\"Volatility plugins path: {}\"",".","format","(","volatility",".","plugins",".","__path__",")",")","vollog",".","info","(","\"Volatility symbols path: {}\"",".","format","(","volatility",".","symbols",".","__path__",")",")","# Set the PARALLELISM","if","partial_args",".","parallelism","==","'processes'",":","constants",".","PARALLELISM","=","constants",".","Parallelism",".","Multiprocessing","elif","partial_args",".","parallelism","==","'threads'",":","constants",".","PARALLELISM","=","constants",".","Parallelism",".","Threading","else",":","constants",".","PARALLELISM","=","constants",".","Parallelism",".","Off","if","partial_args",".","clear_cache",":","framework",".","clear_cache","(",")","# Do the initialization","ctx","=","contexts",".","Context","(",")","# Construct a blank context","failures","=","framework",".","import_files","(","volatility",".","plugins",",","True",")","# Will not log as console's default level is WARNING","if","failures",":","parser",".","epilog","=","\"The following plugins could not be loaded (use -vv to see why): \"","+","\", \"",".","join","(","sorted","(","failures",")",")","vollog",".","info","(","parser",".","epilog",")","automagics","=","automagic",".","available","(","ctx",")","plugin_list","=","framework",".","list_plugins","(",")","seen_automagics","=","set","(",")","chosen_configurables_list","=","{","}","for","amagic","in","automagics",":","if","amagic","in","seen_automagics",":","continue","seen_automagics",".","add","(","amagic",")","if","isinstance","(","amagic",",","interfaces",".","configuration",".","ConfigurableInterface",")",":","self",".","populate_requirements_argparse","(","parser",",","amagic",".","__class__",")","subparser","=","parser",".","add_subparsers","(","title","=","\"Plugins\"",",","dest","=","\"plugin\"",",","description","=","\"For plugin specific options, run '{} --help'\"",".","format","(","self",".","CLI_NAME",")",",","action","=","volargparse",".","HelpfulSubparserAction",")","for","plugin","in","sorted","(","plugin_list",")",":","plugin_parser","=","subparser",".","add_parser","(","plugin",",","help","=","plugin_list","[","plugin","]",".","__doc__",")","self",".","populate_requirements_argparse","(","plugin_parser",",","plugin_list","[","plugin","]",")","###","# PASS TO UI","###","# Hand the plugin requirements over to the CLI (us) and let it construct the config tree","# Run the argparser","args","=","parser",".","parse_args","(",")","if","args",".","plugin","is","None",":","parser",".","error","(","\"Please select a plugin to run\"",")","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Cache directory used: {}\"",".","format","(","constants",".","CACHE_PATH",")",")","plugin","=","plugin_list","[","args",".","plugin","]","chosen_configurables_list","[","args",".","plugin","]","=","plugin","base_config_path","=","\"plugins\"","plugin_config_path","=","interfaces",".","configuration",".","path_join","(","base_config_path",",","plugin",".","__name__",")","# Special case the -f argument because people use is so frequently","# It has to go here so it can be overridden by single-location if it's defined","# NOTE: This will *BREAK* if LayerStacker, or the automagic configuration system, changes at all","###","if","args",".","file",":","file_name","=","os",".","path",".","abspath","(","args",".","file",")","if","not","os",".","path",".","exists","(","file_name",")",":","vollog",".","log","(","logging",".","INFO",",","\"File does not exist: {}\"",".","format","(","file_name",")",")","else",":","single_location","=","\"file:\"","+","request",".","pathname2url","(","file_name",")","ctx",".","config","[","'automagic.LayerStacker.single_location'","]","=","single_location","# UI fills in the config, here we load it from the config file and do it before we process the CL parameters","if","args",".","config",":","with","open","(","args",".","config",",","\"r\"",")","as","f",":","json_val","=","json",".","load","(","f",")","ctx",".","config",".","splice","(","plugin_config_path",",","interfaces",".","configuration",".","HierarchicalDict","(","json_val",")",")","# It should be up to the UI to determine which automagics to run, so this is before BACK TO THE FRAMEWORK","automagics","=","automagic",".","choose_automagic","(","automagics",",","plugin",")","for","amagic","in","automagics",":","chosen_configurables_list","[","amagic",".","__class__",".","__name__","]","=","amagic","if","ctx",".","config",".","get","(","'automagic.LayerStacker.stackers'",",","None",")","is","None",":","ctx",".","config","[","'automagic.LayerStacker.stackers'","]","=","stacker",".","choose_os_stackers","(","plugin",")","self",".","output_dir","=","args",".","output_dir","self",".","populate_config","(","ctx",",","chosen_configurables_list",",","args",",","plugin_config_path",")","if","args",".","extend",":","for","extension","in","args",".","extend",":","if","'='","not","in","extension",":","raise","ValueError","(","\"Invalid extension (extensions must be of the format \\\"conf.path.value='value'\\\")\"",")","address",",","value","=","extension","[",":","extension",".","find","(","'='",")","]",",","json",".","loads","(","extension","[","extension",".","find","(","'='",")","+","1",":","]",")","ctx",".","config","[","address","]","=","value","###","# BACK TO THE FRAMEWORK","###","constructed","=","None","try",":","progress_callback","=","PrintedProgress","(",")","if","args",".","quiet",":","progress_callback","=","MuteProgress","(",")","constructed","=","plugins",".","construct_plugin","(","ctx",",","automagics",",","plugin",",","base_config_path",",","progress_callback",",","self",".","file_handler_class_factory","(",")",")","if","args",".","write_config",":","vollog",".","debug","(","\"Writing out configuration data to config.json\"",")","with","open","(","\"config.json\"",",","\"w\"",")","as","f",":","json",".","dump","(","dict","(","constructed",".","build_configuration","(",")",")",",","f",",","sort_keys","=","True",",","indent","=","2",")","except","exceptions",".","UnsatisfiedException","as","excp",":","self",".","process_unsatisfied_exceptions","(","excp",")","parser",".","exit","(","1",",","\"Unable to validate the plugin requirements: {}\\n\"",".","format","(","[","x","for","x","in","excp",".","unsatisfied","]",")",")","try",":","# Construct and run the plugin","if","constructed",":","renderers","[","args",".","renderer","]","(",")",".","render","(","constructed",".","run","(",")",")","except","(","exceptions",".","VolatilityException",")","as","excp",":","self",".","process_exceptions","(","excp",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py#L86-L317"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py","language":"python","identifier":"CommandLine.process_exceptions","parameters":"(self, excp)","argument_list":"","return_statement":"","docstring":"Provide useful feedback if an exception occurs during a run of a plugin.","docstring_summary":"Provide useful feedback if an exception occurs during a run of a plugin.","docstring_tokens":["Provide","useful","feedback","if","an","exception","occurs","during","a","run","of","a","plugin","."],"function":"def process_exceptions(self, excp):\n \"\"\"Provide useful feedback if an exception occurs during a run of a plugin.\"\"\"\n # Ensure there's nothing in the cache\n sys.stdout.write(\"\\n\\n\")\n sys.stdout.flush()\n sys.stderr.flush()\n\n # Log the full exception at a high level for easy access\n fulltrace = traceback.TracebackException.from_exception(excp).format(chain = True)\n vollog.debug(\"\".join(fulltrace))\n\n if isinstance(excp, exceptions.InvalidAddressException):\n general = \"Volatility was unable to read a requested page:\"\n if isinstance(excp, exceptions.SwappedInvalidAddressException):\n detail = \"Swap error {} in layer {} ({})\".format(hex(excp.invalid_address), excp.layer_name, excp)\n caused_by = [\n \"No suitable swap file having been provided (locate and provide the correct swap file)\",\n \"An intentionally invalid page (operating system protection)\"\n ]\n elif isinstance(excp, exceptions.PagedInvalidAddressException):\n detail = \"Page error {} in layer {} ({})\".format(hex(excp.invalid_address), excp.layer_name, excp)\n caused_by = [\n \"Memory smear during acquisition (try re-acquiring if possible)\",\n \"An intentionally invalid page lookup (operating system protection)\",\n \"A bug in the plugin\/volatility (re-run with -vvv and file a bug)\"\n ]\n else:\n detail = \"{} in layer {} ({})\".format(hex(excp.invalid_address), excp.layer_name, excp)\n caused_by = [\n \"The base memory file being incomplete (try re-acquiring if possible)\",\n \"Memory smear during acquisition (try re-acquiring if possible)\",\n \"An intentionally invalid page lookup (operating system protection)\",\n \"A bug in the plugin\/volatility (re-run with -vvv and file a bug)\"\n ]\n elif isinstance(excp, exceptions.SymbolError):\n general = \"Volatility experienced a symbol-related issue:\"\n detail = \"{}{}{}: {}\".format(excp.table_name, constants.BANG, excp.symbol_name, excp)\n caused_by = [\n \"An invalid symbol table\",\n \"A plugin requesting a bad symbol\",\n \"A plugin requesting a symbol from the wrong table\",\n ]\n elif isinstance(excp, exceptions.SymbolSpaceError):\n general = \"Volatility experienced an issue related to a symbol table:\"\n detail = \"{}\".format(excp)\n caused_by = [\n \"An invalid symbol table\", \"A plugin requesting a bad symbol\",\n \"A plugin requesting a symbol from the wrong table\"\n ]\n elif isinstance(excp, exceptions.LayerException):\n general = \"Volatility experienced a layer-related issue: {}\".format(excp.layer_name)\n detail = \"{}\".format(excp)\n caused_by = [\"A faulty layer implementation (re-run with -vvv and file a bug)\"]\n elif isinstance(excp, exceptions.MissingModuleException):\n general = \"Volatility could not import a necessary module: {}\".format(excp.module)\n detail = \"{}\".format(excp)\n caused_by = [\"A required python module is not installed (install the module and re-run)\"]\n else:\n general = \"Volatilty encountered an unexpected situation.\"\n detail = \"\"\n caused_by = [\n \"Please re-run using with -vvv and file a bug with the output\", \"at {}\".format(constants.BUG_URL)\n ]\n\n # Code that actually renders the exception\n output = sys.stderr\n output.write(general + \"\\n\")\n output.write(detail + \"\\n\\n\")\n for cause in caused_by:\n output.write(\"\\t* \" + cause + \"\\n\")\n output.write(\"\\nNo further results will be produced\\n\")\n sys.exit(1)","function_tokens":["def","process_exceptions","(","self",",","excp",")",":","# Ensure there's nothing in the cache","sys",".","stdout",".","write","(","\"\\n\\n\"",")","sys",".","stdout",".","flush","(",")","sys",".","stderr",".","flush","(",")","# Log the full exception at a high level for easy access","fulltrace","=","traceback",".","TracebackException",".","from_exception","(","excp",")",".","format","(","chain","=","True",")","vollog",".","debug","(","\"\"",".","join","(","fulltrace",")",")","if","isinstance","(","excp",",","exceptions",".","InvalidAddressException",")",":","general","=","\"Volatility was unable to read a requested page:\"","if","isinstance","(","excp",",","exceptions",".","SwappedInvalidAddressException",")",":","detail","=","\"Swap error {} in layer {} ({})\"",".","format","(","hex","(","excp",".","invalid_address",")",",","excp",".","layer_name",",","excp",")","caused_by","=","[","\"No suitable swap file having been provided (locate and provide the correct swap file)\"",",","\"An intentionally invalid page (operating system protection)\"","]","elif","isinstance","(","excp",",","exceptions",".","PagedInvalidAddressException",")",":","detail","=","\"Page error {} in layer {} ({})\"",".","format","(","hex","(","excp",".","invalid_address",")",",","excp",".","layer_name",",","excp",")","caused_by","=","[","\"Memory smear during acquisition (try re-acquiring if possible)\"",",","\"An intentionally invalid page lookup (operating system protection)\"",",","\"A bug in the plugin\/volatility (re-run with -vvv and file a bug)\"","]","else",":","detail","=","\"{} in layer {} ({})\"",".","format","(","hex","(","excp",".","invalid_address",")",",","excp",".","layer_name",",","excp",")","caused_by","=","[","\"The base memory file being incomplete (try re-acquiring if possible)\"",",","\"Memory smear during acquisition (try re-acquiring if possible)\"",",","\"An intentionally invalid page lookup (operating system protection)\"",",","\"A bug in the plugin\/volatility (re-run with -vvv and file a bug)\"","]","elif","isinstance","(","excp",",","exceptions",".","SymbolError",")",":","general","=","\"Volatility experienced a symbol-related issue:\"","detail","=","\"{}{}{}: {}\"",".","format","(","excp",".","table_name",",","constants",".","BANG",",","excp",".","symbol_name",",","excp",")","caused_by","=","[","\"An invalid symbol table\"",",","\"A plugin requesting a bad symbol\"",",","\"A plugin requesting a symbol from the wrong table\"",",","]","elif","isinstance","(","excp",",","exceptions",".","SymbolSpaceError",")",":","general","=","\"Volatility experienced an issue related to a symbol table:\"","detail","=","\"{}\"",".","format","(","excp",")","caused_by","=","[","\"An invalid symbol table\"",",","\"A plugin requesting a bad symbol\"",",","\"A plugin requesting a symbol from the wrong table\"","]","elif","isinstance","(","excp",",","exceptions",".","LayerException",")",":","general","=","\"Volatility experienced a layer-related issue: {}\"",".","format","(","excp",".","layer_name",")","detail","=","\"{}\"",".","format","(","excp",")","caused_by","=","[","\"A faulty layer implementation (re-run with -vvv and file a bug)\"","]","elif","isinstance","(","excp",",","exceptions",".","MissingModuleException",")",":","general","=","\"Volatility could not import a necessary module: {}\"",".","format","(","excp",".","module",")","detail","=","\"{}\"",".","format","(","excp",")","caused_by","=","[","\"A required python module is not installed (install the module and re-run)\"","]","else",":","general","=","\"Volatilty encountered an unexpected situation.\"","detail","=","\"\"","caused_by","=","[","\"Please re-run using with -vvv and file a bug with the output\"",",","\"at {}\"",".","format","(","constants",".","BUG_URL",")","]","# Code that actually renders the exception","output","=","sys",".","stderr","output",".","write","(","general","+","\"\\n\"",")","output",".","write","(","detail","+","\"\\n\\n\"",")","for","cause","in","caused_by",":","output",".","write","(","\"\\t* \"","+","cause","+","\"\\n\"",")","output",".","write","(","\"\\nNo further results will be produced\\n\"",")","sys",".","exit","(","1",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py#L319-L390"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py","language":"python","identifier":"CommandLine.process_unsatisfied_exceptions","parameters":"(self, excp)","argument_list":"","return_statement":"","docstring":"Provide useful feedback if an exception occurs during requirement fulfillment.","docstring_summary":"Provide useful feedback if an exception occurs during requirement fulfillment.","docstring_tokens":["Provide","useful","feedback","if","an","exception","occurs","during","requirement","fulfillment","."],"function":"def process_unsatisfied_exceptions(self, excp):\n \"\"\"Provide useful feedback if an exception occurs during requirement fulfillment.\"\"\"\n # Add a blank newline\n print(\"\")\n translation_failed = False\n symbols_failed = False\n for config_path in excp.unsatisfied:\n translation_failed = translation_failed or isinstance(\n excp.unsatisfied[config_path], configuration.requirements.TranslationLayerRequirement)\n symbols_failed = symbols_failed or isinstance(excp.unsatisfied[config_path],\n configuration.requirements.SymbolTableRequirement)\n\n print(\"Unsatisfied requirement {}: {}\".format(config_path, excp.unsatisfied[config_path].description))\n\n if symbols_failed:\n print(\"\\nA symbol table requirement was not fulfilled. Please verify that:\\n\"\n \"\\tYou have the correct symbol file for the requirement\\n\"\n \"\\tThe symbol file is under the correct directory or zip file\\n\"\n \"\\tThe symbol file is named appropriately or contains the correct banner\\n\")\n if translation_failed:\n print(\"\\nA translation layer requirement was not fulfilled. Please verify that:\\n\"\n \"\\tA file was provided to create this layer (by -f, --single-location or by config)\\n\"\n \"\\tThe file exists and is readable\\n\"\n \"\\tThe necessary symbols are present and identified by volatility\")","function_tokens":["def","process_unsatisfied_exceptions","(","self",",","excp",")",":","# Add a blank newline","print","(","\"\"",")","translation_failed","=","False","symbols_failed","=","False","for","config_path","in","excp",".","unsatisfied",":","translation_failed","=","translation_failed","or","isinstance","(","excp",".","unsatisfied","[","config_path","]",",","configuration",".","requirements",".","TranslationLayerRequirement",")","symbols_failed","=","symbols_failed","or","isinstance","(","excp",".","unsatisfied","[","config_path","]",",","configuration",".","requirements",".","SymbolTableRequirement",")","print","(","\"Unsatisfied requirement {}: {}\"",".","format","(","config_path",",","excp",".","unsatisfied","[","config_path","]",".","description",")",")","if","symbols_failed",":","print","(","\"\\nA symbol table requirement was not fulfilled. Please verify that:\\n\"","\"\\tYou have the correct symbol file for the requirement\\n\"","\"\\tThe symbol file is under the correct directory or zip file\\n\"","\"\\tThe symbol file is named appropriately or contains the correct banner\\n\"",")","if","translation_failed",":","print","(","\"\\nA translation layer requirement was not fulfilled. Please verify that:\\n\"","\"\\tA file was provided to create this layer (by -f, --single-location or by config)\\n\"","\"\\tThe file exists and is readable\\n\"","\"\\tThe necessary symbols are present and identified by volatility\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py#L392-L415"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py","language":"python","identifier":"CommandLine.populate_config","parameters":"(self, context: interfaces.context.ContextInterface,\n configurables_list: Dict[str, Type[interfaces.configuration.ConfigurableInterface]],\n args: argparse.Namespace, plugin_config_path: str)","argument_list":"","return_statement":"","docstring":"Populate the context config based on the returned args.\n\n We have already determined these elements must be descended from ConfigurableInterface\n\n Args:\n context: The volatility context to operate on\n configurables_list: A dictionary of configurable items that can be configured on the plugin\n args: An object containing the arguments necessary\n plugin_config_path: The path within the context's config containing the plugin's configuration","docstring_summary":"Populate the context config based on the returned args.","docstring_tokens":["Populate","the","context","config","based","on","the","returned","args","."],"function":"def populate_config(self, context: interfaces.context.ContextInterface,\n configurables_list: Dict[str, Type[interfaces.configuration.ConfigurableInterface]],\n args: argparse.Namespace, plugin_config_path: str) -> None:\n \"\"\"Populate the context config based on the returned args.\n\n We have already determined these elements must be descended from ConfigurableInterface\n\n Args:\n context: The volatility context to operate on\n configurables_list: A dictionary of configurable items that can be configured on the plugin\n args: An object containing the arguments necessary\n plugin_config_path: The path within the context's config containing the plugin's configuration\n \"\"\"\n vargs = vars(args)\n for configurable in configurables_list:\n for requirement in configurables_list[configurable].get_requirements():\n value = vargs.get(requirement.name, None)\n \n if value is not None:\n if isinstance(requirement, requirements.URIRequirement):\n if isinstance(value, str):\n if not parse.urlparse(value).scheme:\n if not os.path.exists(value):\n raise FileNotFoundError(\n \"Non-existant file {} passed to URIRequirement\".format(value))\n value = \"file:\/\/\" + request.pathname2url(os.path.abspath(value))\n if isinstance(requirement, requirements.ListRequirement):\n if not isinstance(value, list):\n raise TypeError(\"Configuration for ListRequirement was not a list: {}\".format(\n requirement.name))\n value = [requirement.element_type(x) for x in value]\n if not inspect.isclass(configurables_list[configurable]):\n config_path = configurables_list[configurable].config_path\n else:\n # We must be the plugin, so name it appropriately:\n config_path = plugin_config_path\n extended_path = interfaces.configuration.path_join(config_path, requirement.name)\n context.config[extended_path] = value","function_tokens":["def","populate_config","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","configurables_list",":","Dict","[","str",",","Type","[","interfaces",".","configuration",".","ConfigurableInterface","]","]",",","args",":","argparse",".","Namespace",",","plugin_config_path",":","str",")","->","None",":","vargs","=","vars","(","args",")","for","configurable","in","configurables_list",":","for","requirement","in","configurables_list","[","configurable","]",".","get_requirements","(",")",":","value","=","vargs",".","get","(","requirement",".","name",",","None",")","if","value","is","not","None",":","if","isinstance","(","requirement",",","requirements",".","URIRequirement",")",":","if","isinstance","(","value",",","str",")",":","if","not","parse",".","urlparse","(","value",")",".","scheme",":","if","not","os",".","path",".","exists","(","value",")",":","raise","FileNotFoundError","(","\"Non-existant file {} passed to URIRequirement\"",".","format","(","value",")",")","value","=","\"file:\/\/\"","+","request",".","pathname2url","(","os",".","path",".","abspath","(","value",")",")","if","isinstance","(","requirement",",","requirements",".","ListRequirement",")",":","if","not","isinstance","(","value",",","list",")",":","raise","TypeError","(","\"Configuration for ListRequirement was not a list: {}\"",".","format","(","requirement",".","name",")",")","value","=","[","requirement",".","element_type","(","x",")","for","x","in","value","]","if","not","inspect",".","isclass","(","configurables_list","[","configurable","]",")",":","config_path","=","configurables_list","[","configurable","]",".","config_path","else",":","# We must be the plugin, so name it appropriately:","config_path","=","plugin_config_path","extended_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","requirement",".","name",")","context",".","config","[","extended_path","]","=","value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py#L417-L454"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py","language":"python","identifier":"CommandLine.populate_requirements_argparse","parameters":"(self, parser: Union[argparse.ArgumentParser, argparse._ArgumentGroup],\n configurable: Type[interfaces.configuration.ConfigurableInterface])","argument_list":"","return_statement":"","docstring":"Adds the plugin's simple requirements to the provided parser.\n\n Args:\n parser: The parser to add the plugin's (simple) requirements to\n configurable: The plugin object to pull the requirements from","docstring_summary":"Adds the plugin's simple requirements to the provided parser.","docstring_tokens":["Adds","the","plugin","s","simple","requirements","to","the","provided","parser","."],"function":"def populate_requirements_argparse(self, parser: Union[argparse.ArgumentParser, argparse._ArgumentGroup],\n configurable: Type[interfaces.configuration.ConfigurableInterface]):\n \"\"\"Adds the plugin's simple requirements to the provided parser.\n\n Args:\n parser: The parser to add the plugin's (simple) requirements to\n configurable: The plugin object to pull the requirements from\n \"\"\"\n if not issubclass(configurable, interfaces.configuration.ConfigurableInterface):\n raise TypeError(\"Expected ConfigurableInterface type, not: {}\".format(type(configurable)))\n\n # Construct an argparse group\n\n for requirement in configurable.get_requirements():\n additional = {} # type: Dict[str, Any]\n if not isinstance(requirement, interfaces.configuration.RequirementInterface):\n raise TypeError(\"Plugin contains requirements that are not RequirementInterfaces: {}\".format(\n configurable.__name__))\n if isinstance(requirement, interfaces.configuration.SimpleTypeRequirement):\n additional[\"type\"] = requirement.instance_type\n if isinstance(requirement, requirements.IntRequirement):\n additional[\"type\"] = lambda x: int(x, 0)\n if isinstance(requirement, requirements.BooleanRequirement):\n additional[\"action\"] = \"store_true\"\n if \"type\" in additional:\n del additional[\"type\"]\n elif isinstance(requirement, volatility.framework.configuration.requirements.ListRequirement):\n additional[\"type\"] = requirement.element_type\n nargs = '*' if requirement.optional else '+'\n additional[\"nargs\"] = nargs\n elif isinstance(requirement, volatility.framework.configuration.requirements.ChoiceRequirement):\n additional[\"type\"] = str\n additional[\"choices\"] = requirement.choices\n else:\n continue\n parser.add_argument(\"--\" + requirement.name.replace('_', '-'),\n help = requirement.description,\n default = requirement.default,\n dest = requirement.name,\n required = not requirement.optional,\n **additional)","function_tokens":["def","populate_requirements_argparse","(","self",",","parser",":","Union","[","argparse",".","ArgumentParser",",","argparse",".","_ArgumentGroup","]",",","configurable",":","Type","[","interfaces",".","configuration",".","ConfigurableInterface","]",")",":","if","not","issubclass","(","configurable",",","interfaces",".","configuration",".","ConfigurableInterface",")",":","raise","TypeError","(","\"Expected ConfigurableInterface type, not: {}\"",".","format","(","type","(","configurable",")",")",")","# Construct an argparse group","for","requirement","in","configurable",".","get_requirements","(",")",":","additional","=","{","}","# type: Dict[str, Any]","if","not","isinstance","(","requirement",",","interfaces",".","configuration",".","RequirementInterface",")",":","raise","TypeError","(","\"Plugin contains requirements that are not RequirementInterfaces: {}\"",".","format","(","configurable",".","__name__",")",")","if","isinstance","(","requirement",",","interfaces",".","configuration",".","SimpleTypeRequirement",")",":","additional","[","\"type\"","]","=","requirement",".","instance_type","if","isinstance","(","requirement",",","requirements",".","IntRequirement",")",":","additional","[","\"type\"","]","=","lambda","x",":","int","(","x",",","0",")","if","isinstance","(","requirement",",","requirements",".","BooleanRequirement",")",":","additional","[","\"action\"","]","=","\"store_true\"","if","\"type\"","in","additional",":","del","additional","[","\"type\"","]","elif","isinstance","(","requirement",",","volatility",".","framework",".","configuration",".","requirements",".","ListRequirement",")",":","additional","[","\"type\"","]","=","requirement",".","element_type","nargs","=","'*'","if","requirement",".","optional","else","'+'","additional","[","\"nargs\"","]","=","nargs","elif","isinstance","(","requirement",",","volatility",".","framework",".","configuration",".","requirements",".","ChoiceRequirement",")",":","additional","[","\"type\"","]","=","str","additional","[","\"choices\"","]","=","requirement",".","choices","else",":","continue","parser",".","add_argument","(","\"--\"","+","requirement",".","name",".","replace","(","'_'",",","'-'",")",",","help","=","requirement",".","description",",","default","=","requirement",".","default",",","dest","=","requirement",".","name",",","required","=","not","requirement",".","optional",",","*","*","additional",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/__init__.py#L537-L577"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py","language":"python","identifier":"hex_bytes_as_text","parameters":"(value: bytes)","argument_list":"","return_statement":"return output","docstring":"Renders HexBytes as text.\n\n Args:\n value: A series of bytes to convert to text\n\n Returns:\n A text representation of the hexadecimal bytes plus their ascii equivalents, separated by newline characters","docstring_summary":"Renders HexBytes as text.","docstring_tokens":["Renders","HexBytes","as","text","."],"function":"def hex_bytes_as_text(value: bytes) -> str:\n \"\"\"Renders HexBytes as text.\n\n Args:\n value: A series of bytes to convert to text\n\n Returns:\n A text representation of the hexadecimal bytes plus their ascii equivalents, separated by newline characters\n \"\"\"\n if not isinstance(value, bytes):\n raise TypeError(\"hex_bytes_as_text takes bytes not: {}\".format(type(value)))\n ascii = []\n hex = []\n count = 0\n output = \"\"\n for byte in value:\n hex.append(\"{:02x}\".format(byte))\n ascii.append(chr(byte) if 0x20 < byte <= 0x7E else \".\")\n if (count % 8) == 7:\n output += \"\\n\"\n output += \" \".join(hex[count - 7:count + 1])\n output += \"\\t\"\n output += \"\".join(ascii[count - 7:count + 1])\n count += 1\n return output","function_tokens":["def","hex_bytes_as_text","(","value",":","bytes",")","->","str",":","if","not","isinstance","(","value",",","bytes",")",":","raise","TypeError","(","\"hex_bytes_as_text takes bytes not: {}\"",".","format","(","type","(","value",")",")",")","ascii","=","[","]","hex","=","[","]","count","=","0","output","=","\"\"","for","byte","in","value",":","hex",".","append","(","\"{:02x}\"",".","format","(","byte",")",")","ascii",".","append","(","chr","(","byte",")","if","0x20","<","byte","<=","0x7E","else","\".\"",")","if","(","count","%","8",")","==","7",":","output","+=","\"\\n\"","output","+=","\" \"",".","join","(","hex","[","count","-","7",":","count","+","1","]",")","output","+=","\"\\t\"","output","+=","\"\"",".","join","(","ascii","[","count","-","7",":","count","+","1","]",")","count","+=","1","return","output"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py#L28-L52"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py","language":"python","identifier":"multitypedata_as_text","parameters":"(value: format_hints.MultiTypeData)","argument_list":"","return_statement":"return hex_bytes_as_text(value)","docstring":"Renders the bytes as a string where possible, otherwise it displays hex data\n\n This attempts to convert the string based on its encoding and if no data's been lost due to the split on the null character, then it displays it as is","docstring_summary":"Renders the bytes as a string where possible, otherwise it displays hex data","docstring_tokens":["Renders","the","bytes","as","a","string","where","possible","otherwise","it","displays","hex","data"],"function":"def multitypedata_as_text(value: format_hints.MultiTypeData) -> str:\n \"\"\"Renders the bytes as a string where possible, otherwise it displays hex data\n\n This attempts to convert the string based on its encoding and if no data's been lost due to the split on the null character, then it displays it as is\n \"\"\"\n if value.show_hex:\n return hex_bytes_as_text(value)\n string_representation = str(value, encoding = value.encoding, errors = 'replace')\n if value.split_nulls and ((len(value) \/ 2 - 1) <= len(string_representation) <= (len(value) \/ 2)):\n return \"\\n\".join(string_representation.split(\"\\x00\"))\n if len(string_representation) - 1 <= len(string_representation.split(\"\\x00\")[0]) <= len(string_representation):\n return string_representation.split(\"\\x00\")[0]\n return hex_bytes_as_text(value)","function_tokens":["def","multitypedata_as_text","(","value",":","format_hints",".","MultiTypeData",")","->","str",":","if","value",".","show_hex",":","return","hex_bytes_as_text","(","value",")","string_representation","=","str","(","value",",","encoding","=","value",".","encoding",",","errors","=","'replace'",")","if","value",".","split_nulls","and","(","(","len","(","value",")","\/","2","-","1",")","<=","len","(","string_representation",")","<=","(","len","(","value",")","\/","2",")",")",":","return","\"\\n\"",".","join","(","string_representation",".","split","(","\"\\x00\"",")",")","if","len","(","string_representation",")","-","1","<=","len","(","string_representation",".","split","(","\"\\x00\"",")","[","0","]",")","<=","len","(","string_representation",")",":","return","string_representation",".","split","(","\"\\x00\"",")","[","0","]","return","hex_bytes_as_text","(","value",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py#L55-L67"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py","language":"python","identifier":"display_disassembly","parameters":"(disasm: interfaces.renderers.Disassembly)","argument_list":"","return_statement":"return QuickTextRenderer._type_renderers[bytes](disasm.data)","docstring":"Renders a disassembly renderer type into string format.\n\n Args:\n disasm: Input disassembly objects\n\n Returns:\n A string as rendererd by capstone where available, otherwise output as if it were just bytes","docstring_summary":"Renders a disassembly renderer type into string format.","docstring_tokens":["Renders","a","disassembly","renderer","type","into","string","format","."],"function":"def display_disassembly(disasm: interfaces.renderers.Disassembly) -> str:\n \"\"\"Renders a disassembly renderer type into string format.\n\n Args:\n disasm: Input disassembly objects\n\n Returns:\n A string as rendererd by capstone where available, otherwise output as if it were just bytes\n \"\"\"\n\n if CAPSTONE_PRESENT:\n disasm_types = {\n 'intel': capstone.Cs(capstone.CS_ARCH_X86, capstone.CS_MODE_32),\n 'intel64': capstone.Cs(capstone.CS_ARCH_X86, capstone.CS_MODE_64),\n 'arm': capstone.Cs(capstone.CS_ARCH_ARM, capstone.CS_MODE_ARM),\n 'arm64': capstone.Cs(capstone.CS_ARCH_ARM64, capstone.CS_MODE_ARM)\n }\n output = \"\"\n if disasm.architecture is not None:\n for i in disasm_types[disasm.architecture].disasm(disasm.data, disasm.offset):\n output += \"\\n0x%x:\\t%s\\t%s\" % (i.address, i.mnemonic, i.op_str)\n return output\n return QuickTextRenderer._type_renderers[bytes](disasm.data)","function_tokens":["def","display_disassembly","(","disasm",":","interfaces",".","renderers",".","Disassembly",")","->","str",":","if","CAPSTONE_PRESENT",":","disasm_types","=","{","'intel'",":","capstone",".","Cs","(","capstone",".","CS_ARCH_X86",",","capstone",".","CS_MODE_32",")",",","'intel64'",":","capstone",".","Cs","(","capstone",".","CS_ARCH_X86",",","capstone",".","CS_MODE_64",")",",","'arm'",":","capstone",".","Cs","(","capstone",".","CS_ARCH_ARM",",","capstone",".","CS_MODE_ARM",")",",","'arm64'",":","capstone",".","Cs","(","capstone",".","CS_ARCH_ARM64",",","capstone",".","CS_MODE_ARM",")","}","output","=","\"\"","if","disasm",".","architecture","is","not","None",":","for","i","in","disasm_types","[","disasm",".","architecture","]",".","disasm","(","disasm",".","data",",","disasm",".","offset",")",":","output","+=","\"\\n0x%x:\\t%s\\t%s\"","%","(","i",".","address",",","i",".","mnemonic",",","i",".","op_str",")","return","output","return","QuickTextRenderer",".","_type_renderers","[","bytes","]","(","disasm",".","data",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py#L98-L120"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py","language":"python","identifier":"QuickTextRenderer.render","parameters":"(self, grid: interfaces.renderers.TreeGrid)","argument_list":"","return_statement":"","docstring":"Renders each column immediately to stdout.\n\n This does not format each line's width appropriately, it merely tab separates each field\n\n Args:\n grid: The TreeGrid object to render","docstring_summary":"Renders each column immediately to stdout.","docstring_tokens":["Renders","each","column","immediately","to","stdout","."],"function":"def render(self, grid: interfaces.renderers.TreeGrid) -> None:\n \"\"\"Renders each column immediately to stdout.\n\n This does not format each line's width appropriately, it merely tab separates each field\n\n Args:\n grid: The TreeGrid object to render\n \"\"\"\n # TODO: Docstrings\n # TODO: Improve text output\n outfd = sys.stdout\n\n line = []\n for column in grid.columns:\n # Ignore the type because namedtuples don't realize they have accessible attributes\n line.append(\"{}\".format(column.name))\n outfd.write(\"\\n{}\\n\".format(\"\\t\".join(line)))\n\n def visitor(node: interfaces.renderers.TreeNode, accumulator):\n accumulator.write(\"\\n\")\n # Nodes always have a path value, giving them a path_depth of at least 1, we use max just in case\n accumulator.write(\"*\" * max(0, node.path_depth - 1) + (\"\" if (node.path_depth <= 1) else \" \"))\n line = []\n for column_index in range(len(grid.columns)):\n column = grid.columns[column_index]\n renderer = self._type_renderers.get(column.type, self._type_renderers['default'])\n line.append(renderer(node.values[column_index]))\n accumulator.write(\"{}\".format(\"\\t\".join(line)))\n accumulator.flush()\n return accumulator\n\n if not grid.populated:\n grid.populate(visitor, outfd)\n else:\n grid.visit(node = None, function = visitor, initial_accumulator = outfd)\n\n outfd.write(\"\\n\")","function_tokens":["def","render","(","self",",","grid",":","interfaces",".","renderers",".","TreeGrid",")","->","None",":","# TODO: Docstrings","# TODO: Improve text output","outfd","=","sys",".","stdout","line","=","[","]","for","column","in","grid",".","columns",":","# Ignore the type because namedtuples don't realize they have accessible attributes","line",".","append","(","\"{}\"",".","format","(","column",".","name",")",")","outfd",".","write","(","\"\\n{}\\n\"",".","format","(","\"\\t\"",".","join","(","line",")",")",")","def","visitor","(","node",":","interfaces",".","renderers",".","TreeNode",",","accumulator",")",":","accumulator",".","write","(","\"\\n\"",")","# Nodes always have a path value, giving them a path_depth of at least 1, we use max just in case","accumulator",".","write","(","\"*\"","*","max","(","0",",","node",".","path_depth","-","1",")","+","(","\"\"","if","(","node",".","path_depth","<=","1",")","else","\" \"",")",")","line","=","[","]","for","column_index","in","range","(","len","(","grid",".","columns",")",")",":","column","=","grid",".","columns","[","column_index","]","renderer","=","self",".","_type_renderers",".","get","(","column",".","type",",","self",".","_type_renderers","[","'default'","]",")","line",".","append","(","renderer","(","node",".","values","[","column_index","]",")",")","accumulator",".","write","(","\"{}\"",".","format","(","\"\\t\"",".","join","(","line",")",")",")","accumulator",".","flush","(",")","return","accumulator","if","not","grid",".","populated",":","grid",".","populate","(","visitor",",","outfd",")","else",":","grid",".","visit","(","node","=","None",",","function","=","visitor",",","initial_accumulator","=","outfd",")","outfd",".","write","(","\"\\n\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py#L146-L182"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py","language":"python","identifier":"CSVRenderer.render","parameters":"(self, grid: interfaces.renderers.TreeGrid)","argument_list":"","return_statement":"","docstring":"Renders each row immediately to stdout.\n\n Args:\n grid: The TreeGrid object to render","docstring_summary":"Renders each row immediately to stdout.","docstring_tokens":["Renders","each","row","immediately","to","stdout","."],"function":"def render(self, grid: interfaces.renderers.TreeGrid) -> None:\n \"\"\"Renders each row immediately to stdout.\n\n Args:\n grid: The TreeGrid object to render\n \"\"\"\n outfd = sys.stdout\n\n line = ['\"TreeDepth\"']\n for column in grid.columns:\n # Ignore the type because namedtuples don't realize they have accessible attributes\n line.append(\"{}\".format('\"' + column.name + '\"'))\n outfd.write(\"{}\".format(\",\".join(line)))\n\n def visitor(node: interfaces.renderers.TreeNode, accumulator):\n accumulator.write(\"\\n\")\n # Nodes always have a path value, giving them a path_depth of at least 1, we use max just in case\n accumulator.write(str(max(0, node.path_depth - 1)) + \",\")\n line = []\n for column_index in range(len(grid.columns)):\n column = grid.columns[column_index]\n renderer = self._type_renderers.get(column.type, self._type_renderers['default'])\n line.append(renderer(node.values[column_index]))\n accumulator.write(\"{}\".format(\",\".join(line)))\n return accumulator\n\n if not grid.populated:\n grid.populate(visitor, outfd)\n else:\n grid.visit(node = None, function = visitor, initial_accumulator = outfd)\n\n outfd.write(\"\\n\")","function_tokens":["def","render","(","self",",","grid",":","interfaces",".","renderers",".","TreeGrid",")","->","None",":","outfd","=","sys",".","stdout","line","=","[","'\"TreeDepth\"'","]","for","column","in","grid",".","columns",":","# Ignore the type because namedtuples don't realize they have accessible attributes","line",".","append","(","\"{}\"",".","format","(","'\"'","+","column",".","name","+","'\"'",")",")","outfd",".","write","(","\"{}\"",".","format","(","\",\"",".","join","(","line",")",")",")","def","visitor","(","node",":","interfaces",".","renderers",".","TreeNode",",","accumulator",")",":","accumulator",".","write","(","\"\\n\"",")","# Nodes always have a path value, giving them a path_depth of at least 1, we use max just in case","accumulator",".","write","(","str","(","max","(","0",",","node",".","path_depth","-","1",")",")","+","\",\"",")","line","=","[","]","for","column_index","in","range","(","len","(","grid",".","columns",")",")",":","column","=","grid",".","columns","[","column_index","]","renderer","=","self",".","_type_renderers",".","get","(","column",".","type",",","self",".","_type_renderers","[","'default'","]",")","line",".","append","(","renderer","(","node",".","values","[","column_index","]",")",")","accumulator",".","write","(","\"{}\"",".","format","(","\",\"",".","join","(","line",")",")",")","return","accumulator","if","not","grid",".","populated",":","grid",".","populate","(","visitor",",","outfd",")","else",":","grid",".","visit","(","node","=","None",",","function","=","visitor",",","initial_accumulator","=","outfd",")","outfd",".","write","(","\"\\n\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py#L203-L234"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py","language":"python","identifier":"PrettyTextRenderer.render","parameters":"(self, grid: interfaces.renderers.TreeGrid)","argument_list":"","return_statement":"","docstring":"Renders each column immediately to stdout.\n\n This does not format each line's width appropriately, it merely tab separates each field\n\n Args:\n grid: The TreeGrid object to render","docstring_summary":"Renders each column immediately to stdout.","docstring_tokens":["Renders","each","column","immediately","to","stdout","."],"function":"def render(self, grid: interfaces.renderers.TreeGrid) -> None:\n \"\"\"Renders each column immediately to stdout.\n\n This does not format each line's width appropriately, it merely tab separates each field\n\n Args:\n grid: The TreeGrid object to render\n \"\"\"\n # TODO: Docstrings\n # TODO: Improve text output\n outfd = sys.stdout\n\n sys.stderr.write(\"Formatting...\\n\")\n\n display_alignment = \">\"\n column_separator = \" | \"\n\n tree_indent_column = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(20))\n max_column_widths = dict([(column.name, len(column.name)) for column in grid.columns])\n\n def visitor(\n node: interfaces.renderers.TreeNode,\n accumulator: List[Tuple[int, Dict[interfaces.renderers.Column, bytes]]]\n ) -> List[Tuple[int, Dict[interfaces.renderers.Column, bytes]]]:\n # Nodes always have a path value, giving them a path_depth of at least 1, we use max just in case\n max_column_widths[tree_indent_column] = max(max_column_widths.get(tree_indent_column, 0), node.path_depth)\n line = {}\n for column_index in range(len(grid.columns)):\n column = grid.columns[column_index]\n renderer = self._type_renderers.get(column.type, self._type_renderers['default'])\n data = renderer(node.values[column_index])\n max_column_widths[column.name] = max(max_column_widths.get(column.name, len(column.name)),\n len(\"{}\".format(data)))\n line[column] = data\n accumulator.append((node.path_depth, line))\n return accumulator\n\n final_output = [] # type: List[Tuple[int, Dict[interfaces.renderers.Column, bytes]]]\n if not grid.populated:\n grid.populate(visitor, final_output)\n else:\n grid.visit(node = None, function = visitor, initial_accumulator = final_output)\n\n # Always align the tree to the left\n format_string_list = [\"{0:<\" + str(max_column_widths.get(tree_indent_column, 0)) + \"s}\"]\n for column_index in range(len(grid.columns)):\n column = grid.columns[column_index]\n format_string_list.append(\"{\" + str(column_index + 1) + \":\" + display_alignment +\n str(max_column_widths[column.name]) + \"s}\")\n\n format_string = column_separator.join(format_string_list) + \"\\n\"\n\n column_titles = [\"\"] + [column.name for column in grid.columns]\n outfd.write(format_string.format(*column_titles))\n for (depth, line) in final_output:\n outfd.write(format_string.format(\"*\" * depth, *[line[column] for column in grid.columns]))","function_tokens":["def","render","(","self",",","grid",":","interfaces",".","renderers",".","TreeGrid",")","->","None",":","# TODO: Docstrings","# TODO: Improve text output","outfd","=","sys",".","stdout","sys",".","stderr",".","write","(","\"Formatting...\\n\"",")","display_alignment","=","\">\"","column_separator","=","\" | \"","tree_indent_column","=","''",".","join","(","random",".","choice","(","string",".","ascii_uppercase","+","string",".","digits",")","for","_","in","range","(","20",")",")","max_column_widths","=","dict","(","[","(","column",".","name",",","len","(","column",".","name",")",")","for","column","in","grid",".","columns","]",")","def","visitor","(","node",":","interfaces",".","renderers",".","TreeNode",",","accumulator",":","List","[","Tuple","[","int",",","Dict","[","interfaces",".","renderers",".","Column",",","bytes","]","]","]",")","->","List","[","Tuple","[","int",",","Dict","[","interfaces",".","renderers",".","Column",",","bytes","]","]","]",":","# Nodes always have a path value, giving them a path_depth of at least 1, we use max just in case","max_column_widths","[","tree_indent_column","]","=","max","(","max_column_widths",".","get","(","tree_indent_column",",","0",")",",","node",".","path_depth",")","line","=","{","}","for","column_index","in","range","(","len","(","grid",".","columns",")",")",":","column","=","grid",".","columns","[","column_index","]","renderer","=","self",".","_type_renderers",".","get","(","column",".","type",",","self",".","_type_renderers","[","'default'","]",")","data","=","renderer","(","node",".","values","[","column_index","]",")","max_column_widths","[","column",".","name","]","=","max","(","max_column_widths",".","get","(","column",".","name",",","len","(","column",".","name",")",")",",","len","(","\"{}\"",".","format","(","data",")",")",")","line","[","column","]","=","data","accumulator",".","append","(","(","node",".","path_depth",",","line",")",")","return","accumulator","final_output","=","[","]","# type: List[Tuple[int, Dict[interfaces.renderers.Column, bytes]]]","if","not","grid",".","populated",":","grid",".","populate","(","visitor",",","final_output",")","else",":","grid",".","visit","(","node","=","None",",","function","=","visitor",",","initial_accumulator","=","final_output",")","# Always align the tree to the left","format_string_list","=","[","\"{0:<\"","+","str","(","max_column_widths",".","get","(","tree_indent_column",",","0",")",")","+","\"s}\"","]","for","column_index","in","range","(","len","(","grid",".","columns",")",")",":","column","=","grid",".","columns","[","column_index","]","format_string_list",".","append","(","\"{\"","+","str","(","column_index","+","1",")","+","\":\"","+","display_alignment","+","str","(","max_column_widths","[","column",".","name","]",")","+","\"s}\"",")","format_string","=","column_separator",".","join","(","format_string_list",")","+","\"\\n\"","column_titles","=","[","\"\"","]","+","[","column",".","name","for","column","in","grid",".","columns","]","outfd",".","write","(","format_string",".","format","(","*","column_titles",")",")","for","(","depth",",","line",")","in","final_output",":","outfd",".","write","(","format_string",".","format","(","\"*\"","*","depth",",","*","[","line","[","column","]","for","column","in","grid",".","columns","]",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py#L245-L300"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py","language":"python","identifier":"JsonRenderer.output_result","parameters":"(self, outfd, result)","argument_list":"","return_statement":"","docstring":"Outputs the JSON data to a file in a particular format","docstring_summary":"Outputs the JSON data to a file in a particular format","docstring_tokens":["Outputs","the","JSON","data","to","a","file","in","a","particular","format"],"function":"def output_result(self, outfd, result):\n \"\"\"Outputs the JSON data to a file in a particular format\"\"\"\n outfd.write(json.dumps(result, indent = 2, sort_keys = True))","function_tokens":["def","output_result","(","self",",","outfd",",","result",")",":","outfd",".","write","(","json",".","dumps","(","result",",","indent","=","2",",","sort_keys","=","True",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py#L318-L320"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py","language":"python","identifier":"JsonLinesRenderer.output_result","parameters":"(self, outfd, result)","argument_list":"","return_statement":"","docstring":"Outputs the JSON results as JSON lines","docstring_summary":"Outputs the JSON results as JSON lines","docstring_tokens":["Outputs","the","JSON","results","as","JSON","lines"],"function":"def output_result(self, outfd, result):\n \"\"\"Outputs the JSON results as JSON lines\"\"\"\n for line in result:\n outfd.write(json.dumps(line, sort_keys = True))\n outfd.write(\"\\n\")","function_tokens":["def","output_result","(","self",",","outfd",",","result",")",":","for","line","in","result",":","outfd",".","write","(","json",".","dumps","(","line",",","sort_keys","=","True",")",")","outfd",".","write","(","\"\\n\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/text_renderer.py#L361-L365"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/__init__.py","language":"python","identifier":"main","parameters":"()","argument_list":"","return_statement":"","docstring":"A convenience function for constructing and running the\n :class:`CommandLine`'s run method.","docstring_summary":"A convenience function for constructing and running the\n :class:`CommandLine`'s run method.","docstring_tokens":["A","convenience","function","for","constructing","and","running","the",":","class",":","CommandLine","s","run","method","."],"function":"def main():\n \"\"\"A convenience function for constructing and running the\n :class:`CommandLine`'s run method.\"\"\"\n VolShell().run()","function_tokens":["def","main","(",")",":","VolShell","(",")",".","run","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/__init__.py#L242-L245"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/__init__.py","language":"python","identifier":"VolShell.run","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Executes the command line module, taking the system arguments,\n determining the plugin to run and then running it.","docstring_summary":"Executes the command line module, taking the system arguments,\n determining the plugin to run and then running it.","docstring_tokens":["Executes","the","command","line","module","taking","the","system","arguments","determining","the","plugin","to","run","and","then","running","it","."],"function":"def run(self):\n \"\"\"Executes the command line module, taking the system arguments,\n determining the plugin to run and then running it.\"\"\"\n sys.stdout.write(\"Volshell (Volatility 3 Framework) {}\\n\".format(constants.PACKAGE_VERSION))\n\n framework.require_interface_version(2, 0, 0)\n\n parser = argparse.ArgumentParser(prog = 'volshell',\n description = \"A tool for interactivate forensic analysis of memory images\")\n parser.add_argument(\"-c\",\n \"--config\",\n help = \"Load the configuration from a json file\",\n default = None,\n type = str)\n parser.add_argument(\"-e\",\n \"--extend\",\n help = \"Extend the configuration with a new (or changed) setting\",\n default = None,\n action = 'append')\n parser.add_argument(\"-p\",\n \"--plugin-dirs\",\n help = \"Semi-colon separated list of paths to find plugins\",\n default = \"\",\n type = str)\n parser.add_argument(\"-s\",\n \"--symbol-dirs\",\n help = \"Semi-colon separated list of paths to find symbols\",\n default = \"\",\n type = str)\n parser.add_argument(\"-v\", \"--verbosity\", help = \"Increase output verbosity\", default = 0, action = \"count\")\n parser.add_argument(\"-o\",\n \"--output-dir\",\n help = \"Directory in which to output any generated files\",\n default = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')),\n type = str)\n parser.add_argument(\"-q\", \"--quiet\", help = \"Remove progress feedback\", default = False, action = 'store_true')\n parser.add_argument(\"--log\", help = \"Log output to a file as well as the console\", default = None, type = str)\n parser.add_argument(\"-f\",\n \"--file\",\n metavar = 'FILE',\n default = None,\n type = str,\n help = \"Shorthand for --single-location=file:\/\/ if single-location is not defined\")\n parser.add_argument(\"--write-config\",\n help = \"Write configuration JSON file out to config.json\",\n default = False,\n action = 'store_true')\n parser.add_argument(\"--clear-cache\",\n help = \"Clears out all short-term cached items\",\n default = False,\n action = 'store_true')\n\n # Volshell specific flags\n os_specific = parser.add_mutually_exclusive_group(required = False)\n os_specific.add_argument(\"-w\",\n \"--windows\",\n default = False,\n action = \"store_true\",\n help = \"Run a Windows volshell\")\n os_specific.add_argument(\"-l\", \"--linux\", default = False, action = \"store_true\", help = \"Run a Linux volshell\")\n os_specific.add_argument(\"-m\", \"--mac\", default = False, action = \"store_true\", help = \"Run a Mac volshell\")\n\n # We have to filter out help, otherwise parse_known_args will trigger the help message before having\n # processed the plugin choice or had the plugin subparser added.\n known_args = [arg for arg in sys.argv if arg != '--help' and arg != '-h']\n partial_args, _ = parser.parse_known_args(known_args)\n if partial_args.plugin_dirs:\n volatility.plugins.__path__ = [os.path.abspath(p)\n for p in partial_args.plugin_dirs.split(\";\")] + constants.PLUGINS_PATH\n\n if partial_args.symbol_dirs:\n volatility.symbols.__path__ = [os.path.abspath(p)\n for p in partial_args.symbol_dirs.split(\";\")] + constants.SYMBOL_BASEPATHS\n\n vollog.info(\"Volatility plugins path: {}\".format(volatility.plugins.__path__))\n vollog.info(\"Volatility symbols path: {}\".format(volatility.symbols.__path__))\n\n if partial_args.log:\n file_logger = logging.FileHandler(partial_args.log)\n file_logger.setLevel(0)\n file_formatter = logging.Formatter(datefmt = '%y-%m-%d %H:%M:%S',\n fmt = '%(asctime)s %(name)-12s %(levelname)-8s %(message)s')\n file_logger.setFormatter(file_formatter)\n vollog.addHandler(file_logger)\n vollog.info(\"Logging started\")\n\n if partial_args.verbosity < 3:\n console.setLevel(30 - (partial_args.verbosity * 10))\n else:\n console.setLevel(10 - (partial_args.verbosity - 2))\n\n if partial_args.clear_cache:\n for cache_filename in glob.glob(os.path.join(constants.CACHE_PATH, '*.cache')):\n os.unlink(cache_filename)\n\n # Do the initialization\n ctx = contexts.Context() # Construct a blank context\n failures = framework.import_files(volatility.plugins,\n True) # Will not log as console's default level is WARNING\n if failures:\n parser.epilog = \"The following plugins could not be loaded (use -vv to see why): \" + \\\n \", \".join(sorted(failures))\n vollog.info(parser.epilog)\n automagics = automagic.available(ctx)\n\n # Initialize the list of plugins in case volshell needs it\n framework.list_plugins()\n\n seen_automagics = set()\n configurables_list = {}\n for amagic in automagics:\n if amagic in seen_automagics:\n continue\n seen_automagics.add(amagic)\n if isinstance(amagic, interfaces.configuration.ConfigurableInterface):\n self.populate_requirements_argparse(parser, amagic.__class__)\n configurables_list[amagic.__class__.__name__] = amagic\n\n # We don't list plugin arguments, because they can be provided within python\n volshell_plugin_list = {'generic': generic.Volshell, 'windows': windows.Volshell}\n for plugin in volshell_plugin_list:\n subparser = parser.add_argument_group(title = plugin.capitalize(),\n description = \"Configuration options based on {} options\".format(\n plugin.capitalize()))\n self.populate_requirements_argparse(subparser, volshell_plugin_list[plugin])\n configurables_list[plugin] = volshell_plugin_list[plugin]\n\n ###\n # PASS TO UI\n ###\n # Hand the plugin requirements over to the CLI (us) and let it construct the config tree\n\n # Run the argparser\n args = parser.parse_args()\n\n vollog.log(constants.LOGLEVEL_VVV, \"Cache directory used: {}\".format(constants.CACHE_PATH))\n\n plugin = generic.Volshell\n if args.windows:\n plugin = windows.Volshell\n if args.linux:\n plugin = linux.Volshell\n if args.mac:\n plugin = mac.Volshell\n\n base_config_path = \"plugins\"\n plugin_config_path = interfaces.configuration.path_join(base_config_path, plugin.__name__)\n\n # Special case the -f argument because people use is so frequently\n # It has to go here so it can be overridden by single-location if it's defined\n # NOTE: This will *BREAK* if LayerStacker, or the automagic configuration system, changes at all\n ###\n if args.file:\n file_name = os.path.abspath(args.file)\n if not os.path.exists(file_name):\n vollog.log(logging.INFO, \"File does not exist: {}\".format(file_name))\n else:\n single_location = \"file:\" + request.pathname2url(file_name)\n ctx.config['automagic.LayerStacker.single_location'] = single_location\n\n # UI fills in the config, here we load it from the config file and do it before we process the CL parameters\n if args.config:\n with open(args.config, \"r\") as f:\n json_val = json.load(f)\n ctx.config.splice(plugin_config_path, interfaces.configuration.HierarchicalDict(json_val))\n\n self.populate_config(ctx, configurables_list, args, plugin_config_path)\n\n if args.extend:\n for extension in args.extend:\n if '=' not in extension:\n raise ValueError(\"Invalid extension (extensions must be of the format \\\"conf.path.value='value'\\\")\")\n address, value = extension[:extension.find('=')], json.loads(extension[extension.find('=') + 1:])\n ctx.config[address] = value\n\n # It should be up to the UI to determine which automagics to run, so this is before BACK TO THE FRAMEWORK\n automagics = automagic.choose_automagic(automagics, plugin)\n self.output_dir = args.output_dir\n\n ###\n # BACK TO THE FRAMEWORK\n ###\n try:\n progress_callback = cli.PrintedProgress()\n if args.quiet:\n progress_callback = cli.MuteProgress()\n\n constructed = plugins.construct_plugin(ctx, automagics, plugin, base_config_path, progress_callback,\n self.file_handler_class_factory())\n\n if args.write_config:\n vollog.debug(\"Writing out configuration data to config.json\")\n with open(\"config.json\", \"w\") as f:\n json.dump(dict(constructed.build_configuration()), f, sort_keys = True, indent = 2)\n\n # Construct and run the plugin\n constructed.run()\n except exceptions.VolatilityException as excp:\n self.process_exceptions(excp)\n parser.exit(1, \"Unable to validate the plugin requirements: {}\\n\".format([x for x in excp.unsatisfied]))","function_tokens":["def","run","(","self",")",":","sys",".","stdout",".","write","(","\"Volshell (Volatility 3 Framework) {}\\n\"",".","format","(","constants",".","PACKAGE_VERSION",")",")","framework",".","require_interface_version","(","2",",","0",",","0",")","parser","=","argparse",".","ArgumentParser","(","prog","=","'volshell'",",","description","=","\"A tool for interactivate forensic analysis of memory images\"",")","parser",".","add_argument","(","\"-c\"",",","\"--config\"",",","help","=","\"Load the configuration from a json file\"",",","default","=","None",",","type","=","str",")","parser",".","add_argument","(","\"-e\"",",","\"--extend\"",",","help","=","\"Extend the configuration with a new (or changed) setting\"",",","default","=","None",",","action","=","'append'",")","parser",".","add_argument","(","\"-p\"",",","\"--plugin-dirs\"",",","help","=","\"Semi-colon separated list of paths to find plugins\"",",","default","=","\"\"",",","type","=","str",")","parser",".","add_argument","(","\"-s\"",",","\"--symbol-dirs\"",",","help","=","\"Semi-colon separated list of paths to find symbols\"",",","default","=","\"\"",",","type","=","str",")","parser",".","add_argument","(","\"-v\"",",","\"--verbosity\"",",","help","=","\"Increase output verbosity\"",",","default","=","0",",","action","=","\"count\"",")","parser",".","add_argument","(","\"-o\"",",","\"--output-dir\"",",","help","=","\"Directory in which to output any generated files\"",",","default","=","os",".","path",".","abspath","(","os",".","path",".","join","(","os",".","path",".","dirname","(","__file__",")",",","'..'",",","'..'",")",")",",","type","=","str",")","parser",".","add_argument","(","\"-q\"",",","\"--quiet\"",",","help","=","\"Remove progress feedback\"",",","default","=","False",",","action","=","'store_true'",")","parser",".","add_argument","(","\"--log\"",",","help","=","\"Log output to a file as well as the console\"",",","default","=","None",",","type","=","str",")","parser",".","add_argument","(","\"-f\"",",","\"--file\"",",","metavar","=","'FILE'",",","default","=","None",",","type","=","str",",","help","=","\"Shorthand for --single-location=file:\/\/ if single-location is not defined\"",")","parser",".","add_argument","(","\"--write-config\"",",","help","=","\"Write configuration JSON file out to config.json\"",",","default","=","False",",","action","=","'store_true'",")","parser",".","add_argument","(","\"--clear-cache\"",",","help","=","\"Clears out all short-term cached items\"",",","default","=","False",",","action","=","'store_true'",")","# Volshell specific flags","os_specific","=","parser",".","add_mutually_exclusive_group","(","required","=","False",")","os_specific",".","add_argument","(","\"-w\"",",","\"--windows\"",",","default","=","False",",","action","=","\"store_true\"",",","help","=","\"Run a Windows volshell\"",")","os_specific",".","add_argument","(","\"-l\"",",","\"--linux\"",",","default","=","False",",","action","=","\"store_true\"",",","help","=","\"Run a Linux volshell\"",")","os_specific",".","add_argument","(","\"-m\"",",","\"--mac\"",",","default","=","False",",","action","=","\"store_true\"",",","help","=","\"Run a Mac volshell\"",")","# We have to filter out help, otherwise parse_known_args will trigger the help message before having","# processed the plugin choice or had the plugin subparser added.","known_args","=","[","arg","for","arg","in","sys",".","argv","if","arg","!=","'--help'","and","arg","!=","'-h'","]","partial_args",",","_","=","parser",".","parse_known_args","(","known_args",")","if","partial_args",".","plugin_dirs",":","volatility",".","plugins",".","__path__","=","[","os",".","path",".","abspath","(","p",")","for","p","in","partial_args",".","plugin_dirs",".","split","(","\";\"",")","]","+","constants",".","PLUGINS_PATH","if","partial_args",".","symbol_dirs",":","volatility",".","symbols",".","__path__","=","[","os",".","path",".","abspath","(","p",")","for","p","in","partial_args",".","symbol_dirs",".","split","(","\";\"",")","]","+","constants",".","SYMBOL_BASEPATHS","vollog",".","info","(","\"Volatility plugins path: {}\"",".","format","(","volatility",".","plugins",".","__path__",")",")","vollog",".","info","(","\"Volatility symbols path: {}\"",".","format","(","volatility",".","symbols",".","__path__",")",")","if","partial_args",".","log",":","file_logger","=","logging",".","FileHandler","(","partial_args",".","log",")","file_logger",".","setLevel","(","0",")","file_formatter","=","logging",".","Formatter","(","datefmt","=","'%y-%m-%d %H:%M:%S'",",","fmt","=","'%(asctime)s %(name)-12s %(levelname)-8s %(message)s'",")","file_logger",".","setFormatter","(","file_formatter",")","vollog",".","addHandler","(","file_logger",")","vollog",".","info","(","\"Logging started\"",")","if","partial_args",".","verbosity","<","3",":","console",".","setLevel","(","30","-","(","partial_args",".","verbosity","*","10",")",")","else",":","console",".","setLevel","(","10","-","(","partial_args",".","verbosity","-","2",")",")","if","partial_args",".","clear_cache",":","for","cache_filename","in","glob",".","glob","(","os",".","path",".","join","(","constants",".","CACHE_PATH",",","'*.cache'",")",")",":","os",".","unlink","(","cache_filename",")","# Do the initialization","ctx","=","contexts",".","Context","(",")","# Construct a blank context","failures","=","framework",".","import_files","(","volatility",".","plugins",",","True",")","# Will not log as console's default level is WARNING","if","failures",":","parser",".","epilog","=","\"The following plugins could not be loaded (use -vv to see why): \"","+","\", \"",".","join","(","sorted","(","failures",")",")","vollog",".","info","(","parser",".","epilog",")","automagics","=","automagic",".","available","(","ctx",")","# Initialize the list of plugins in case volshell needs it","framework",".","list_plugins","(",")","seen_automagics","=","set","(",")","configurables_list","=","{","}","for","amagic","in","automagics",":","if","amagic","in","seen_automagics",":","continue","seen_automagics",".","add","(","amagic",")","if","isinstance","(","amagic",",","interfaces",".","configuration",".","ConfigurableInterface",")",":","self",".","populate_requirements_argparse","(","parser",",","amagic",".","__class__",")","configurables_list","[","amagic",".","__class__",".","__name__","]","=","amagic","# We don't list plugin arguments, because they can be provided within python","volshell_plugin_list","=","{","'generic'",":","generic",".","Volshell",",","'windows'",":","windows",".","Volshell","}","for","plugin","in","volshell_plugin_list",":","subparser","=","parser",".","add_argument_group","(","title","=","plugin",".","capitalize","(",")",",","description","=","\"Configuration options based on {} options\"",".","format","(","plugin",".","capitalize","(",")",")",")","self",".","populate_requirements_argparse","(","subparser",",","volshell_plugin_list","[","plugin","]",")","configurables_list","[","plugin","]","=","volshell_plugin_list","[","plugin","]","###","# PASS TO UI","###","# Hand the plugin requirements over to the CLI (us) and let it construct the config tree","# Run the argparser","args","=","parser",".","parse_args","(",")","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Cache directory used: {}\"",".","format","(","constants",".","CACHE_PATH",")",")","plugin","=","generic",".","Volshell","if","args",".","windows",":","plugin","=","windows",".","Volshell","if","args",".","linux",":","plugin","=","linux",".","Volshell","if","args",".","mac",":","plugin","=","mac",".","Volshell","base_config_path","=","\"plugins\"","plugin_config_path","=","interfaces",".","configuration",".","path_join","(","base_config_path",",","plugin",".","__name__",")","# Special case the -f argument because people use is so frequently","# It has to go here so it can be overridden by single-location if it's defined","# NOTE: This will *BREAK* if LayerStacker, or the automagic configuration system, changes at all","###","if","args",".","file",":","file_name","=","os",".","path",".","abspath","(","args",".","file",")","if","not","os",".","path",".","exists","(","file_name",")",":","vollog",".","log","(","logging",".","INFO",",","\"File does not exist: {}\"",".","format","(","file_name",")",")","else",":","single_location","=","\"file:\"","+","request",".","pathname2url","(","file_name",")","ctx",".","config","[","'automagic.LayerStacker.single_location'","]","=","single_location","# UI fills in the config, here we load it from the config file and do it before we process the CL parameters","if","args",".","config",":","with","open","(","args",".","config",",","\"r\"",")","as","f",":","json_val","=","json",".","load","(","f",")","ctx",".","config",".","splice","(","plugin_config_path",",","interfaces",".","configuration",".","HierarchicalDict","(","json_val",")",")","self",".","populate_config","(","ctx",",","configurables_list",",","args",",","plugin_config_path",")","if","args",".","extend",":","for","extension","in","args",".","extend",":","if","'='","not","in","extension",":","raise","ValueError","(","\"Invalid extension (extensions must be of the format \\\"conf.path.value='value'\\\")\"",")","address",",","value","=","extension","[",":","extension",".","find","(","'='",")","]",",","json",".","loads","(","extension","[","extension",".","find","(","'='",")","+","1",":","]",")","ctx",".","config","[","address","]","=","value","# It should be up to the UI to determine which automagics to run, so this is before BACK TO THE FRAMEWORK","automagics","=","automagic",".","choose_automagic","(","automagics",",","plugin",")","self",".","output_dir","=","args",".","output_dir","###","# BACK TO THE FRAMEWORK","###","try",":","progress_callback","=","cli",".","PrintedProgress","(",")","if","args",".","quiet",":","progress_callback","=","cli",".","MuteProgress","(",")","constructed","=","plugins",".","construct_plugin","(","ctx",",","automagics",",","plugin",",","base_config_path",",","progress_callback",",","self",".","file_handler_class_factory","(",")",")","if","args",".","write_config",":","vollog",".","debug","(","\"Writing out configuration data to config.json\"",")","with","open","(","\"config.json\"",",","\"w\"",")","as","f",":","json",".","dump","(","dict","(","constructed",".","build_configuration","(",")",")",",","f",",","sort_keys","=","True",",","indent","=","2",")","# Construct and run the plugin","constructed",".","run","(",")","except","exceptions",".","VolatilityException","as","excp",":","self",".","process_exceptions","(","excp",")","parser",".","exit","(","1",",","\"Unable to validate the plugin requirements: {}\\n\"",".","format","(","[","x","for","x","in","excp",".","unsatisfied","]",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/__init__.py#L40-L239"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.run","parameters":"(self, additional_locals: Dict[str, Any] = None)","argument_list":"","return_statement":"return renderers.TreeGrid([(\"Terminating\", str)], None)","docstring":"Runs the interactive volshell plugin.\n\n Returns:\n Return a TreeGrid but this is always empty since the point of this plugin is to run interactively","docstring_summary":"Runs the interactive volshell plugin.","docstring_tokens":["Runs","the","interactive","volshell","plugin","."],"function":"def run(self, additional_locals: Dict[str, Any] = None) -> interfaces.renderers.TreeGrid:\n \"\"\"Runs the interactive volshell plugin.\n\n Returns:\n Return a TreeGrid but this is always empty since the point of this plugin is to run interactively\n \"\"\"\n\n self._current_layer = self.config['primary']\n\n # Try to enable tab completion\n try:\n import readline\n except ImportError:\n pass\n else:\n import rlcompleter\n completer = rlcompleter.Completer(namespace = self._construct_locals_dict())\n readline.set_completer(completer.complete)\n readline.parse_and_bind(\"tab: complete\")\n print(\"Readline imported successfully\")\n\n # TODO: provide help, consider generic functions (pslist?) and\/or providing windows\/linux functions\n\n mode = self.__module__.split('.')[-1]\n mode = mode[0].upper() + mode[1:]\n\n banner = \"\"\"\n Call help() to see available functions\n\n Volshell mode: {}\n Current Layer: {}\n \"\"\".format(mode, self.current_layer)\n\n sys.ps1 = \"({}) >>> \".format(self.current_layer)\n code.interact(banner = banner, local = self._construct_locals_dict())\n\n return renderers.TreeGrid([(\"Terminating\", str)], None)","function_tokens":["def","run","(","self",",","additional_locals",":","Dict","[","str",",","Any","]","=","None",")","->","interfaces",".","renderers",".","TreeGrid",":","self",".","_current_layer","=","self",".","config","[","'primary'","]","# Try to enable tab completion","try",":","import","readline","except","ImportError",":","pass","else",":","import","rlcompleter","completer","=","rlcompleter",".","Completer","(","namespace","=","self",".","_construct_locals_dict","(",")",")","readline",".","set_completer","(","completer",".","complete",")","readline",".","parse_and_bind","(","\"tab: complete\"",")","print","(","\"Readline imported successfully\"",")","# TODO: provide help, consider generic functions (pslist?) and\/or providing windows\/linux functions","mode","=","self",".","__module__",".","split","(","'.'",")","[","-","1","]","mode","=","mode","[","0","]",".","upper","(",")","+","mode","[","1",":","]","banner","=","\"\"\"\n Call help() to see available functions\n\n Volshell mode: {}\n Current Layer: {}\n \"\"\"",".","format","(","mode",",","self",".","current_layer",")","sys",".","ps1","=","\"({}) >>> \"",".","format","(","self",".","current_layer",")","code",".","interact","(","banner","=","banner",",","local","=","self",".","_construct_locals_dict","(",")",")","return","renderers",".","TreeGrid","(","[","(","\"Terminating\"",",","str",")","]",",","None",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L42-L78"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.help","parameters":"(self, *args)","argument_list":"","return_statement":"","docstring":"Describes the available commands","docstring_summary":"Describes the available commands","docstring_tokens":["Describes","the","available","commands"],"function":"def help(self, *args):\n \"\"\"Describes the available commands\"\"\"\n if args:\n help(*args)\n return\n\n variables = []\n print(\"\\nMethods:\")\n for aliases, item in self.construct_locals():\n name = \", \".join(aliases)\n if item.__doc__ and callable(item):\n print(\"* {}\".format(name))\n print(\" {}\".format(item.__doc__))\n else:\n variables.append(name)\n\n print(\"\\nVariables:\")\n for var in variables:\n print(\" {}\".format(var))","function_tokens":["def","help","(","self",",","*","args",")",":","if","args",":","help","(","*","args",")","return","variables","=","[","]","print","(","\"\\nMethods:\"",")","for","aliases",",","item","in","self",".","construct_locals","(",")",":","name","=","\", \"",".","join","(","aliases",")","if","item",".","__doc__","and","callable","(","item",")",":","print","(","\"* {}\"",".","format","(","name",")",")","print","(","\" {}\"",".","format","(","item",".","__doc__",")",")","else",":","variables",".","append","(","name",")","print","(","\"\\nVariables:\"",")","for","var","in","variables",":","print","(","\" {}\"",".","format","(","var",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L80-L98"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.construct_locals","parameters":"(self)","argument_list":"","return_statement":"return [(['dt', 'display_type'], self.display_type), (['db', 'display_bytes'], self.display_bytes),\n (['dw', 'display_words'], self.display_words), (['dd',\n 'display_doublewords'], self.display_doublewords),\n (['dq', 'display_quadwords'], self.display_quadwords), (['dis', 'disassemble'], self.disassemble),\n (['cl', 'change_layer'], self.change_layer), (['context'], self.context), (['self'], self),\n (['dpo', 'display_plugin_output'], self.display_plugin_output),\n (['gt', 'generate_treegrid'], self.generate_treegrid), (['rt',\n 'render_treegrid'], self.render_treegrid),\n (['ds', 'display_symbols'], self.display_symbols), (['hh', 'help'], self.help)]","docstring":"Returns a dictionary listing the functions to be added to the\n environment.","docstring_summary":"Returns a dictionary listing the functions to be added to the\n environment.","docstring_tokens":["Returns","a","dictionary","listing","the","functions","to","be","added","to","the","environment","."],"function":"def construct_locals(self) -> List[Tuple[List[str], Any]]:\n \"\"\"Returns a dictionary listing the functions to be added to the\n environment.\"\"\"\n return [(['dt', 'display_type'], self.display_type), (['db', 'display_bytes'], self.display_bytes),\n (['dw', 'display_words'], self.display_words), (['dd',\n 'display_doublewords'], self.display_doublewords),\n (['dq', 'display_quadwords'], self.display_quadwords), (['dis', 'disassemble'], self.disassemble),\n (['cl', 'change_layer'], self.change_layer), (['context'], self.context), (['self'], self),\n (['dpo', 'display_plugin_output'], self.display_plugin_output),\n (['gt', 'generate_treegrid'], self.generate_treegrid), (['rt',\n 'render_treegrid'], self.render_treegrid),\n (['ds', 'display_symbols'], self.display_symbols), (['hh', 'help'], self.help)]","function_tokens":["def","construct_locals","(","self",")","->","List","[","Tuple","[","List","[","str","]",",","Any","]","]",":","return","[","(","[","'dt'",",","'display_type'","]",",","self",".","display_type",")",",","(","[","'db'",",","'display_bytes'","]",",","self",".","display_bytes",")",",","(","[","'dw'",",","'display_words'","]",",","self",".","display_words",")",",","(","[","'dd'",",","'display_doublewords'","]",",","self",".","display_doublewords",")",",","(","[","'dq'",",","'display_quadwords'","]",",","self",".","display_quadwords",")",",","(","[","'dis'",",","'disassemble'","]",",","self",".","disassemble",")",",","(","[","'cl'",",","'change_layer'","]",",","self",".","change_layer",")",",","(","[","'context'","]",",","self",".","context",")",",","(","[","'self'","]",",","self",")",",","(","[","'dpo'",",","'display_plugin_output'","]",",","self",".","display_plugin_output",")",",","(","[","'gt'",",","'generate_treegrid'","]",",","self",".","generate_treegrid",")",",","(","[","'rt'",",","'render_treegrid'","]",",","self",".","render_treegrid",")",",","(","[","'ds'",",","'display_symbols'","]",",","self",".","display_symbols",")",",","(","[","'hh'",",","'help'","]",",","self",".","help",")","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L100-L111"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell._construct_locals_dict","parameters":"(self)","argument_list":"","return_statement":"return result","docstring":"Returns a dictionary of the locals","docstring_summary":"Returns a dictionary of the locals","docstring_tokens":["Returns","a","dictionary","of","the","locals"],"function":"def _construct_locals_dict(self) -> Dict[str, Any]:\n \"\"\"Returns a dictionary of the locals \"\"\"\n result = {}\n for aliases, value in self.construct_locals():\n for alias in aliases:\n result[alias] = value\n return result","function_tokens":["def","_construct_locals_dict","(","self",")","->","Dict","[","str",",","Any","]",":","result","=","{","}","for","aliases",",","value","in","self",".","construct_locals","(",")",":","for","alias","in","aliases",":","result","[","alias","]","=","value","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L113-L119"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell._read_data","parameters":"(self, offset, count = 128, layer_name = None)","argument_list":"","return_statement":"return self.context.layers[layer_name or self.current_layer].read(offset, count)","docstring":"Reads the bytes necessary for the display_* methods","docstring_summary":"Reads the bytes necessary for the display_* methods","docstring_tokens":["Reads","the","bytes","necessary","for","the","display_","*","methods"],"function":"def _read_data(self, offset, count = 128, layer_name = None):\n \"\"\"Reads the bytes necessary for the display_* methods\"\"\"\n return self.context.layers[layer_name or self.current_layer].read(offset, count)","function_tokens":["def","_read_data","(","self",",","offset",",","count","=","128",",","layer_name","=","None",")",":","return","self",".","context",".","layers","[","layer_name","or","self",".","current_layer","]",".","read","(","offset",",","count",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L121-L123"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell._display_data","parameters":"(self, offset: int, remaining_data: bytes, format_string: str = \"B\", ascii: bool = True)","argument_list":"","return_statement":"","docstring":"Display a series of bytes","docstring_summary":"Display a series of bytes","docstring_tokens":["Display","a","series","of","bytes"],"function":"def _display_data(self, offset: int, remaining_data: bytes, format_string: str = \"B\", ascii: bool = True):\n \"\"\"Display a series of bytes\"\"\"\n chunk_size = struct.calcsize(format_string)\n data_length = len(remaining_data)\n remaining_data = remaining_data[:data_length - (data_length % chunk_size)]\n\n while remaining_data:\n current_line, remaining_data = remaining_data[:16], remaining_data[16:]\n\n data_blocks = [current_line[chunk_size * i:chunk_size * (i + 1)] for i in range(16 \/\/ chunk_size)]\n data_blocks = [x for x in data_blocks if x != b'']\n valid_data = [(\"{:0\" + str(2 * chunk_size) + \"x}\").format(struct.unpack(format_string, x)[0])\n for x in data_blocks]\n padding_data = [\" \" * 2 * chunk_size for _ in range((16 - len(current_line)) \/\/ chunk_size)]\n hex_data = \" \".join(valid_data + padding_data)\n\n ascii_data = \"\"\n if ascii:\n connector = \" \"\n if chunk_size < 2:\n connector = \"\"\n ascii_data = connector.join([self._ascii_bytes(x) for x in valid_data])\n\n print(hex(offset), \" \", hex_data, \" \", ascii_data)\n offset += 16","function_tokens":["def","_display_data","(","self",",","offset",":","int",",","remaining_data",":","bytes",",","format_string",":","str","=","\"B\"",",","ascii",":","bool","=","True",")",":","chunk_size","=","struct",".","calcsize","(","format_string",")","data_length","=","len","(","remaining_data",")","remaining_data","=","remaining_data","[",":","data_length","-","(","data_length","%","chunk_size",")","]","while","remaining_data",":","current_line",",","remaining_data","=","remaining_data","[",":","16","]",",","remaining_data","[","16",":","]","data_blocks","=","[","current_line","[","chunk_size","*","i",":","chunk_size","*","(","i","+","1",")","]","for","i","in","range","(","16","\/\/","chunk_size",")","]","data_blocks","=","[","x","for","x","in","data_blocks","if","x","!=","b''","]","valid_data","=","[","(","\"{:0\"","+","str","(","2","*","chunk_size",")","+","\"x}\"",")",".","format","(","struct",".","unpack","(","format_string",",","x",")","[","0","]",")","for","x","in","data_blocks","]","padding_data","=","[","\" \"","*","2","*","chunk_size","for","_","in","range","(","(","16","-","len","(","current_line",")",")","\/\/","chunk_size",")","]","hex_data","=","\" \"",".","join","(","valid_data","+","padding_data",")","ascii_data","=","\"\"","if","ascii",":","connector","=","\" \"","if","chunk_size","<","2",":","connector","=","\"\"","ascii_data","=","connector",".","join","(","[","self",".","_ascii_bytes","(","x",")","for","x","in","valid_data","]",")","print","(","hex","(","offset",")",",","\" \"",",","hex_data",",","\" \"",",","ascii_data",")","offset","+=","16"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L125-L149"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell._ascii_bytes","parameters":"(bytes)","argument_list":"","return_statement":"return \"\".join([chr(x) if 32 < x < 127 else '.' for x in binascii.unhexlify(bytes)])","docstring":"Converts bytes into an ascii string","docstring_summary":"Converts bytes into an ascii string","docstring_tokens":["Converts","bytes","into","an","ascii","string"],"function":"def _ascii_bytes(bytes):\n \"\"\"Converts bytes into an ascii string\"\"\"\n return \"\".join([chr(x) if 32 < x < 127 else '.' for x in binascii.unhexlify(bytes)])","function_tokens":["def","_ascii_bytes","(","bytes",")",":","return","\"\"",".","join","(","[","chr","(","x",")","if","32","<","x","<","127","else","'.'","for","x","in","binascii",".","unhexlify","(","bytes",")","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L152-L154"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.change_layer","parameters":"(self, layer_name = None)","argument_list":"","return_statement":"","docstring":"Changes the current default layer","docstring_summary":"Changes the current default layer","docstring_tokens":["Changes","the","current","default","layer"],"function":"def change_layer(self, layer_name = None):\n \"\"\"Changes the current default layer\"\"\"\n if not layer_name:\n layer_name = self.config['primary']\n self._current_layer = layer_name\n sys.ps1 = \"({}) >>> \".format(self.current_layer)","function_tokens":["def","change_layer","(","self",",","layer_name","=","None",")",":","if","not","layer_name",":","layer_name","=","self",".","config","[","'primary'","]","self",".","_current_layer","=","layer_name","sys",".","ps1","=","\"({}) >>> \"",".","format","(","self",".","current_layer",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L160-L165"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.display_bytes","parameters":"(self, offset, count = 128, layer_name = None)","argument_list":"","return_statement":"","docstring":"Displays byte values and ASCII characters","docstring_summary":"Displays byte values and ASCII characters","docstring_tokens":["Displays","byte","values","and","ASCII","characters"],"function":"def display_bytes(self, offset, count = 128, layer_name = None):\n \"\"\"Displays byte values and ASCII characters\"\"\"\n remaining_data = self._read_data(offset, count = count, layer_name = layer_name)\n self._display_data(offset, remaining_data)","function_tokens":["def","display_bytes","(","self",",","offset",",","count","=","128",",","layer_name","=","None",")",":","remaining_data","=","self",".","_read_data","(","offset",",","count","=","count",",","layer_name","=","layer_name",")","self",".","_display_data","(","offset",",","remaining_data",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L167-L170"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.display_quadwords","parameters":"(self, offset, count = 128, layer_name = None)","argument_list":"","return_statement":"","docstring":"Displays quad-word values (8 bytes) and corresponding ASCII characters","docstring_summary":"Displays quad-word values (8 bytes) and corresponding ASCII characters","docstring_tokens":["Displays","quad","-","word","values","(","8","bytes",")","and","corresponding","ASCII","characters"],"function":"def display_quadwords(self, offset, count = 128, layer_name = None):\n \"\"\"Displays quad-word values (8 bytes) and corresponding ASCII characters\"\"\"\n remaining_data = self._read_data(offset, count = count, layer_name = layer_name)\n self._display_data(offset, remaining_data, format_string = \"Q\")","function_tokens":["def","display_quadwords","(","self",",","offset",",","count","=","128",",","layer_name","=","None",")",":","remaining_data","=","self",".","_read_data","(","offset",",","count","=","count",",","layer_name","=","layer_name",")","self",".","_display_data","(","offset",",","remaining_data",",","format_string","=","\"Q\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L172-L175"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.display_doublewords","parameters":"(self, offset, count = 128, layer_name = None)","argument_list":"","return_statement":"","docstring":"Displays double-word values (4 bytes) and corresponding ASCII characters","docstring_summary":"Displays double-word values (4 bytes) and corresponding ASCII characters","docstring_tokens":["Displays","double","-","word","values","(","4","bytes",")","and","corresponding","ASCII","characters"],"function":"def display_doublewords(self, offset, count = 128, layer_name = None):\n \"\"\"Displays double-word values (4 bytes) and corresponding ASCII characters\"\"\"\n remaining_data = self._read_data(offset, count = count, layer_name = layer_name)\n self._display_data(offset, remaining_data, format_string = \"I\")","function_tokens":["def","display_doublewords","(","self",",","offset",",","count","=","128",",","layer_name","=","None",")",":","remaining_data","=","self",".","_read_data","(","offset",",","count","=","count",",","layer_name","=","layer_name",")","self",".","_display_data","(","offset",",","remaining_data",",","format_string","=","\"I\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L177-L180"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.display_words","parameters":"(self, offset, count = 128, layer_name = None)","argument_list":"","return_statement":"","docstring":"Displays word values (2 bytes) and corresponding ASCII characters","docstring_summary":"Displays word values (2 bytes) and corresponding ASCII characters","docstring_tokens":["Displays","word","values","(","2","bytes",")","and","corresponding","ASCII","characters"],"function":"def display_words(self, offset, count = 128, layer_name = None):\n \"\"\"Displays word values (2 bytes) and corresponding ASCII characters\"\"\"\n remaining_data = self._read_data(offset, count = count, layer_name = layer_name)\n self._display_data(offset, remaining_data, format_string = \"H\")","function_tokens":["def","display_words","(","self",",","offset",",","count","=","128",",","layer_name","=","None",")",":","remaining_data","=","self",".","_read_data","(","offset",",","count","=","count",",","layer_name","=","layer_name",")","self",".","_display_data","(","offset",",","remaining_data",",","format_string","=","\"H\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L182-L185"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.disassemble","parameters":"(self, offset, count = 128, layer_name = None, architecture = None)","argument_list":"","return_statement":"","docstring":"Disassembles a number of instructions from the code at offset","docstring_summary":"Disassembles a number of instructions from the code at offset","docstring_tokens":["Disassembles","a","number","of","instructions","from","the","code","at","offset"],"function":"def disassemble(self, offset, count = 128, layer_name = None, architecture = None):\n \"\"\"Disassembles a number of instructions from the code at offset\"\"\"\n remaining_data = self._read_data(offset, count = count, layer_name = layer_name)\n if not has_capstone:\n print(\"Capstone not available - please install it to use the disassemble command\")\n else:\n if isinstance(self.context.layers[layer_name or self.current_layer], intel.Intel32e):\n architecture = 'intel64'\n elif isinstance(self.context.layers[layer_name or self.current_layer], intel.Intel):\n architecture = 'intel'\n disasm_types = {\n 'intel': capstone.Cs(capstone.CS_ARCH_X86, capstone.CS_MODE_32),\n 'intel64': capstone.Cs(capstone.CS_ARCH_X86, capstone.CS_MODE_64),\n 'arm': capstone.Cs(capstone.CS_ARCH_ARM, capstone.CS_MODE_ARM),\n 'arm64': capstone.Cs(capstone.CS_ARCH_ARM64, capstone.CS_MODE_ARM)\n }\n if architecture is not None:\n for i in disasm_types[architecture].disasm(remaining_data, offset):\n print(\"0x%x:\\t%s\\t%s\" % (i.address, i.mnemonic, i.op_str))","function_tokens":["def","disassemble","(","self",",","offset",",","count","=","128",",","layer_name","=","None",",","architecture","=","None",")",":","remaining_data","=","self",".","_read_data","(","offset",",","count","=","count",",","layer_name","=","layer_name",")","if","not","has_capstone",":","print","(","\"Capstone not available - please install it to use the disassemble command\"",")","else",":","if","isinstance","(","self",".","context",".","layers","[","layer_name","or","self",".","current_layer","]",",","intel",".","Intel32e",")",":","architecture","=","'intel64'","elif","isinstance","(","self",".","context",".","layers","[","layer_name","or","self",".","current_layer","]",",","intel",".","Intel",")",":","architecture","=","'intel'","disasm_types","=","{","'intel'",":","capstone",".","Cs","(","capstone",".","CS_ARCH_X86",",","capstone",".","CS_MODE_32",")",",","'intel64'",":","capstone",".","Cs","(","capstone",".","CS_ARCH_X86",",","capstone",".","CS_MODE_64",")",",","'arm'",":","capstone",".","Cs","(","capstone",".","CS_ARCH_ARM",",","capstone",".","CS_MODE_ARM",")",",","'arm64'",":","capstone",".","Cs","(","capstone",".","CS_ARCH_ARM64",",","capstone",".","CS_MODE_ARM",")","}","if","architecture","is","not","None",":","for","i","in","disasm_types","[","architecture","]",".","disasm","(","remaining_data",",","offset",")",":","print","(","\"0x%x:\\t%s\\t%s\"","%","(","i",".","address",",","i",".","mnemonic",",","i",".","op_str",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L187-L205"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.display_type","parameters":"(self,\n object: Union[str, interfaces.objects.ObjectInterface, interfaces.objects.Template],\n offset: int = None)","argument_list":"","return_statement":"","docstring":"Display Type describes the members of a particular object in alphabetical order","docstring_summary":"Display Type describes the members of a particular object in alphabetical order","docstring_tokens":["Display","Type","describes","the","members","of","a","particular","object","in","alphabetical","order"],"function":"def display_type(self,\n object: Union[str, interfaces.objects.ObjectInterface, interfaces.objects.Template],\n offset: int = None):\n \"\"\"Display Type describes the members of a particular object in alphabetical order\"\"\"\n if not isinstance(object, (str, interfaces.objects.ObjectInterface, interfaces.objects.Template)):\n print(\"Cannot display information about non-type object\")\n return\n\n if not isinstance(object, str):\n # Mypy requires us to order things this way\n volobject = object\n elif offset is None:\n # Str and no offset\n volobject = self.context.symbol_space.get_type(object)\n else:\n # Str and offset\n volobject = self.context.object(object, layer_name = self.current_layer, offset = offset)\n\n if offset is not None:\n volobject = self.context.object(volobject.vol.type_name, layer_name = self.current_layer, offset = offset)\n\n if hasattr(volobject.vol, 'size'):\n print(\"{} ({} bytes)\".format(volobject.vol.type_name, volobject.vol.size))\n elif hasattr(volobject.vol, 'data_format'):\n data_format = volobject.vol.data_format\n print(\"{} ({} bytes, {} endian, {})\".format(volobject.vol.type_name, data_format.length,\n data_format.byteorder,\n 'signed' if data_format.signed else 'unsigned'))\n\n if hasattr(volobject.vol, 'members'):\n longest_member = longest_offset = longest_typename = 0\n for member in volobject.vol.members:\n relative_offset, member_type = volobject.vol.members[member]\n longest_member = max(len(member), longest_member)\n longest_offset = max(len(hex(relative_offset)), longest_offset)\n longest_typename = max(len(member_type.vol.type_name), longest_typename)\n\n for member in sorted(volobject.vol.members, key = lambda x: (volobject.vol.members[x][0], x)):\n relative_offset, member_type = volobject.vol.members[member]\n len_offset = len(hex(relative_offset))\n len_member = len(member)\n len_typename = len(member_type.vol.type_name)\n if isinstance(volobject, interfaces.objects.ObjectInterface):\n # We're an instance, so also display the data\n print(\" \" * (longest_offset - len_offset), hex(relative_offset), \": \", member,\n \" \" * (longest_member - len_member), \" \",\n member_type.vol.type_name, \" \" * (longest_typename - len_typename), \" \",\n self._display_value(getattr(volobject, member)))\n else:\n print(\" \" * (longest_offset - len_offset), hex(relative_offset), \": \", member,\n \" \" * (longest_member - len_member), \" \", member_type.vol.type_name)","function_tokens":["def","display_type","(","self",",","object",":","Union","[","str",",","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","Template","]",",","offset",":","int","=","None",")",":","if","not","isinstance","(","object",",","(","str",",","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","Template",")",")",":","print","(","\"Cannot display information about non-type object\"",")","return","if","not","isinstance","(","object",",","str",")",":","# Mypy requires us to order things this way","volobject","=","object","elif","offset","is","None",":","# Str and no offset","volobject","=","self",".","context",".","symbol_space",".","get_type","(","object",")","else",":","# Str and offset","volobject","=","self",".","context",".","object","(","object",",","layer_name","=","self",".","current_layer",",","offset","=","offset",")","if","offset","is","not","None",":","volobject","=","self",".","context",".","object","(","volobject",".","vol",".","type_name",",","layer_name","=","self",".","current_layer",",","offset","=","offset",")","if","hasattr","(","volobject",".","vol",",","'size'",")",":","print","(","\"{} ({} bytes)\"",".","format","(","volobject",".","vol",".","type_name",",","volobject",".","vol",".","size",")",")","elif","hasattr","(","volobject",".","vol",",","'data_format'",")",":","data_format","=","volobject",".","vol",".","data_format","print","(","\"{} ({} bytes, {} endian, {})\"",".","format","(","volobject",".","vol",".","type_name",",","data_format",".","length",",","data_format",".","byteorder",",","'signed'","if","data_format",".","signed","else","'unsigned'",")",")","if","hasattr","(","volobject",".","vol",",","'members'",")",":","longest_member","=","longest_offset","=","longest_typename","=","0","for","member","in","volobject",".","vol",".","members",":","relative_offset",",","member_type","=","volobject",".","vol",".","members","[","member","]","longest_member","=","max","(","len","(","member",")",",","longest_member",")","longest_offset","=","max","(","len","(","hex","(","relative_offset",")",")",",","longest_offset",")","longest_typename","=","max","(","len","(","member_type",".","vol",".","type_name",")",",","longest_typename",")","for","member","in","sorted","(","volobject",".","vol",".","members",",","key","=","lambda","x",":","(","volobject",".","vol",".","members","[","x","]","[","0","]",",","x",")",")",":","relative_offset",",","member_type","=","volobject",".","vol",".","members","[","member","]","len_offset","=","len","(","hex","(","relative_offset",")",")","len_member","=","len","(","member",")","len_typename","=","len","(","member_type",".","vol",".","type_name",")","if","isinstance","(","volobject",",","interfaces",".","objects",".","ObjectInterface",")",":","# We're an instance, so also display the data","print","(","\" \"","*","(","longest_offset","-","len_offset",")",",","hex","(","relative_offset",")",",","\": \"",",","member",",","\" \"","*","(","longest_member","-","len_member",")",",","\" \"",",","member_type",".","vol",".","type_name",",","\" \"","*","(","longest_typename","-","len_typename",")",",","\" \"",",","self",".","_display_value","(","getattr","(","volobject",",","member",")",")",")","else",":","print","(","\" \"","*","(","longest_offset","-","len_offset",")",",","hex","(","relative_offset",")",",","\": \"",",","member",",","\" \"","*","(","longest_member","-","len_member",")",",","\" \"",",","member_type",".","vol",".","type_name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L207-L257"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.generate_treegrid","parameters":"(self, plugin: Type[interfaces.plugins.PluginInterface],\n **kwargs)","argument_list":"","return_statement":"return None","docstring":"Generates a TreeGrid based on a specific plugin passing in kwarg configuration values","docstring_summary":"Generates a TreeGrid based on a specific plugin passing in kwarg configuration values","docstring_tokens":["Generates","a","TreeGrid","based","on","a","specific","plugin","passing","in","kwarg","configuration","values"],"function":"def generate_treegrid(self, plugin: Type[interfaces.plugins.PluginInterface],\n **kwargs) -> Optional[interfaces.renderers.TreeGrid]:\n \"\"\"Generates a TreeGrid based on a specific plugin passing in kwarg configuration values\"\"\"\n path_join = interfaces.configuration.path_join\n\n # Generate a temporary configuration path\n plugin_config_suffix = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(32))\n plugin_path = path_join(self.config_path, plugin_config_suffix)\n\n # Populate the configuration\n for name, value in kwargs.items():\n self.config[path_join(plugin_config_suffix, plugin.__name__, name)] = value\n\n try:\n constructed = plugins.construct_plugin(self.context, [], plugin, plugin_path, None, NullFileHandler)\n return constructed.run()\n except exceptions.UnsatisfiedException as excp:\n print(\"Unable to validate the plugin requirements: {}\\n\".format([x for x in excp.unsatisfied]))\n return None","function_tokens":["def","generate_treegrid","(","self",",","plugin",":","Type","[","interfaces",".","plugins",".","PluginInterface","]",",","*","*","kwargs",")","->","Optional","[","interfaces",".","renderers",".","TreeGrid","]",":","path_join","=","interfaces",".","configuration",".","path_join","# Generate a temporary configuration path","plugin_config_suffix","=","''",".","join","(","random",".","choice","(","string",".","ascii_uppercase","+","string",".","digits",")","for","_","in","range","(","32",")",")","plugin_path","=","path_join","(","self",".","config_path",",","plugin_config_suffix",")","# Populate the configuration","for","name",",","value","in","kwargs",".","items","(",")",":","self",".","config","[","path_join","(","plugin_config_suffix",",","plugin",".","__name__",",","name",")","]","=","value","try",":","constructed","=","plugins",".","construct_plugin","(","self",".","context",",","[","]",",","plugin",",","plugin_path",",","None",",","NullFileHandler",")","return","constructed",".","run","(",")","except","exceptions",".","UnsatisfiedException","as","excp",":","print","(","\"Unable to validate the plugin requirements: {}\\n\"",".","format","(","[","x","for","x","in","excp",".","unsatisfied","]",")",")","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L268-L286"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.render_treegrid","parameters":"(self,\n treegrid: interfaces.renderers.TreeGrid,\n renderer: Optional[interfaces.renderers.Renderer] = None)","argument_list":"","return_statement":"","docstring":"Renders a treegrid as produced by generate_treegrid","docstring_summary":"Renders a treegrid as produced by generate_treegrid","docstring_tokens":["Renders","a","treegrid","as","produced","by","generate_treegrid"],"function":"def render_treegrid(self,\n treegrid: interfaces.renderers.TreeGrid,\n renderer: Optional[interfaces.renderers.Renderer] = None) -> None:\n \"\"\"Renders a treegrid as produced by generate_treegrid\"\"\"\n if renderer is None:\n renderer = text_renderer.QuickTextRenderer()\n renderer.render(treegrid)","function_tokens":["def","render_treegrid","(","self",",","treegrid",":","interfaces",".","renderers",".","TreeGrid",",","renderer",":","Optional","[","interfaces",".","renderers",".","Renderer","]","=","None",")","->","None",":","if","renderer","is","None",":","renderer","=","text_renderer",".","QuickTextRenderer","(",")","renderer",".","render","(","treegrid",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L288-L294"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.display_plugin_output","parameters":"(self, plugin: Type[interfaces.plugins.PluginInterface], **kwargs)","argument_list":"","return_statement":"","docstring":"Displays the output for a particular plugin (with keyword arguments)","docstring_summary":"Displays the output for a particular plugin (with keyword arguments)","docstring_tokens":["Displays","the","output","for","a","particular","plugin","(","with","keyword","arguments",")"],"function":"def display_plugin_output(self, plugin: Type[interfaces.plugins.PluginInterface], **kwargs) -> None:\n \"\"\"Displays the output for a particular plugin (with keyword arguments)\"\"\"\n treegrid = self.generate_treegrid(plugin, **kwargs)\n if treegrid is not None:\n self.render_treegrid(treegrid)","function_tokens":["def","display_plugin_output","(","self",",","plugin",":","Type","[","interfaces",".","plugins",".","PluginInterface","]",",","*","*","kwargs",")","->","None",":","treegrid","=","self",".","generate_treegrid","(","plugin",",","*","*","kwargs",")","if","treegrid","is","not","None",":","self",".","render_treegrid","(","treegrid",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L296-L300"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"Volshell.display_symbols","parameters":"(self, symbol_table: str = None)","argument_list":"","return_statement":"","docstring":"Prints an alphabetical list of symbols for a symbol table","docstring_summary":"Prints an alphabetical list of symbols for a symbol table","docstring_tokens":["Prints","an","alphabetical","list","of","symbols","for","a","symbol","table"],"function":"def display_symbols(self, symbol_table: str = None):\n \"\"\"Prints an alphabetical list of symbols for a symbol table\"\"\"\n if symbol_table is None:\n print(\"No symbol table provided\")\n return\n longest_offset = longest_name = 0\n\n table = self.context.symbol_space[symbol_table]\n for symbol_name in table.symbols:\n symbol = table.get_symbol(symbol_name)\n longest_offset = max(longest_offset, len(hex(symbol.address)))\n longest_name = max(longest_name, len(symbol.name))\n\n for symbol_name in sorted(table.symbols):\n symbol = table.get_symbol(symbol_name)\n len_offset = len(hex(symbol.address))\n print(\" \" * (longest_offset - len_offset), hex(symbol.address), \" \", symbol.name)","function_tokens":["def","display_symbols","(","self",",","symbol_table",":","str","=","None",")",":","if","symbol_table","is","None",":","print","(","\"No symbol table provided\"",")","return","longest_offset","=","longest_name","=","0","table","=","self",".","context",".","symbol_space","[","symbol_table","]","for","symbol_name","in","table",".","symbols",":","symbol","=","table",".","get_symbol","(","symbol_name",")","longest_offset","=","max","(","longest_offset",",","len","(","hex","(","symbol",".","address",")",")",")","longest_name","=","max","(","longest_name",",","len","(","symbol",".","name",")",")","for","symbol_name","in","sorted","(","table",".","symbols",")",":","symbol","=","table",".","get_symbol","(","symbol_name",")","len_offset","=","len","(","hex","(","symbol",".","address",")",")","print","(","\" \"","*","(","longest_offset","-","len_offset",")",",","hex","(","symbol",".","address",")",",","\" \"",",","symbol",".","name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L302-L318"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"NullFileHandler.writelines","parameters":"(self, lines)","argument_list":"","return_statement":"","docstring":"Dummy method","docstring_summary":"Dummy method","docstring_tokens":["Dummy","method"],"function":"def writelines(self, lines):\n \"\"\"Dummy method\"\"\"\n pass","function_tokens":["def","writelines","(","self",",","lines",")",":","pass"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L328-L330"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py","language":"python","identifier":"NullFileHandler.write","parameters":"(self, data)","argument_list":"","return_statement":"return len(data)","docstring":"Dummy method","docstring_summary":"Dummy method","docstring_tokens":["Dummy","method"],"function":"def write(self, data):\n \"\"\"Dummy method\"\"\"\n return len(data)","function_tokens":["def","write","(","self",",","data",")",":","return","len","(","data",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/generic.py#L332-L334"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/windows.py","language":"python","identifier":"Volshell.change_process","parameters":"(self, pid = None)","argument_list":"","return_statement":"","docstring":"Change the current process and layer, based on a process ID","docstring_summary":"Change the current process and layer, based on a process ID","docstring_tokens":["Change","the","current","process","and","layer","based","on","a","process","ID"],"function":"def change_process(self, pid = None):\n \"\"\"Change the current process and layer, based on a process ID\"\"\"\n processes = self.list_processes()\n for process in processes:\n if process.UniqueProcessId == pid:\n process_layer = process.add_process_layer()\n self.change_layer(process_layer)\n return\n print(\"No process with process ID {} found\".format(pid))","function_tokens":["def","change_process","(","self",",","pid","=","None",")",":","processes","=","self",".","list_processes","(",")","for","process","in","processes",":","if","process",".","UniqueProcessId","==","pid",":","process_layer","=","process",".","add_process_layer","(",")","self",".","change_layer","(","process_layer",")","return","print","(","\"No process with process ID {} found\"",".","format","(","pid",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/windows.py#L24-L32"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/windows.py","language":"python","identifier":"Volshell.list_processes","parameters":"(self)","argument_list":"","return_statement":"return list(pslist.PsList.list_processes(self.context, self.config['primary'], self.config['nt_symbols']))","docstring":"Returns a list of EPROCESS objects from the primary layer","docstring_summary":"Returns a list of EPROCESS objects from the primary layer","docstring_tokens":["Returns","a","list","of","EPROCESS","objects","from","the","primary","layer"],"function":"def list_processes(self):\n \"\"\"Returns a list of EPROCESS objects from the primary layer\"\"\"\n # We always use the main kernel memory and associated symbols\n return list(pslist.PsList.list_processes(self.context, self.config['primary'], self.config['nt_symbols']))","function_tokens":["def","list_processes","(","self",")",":","# We always use the main kernel memory and associated symbols","return","list","(","pslist",".","PsList",".","list_processes","(","self",".","context",",","self",".","config","[","'primary'","]",",","self",".","config","[","'nt_symbols'","]",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/windows.py#L34-L37"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/windows.py","language":"python","identifier":"Volshell.display_type","parameters":"(self,\n object: Union[str, interfaces.objects.ObjectInterface, interfaces.objects.Template],\n offset: int = None)","argument_list":"","return_statement":"return super().display_type(object, offset)","docstring":"Display Type describes the members of a particular object in alphabetical order","docstring_summary":"Display Type describes the members of a particular object in alphabetical order","docstring_tokens":["Display","Type","describes","the","members","of","a","particular","object","in","alphabetical","order"],"function":"def display_type(self,\n object: Union[str, interfaces.objects.ObjectInterface, interfaces.objects.Template],\n offset: int = None):\n \"\"\"Display Type describes the members of a particular object in alphabetical order\"\"\"\n if isinstance(object, str):\n if constants.BANG not in object:\n object = self.config['nt_symbols'] + constants.BANG + object\n return super().display_type(object, offset)","function_tokens":["def","display_type","(","self",",","object",":","Union","[","str",",","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","Template","]",",","offset",":","int","=","None",")",":","if","isinstance","(","object",",","str",")",":","if","constants",".","BANG","not","in","object",":","object","=","self",".","config","[","'nt_symbols'","]","+","constants",".","BANG","+","object","return","super","(",")",".","display_type","(","object",",","offset",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/windows.py#L50-L57"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/windows.py","language":"python","identifier":"Volshell.display_symbols","parameters":"(self, symbol_table: str = None)","argument_list":"","return_statement":"return super().display_symbols(symbol_table)","docstring":"Prints an alphabetical list of symbols for a symbol table","docstring_summary":"Prints an alphabetical list of symbols for a symbol table","docstring_tokens":["Prints","an","alphabetical","list","of","symbols","for","a","symbol","table"],"function":"def display_symbols(self, symbol_table: str = None):\n \"\"\"Prints an alphabetical list of symbols for a symbol table\"\"\"\n if symbol_table is None:\n symbol_table = self.config['nt_symbols']\n return super().display_symbols(symbol_table)","function_tokens":["def","display_symbols","(","self",",","symbol_table",":","str","=","None",")",":","if","symbol_table","is","None",":","symbol_table","=","self",".","config","[","'nt_symbols'","]","return","super","(",")",".","display_symbols","(","symbol_table",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/windows.py#L59-L63"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/linux.py","language":"python","identifier":"Volshell.change_task","parameters":"(self, pid = None)","argument_list":"","return_statement":"","docstring":"Change the current process and layer, based on a process ID","docstring_summary":"Change the current process and layer, based on a process ID","docstring_tokens":["Change","the","current","process","and","layer","based","on","a","process","ID"],"function":"def change_task(self, pid = None):\n \"\"\"Change the current process and layer, based on a process ID\"\"\"\n tasks = self.list_tasks()\n for task in tasks:\n if task.pid == pid:\n process_layer = task.add_process_layer()\n if process_layer is not None:\n self.change_layer(process_layer)\n return\n print(\"Layer for task ID {} could not be constructed\".format(pid))\n return\n print(\"No task with task ID {} found\".format(pid))","function_tokens":["def","change_task","(","self",",","pid","=","None",")",":","tasks","=","self",".","list_tasks","(",")","for","task","in","tasks",":","if","task",".","pid","==","pid",":","process_layer","=","task",".","add_process_layer","(",")","if","process_layer","is","not","None",":","self",".","change_layer","(","process_layer",")","return","print","(","\"Layer for task ID {} could not be constructed\"",".","format","(","pid",")",")","return","print","(","\"No task with task ID {} found\"",".","format","(","pid",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/linux.py#L24-L35"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/linux.py","language":"python","identifier":"Volshell.list_tasks","parameters":"(self)","argument_list":"","return_statement":"return list(pslist.PsList.list_tasks(self.context, self.config['primary'], self.config['vmlinux']))","docstring":"Returns a list of task objects from the primary layer","docstring_summary":"Returns a list of task objects from the primary layer","docstring_tokens":["Returns","a","list","of","task","objects","from","the","primary","layer"],"function":"def list_tasks(self):\n \"\"\"Returns a list of task objects from the primary layer\"\"\"\n # We always use the main kernel memory and associated symbols\n return list(pslist.PsList.list_tasks(self.context, self.config['primary'], self.config['vmlinux']))","function_tokens":["def","list_tasks","(","self",")",":","# We always use the main kernel memory and associated symbols","return","list","(","pslist",".","PsList",".","list_tasks","(","self",".","context",",","self",".","config","[","'primary'","]",",","self",".","config","[","'vmlinux'","]",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/linux.py#L37-L40"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/linux.py","language":"python","identifier":"Volshell.display_type","parameters":"(self,\n object: Union[str, interfaces.objects.ObjectInterface, interfaces.objects.Template],\n offset: int = None)","argument_list":"","return_statement":"return super().display_type(object, offset)","docstring":"Display Type describes the members of a particular object in alphabetical order","docstring_summary":"Display Type describes the members of a particular object in alphabetical order","docstring_tokens":["Display","Type","describes","the","members","of","a","particular","object","in","alphabetical","order"],"function":"def display_type(self,\n object: Union[str, interfaces.objects.ObjectInterface, interfaces.objects.Template],\n offset: int = None):\n \"\"\"Display Type describes the members of a particular object in alphabetical order\"\"\"\n if isinstance(object, str):\n if constants.BANG not in object:\n object = self.config['vmlinux'] + constants.BANG + object\n return super().display_type(object, offset)","function_tokens":["def","display_type","(","self",",","object",":","Union","[","str",",","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","Template","]",",","offset",":","int","=","None",")",":","if","isinstance","(","object",",","str",")",":","if","constants",".","BANG","not","in","object",":","object","=","self",".","config","[","'vmlinux'","]","+","constants",".","BANG","+","object","return","super","(",")",".","display_type","(","object",",","offset",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/linux.py#L53-L60"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/linux.py","language":"python","identifier":"Volshell.display_symbols","parameters":"(self, symbol_table: str = None)","argument_list":"","return_statement":"return super().display_symbols(symbol_table)","docstring":"Prints an alphabetical list of symbols for a symbol table","docstring_summary":"Prints an alphabetical list of symbols for a symbol table","docstring_tokens":["Prints","an","alphabetical","list","of","symbols","for","a","symbol","table"],"function":"def display_symbols(self, symbol_table: str = None):\n \"\"\"Prints an alphabetical list of symbols for a symbol table\"\"\"\n if symbol_table is None:\n symbol_table = self.config['vmlinux']\n return super().display_symbols(symbol_table)","function_tokens":["def","display_symbols","(","self",",","symbol_table",":","str","=","None",")",":","if","symbol_table","is","None",":","symbol_table","=","self",".","config","[","'vmlinux'","]","return","super","(",")",".","display_symbols","(","symbol_table",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/linux.py#L62-L66"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/mac.py","language":"python","identifier":"Volshell.change_task","parameters":"(self, pid = None)","argument_list":"","return_statement":"","docstring":"Change the current process and layer, based on a process ID","docstring_summary":"Change the current process and layer, based on a process ID","docstring_tokens":["Change","the","current","process","and","layer","based","on","a","process","ID"],"function":"def change_task(self, pid = None):\n \"\"\"Change the current process and layer, based on a process ID\"\"\"\n tasks = self.list_tasks()\n for task in tasks:\n if task.p_pid == pid:\n process_layer = task.add_process_layer()\n if process_layer is not None:\n self.change_layer(process_layer)\n return\n print(\"Layer for task ID {} could not be constructed\".format(pid))\n return\n print(\"No task with task ID {} found\".format(pid))","function_tokens":["def","change_task","(","self",",","pid","=","None",")",":","tasks","=","self",".","list_tasks","(",")","for","task","in","tasks",":","if","task",".","p_pid","==","pid",":","process_layer","=","task",".","add_process_layer","(",")","if","process_layer","is","not","None",":","self",".","change_layer","(","process_layer",")","return","print","(","\"Layer for task ID {} could not be constructed\"",".","format","(","pid",")",")","return","print","(","\"No task with task ID {} found\"",".","format","(","pid",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/mac.py#L24-L35"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/mac.py","language":"python","identifier":"Volshell.list_tasks","parameters":"(self)","argument_list":"","return_statement":"return list(pslist.PsList.list_tasks(self.context, self.config['primary'], self.config['darwin']))","docstring":"Returns a list of task objects from the primary layer","docstring_summary":"Returns a list of task objects from the primary layer","docstring_tokens":["Returns","a","list","of","task","objects","from","the","primary","layer"],"function":"def list_tasks(self):\n \"\"\"Returns a list of task objects from the primary layer\"\"\"\n # We always use the main kernel memory and associated symbols\n return list(pslist.PsList.list_tasks(self.context, self.config['primary'], self.config['darwin']))","function_tokens":["def","list_tasks","(","self",")",":","# We always use the main kernel memory and associated symbols","return","list","(","pslist",".","PsList",".","list_tasks","(","self",".","context",",","self",".","config","[","'primary'","]",",","self",".","config","[","'darwin'","]",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/mac.py#L37-L40"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/mac.py","language":"python","identifier":"Volshell.display_type","parameters":"(self,\n object: Union[str, interfaces.objects.ObjectInterface, interfaces.objects.Template],\n offset: int = None)","argument_list":"","return_statement":"return super().display_type(object, offset)","docstring":"Display Type describes the members of a particular object in alphabetical order","docstring_summary":"Display Type describes the members of a particular object in alphabetical order","docstring_tokens":["Display","Type","describes","the","members","of","a","particular","object","in","alphabetical","order"],"function":"def display_type(self,\n object: Union[str, interfaces.objects.ObjectInterface, interfaces.objects.Template],\n offset: int = None):\n \"\"\"Display Type describes the members of a particular object in alphabetical order\"\"\"\n if isinstance(object, str):\n if constants.BANG not in object:\n object = self.config['darwin'] + constants.BANG + object\n return super().display_type(object, offset)","function_tokens":["def","display_type","(","self",",","object",":","Union","[","str",",","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","Template","]",",","offset",":","int","=","None",")",":","if","isinstance","(","object",",","str",")",":","if","constants",".","BANG","not","in","object",":","object","=","self",".","config","[","'darwin'","]","+","constants",".","BANG","+","object","return","super","(",")",".","display_type","(","object",",","offset",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/mac.py#L53-L60"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/mac.py","language":"python","identifier":"Volshell.display_symbols","parameters":"(self, symbol_table: str = None)","argument_list":"","return_statement":"return super().display_symbols(symbol_table)","docstring":"Prints an alphabetical list of symbols for a symbol table","docstring_summary":"Prints an alphabetical list of symbols for a symbol table","docstring_tokens":["Prints","an","alphabetical","list","of","symbols","for","a","symbol","table"],"function":"def display_symbols(self, symbol_table: str = None):\n \"\"\"Prints an alphabetical list of symbols for a symbol table\"\"\"\n if symbol_table is None:\n symbol_table = self.config['darwin']\n return super().display_symbols(symbol_table)","function_tokens":["def","display_symbols","(","self",",","symbol_table",":","str","=","None",")",":","if","symbol_table","is","None",":","symbol_table","=","self",".","config","[","'darwin'","]","return","super","(",")",".","display_symbols","(","symbol_table",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/cli\/volshell\/mac.py#L62-L66"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/__init__.py","language":"python","identifier":"interface_version","parameters":"()","argument_list":"","return_statement":"return constants.VERSION_MAJOR, constants.VERSION_MINOR, constants.VERSION_PATCH","docstring":"Provides the so version number of the library.","docstring_summary":"Provides the so version number of the library.","docstring_tokens":["Provides","the","so","version","number","of","the","library","."],"function":"def interface_version():\n \"\"\"Provides the so version number of the library.\"\"\"\n return constants.VERSION_MAJOR, constants.VERSION_MINOR, constants.VERSION_PATCH","function_tokens":["def","interface_version","(",")",":","return","constants",".","VERSION_MAJOR",",","constants",".","VERSION_MINOR",",","constants",".","VERSION_PATCH"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/__init__.py#L35-L37"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/__init__.py","language":"python","identifier":"require_interface_version","parameters":"(*args)","argument_list":"","return_statement":"","docstring":"Checks the required version of a plugin.","docstring_summary":"Checks the required version of a plugin.","docstring_tokens":["Checks","the","required","version","of","a","plugin","."],"function":"def require_interface_version(*args) -> None:\n \"\"\"Checks the required version of a plugin.\"\"\"\n if len(args):\n if args[0] != interface_version()[0]:\n raise RuntimeError(\"Framework interface version {} is incompatible with required version {}\".format(\n interface_version()[0], args[0]))\n if len(args) > 1:\n if args[1] > interface_version()[1]:\n raise RuntimeError(\n \"Framework interface version {} is an older revision than the required version {}\".format(\n \".\".join([str(x) for x in interface_version()[0:1]]), \".\".join([str(x) for x in args[0:2]])))","function_tokens":["def","require_interface_version","(","*","args",")","->","None",":","if","len","(","args",")",":","if","args","[","0","]","!=","interface_version","(",")","[","0","]",":","raise","RuntimeError","(","\"Framework interface version {} is incompatible with required version {}\"",".","format","(","interface_version","(",")","[","0","]",",","args","[","0","]",")",")","if","len","(","args",")",">","1",":","if","args","[","1","]",">","interface_version","(",")","[","1","]",":","raise","RuntimeError","(","\"Framework interface version {} is an older revision than the required version {}\"",".","format","(","\".\"",".","join","(","[","str","(","x",")","for","x","in","interface_version","(",")","[","0",":","1","]","]",")",",","\".\"",".","join","(","[","str","(","x",")","for","x","in","args","[","0",":","2","]","]",")",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/__init__.py#L43-L53"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/__init__.py","language":"python","identifier":"class_subclasses","parameters":"(cls: Type[T])","argument_list":"","return_statement":"","docstring":"Returns all the (recursive) subclasses of a given class.","docstring_summary":"Returns all the (recursive) subclasses of a given class.","docstring_tokens":["Returns","all","the","(","recursive",")","subclasses","of","a","given","class","."],"function":"def class_subclasses(cls: Type[T]) -> Generator[Type[T], None, None]:\n \"\"\"Returns all the (recursive) subclasses of a given class.\"\"\"\n if not inspect.isclass(cls):\n raise TypeError(\"class_subclasses parameter not a valid class: {}\".format(cls))\n for clazz in cls.__subclasses__():\n # The typing system is not clever enough to realize that clazz has a hidden attr after the hasattr check\n if not hasattr(clazz, 'hidden') or not clazz.hidden: # type: ignore\n yield clazz\n for return_value in class_subclasses(clazz):\n yield return_value","function_tokens":["def","class_subclasses","(","cls",":","Type","[","T","]",")","->","Generator","[","Type","[","T","]",",","None",",","None","]",":","if","not","inspect",".","isclass","(","cls",")",":","raise","TypeError","(","\"class_subclasses parameter not a valid class: {}\"",".","format","(","cls",")",")","for","clazz","in","cls",".","__subclasses__","(",")",":","# The typing system is not clever enough to realize that clazz has a hidden attr after the hasattr check","if","not","hasattr","(","clazz",",","'hidden'",")","or","not","clazz",".","hidden",":","# type: ignore","yield","clazz","for","return_value","in","class_subclasses","(","clazz",")",":","yield","return_value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/__init__.py#L78-L87"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/__init__.py","language":"python","identifier":"import_files","parameters":"(base_module, ignore_errors = False)","argument_list":"","return_statement":"return failures","docstring":"Imports all plugins present under plugins module namespace.","docstring_summary":"Imports all plugins present under plugins module namespace.","docstring_tokens":["Imports","all","plugins","present","under","plugins","module","namespace","."],"function":"def import_files(base_module, ignore_errors = False) -> List[str]:\n \"\"\"Imports all plugins present under plugins module namespace.\"\"\"\n failures = []\n if not isinstance(base_module.__path__, list):\n raise TypeError(\"[base_module].__path__ must be a list of paths\")\n vollog.log(constants.LOGLEVEL_VVVV,\n \"Importing from the following paths: {}\".format(\", \".join(base_module.__path__)))\n for path in base_module.__path__:\n for root, _, files in os.walk(path, followlinks = True):\n # TODO: Figure out how to import pycache files\n if root.endswith(\"__pycache__\"):\n continue\n for f in files:\n if (f.endswith(\".py\") or f.endswith(\".pyc\") or f.endswith(\".pyo\")) and not f.startswith(\"__\"):\n modpath = os.path.join(root[len(path) + len(os.path.sep):], f[:f.rfind(\".\")])\n module = modpath.replace(os.path.sep, \".\")\n if base_module.__name__ + \".\" + module not in sys.modules:\n try:\n importlib.import_module(base_module.__name__ + \".\" + module)\n except ImportError as e:\n vollog.debug(str(e))\n vollog.debug(\"Failed to import module {} based on file: {}\".format(\n base_module.__name__ + \".\" + module, modpath))\n failures.append(base_module.__name__ + \".\" + module)\n if not ignore_errors:\n raise\n return failures","function_tokens":["def","import_files","(","base_module",",","ignore_errors","=","False",")","->","List","[","str","]",":","failures","=","[","]","if","not","isinstance","(","base_module",".","__path__",",","list",")",":","raise","TypeError","(","\"[base_module].__path__ must be a list of paths\"",")","vollog",".","log","(","constants",".","LOGLEVEL_VVVV",",","\"Importing from the following paths: {}\"",".","format","(","\", \"",".","join","(","base_module",".","__path__",")",")",")","for","path","in","base_module",".","__path__",":","for","root",",","_",",","files","in","os",".","walk","(","path",",","followlinks","=","True",")",":","# TODO: Figure out how to import pycache files","if","root",".","endswith","(","\"__pycache__\"",")",":","continue","for","f","in","files",":","if","(","f",".","endswith","(","\".py\"",")","or","f",".","endswith","(","\".pyc\"",")","or","f",".","endswith","(","\".pyo\"",")",")","and","not","f",".","startswith","(","\"__\"",")",":","modpath","=","os",".","path",".","join","(","root","[","len","(","path",")","+","len","(","os",".","path",".","sep",")",":","]",",","f","[",":","f",".","rfind","(","\".\"",")","]",")","module","=","modpath",".","replace","(","os",".","path",".","sep",",","\".\"",")","if","base_module",".","__name__","+","\".\"","+","module","not","in","sys",".","modules",":","try",":","importlib",".","import_module","(","base_module",".","__name__","+","\".\"","+","module",")","except","ImportError","as","e",":","vollog",".","debug","(","str","(","e",")",")","vollog",".","debug","(","\"Failed to import module {} based on file: {}\"",".","format","(","base_module",".","__name__","+","\".\"","+","module",",","modpath",")",")","failures",".","append","(","base_module",".","__name__","+","\".\"","+","module",")","if","not","ignore_errors",":","raise","return","failures"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/__init__.py#L90-L116"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/timeliner.py","language":"python","identifier":"TimeLinerInterface.generate_timeline","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Method generates Tuples of (description, timestamp_type, timestamp)\n\n These need not be generated in any particular order, sorting\n will be done later","docstring_summary":"Method generates Tuples of (description, timestamp_type, timestamp)","docstring_tokens":["Method","generates","Tuples","of","(","description","timestamp_type","timestamp",")"],"function":"def generate_timeline(self) -> Generator[Tuple[str, TimeLinerType, datetime.datetime], None, None]:\n \"\"\"Method generates Tuples of (description, timestamp_type, timestamp)\n\n These need not be generated in any particular order, sorting\n will be done later\n \"\"\"","function_tokens":["def","generate_timeline","(","self",")","->","Generator","[","Tuple","[","str",",","TimeLinerType",",","datetime",".","datetime","]",",","None",",","None","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/timeliner.py#L33-L38"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/timeliner.py","language":"python","identifier":"Timeliner._generator","parameters":"(self, runable_plugins: List[TimeLinerInterface])","argument_list":"","return_statement":"","docstring":"Takes a timeline, sorts it and output the data from each relevant\n row from each plugin.","docstring_summary":"Takes a timeline, sorts it and output the data from each relevant\n row from each plugin.","docstring_tokens":["Takes","a","timeline","sorts","it","and","output","the","data","from","each","relevant","row","from","each","plugin","."],"function":"def _generator(self, runable_plugins: List[TimeLinerInterface]) -> Optional[Iterable[Tuple[int, Tuple]]]:\n \"\"\"Takes a timeline, sorts it and output the data from each relevant\n row from each plugin.\"\"\"\n # Generate the results for each plugin\n data = []\n for plugin in runable_plugins:\n plugin_name = plugin.__class__.__name__\n self._progress_callback((runable_plugins.index(plugin) * 100) \/\/ len(runable_plugins),\n \"Running plugin {}...\".format(plugin_name))\n try:\n vollog.log(logging.INFO, \"Running {}\".format(plugin_name))\n for (item, timestamp_type, timestamp) in plugin.generate_timeline():\n times = self.timeline.get((plugin_name, item), {})\n if times.get(timestamp_type, None) is not None:\n vollog.debug(\"Multiple timestamps for the same plugin\/file combination found: {} {}\".format(\n plugin_name, item))\n times[timestamp_type] = timestamp\n self.timeline[(plugin_name, item)] = times\n data.append((0, [\n plugin_name, item,\n times.get(TimeLinerType.CREATED, renderers.NotApplicableValue()),\n times.get(TimeLinerType.MODIFIED, renderers.NotApplicableValue()),\n times.get(TimeLinerType.ACCESSED, renderers.NotApplicableValue()),\n times.get(TimeLinerType.CHANGED, renderers.NotApplicableValue())\n ]))\n except Exception:\n vollog.log(logging.INFO, \"Exception occurred running plugin: {}\".format(plugin_name))\n vollog.log(logging.DEBUG, traceback.format_exc())\n for data_item in sorted(data, key = self._sort_function):\n yield data_item\n\n # Write out a body file if necessary\n if self.config.get('create-bodyfile', True):\n with self.open(\"volatility.body\") as file_data:\n with io.TextIOWrapper(file_data, write_through = True) as fp:\n for (plugin_name, item) in self.timeline:\n times = self.timeline[(plugin_name, item)]\n # Body format is: MD5|name|inode|mode_as_string|UID|GID|size|atime|mtime|ctime|crtime\n\n if self._any_time_present(times):\n fp.write(\"|{} - {}||||||{}|{}|{}|{}\\n\".format(\n plugin_name, self._sanitize_body_format(item),\n self._text_format(times.get(TimeLinerType.ACCESSED, \"\")),\n self._text_format(times.get(TimeLinerType.MODIFIED, \"\")),\n self._text_format(times.get(TimeLinerType.CHANGED, \"\")),\n self._text_format(times.get(TimeLinerType.CREATED, \"\"))))","function_tokens":["def","_generator","(","self",",","runable_plugins",":","List","[","TimeLinerInterface","]",")","->","Optional","[","Iterable","[","Tuple","[","int",",","Tuple","]","]","]",":","# Generate the results for each plugin","data","=","[","]","for","plugin","in","runable_plugins",":","plugin_name","=","plugin",".","__class__",".","__name__","self",".","_progress_callback","(","(","runable_plugins",".","index","(","plugin",")","*","100",")","\/\/","len","(","runable_plugins",")",",","\"Running plugin {}...\"",".","format","(","plugin_name",")",")","try",":","vollog",".","log","(","logging",".","INFO",",","\"Running {}\"",".","format","(","plugin_name",")",")","for","(","item",",","timestamp_type",",","timestamp",")","in","plugin",".","generate_timeline","(",")",":","times","=","self",".","timeline",".","get","(","(","plugin_name",",","item",")",",","{","}",")","if","times",".","get","(","timestamp_type",",","None",")","is","not","None",":","vollog",".","debug","(","\"Multiple timestamps for the same plugin\/file combination found: {} {}\"",".","format","(","plugin_name",",","item",")",")","times","[","timestamp_type","]","=","timestamp","self",".","timeline","[","(","plugin_name",",","item",")","]","=","times","data",".","append","(","(","0",",","[","plugin_name",",","item",",","times",".","get","(","TimeLinerType",".","CREATED",",","renderers",".","NotApplicableValue","(",")",")",",","times",".","get","(","TimeLinerType",".","MODIFIED",",","renderers",".","NotApplicableValue","(",")",")",",","times",".","get","(","TimeLinerType",".","ACCESSED",",","renderers",".","NotApplicableValue","(",")",")",",","times",".","get","(","TimeLinerType",".","CHANGED",",","renderers",".","NotApplicableValue","(",")",")","]",")",")","except","Exception",":","vollog",".","log","(","logging",".","INFO",",","\"Exception occurred running plugin: {}\"",".","format","(","plugin_name",")",")","vollog",".","log","(","logging",".","DEBUG",",","traceback",".","format_exc","(",")",")","for","data_item","in","sorted","(","data",",","key","=","self",".","_sort_function",")",":","yield","data_item","# Write out a body file if necessary","if","self",".","config",".","get","(","'create-bodyfile'",",","True",")",":","with","self",".","open","(","\"volatility.body\"",")","as","file_data",":","with","io",".","TextIOWrapper","(","file_data",",","write_through","=","True",")","as","fp",":","for","(","plugin_name",",","item",")","in","self",".","timeline",":","times","=","self",".","timeline","[","(","plugin_name",",","item",")","]","# Body format is: MD5|name|inode|mode_as_string|UID|GID|size|atime|mtime|ctime|crtime","if","self",".","_any_time_present","(","times",")",":","fp",".","write","(","\"|{} - {}||||||{}|{}|{}|{}\\n\"",".","format","(","plugin_name",",","self",".","_sanitize_body_format","(","item",")",",","self",".","_text_format","(","times",".","get","(","TimeLinerType",".","ACCESSED",",","\"\"",")",")",",","self",".","_text_format","(","times",".","get","(","TimeLinerType",".","MODIFIED",",","\"\"",")",")",",","self",".","_text_format","(","times",".","get","(","TimeLinerType",".","CHANGED",",","\"\"",")",")",",","self",".","_text_format","(","times",".","get","(","TimeLinerType",".","CREATED",",","\"\"",")",")",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/timeliner.py#L108-L153"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/timeliner.py","language":"python","identifier":"Timeliner._text_format","parameters":"(self, value)","argument_list":"","return_statement":"return value","docstring":"Formats a value as text, in case it is an AbsentValue","docstring_summary":"Formats a value as text, in case it is an AbsentValue","docstring_tokens":["Formats","a","value","as","text","in","case","it","is","an","AbsentValue"],"function":"def _text_format(self, value):\n \"\"\"Formats a value as text, in case it is an AbsentValue\"\"\"\n if isinstance(value, interfaces.renderers.BaseAbsentValue):\n return \"\"\n if isinstance(value, datetime.datetime):\n return int(value.timestamp())\n return value","function_tokens":["def","_text_format","(","self",",","value",")",":","if","isinstance","(","value",",","interfaces",".","renderers",".","BaseAbsentValue",")",":","return","\"\"","if","isinstance","(","value",",","datetime",".","datetime",")",":","return","int","(","value",".","timestamp","(",")",")","return","value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/timeliner.py#L164-L170"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/timeliner.py","language":"python","identifier":"Timeliner.run","parameters":"(self)","argument_list":"","return_statement":"return renderers.TreeGrid(columns = [(\"Plugin\", str), (\"Description\", str), (\"Created Date\", datetime.datetime),\n (\"Modified Date\", datetime.datetime), (\"Accessed Date\", datetime.datetime),\n (\"Changed Date\", datetime.datetime)],\n generator = self._generator(plugins_to_run))","docstring":"Isolate each plugin and run it.","docstring_summary":"Isolate each plugin and run it.","docstring_tokens":["Isolate","each","plugin","and","run","it","."],"function":"def run(self):\n \"\"\"Isolate each plugin and run it.\"\"\"\n\n # Use all the plugins if there's no filter\n self.usable_plugins = self.usable_plugins or self.get_usable_plugins()\n self.automagics = self.automagics or automagic.available(self._context)\n plugins_to_run = []\n\n filter_list = self.config['plugin-filter']\n # Identify plugins that we can run which output datetimes\n for plugin_class in self.usable_plugins:\n try:\n automagics = automagic.choose_automagic(self.automagics, plugin_class)\n\n plugin = plugins.construct_plugin(self.context, automagics, plugin_class, self.config_path,\n self._progress_callback, self.open)\n\n if isinstance(plugin, TimeLinerInterface):\n if not len(filter_list) or any(\n [filter in plugin.__module__ + '.' + plugin.__class__.__name__ for filter in filter_list]):\n plugins_to_run.append(plugin)\n except exceptions.UnsatisfiedException as excp:\n # Remove the failed plugin from the list and continue\n vollog.debug(\"Unable to satisfy {}: {}\".format(plugin_class.__name__, excp.unsatisfied))\n continue\n\n if self.config.get('record-config', False):\n total_config = {}\n for plugin in plugins_to_run:\n old_dict = dict(plugin.build_configuration())\n for entry in old_dict:\n total_config[interfaces.configuration.path_join(plugin.__class__.__name__, entry)] = old_dict[entry]\n\n with self.open(\"config.json\") as file_data:\n with io.TextIOWrapper(file_data, write_through = True) as fp:\n json.dump(total_config, fp, sort_keys = True, indent = 2)\n\n return renderers.TreeGrid(columns = [(\"Plugin\", str), (\"Description\", str), (\"Created Date\", datetime.datetime),\n (\"Modified Date\", datetime.datetime), (\"Accessed Date\", datetime.datetime),\n (\"Changed Date\", datetime.datetime)],\n generator = self._generator(plugins_to_run))","function_tokens":["def","run","(","self",")",":","# Use all the plugins if there's no filter","self",".","usable_plugins","=","self",".","usable_plugins","or","self",".","get_usable_plugins","(",")","self",".","automagics","=","self",".","automagics","or","automagic",".","available","(","self",".","_context",")","plugins_to_run","=","[","]","filter_list","=","self",".","config","[","'plugin-filter'","]","# Identify plugins that we can run which output datetimes","for","plugin_class","in","self",".","usable_plugins",":","try",":","automagics","=","automagic",".","choose_automagic","(","self",".","automagics",",","plugin_class",")","plugin","=","plugins",".","construct_plugin","(","self",".","context",",","automagics",",","plugin_class",",","self",".","config_path",",","self",".","_progress_callback",",","self",".","open",")","if","isinstance","(","plugin",",","TimeLinerInterface",")",":","if","not","len","(","filter_list",")","or","any","(","[","filter","in","plugin",".","__module__","+","'.'","+","plugin",".","__class__",".","__name__","for","filter","in","filter_list","]",")",":","plugins_to_run",".","append","(","plugin",")","except","exceptions",".","UnsatisfiedException","as","excp",":","# Remove the failed plugin from the list and continue","vollog",".","debug","(","\"Unable to satisfy {}: {}\"",".","format","(","plugin_class",".","__name__",",","excp",".","unsatisfied",")",")","continue","if","self",".","config",".","get","(","'record-config'",",","False",")",":","total_config","=","{","}","for","plugin","in","plugins_to_run",":","old_dict","=","dict","(","plugin",".","build_configuration","(",")",")","for","entry","in","old_dict",":","total_config","[","interfaces",".","configuration",".","path_join","(","plugin",".","__class__",".","__name__",",","entry",")","]","=","old_dict","[","entry","]","with","self",".","open","(","\"config.json\"",")","as","file_data",":","with","io",".","TextIOWrapper","(","file_data",",","write_through","=","True",")","as","fp",":","json",".","dump","(","total_config",",","fp",",","sort_keys","=","True",",","indent","=","2",")","return","renderers",".","TreeGrid","(","columns","=","[","(","\"Plugin\"",",","str",")",",","(","\"Description\"",",","str",")",",","(","\"Created Date\"",",","datetime",".","datetime",")",",","(","\"Modified Date\"",",","datetime",".","datetime",")",",","(","\"Accessed Date\"",",","datetime",".","datetime",")",",","(","\"Changed Date\"",",","datetime",".","datetime",")","]",",","generator","=","self",".","_generator","(","plugins_to_run",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/timeliner.py#L172-L212"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/timeliner.py","language":"python","identifier":"Timeliner.build_configuration","parameters":"(self)","argument_list":"","return_statement":"return []","docstring":"Builds the configuration to save for the plugin such that it can be\n reconstructed.","docstring_summary":"Builds the configuration to save for the plugin such that it can be\n reconstructed.","docstring_tokens":["Builds","the","configuration","to","save","for","the","plugin","such","that","it","can","be","reconstructed","."],"function":"def build_configuration(self):\n \"\"\"Builds the configuration to save for the plugin such that it can be\n reconstructed.\"\"\"\n vollog.warning(\"Unable to record configuration data for the timeliner plugin\")\n return []","function_tokens":["def","build_configuration","(","self",")",":","vollog",".","warning","(","\"Unable to record configuration data for the timeliner plugin\"",")","return","[","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/timeliner.py#L214-L218"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/__init__.py","language":"python","identifier":"construct_plugin","parameters":"(context: interfaces.context.ContextInterface,\n automagics: List[interfaces.automagic.AutomagicInterface],\n plugin: Type[interfaces.plugins.PluginInterface], base_config_path: str,\n progress_callback: constants.ProgressCallback,\n open_method: Type[interfaces.plugins.FileHandlerInterface])","argument_list":"","return_statement":"return constructed","docstring":"Constructs a plugin object based on the parameters.\n\n Clever magic figures out how to fulfill each requirement that might not be fulfilled\n\n Args:\n context: The volatility context to operate on\n automagics: A list of automagic modules to run to augment the context\n plugin: The plugin to run\n base_config_path: The path within the context's config containing the plugin's configuration\n progress_callback: Callback function to provide feedback for ongoing processes\n open_method: class to provide context manager for opening the file\n\n Returns:\n The constructed plugin object","docstring_summary":"Constructs a plugin object based on the parameters.","docstring_tokens":["Constructs","a","plugin","object","based","on","the","parameters","."],"function":"def construct_plugin(context: interfaces.context.ContextInterface,\n automagics: List[interfaces.automagic.AutomagicInterface],\n plugin: Type[interfaces.plugins.PluginInterface], base_config_path: str,\n progress_callback: constants.ProgressCallback,\n open_method: Type[interfaces.plugins.FileHandlerInterface]) -> interfaces.plugins.PluginInterface:\n \"\"\"Constructs a plugin object based on the parameters.\n\n Clever magic figures out how to fulfill each requirement that might not be fulfilled\n\n Args:\n context: The volatility context to operate on\n automagics: A list of automagic modules to run to augment the context\n plugin: The plugin to run\n base_config_path: The path within the context's config containing the plugin's configuration\n progress_callback: Callback function to provide feedback for ongoing processes\n open_method: class to provide context manager for opening the file\n\n Returns:\n The constructed plugin object\n \"\"\"\n errors = automagic.run(automagics, context, plugin, base_config_path, progress_callback = progress_callback)\n # Plugins always get their configuration stored under their plugin name\n plugin_config_path = interfaces.configuration.path_join(base_config_path, plugin.__name__)\n\n # Check all the requirements and\/or go back to the automagic step\n unsatisfied = plugin.unsatisfied(context, plugin_config_path)\n if unsatisfied:\n for error in errors:\n error_string = [x for x in error.format_exception_only()][-1]\n vollog.warning(\"Automagic exception occurred: {}\".format(error_string[:-1]))\n vollog.log(constants.LOGLEVEL_V, \"\".join(error.format(chain = True)))\n raise exceptions.UnsatisfiedException(unsatisfied)\n\n constructed = plugin(context, plugin_config_path, progress_callback = progress_callback)\n if open_method:\n constructed.set_open_method(open_method)\n return constructed","function_tokens":["def","construct_plugin","(","context",":","interfaces",".","context",".","ContextInterface",",","automagics",":","List","[","interfaces",".","automagic",".","AutomagicInterface","]",",","plugin",":","Type","[","interfaces",".","plugins",".","PluginInterface","]",",","base_config_path",":","str",",","progress_callback",":","constants",".","ProgressCallback",",","open_method",":","Type","[","interfaces",".","plugins",".","FileHandlerInterface","]",")","->","interfaces",".","plugins",".","PluginInterface",":","errors","=","automagic",".","run","(","automagics",",","context",",","plugin",",","base_config_path",",","progress_callback","=","progress_callback",")","# Plugins always get their configuration stored under their plugin name","plugin_config_path","=","interfaces",".","configuration",".","path_join","(","base_config_path",",","plugin",".","__name__",")","# Check all the requirements and\/or go back to the automagic step","unsatisfied","=","plugin",".","unsatisfied","(","context",",","plugin_config_path",")","if","unsatisfied",":","for","error","in","errors",":","error_string","=","[","x","for","x","in","error",".","format_exception_only","(",")","]","[","-","1","]","vollog",".","warning","(","\"Automagic exception occurred: {}\"",".","format","(","error_string","[",":","-","1","]",")",")","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"\"",".","join","(","error",".","format","(","chain","=","True",")",")",")","raise","exceptions",".","UnsatisfiedException","(","unsatisfied",")","constructed","=","plugin","(","context",",","plugin_config_path",",","progress_callback","=","progress_callback",")","if","open_method",":","constructed",".","set_open_method","(","open_method",")","return","constructed"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/__init__.py#L18-L54"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/isfinfo.py","language":"python","identifier":"IsfInfo.list_all_isf_files","parameters":"(cls)","argument_list":"","return_statement":"","docstring":"Lists all the ISF files that can be found","docstring_summary":"Lists all the ISF files that can be found","docstring_tokens":["Lists","all","the","ISF","files","that","can","be","found"],"function":"def list_all_isf_files(cls) -> Generator[str, None, None]:\n \"\"\"Lists all the ISF files that can be found\"\"\"\n for symbol_path in symbols.__path__:\n for root, dirs, files in os.walk(symbol_path, followlinks = True):\n for filename in files:\n base_name = os.path.join(root, filename)\n if filename.endswith('zip'):\n with zipfile.ZipFile(base_name, 'r') as zfile:\n for name in zfile.namelist():\n for extension in constants.ISF_EXTENSIONS:\n # By ending with an extension (and therefore, not \/), we should not return any directories\n if name.endswith(extension):\n yield \"jar:file:\" + str(pathlib.Path(base_name)) + \"!\" + name\n\n else:\n for extension in constants.ISF_EXTENSIONS:\n if filename.endswith(extension):\n yield pathlib.Path(base_name).as_uri()","function_tokens":["def","list_all_isf_files","(","cls",")","->","Generator","[","str",",","None",",","None","]",":","for","symbol_path","in","symbols",".","__path__",":","for","root",",","dirs",",","files","in","os",".","walk","(","symbol_path",",","followlinks","=","True",")",":","for","filename","in","files",":","base_name","=","os",".","path",".","join","(","root",",","filename",")","if","filename",".","endswith","(","'zip'",")",":","with","zipfile",".","ZipFile","(","base_name",",","'r'",")","as","zfile",":","for","name","in","zfile",".","namelist","(",")",":","for","extension","in","constants",".","ISF_EXTENSIONS",":","# By ending with an extension (and therefore, not \/), we should not return any directories","if","name",".","endswith","(","extension",")",":","yield","\"jar:file:\"","+","str","(","pathlib",".","Path","(","base_name",")",")","+","\"!\"","+","name","else",":","for","extension","in","constants",".","ISF_EXTENSIONS",":","if","filename",".","endswith","(","extension",")",":","yield","pathlib",".","Path","(","base_name",")",".","as_uri","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/isfinfo.py#L46-L63"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/isfinfo.py","language":"python","identifier":"IsfInfo._get_banner","parameters":"(self, clazz: Type[symbol_cache.SymbolBannerCache], data: Any)","argument_list":"","return_statement":"return banner_symbol","docstring":"Gets a banner from an ISF file","docstring_summary":"Gets a banner from an ISF file","docstring_tokens":["Gets","a","banner","from","an","ISF","file"],"function":"def _get_banner(self, clazz: Type[symbol_cache.SymbolBannerCache], data: Any) -> str:\n \"\"\"Gets a banner from an ISF file\"\"\"\n banner_symbol = data.get('symbols', {}).get(clazz.symbol_name, {}).get('constant_data',\n renderers.NotAvailableValue())\n if not isinstance(banner_symbol, interfaces.renderers.BaseAbsentValue):\n banner_symbol = str(base64.b64decode(banner_symbol), encoding = 'latin-1')\n return banner_symbol","function_tokens":["def","_get_banner","(","self",",","clazz",":","Type","[","symbol_cache",".","SymbolBannerCache","]",",","data",":","Any",")","->","str",":","banner_symbol","=","data",".","get","(","'symbols'",",","{","}",")",".","get","(","clazz",".","symbol_name",",","{","}",")",".","get","(","'constant_data'",",","renderers",".","NotAvailableValue","(",")",")","if","not","isinstance","(","banner_symbol",",","interfaces",".","renderers",".","BaseAbsentValue",")",":","banner_symbol","=","str","(","base64",".","b64decode","(","banner_symbol",")",",","encoding","=","'latin-1'",")","return","banner_symbol"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/isfinfo.py#L65-L71"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/layerwriter.py","language":"python","identifier":"LayerWriter.write_layer","parameters":"(\n cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n preferred_name: str,\n open_method: Type[plugins.FileHandlerInterface],\n chunk_size: Optional[int] = None,\n progress_callback: Optional[constants.ProgressCallback] = None)","argument_list":"","return_statement":"return file_handle","docstring":"Produces a FileHandler from the named layer in the provided context or None on failure\n\n Args:\n context: the context from which to read the memory layer\n layer_name: the name of the layer to write out\n preferred_name: a string with the preferred filename for hte file\n chunk_size: an optional size for the chunks that should be written (defaults to 0x500000)\n open_method: class for creating FileHandler context managers\n progress_callback: an optional function that takes a percentage and a string that displays output","docstring_summary":"Produces a FileHandler from the named layer in the provided context or None on failure","docstring_tokens":["Produces","a","FileHandler","from","the","named","layer","in","the","provided","context","or","None","on","failure"],"function":"def write_layer(\n cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n preferred_name: str,\n open_method: Type[plugins.FileHandlerInterface],\n chunk_size: Optional[int] = None,\n progress_callback: Optional[constants.ProgressCallback] = None) -> Optional[plugins.FileHandlerInterface]:\n \"\"\"Produces a FileHandler from the named layer in the provided context or None on failure\n\n Args:\n context: the context from which to read the memory layer\n layer_name: the name of the layer to write out\n preferred_name: a string with the preferred filename for hte file\n chunk_size: an optional size for the chunks that should be written (defaults to 0x500000)\n open_method: class for creating FileHandler context managers\n progress_callback: an optional function that takes a percentage and a string that displays output\n \"\"\"\n\n if layer_name not in context.layers:\n raise exceptions.LayerException(\"Layer not found\")\n layer = context.layers[layer_name]\n\n if chunk_size is None:\n chunk_size = cls.default_block_size\n\n file_handle = open_method(preferred_name)\n for i in range(0, layer.maximum_address, chunk_size):\n current_chunk_size = min(chunk_size, layer.maximum_address - i)\n data = layer.read(i, current_chunk_size, pad = True)\n file_handle.write(data)\n if progress_callback:\n progress_callback((i \/ layer.maximum_address) * 100, 'Writing layer {}'.format(layer_name))\n return file_handle","function_tokens":["def","write_layer","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","preferred_name",":","str",",","open_method",":","Type","[","plugins",".","FileHandlerInterface","]",",","chunk_size",":","Optional","[","int","]","=","None",",","progress_callback",":","Optional","[","constants",".","ProgressCallback","]","=","None",")","->","Optional","[","plugins",".","FileHandlerInterface","]",":","if","layer_name","not","in","context",".","layers",":","raise","exceptions",".","LayerException","(","\"Layer not found\"",")","layer","=","context",".","layers","[","layer_name","]","if","chunk_size","is","None",":","chunk_size","=","cls",".","default_block_size","file_handle","=","open_method","(","preferred_name",")","for","i","in","range","(","0",",","layer",".","maximum_address",",","chunk_size",")",":","current_chunk_size","=","min","(","chunk_size",",","layer",".","maximum_address","-","i",")","data","=","layer",".","read","(","i",",","current_chunk_size",",","pad","=","True",")","file_handle",".","write","(","data",")","if","progress_callback",":","progress_callback","(","(","i","\/","layer",".","maximum_address",")","*","100",",","'Writing layer {}'",".","format","(","layer_name",")",")","return","file_handle"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/layerwriter.py#L45-L78"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/layerwriter.py","language":"python","identifier":"LayerWriter._generate_layers","parameters":"(self)","argument_list":"","return_statement":"","docstring":"List layer names from this run","docstring_summary":"List layer names from this run","docstring_tokens":["List","layer","names","from","this","run"],"function":"def _generate_layers(self):\n \"\"\"List layer names from this run\"\"\"\n for name in self.context.layers:\n yield (0, (name,))","function_tokens":["def","_generate_layers","(","self",")",":","for","name","in","self",".","context",".","layers",":","yield","(","0",",","(","name",",",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/layerwriter.py#L113-L116"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/banners.py","language":"python","identifier":"Banners.locate_banners","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str)","argument_list":"","return_statement":"","docstring":"Identifies banners from a memory image","docstring_summary":"Identifies banners from a memory image","docstring_tokens":["Identifies","banners","from","a","memory","image"],"function":"def locate_banners(cls, context: interfaces.context.ContextInterface, layer_name: str):\n \"\"\"Identifies banners from a memory image\"\"\"\n layer = context.layers[layer_name]\n for offset in layer.scan(\n context = context,\n scanner = scanners.RegExScanner(rb\"(Linux version|Darwin Kernel Version) [0-9]+\\.[0-9]+\\.[0-9]+\")):\n data = layer.read(offset, 0xfff)\n data_index = data.find(b'\\x00')\n if data_index > 0:\n data = data[:data_index].strip()\n failed = [\n char for char in data\n if char not in b' #()+,;\/-.0123456789:@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~'\n ]\n if not failed:\n yield format_hints.Hex(offset), str(data, encoding = 'latin-1', errors = '?')","function_tokens":["def","locate_banners","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",")",":","layer","=","context",".","layers","[","layer_name","]","for","offset","in","layer",".","scan","(","context","=","context",",","scanner","=","scanners",".","RegExScanner","(","rb\"(Linux version|Darwin Kernel Version) [0-9]+\\.[0-9]+\\.[0-9]+\"",")",")",":","data","=","layer",".","read","(","offset",",","0xfff",")","data_index","=","data",".","find","(","b'\\x00'",")","if","data_index",">","0",":","data","=","data","[",":","data_index","]",".","strip","(",")","failed","=","[","char","for","char","in","data","if","char","not","in","b' #()+,;\/-.0123456789:@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~'","]","if","not","failed",":","yield","format_hints",".","Hex","(","offset",")",",","str","(","data",",","encoding","=","'latin-1'",",","errors","=","'?'",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/banners.py#L32-L47"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/vadinfo.py","language":"python","identifier":"VadInfo.protect_values","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"return values","docstring":"Look up the array of memory protection constants from the memory\n sample. These don't change often, but if they do in the future, then\n finding them dynamically versus hard-coding here will ensure we parse\n them properly.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols","docstring_summary":"Look up the array of memory protection constants from the memory\n sample. These don't change often, but if they do in the future, then\n finding them dynamically versus hard-coding here will ensure we parse\n them properly.","docstring_tokens":["Look","up","the","array","of","memory","protection","constants","from","the","memory","sample",".","These","don","t","change","often","but","if","they","do","in","the","future","then","finding","them","dynamically","versus","hard","-","coding","here","will","ensure","we","parse","them","properly","."],"function":"def protect_values(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str) -> Iterable[int]:\n \"\"\"Look up the array of memory protection constants from the memory\n sample. These don't change often, but if they do in the future, then\n finding them dynamically versus hard-coding here will ensure we parse\n them properly.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n \"\"\"\n\n kvo = context.layers[layer_name].config[\"kernel_virtual_offset\"]\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n addr = ntkrnlmp.get_symbol(\"MmProtectToValue\").address\n values = ntkrnlmp.object(object_type = \"array\", offset = addr, subtype = ntkrnlmp.get_type(\"int\"), count = 32)\n return values","function_tokens":["def","protect_values","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","Iterable","[","int","]",":","kvo","=","context",".","layers","[","layer_name","]",".","config","[","\"kernel_virtual_offset\"","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","addr","=","ntkrnlmp",".","get_symbol","(","\"MmProtectToValue\"",")",".","address","values","=","ntkrnlmp",".","object","(","object_type","=","\"array\"",",","offset","=","addr",",","subtype","=","ntkrnlmp",".","get_type","(","\"int\"",")",",","count","=","32",")","return","values"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/vadinfo.py#L74-L91"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/vadinfo.py","language":"python","identifier":"VadInfo.list_vads","parameters":"(cls, proc: interfaces.objects.ObjectInterface,\n filter_func: Callable[[interfaces.objects.ObjectInterface], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Lists the Virtual Address Descriptors of a specific process.\n\n Args:\n proc: _EPROCESS object from which to list the VADs\n filter_func: Function to take a virtual address descriptor value and return True if it should be filtered out\n\n Returns:\n A list of virtual address descriptors based on the process and filtered based on the filter function","docstring_summary":"Lists the Virtual Address Descriptors of a specific process.","docstring_tokens":["Lists","the","Virtual","Address","Descriptors","of","a","specific","process","."],"function":"def list_vads(cls, proc: interfaces.objects.ObjectInterface,\n filter_func: Callable[[interfaces.objects.ObjectInterface], bool] = lambda _: False) -> \\\n Generator[interfaces.objects.ObjectInterface, None, None]:\n \"\"\"Lists the Virtual Address Descriptors of a specific process.\n\n Args:\n proc: _EPROCESS object from which to list the VADs\n filter_func: Function to take a virtual address descriptor value and return True if it should be filtered out\n\n Returns:\n A list of virtual address descriptors based on the process and filtered based on the filter function\n \"\"\"\n for vad in proc.get_vad_root().traverse():\n if not filter_func(vad):\n yield vad","function_tokens":["def","list_vads","(","cls",",","proc",":","interfaces",".","objects",".","ObjectInterface",",","filter_func",":","Callable","[","[","interfaces",".","objects",".","ObjectInterface","]",",","bool","]","=","lambda","_",":","False",")","->","Generator","[","interfaces",".","objects",".","ObjectInterface",",","None",",","None","]",":","for","vad","in","proc",".","get_vad_root","(",")",".","traverse","(",")",":","if","not","filter_func","(","vad",")",":","yield","vad"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/vadinfo.py#L94-L108"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/vadinfo.py","language":"python","identifier":"VadInfo.vad_dump","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n proc: interfaces.objects.ObjectInterface,\n vad: interfaces.objects.ObjectInterface,\n open_method: Type[\n interfaces.plugins.FileHandlerInterface],\n maxsize: int = MAXSIZE_DEFAULT)","argument_list":"","return_statement":"return file_handle","docstring":"Extracts the complete data for Vad as a FileInterface.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n proc: an _EPROCESS instance\n vad: The suspected VAD to extract (ObjectInterface)\n open_method: class to provide context manager for opening the file\n maxsize: Max size of VAD section (default MAXSIZE_DEFAULT)\n\n Returns:\n An open FileInterface object containing the complete data for the process or None in the case of failure","docstring_summary":"Extracts the complete data for Vad as a FileInterface.","docstring_tokens":["Extracts","the","complete","data","for","Vad","as","a","FileInterface","."],"function":"def vad_dump(cls,\n context: interfaces.context.ContextInterface,\n proc: interfaces.objects.ObjectInterface,\n vad: interfaces.objects.ObjectInterface,\n open_method: Type[\n interfaces.plugins.FileHandlerInterface],\n maxsize: int = MAXSIZE_DEFAULT) -> Optional[interfaces.plugins.FileHandlerInterface]:\n \"\"\"Extracts the complete data for Vad as a FileInterface.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n proc: an _EPROCESS instance\n vad: The suspected VAD to extract (ObjectInterface)\n open_method: class to provide context manager for opening the file\n maxsize: Max size of VAD section (default MAXSIZE_DEFAULT)\n\n Returns:\n An open FileInterface object containing the complete data for the process or None in the case of failure\n \"\"\"\n\n try:\n vad_start = vad.get_start()\n vad_end = vad.get_end()\n except AttributeError:\n vollog.debug(\"Unable to find the starting\/ending VPN member\")\n return\n\n if maxsize > 0 and (vad_end - vad_start) > maxsize:\n vollog.debug(\"Skip VAD dump {0:#x}-{1:#x} due to maxsize limit\".format(vad_start, vad_end))\n return\n\n proc_id = \"Unknown\"\n try:\n proc_id = proc.UniqueProcessId\n proc_layer_name = proc.add_process_layer()\n except exceptions.InvalidAddressException as excp:\n vollog.debug(\"Process {}: invalid address {} in layer {}\".format(proc_id, excp.invalid_address,\n excp.layer_name))\n return None\n\n proc_layer = context.layers[proc_layer_name]\n file_name = \"pid.{0}.vad.{1:#x}-{2:#x}.dmp\".format(proc_id, vad_start, vad_end)\n try:\n file_handle = open_method(file_name)\n chunk_size = 1024 * 1024 * 10\n offset = vad_start\n while offset < vad_end:\n to_read = min(chunk_size, vad_end - offset)\n data = proc_layer.read(offset, to_read, pad = True)\n if not data:\n break\n file_handle.write(data)\n offset += to_read\n\n except Exception as excp:\n vollog.debug(\"Unable to dump VAD {}: {}\".format(file_name, excp))\n return\n\n return file_handle","function_tokens":["def","vad_dump","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","proc",":","interfaces",".","objects",".","ObjectInterface",",","vad",":","interfaces",".","objects",".","ObjectInterface",",","open_method",":","Type","[","interfaces",".","plugins",".","FileHandlerInterface","]",",","maxsize",":","int","=","MAXSIZE_DEFAULT",")","->","Optional","[","interfaces",".","plugins",".","FileHandlerInterface","]",":","try",":","vad_start","=","vad",".","get_start","(",")","vad_end","=","vad",".","get_end","(",")","except","AttributeError",":","vollog",".","debug","(","\"Unable to find the starting\/ending VPN member\"",")","return","if","maxsize",">","0","and","(","vad_end","-","vad_start",")",">","maxsize",":","vollog",".","debug","(","\"Skip VAD dump {0:#x}-{1:#x} due to maxsize limit\"",".","format","(","vad_start",",","vad_end",")",")","return","proc_id","=","\"Unknown\"","try",":","proc_id","=","proc",".","UniqueProcessId","proc_layer_name","=","proc",".","add_process_layer","(",")","except","exceptions",".","InvalidAddressException","as","excp",":","vollog",".","debug","(","\"Process {}: invalid address {} in layer {}\"",".","format","(","proc_id",",","excp",".","invalid_address",",","excp",".","layer_name",")",")","return","None","proc_layer","=","context",".","layers","[","proc_layer_name","]","file_name","=","\"pid.{0}.vad.{1:#x}-{2:#x}.dmp\"",".","format","(","proc_id",",","vad_start",",","vad_end",")","try",":","file_handle","=","open_method","(","file_name",")","chunk_size","=","1024","*","1024","*","10","offset","=","vad_start","while","offset","<","vad_end",":","to_read","=","min","(","chunk_size",",","vad_end","-","offset",")","data","=","proc_layer",".","read","(","offset",",","to_read",",","pad","=","True",")","if","not","data",":","break","file_handle",".","write","(","data",")","offset","+=","to_read","except","Exception","as","excp",":","vollog",".","debug","(","\"Unable to dump VAD {}: {}\"",".","format","(","file_name",",","excp",")",")","return","return","file_handle"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/vadinfo.py#L111-L169"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/getsids.py","language":"python","identifier":"GetSIDs.lookup_user_sids","parameters":"(self)","argument_list":"","return_statement":"return sids","docstring":"Enumerate the registry for all the users.\n\n Returns:\n An dictionary of {sid: user name}","docstring_summary":"Enumerate the registry for all the users.","docstring_tokens":["Enumerate","the","registry","for","all","the","users","."],"function":"def lookup_user_sids(self) -> Dict[str, str]:\n \"\"\"\n Enumerate the registry for all the users.\n\n Returns:\n An dictionary of {sid: user name}\n \"\"\"\n\n key = \"Microsoft\\\\Windows NT\\\\CurrentVersion\\\\ProfileList\"\n val = \"ProfileImagePath\"\n\n sids = {}\n for hive in hivelist.HiveList.list_hives(context = self.context,\n base_config_path = self.config_path,\n layer_name = self.config['primary'],\n symbol_table = self.config['nt_symbols'],\n hive_offsets = None):\n\n try:\n for subkey in hive.get_key(key).get_subkeys():\n sid = str(subkey.get_name())\n path = \"\"\n for node in subkey.get_values():\n try:\n value_node_name = node.get_name() or \"(Default)\"\n except (exceptions.InvalidAddressException, layers.registry.RegistryFormatException) as excp:\n continue\n try:\n value_data = node.decode_data()\n if isinstance(value_data, int):\n value_data = format_hints.MultiTypeData(value_data, encoding = 'utf-8')\n elif registry.RegValueTypes.get(node.Type) == registry.RegValueTypes.REG_BINARY:\n value_data = format_hints.MultiTypeData(value_data, show_hex = True)\n elif registry.RegValueTypes.get(node.Type) == registry.RegValueTypes.REG_MULTI_SZ:\n value_data = format_hints.MultiTypeData(value_data,\n encoding = 'utf-16-le',\n split_nulls = True)\n else:\n value_data = format_hints.MultiTypeData(value_data, encoding = 'utf-16-le')\n if value_node_name == val:\n path = str(value_data).replace('\\\\x00', '')[:-1]\n user = ntpath.basename(path)\n sids[sid] = user\n except (ValueError, exceptions.InvalidAddressException,\n layers.registry.RegistryFormatException) as excp:\n continue\n except (KeyError, exceptions.InvalidAddressException):\n continue\n\n return sids","function_tokens":["def","lookup_user_sids","(","self",")","->","Dict","[","str",",","str","]",":","key","=","\"Microsoft\\\\Windows NT\\\\CurrentVersion\\\\ProfileList\"","val","=","\"ProfileImagePath\"","sids","=","{","}","for","hive","in","hivelist",".","HiveList",".","list_hives","(","context","=","self",".","context",",","base_config_path","=","self",".","config_path",",","layer_name","=","self",".","config","[","'primary'","]",",","symbol_table","=","self",".","config","[","'nt_symbols'","]",",","hive_offsets","=","None",")",":","try",":","for","subkey","in","hive",".","get_key","(","key",")",".","get_subkeys","(",")",":","sid","=","str","(","subkey",".","get_name","(",")",")","path","=","\"\"","for","node","in","subkey",".","get_values","(",")",":","try",":","value_node_name","=","node",".","get_name","(",")","or","\"(Default)\"","except","(","exceptions",".","InvalidAddressException",",","layers",".","registry",".","RegistryFormatException",")","as","excp",":","continue","try",":","value_data","=","node",".","decode_data","(",")","if","isinstance","(","value_data",",","int",")",":","value_data","=","format_hints",".","MultiTypeData","(","value_data",",","encoding","=","'utf-8'",")","elif","registry",".","RegValueTypes",".","get","(","node",".","Type",")","==","registry",".","RegValueTypes",".","REG_BINARY",":","value_data","=","format_hints",".","MultiTypeData","(","value_data",",","show_hex","=","True",")","elif","registry",".","RegValueTypes",".","get","(","node",".","Type",")","==","registry",".","RegValueTypes",".","REG_MULTI_SZ",":","value_data","=","format_hints",".","MultiTypeData","(","value_data",",","encoding","=","'utf-16-le'",",","split_nulls","=","True",")","else",":","value_data","=","format_hints",".","MultiTypeData","(","value_data",",","encoding","=","'utf-16-le'",")","if","value_node_name","==","val",":","path","=","str","(","value_data",")",".","replace","(","'\\\\x00'",",","''",")","[",":","-","1","]","user","=","ntpath",".","basename","(","path",")","sids","[","sid","]","=","user","except","(","ValueError",",","exceptions",".","InvalidAddressException",",","layers",".","registry",".","RegistryFormatException",")","as","excp",":","continue","except","(","KeyError",",","exceptions",".","InvalidAddressException",")",":","continue","return","sids"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/getsids.py#L68-L117"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modules.py","language":"python","identifier":"Modules.get_session_layers","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n pids: List[int] = None)","argument_list":"","return_statement":"","docstring":"Build a cache of possible virtual layers, in priority starting with\n the primary\/kernel layer. Then keep one layer per session by cycling\n through the process list.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n pids: A list of process identifiers to include exclusively or None for no filter\n\n Returns:\n A list of session layer names","docstring_summary":"Build a cache of possible virtual layers, in priority starting with\n the primary\/kernel layer. Then keep one layer per session by cycling\n through the process list.","docstring_tokens":["Build","a","cache","of","possible","virtual","layers","in","priority","starting","with","the","primary","\/","kernel","layer",".","Then","keep","one","layer","per","session","by","cycling","through","the","process","list","."],"function":"def get_session_layers(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n pids: List[int] = None) -> Generator[str, None, None]:\n \"\"\"Build a cache of possible virtual layers, in priority starting with\n the primary\/kernel layer. Then keep one layer per session by cycling\n through the process list.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n pids: A list of process identifiers to include exclusively or None for no filter\n\n Returns:\n A list of session layer names\n \"\"\"\n seen_ids = [] # type: List[interfaces.objects.ObjectInterface]\n filter_func = pslist.PsList.create_pid_filter(pids or [])\n\n for proc in pslist.PsList.list_processes(context = context,\n layer_name = layer_name,\n symbol_table = symbol_table,\n filter_func = filter_func):\n proc_id = \"Unknown\"\n try:\n proc_id = proc.UniqueProcessId\n proc_layer_name = proc.add_process_layer()\n\n # create the session space object in the process' own layer.\n # not all processes have a valid session pointer.\n session_space = context.object(symbol_table + constants.BANG + \"_MM_SESSION_SPACE\",\n layer_name = layer_name,\n offset = proc.Session)\n\n if session_space.SessionId in seen_ids:\n continue\n\n except exceptions.InvalidAddressException:\n vollog.log(\n constants.LOGLEVEL_VVV,\n \"Process {} does not have a valid Session or a layer could not be constructed for it\".format(\n proc_id))\n continue\n\n # save the layer if we haven't seen the session yet\n seen_ids.append(session_space.SessionId)\n yield proc_layer_name","function_tokens":["def","get_session_layers","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","pids",":","List","[","int","]","=","None",")","->","Generator","[","str",",","None",",","None","]",":","seen_ids","=","[","]","# type: List[interfaces.objects.ObjectInterface]","filter_func","=","pslist",".","PsList",".","create_pid_filter","(","pids","or","[","]",")","for","proc","in","pslist",".","PsList",".","list_processes","(","context","=","context",",","layer_name","=","layer_name",",","symbol_table","=","symbol_table",",","filter_func","=","filter_func",")",":","proc_id","=","\"Unknown\"","try",":","proc_id","=","proc",".","UniqueProcessId","proc_layer_name","=","proc",".","add_process_layer","(",")","# create the session space object in the process' own layer.","# not all processes have a valid session pointer.","session_space","=","context",".","object","(","symbol_table","+","constants",".","BANG","+","\"_MM_SESSION_SPACE\"",",","layer_name","=","layer_name",",","offset","=","proc",".","Session",")","if","session_space",".","SessionId","in","seen_ids",":","continue","except","exceptions",".","InvalidAddressException",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Process {} does not have a valid Session or a layer could not be constructed for it\"",".","format","(","proc_id",")",")","continue","# save the layer if we haven't seen the session yet","seen_ids",".","append","(","session_space",".","SessionId",")","yield","proc_layer_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modules.py#L71-L119"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modules.py","language":"python","identifier":"Modules.find_session_layer","parameters":"(cls, context: interfaces.context.ContextInterface, session_layers: Iterable[str],\n base_address: int)","argument_list":"","return_statement":"return None","docstring":"Given a base address and a list of layer names, find a layer that\n can access the specified address.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n session_layers: A list of session layer names\n base_address: The base address to identify the layers that can access it\n\n Returns:\n Layer name or None if no layers that contain the base address can be found","docstring_summary":"Given a base address and a list of layer names, find a layer that\n can access the specified address.","docstring_tokens":["Given","a","base","address","and","a","list","of","layer","names","find","a","layer","that","can","access","the","specified","address","."],"function":"def find_session_layer(cls, context: interfaces.context.ContextInterface, session_layers: Iterable[str],\n base_address: int):\n \"\"\"Given a base address and a list of layer names, find a layer that\n can access the specified address.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n session_layers: A list of session layer names\n base_address: The base address to identify the layers that can access it\n\n Returns:\n Layer name or None if no layers that contain the base address can be found\n \"\"\"\n\n for layer_name in session_layers:\n if context.layers[layer_name].is_valid(base_address):\n return layer_name\n\n return None","function_tokens":["def","find_session_layer","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","session_layers",":","Iterable","[","str","]",",","base_address",":","int",")",":","for","layer_name","in","session_layers",":","if","context",".","layers","[","layer_name","]",".","is_valid","(","base_address",")",":","return","layer_name","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modules.py#L122-L142"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modules.py","language":"python","identifier":"Modules.list_modules","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"","docstring":"Lists all the modules in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of Modules as retrieved from PsLoadedModuleList","docstring_summary":"Lists all the modules in the primary layer.","docstring_tokens":["Lists","all","the","modules","in","the","primary","layer","."],"function":"def list_modules(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str) -> Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Lists all the modules in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of Modules as retrieved from PsLoadedModuleList\n \"\"\"\n\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n\n try:\n # use this type if its available (starting with windows 10)\n ldr_entry_type = ntkrnlmp.get_type(\"_KLDR_DATA_TABLE_ENTRY\")\n except exceptions.SymbolError:\n ldr_entry_type = ntkrnlmp.get_type(\"_LDR_DATA_TABLE_ENTRY\")\n\n type_name = ldr_entry_type.type_name.split(constants.BANG)[1]\n\n list_head = ntkrnlmp.get_symbol(\"PsLoadedModuleList\").address\n list_entry = ntkrnlmp.object(object_type = \"_LIST_ENTRY\", offset = list_head)\n reloff = ldr_entry_type.relative_child_offset(\"InLoadOrderLinks\")\n module = ntkrnlmp.object(object_type = type_name, offset = list_entry.vol.offset - reloff, absolute = True)\n\n for mod in module.InLoadOrderLinks:\n yield mod","function_tokens":["def","list_modules","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","try",":","# use this type if its available (starting with windows 10)","ldr_entry_type","=","ntkrnlmp",".","get_type","(","\"_KLDR_DATA_TABLE_ENTRY\"",")","except","exceptions",".","SymbolError",":","ldr_entry_type","=","ntkrnlmp",".","get_type","(","\"_LDR_DATA_TABLE_ENTRY\"",")","type_name","=","ldr_entry_type",".","type_name",".","split","(","constants",".","BANG",")","[","1","]","list_head","=","ntkrnlmp",".","get_symbol","(","\"PsLoadedModuleList\"",")",".","address","list_entry","=","ntkrnlmp",".","object","(","object_type","=","\"_LIST_ENTRY\"",",","offset","=","list_head",")","reloff","=","ldr_entry_type",".","relative_child_offset","(","\"InLoadOrderLinks\"",")","module","=","ntkrnlmp",".","object","(","object_type","=","type_name",",","offset","=","list_entry",".","vol",".","offset","-","reloff",",","absolute","=","True",")","for","mod","in","module",".","InLoadOrderLinks",":","yield","mod"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modules.py#L145-L175"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py","language":"python","identifier":"Handles._decode_pointer","parameters":"(self, value, magic)","argument_list":"","return_statement":"return value","docstring":"Windows encodes pointers to objects and decodes them on the fly\n before using them.\n\n This function mimics the decoding routine so we can generate the\n proper pointer values as well.","docstring_summary":"Windows encodes pointers to objects and decodes them on the fly\n before using them.","docstring_tokens":["Windows","encodes","pointers","to","objects","and","decodes","them","on","the","fly","before","using","them","."],"function":"def _decode_pointer(self, value, magic):\n \"\"\"Windows encodes pointers to objects and decodes them on the fly\n before using them.\n\n This function mimics the decoding routine so we can generate the\n proper pointer values as well.\n \"\"\"\n\n value = value & 0xFFFFFFFFFFFFFFF8\n value = value >> magic\n # if (value & (1 << 47)):\n # value = value | 0xFFFF000000000000\n\n return value","function_tokens":["def","_decode_pointer","(","self",",","value",",","magic",")",":","value","=","value","&","0xFFFFFFFFFFFFFFF8","value","=","value",">>","magic","# if (value & (1 << 47)):","# value = value | 0xFFFF000000000000","return","value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py#L52-L65"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py","language":"python","identifier":"Handles._get_item","parameters":"(self, handle_table_entry, handle_value)","argument_list":"","return_statement":"return object_header","docstring":"Given a handle table entry (_HANDLE_TABLE_ENTRY) structure from a\n process' handle table, determine where the corresponding object's\n _OBJECT_HEADER can be found.","docstring_summary":"Given a handle table entry (_HANDLE_TABLE_ENTRY) structure from a\n process' handle table, determine where the corresponding object's\n _OBJECT_HEADER can be found.","docstring_tokens":["Given","a","handle","table","entry","(","_HANDLE_TABLE_ENTRY",")","structure","from","a","process","handle","table","determine","where","the","corresponding","object","s","_OBJECT_HEADER","can","be","found","."],"function":"def _get_item(self, handle_table_entry, handle_value):\n \"\"\"Given a handle table entry (_HANDLE_TABLE_ENTRY) structure from a\n process' handle table, determine where the corresponding object's\n _OBJECT_HEADER can be found.\"\"\"\n\n virtual = self.config[\"primary\"]\n \n try:\n # before windows 7\n \n if not self.context.layers[virtual].is_valid(handle_table_entry.Object):\n return None\n \n fast_ref = handle_table_entry.Object.cast(\"_EX_FAST_REF\")\n object_header = fast_ref.dereference().cast(\"_OBJECT_HEADER\")\n object_header.GrantedAccess = handle_table_entry.GrantedAccess\n except AttributeError:\n # starting with windows 8\n \n if handle_table_entry.LowValue == 0:\n return None\n\n magic = self.find_sar_value()\n # is this the right thing to raise here?\n if magic is None:\n return None\n #if not has_capstone:\n # raise AttributeError(\"Unable to find the SAR value for decoding handle table pointers\")\n #else:\n # raise exceptions.MissingModuleException(\"capstone\",\"Unable to find the SAR value for decoding handle table pointers\")\n\n offset = self._decode_pointer(handle_table_entry.LowValue, magic)\n # print(\"LowValue: {0:#x} Magic: {1:#x} Offset: {2:#x}\".format(handle_table_entry.InfoTable, magic, offset))\n object_header = self.context.object(self.config[\"nt_symbols\"] + constants.BANG + \"_OBJECT_HEADER\",\n virtual,\n offset = offset)\n object_header.GrantedAccess = handle_table_entry.GrantedAccessBits\n\n object_header.HandleValue = handle_value\n return object_header","function_tokens":["def","_get_item","(","self",",","handle_table_entry",",","handle_value",")",":","virtual","=","self",".","config","[","\"primary\"","]","try",":","# before windows 7","if","not","self",".","context",".","layers","[","virtual","]",".","is_valid","(","handle_table_entry",".","Object",")",":","return","None","fast_ref","=","handle_table_entry",".","Object",".","cast","(","\"_EX_FAST_REF\"",")","object_header","=","fast_ref",".","dereference","(",")",".","cast","(","\"_OBJECT_HEADER\"",")","object_header",".","GrantedAccess","=","handle_table_entry",".","GrantedAccess","except","AttributeError",":","# starting with windows 8","if","handle_table_entry",".","LowValue","==","0",":","return","None","magic","=","self",".","find_sar_value","(",")","# is this the right thing to raise here?","if","magic","is","None",":","return","None","#if not has_capstone:","# raise AttributeError(\"Unable to find the SAR value for decoding handle table pointers\")","#else:","# raise exceptions.MissingModuleException(\"capstone\",\"Unable to find the SAR value for decoding handle table pointers\")","offset","=","self",".","_decode_pointer","(","handle_table_entry",".","LowValue",",","magic",")","# print(\"LowValue: {0:#x} Magic: {1:#x} Offset: {2:#x}\".format(handle_table_entry.InfoTable, magic, offset))","object_header","=","self",".","context",".","object","(","self",".","config","[","\"nt_symbols\"","]","+","constants",".","BANG","+","\"_OBJECT_HEADER\"",",","virtual",",","offset","=","offset",")","object_header",".","GrantedAccess","=","handle_table_entry",".","GrantedAccessBits","object_header",".","HandleValue","=","handle_value","return","object_header"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py#L67-L106"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py","language":"python","identifier":"Handles.find_sar_value","parameters":"(self)","argument_list":"","return_statement":"return self._sar_value","docstring":"Locate ObpCaptureHandleInformationEx if it exists in the sample.\n\n Once found, parse it for the SAR value that we need to decode\n pointers in the _HANDLE_TABLE_ENTRY which allows us to find the\n associated _OBJECT_HEADER.","docstring_summary":"Locate ObpCaptureHandleInformationEx if it exists in the sample.","docstring_tokens":["Locate","ObpCaptureHandleInformationEx","if","it","exists","in","the","sample","."],"function":"def find_sar_value(self):\n \"\"\"Locate ObpCaptureHandleInformationEx if it exists in the sample.\n\n Once found, parse it for the SAR value that we need to decode\n pointers in the _HANDLE_TABLE_ENTRY which allows us to find the\n associated _OBJECT_HEADER.\n \"\"\"\n\n if self._sar_value is None:\n\n if not has_capstone:\n return None\n\n virtual_layer_name = self.config['primary']\n kvo = self.context.layers[virtual_layer_name].config['kernel_virtual_offset']\n ntkrnlmp = self.context.module(self.config[\"nt_symbols\"], layer_name = virtual_layer_name, offset = kvo)\n\n try:\n func_addr = ntkrnlmp.get_symbol(\"ObpCaptureHandleInformationEx\").address\n except exceptions.SymbolError:\n return None\n\n data = self.context.layers.read(virtual_layer_name, kvo + func_addr, 0x200)\n if data is None:\n return None\n\n md = capstone.Cs(capstone.CS_ARCH_X86, capstone.CS_MODE_64)\n\n for (address, size, mnemonic, op_str) in md.disasm_lite(data, kvo + func_addr):\n # print(\"{} {} {} {}\".format(address, size, mnemonic, op_str))\n\n if mnemonic.startswith(\"sar\"):\n # if we don't want to parse op strings, we can disasm the\n # single sar instruction again, but we use disasm_lite for speed\n self._sar_value = int(op_str.split(\",\")[1].strip(), 16)\n break\n\n return self._sar_value","function_tokens":["def","find_sar_value","(","self",")",":","if","self",".","_sar_value","is","None",":","if","not","has_capstone",":","return","None","virtual_layer_name","=","self",".","config","[","'primary'","]","kvo","=","self",".","context",".","layers","[","virtual_layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","self",".","context",".","module","(","self",".","config","[","\"nt_symbols\"","]",",","layer_name","=","virtual_layer_name",",","offset","=","kvo",")","try",":","func_addr","=","ntkrnlmp",".","get_symbol","(","\"ObpCaptureHandleInformationEx\"",")",".","address","except","exceptions",".","SymbolError",":","return","None","data","=","self",".","context",".","layers",".","read","(","virtual_layer_name",",","kvo","+","func_addr",",","0x200",")","if","data","is","None",":","return","None","md","=","capstone",".","Cs","(","capstone",".","CS_ARCH_X86",",","capstone",".","CS_MODE_64",")","for","(","address",",","size",",","mnemonic",",","op_str",")","in","md",".","disasm_lite","(","data",",","kvo","+","func_addr",")",":","# print(\"{} {} {} {}\".format(address, size, mnemonic, op_str))","if","mnemonic",".","startswith","(","\"sar\"",")",":","# if we don't want to parse op strings, we can disasm the","# single sar instruction again, but we use disasm_lite for speed","self",".","_sar_value","=","int","(","op_str",".","split","(","\",\"",")","[","1","]",".","strip","(",")",",","16",")","break","return","self",".","_sar_value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py#L108-L145"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py","language":"python","identifier":"Handles.get_type_map","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"return type_map","docstring":"List the executive object types (_OBJECT_TYPE) using the\n ObTypeIndexTable or ObpObjectTypes symbol (differs per OS). This method\n will be necessary for determining what type of object we have given an\n object header.\n\n Note:\n The object type index map was hard coded into profiles in previous versions of volatility.\n It is now generated dynamically.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A mapping of type indicies to type names","docstring_summary":"List the executive object types (_OBJECT_TYPE) using the\n ObTypeIndexTable or ObpObjectTypes symbol (differs per OS). This method\n will be necessary for determining what type of object we have given an\n object header.","docstring_tokens":["List","the","executive","object","types","(","_OBJECT_TYPE",")","using","the","ObTypeIndexTable","or","ObpObjectTypes","symbol","(","differs","per","OS",")",".","This","method","will","be","necessary","for","determining","what","type","of","object","we","have","given","an","object","header","."],"function":"def get_type_map(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str) -> Dict[int, str]:\n \"\"\"List the executive object types (_OBJECT_TYPE) using the\n ObTypeIndexTable or ObpObjectTypes symbol (differs per OS). This method\n will be necessary for determining what type of object we have given an\n object header.\n\n Note:\n The object type index map was hard coded into profiles in previous versions of volatility.\n It is now generated dynamically.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A mapping of type indicies to type names\n \"\"\"\n\n type_map = {} # type: Dict[int, str]\n\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n\n try:\n table_addr = ntkrnlmp.get_symbol(\"ObTypeIndexTable\").address\n except exceptions.SymbolError:\n table_addr = ntkrnlmp.get_symbol(\"ObpObjectTypes\").address\n\n trans_layer = context.layers[layer_name]\n\n if not trans_layer.is_valid(kvo + table_addr):\n return type_map\n\n ptrs = ntkrnlmp.object(object_type = \"array\",\n offset = table_addr,\n subtype = ntkrnlmp.get_type(\"pointer\"),\n count = 100)\n\n for i, ptr in enumerate(ptrs): # type: ignore\n # the first entry in the table is always null. break the\n # loop when we encounter the first null entry after that\n if i > 0 and ptr == 0:\n break\n\n try:\n objt = ptr.dereference().cast(symbol_table + constants.BANG + \"_OBJECT_TYPE\")\n type_name = objt.Name.String\n except exceptions.InvalidAddressException:\n vollog.log(constants.LOGLEVEL_VVV,\n \"Cannot access _OBJECT_HEADER Name at {0:#x}\".format(objt.vol.offset))\n continue\n\n type_map[i] = type_name\n\n return type_map","function_tokens":["def","get_type_map","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","Dict","[","int",",","str","]",":","type_map","=","{","}","# type: Dict[int, str]","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","try",":","table_addr","=","ntkrnlmp",".","get_symbol","(","\"ObTypeIndexTable\"",")",".","address","except","exceptions",".","SymbolError",":","table_addr","=","ntkrnlmp",".","get_symbol","(","\"ObpObjectTypes\"",")",".","address","trans_layer","=","context",".","layers","[","layer_name","]","if","not","trans_layer",".","is_valid","(","kvo","+","table_addr",")",":","return","type_map","ptrs","=","ntkrnlmp",".","object","(","object_type","=","\"array\"",",","offset","=","table_addr",",","subtype","=","ntkrnlmp",".","get_type","(","\"pointer\"",")",",","count","=","100",")","for","i",",","ptr","in","enumerate","(","ptrs",")",":","# type: ignore","# the first entry in the table is always null. break the","# loop when we encounter the first null entry after that","if","i",">","0","and","ptr","==","0",":","break","try",":","objt","=","ptr",".","dereference","(",")",".","cast","(","symbol_table","+","constants",".","BANG","+","\"_OBJECT_TYPE\"",")","type_name","=","objt",".","Name",".","String","except","exceptions",".","InvalidAddressException",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Cannot access _OBJECT_HEADER Name at {0:#x}\"",".","format","(","objt",".","vol",".","offset",")",")","continue","type_map","[","i","]","=","type_name","return","type_map"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py#L148-L204"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py","language":"python","identifier":"Handles.find_cookie","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"return context.object(symbol_table + constants.BANG + \"unsigned int\", layer_name, offset = kvo + offset)","docstring":"Find the ObHeaderCookie value (if it exists)","docstring_summary":"Find the ObHeaderCookie value (if it exists)","docstring_tokens":["Find","the","ObHeaderCookie","value","(","if","it","exists",")"],"function":"def find_cookie(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str) -> Optional[interfaces.objects.ObjectInterface]:\n \"\"\"Find the ObHeaderCookie value (if it exists)\"\"\"\n\n try:\n offset = context.symbol_space.get_symbol(symbol_table + constants.BANG + \"ObHeaderCookie\").address\n except exceptions.SymbolError:\n return None\n\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n return context.object(symbol_table + constants.BANG + \"unsigned int\", layer_name, offset = kvo + offset)","function_tokens":["def","find_cookie","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","Optional","[","interfaces",".","objects",".","ObjectInterface","]",":","try",":","offset","=","context",".","symbol_space",".","get_symbol","(","symbol_table","+","constants",".","BANG","+","\"ObHeaderCookie\"",")",".","address","except","exceptions",".","SymbolError",":","return","None","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","return","context",".","object","(","symbol_table","+","constants",".","BANG","+","\"unsigned int\"",",","layer_name",",","offset","=","kvo","+","offset",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py#L207-L217"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py","language":"python","identifier":"Handles._make_handle_array","parameters":"(self, offset, level, depth = 0)","argument_list":"","return_statement":"","docstring":"Parse a process' handle table and yield valid handle table entries,\n going as deep into the table \"levels\" as necessary.","docstring_summary":"Parse a process' handle table and yield valid handle table entries,\n going as deep into the table \"levels\" as necessary.","docstring_tokens":["Parse","a","process","handle","table","and","yield","valid","handle","table","entries","going","as","deep","into","the","table","levels","as","necessary","."],"function":"def _make_handle_array(self, offset, level, depth = 0):\n \"\"\"Parse a process' handle table and yield valid handle table entries,\n going as deep into the table \"levels\" as necessary.\"\"\"\n virtual = self.config[\"primary\"]\n kvo = self.context.layers[virtual].config['kernel_virtual_offset']\n\n ntkrnlmp = self.context.module(self.config[\"nt_symbols\"], layer_name = virtual, offset = kvo)\n\n if level > 0:\n subtype = ntkrnlmp.get_type(\"pointer\")\n count = 0x1000 \/ subtype.size\n else:\n subtype = ntkrnlmp.get_type(\"_HANDLE_TABLE_ENTRY\")\n count = 0x1000 \/ subtype.size\n \n if not self.context.layers[virtual].is_valid(offset):\n yield None\n\n table = ntkrnlmp.object(object_type = \"array\",\n offset = offset,\n subtype = subtype,\n count = int(count),\n absolute = True)\n\n layer_object = self.context.layers[virtual]\n masked_offset = (offset & layer_object.maximum_address)\n\n for entry in table:\n\n if level > 0:\n for x in self._make_handle_array(entry, level - 1, depth):\n yield x\n depth += 1\n else:\n handle_multiplier = 4\n handle_level_base = depth * count * handle_multiplier\n\n handle_value = ((entry.vol.offset - masked_offset) \/\n (subtype.size \/ handle_multiplier)) + handle_level_base\n \n item = self._get_item(entry, handle_value)\n\n if item is None:\n continue\n try:\n if item.TypeIndex != 0x0:\n yield item\n except AttributeError:\n if item.Type.Name:\n yield item\n except exceptions.InvalidAddressException:\n continue","function_tokens":["def","_make_handle_array","(","self",",","offset",",","level",",","depth","=","0",")",":","virtual","=","self",".","config","[","\"primary\"","]","kvo","=","self",".","context",".","layers","[","virtual","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","self",".","context",".","module","(","self",".","config","[","\"nt_symbols\"","]",",","layer_name","=","virtual",",","offset","=","kvo",")","if","level",">","0",":","subtype","=","ntkrnlmp",".","get_type","(","\"pointer\"",")","count","=","0x1000","\/","subtype",".","size","else",":","subtype","=","ntkrnlmp",".","get_type","(","\"_HANDLE_TABLE_ENTRY\"",")","count","=","0x1000","\/","subtype",".","size","if","not","self",".","context",".","layers","[","virtual","]",".","is_valid","(","offset",")",":","yield","None","table","=","ntkrnlmp",".","object","(","object_type","=","\"array\"",",","offset","=","offset",",","subtype","=","subtype",",","count","=","int","(","count",")",",","absolute","=","True",")","layer_object","=","self",".","context",".","layers","[","virtual","]","masked_offset","=","(","offset","&","layer_object",".","maximum_address",")","for","entry","in","table",":","if","level",">","0",":","for","x","in","self",".","_make_handle_array","(","entry",",","level","-","1",",","depth",")",":","yield","x","depth","+=","1","else",":","handle_multiplier","=","4","handle_level_base","=","depth","*","count","*","handle_multiplier","handle_value","=","(","(","entry",".","vol",".","offset","-","masked_offset",")","\/","(","subtype",".","size","\/","handle_multiplier",")",")","+","handle_level_base","item","=","self",".","_get_item","(","entry",",","handle_value",")","if","item","is","None",":","continue","try",":","if","item",".","TypeIndex","!=","0x0",":","yield","item","except","AttributeError",":","if","item",".","Type",".","Name",":","yield","item","except","exceptions",".","InvalidAddressException",":","continue"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/handles.py#L219-L270"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/filescan.py","language":"python","identifier":"FileScan.scan_files","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"","docstring":"Scans for file objects using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of File objects as found from the `layer_name` layer based on File pool signatures","docstring_summary":"Scans for file objects using the poolscanner module and constraints.","docstring_tokens":["Scans","for","file","objects","using","the","poolscanner","module","and","constraints","."],"function":"def scan_files(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Scans for file objects using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of File objects as found from the `layer_name` layer based on File pool signatures\n \"\"\"\n\n constraints = poolscanner.PoolScanner.builtin_constraints(symbol_table, [b'Fil\\xe5', b'File'])\n\n for result in poolscanner.PoolScanner.generate_pool_scan(context, layer_name, symbol_table, constraints):\n\n _constraint, mem_object, _header = result\n yield mem_object","function_tokens":["def","scan_files","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","constraints","=","poolscanner",".","PoolScanner",".","builtin_constraints","(","symbol_table",",","[","b'Fil\\xe5'",",","b'File'","]",")","for","result","in","poolscanner",".","PoolScanner",".","generate_pool_scan","(","context",",","layer_name",",","symbol_table",",","constraints",")",":","_constraint",",","mem_object",",","_header","=","result","yield","mem_object"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/filescan.py#L29-L50"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/getservicesids.py","language":"python","identifier":"createservicesid","parameters":"(svc)","argument_list":"","return_statement":"return 'S-1-5-80-' + '-'.join([str(n) for n in dec])","docstring":"Calculate the Service SID","docstring_summary":"Calculate the Service SID","docstring_tokens":["Calculate","the","Service","SID"],"function":"def createservicesid(svc) -> str:\n \"\"\" Calculate the Service SID \"\"\"\n uni = ''.join([c + '\\x00' for c in svc])\n sha = hashlib.sha1(uni.upper().encode(\"utf-8\")).digest() # pylint: disable-msg=E1101\n dec = list()\n for i in range(5):\n ## The use of struct here is OK. It doesn't make much sense\n ## to leverage obj.Object inside this loop.\n dec.append(struct.unpack('","str",":","uni","=","''",".","join","(","[","c","+","'\\x00'","for","c","in","svc","]",")","sha","=","hashlib",".","sha1","(","uni",".","upper","(",")",".","encode","(","\"utf-8\"",")",")",".","digest","(",")","# pylint: disable-msg=E1101","dec","=","list","(",")","for","i","in","range","(","5",")",":","## The use of struct here is OK. It doesn't make much sense","## to leverage obj.Object inside this loop.","dec",".","append","(","struct",".","unpack","(","' \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Scans for mutants using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of Mutant objects found by scanning memory for the Mutant pool signatures\n \"\"\"\n\n constraints = poolscanner.PoolScanner.builtin_constraints(symbol_table, [b'Mut\\xe1', b'Muta'])\n\n for result in poolscanner.PoolScanner.generate_pool_scan(context, layer_name, symbol_table, constraints):\n\n _constraint, mem_object, _header = result\n yield mem_object","function_tokens":["def","scan_mutants","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","constraints","=","poolscanner",".","PoolScanner",".","builtin_constraints","(","symbol_table",",","[","b'Mut\\xe1'",",","b'Muta'","]",")","for","result","in","poolscanner",".","PoolScanner",".","generate_pool_scan","(","context",",","layer_name",",","symbol_table",",","constraints",")",":","_constraint",",","mem_object",",","_header","=","result","yield","mem_object"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/mutantscan.py#L29-L50"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/pstree.py","language":"python","identifier":"PsTree.find_level","parameters":"(self, pid: objects.Pointer)","argument_list":"","return_statement":"","docstring":"Finds how deep the pid is in the processes list.","docstring_summary":"Finds how deep the pid is in the processes list.","docstring_tokens":["Finds","how","deep","the","pid","is","in","the","processes","list","."],"function":"def find_level(self, pid: objects.Pointer) -> None:\n \"\"\"Finds how deep the pid is in the processes list.\"\"\"\n seen = set([])\n seen.add(pid)\n level = 0\n proc = self._processes.get(pid, None)\n while proc is not None and proc.InheritedFromUniqueProcessId not in seen:\n child_list = self._children.get(proc.InheritedFromUniqueProcessId, set([]))\n child_list.add(proc.UniqueProcessId)\n self._children[proc.InheritedFromUniqueProcessId] = child_list\n proc = self._processes.get(proc.InheritedFromUniqueProcessId, None)\n level += 1\n self._levels[pid] = level","function_tokens":["def","find_level","(","self",",","pid",":","objects",".","Pointer",")","->","None",":","seen","=","set","(","[","]",")","seen",".","add","(","pid",")","level","=","0","proc","=","self",".","_processes",".","get","(","pid",",","None",")","while","proc","is","not","None","and","proc",".","InheritedFromUniqueProcessId","not","in","seen",":","child_list","=","self",".","_children",".","get","(","proc",".","InheritedFromUniqueProcessId",",","set","(","[","]",")",")","child_list",".","add","(","proc",".","UniqueProcessId",")","self",".","_children","[","proc",".","InheritedFromUniqueProcessId","]","=","child_list","proc","=","self",".","_processes",".","get","(","proc",".","InheritedFromUniqueProcessId",",","None",")","level","+=","1","self",".","_levels","[","pid","]","=","level"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/pstree.py#L45-L57"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/pstree.py","language":"python","identifier":"PsTree._generator","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Generates the Tree of processes.","docstring_summary":"Generates the Tree of processes.","docstring_tokens":["Generates","the","Tree","of","processes","."],"function":"def _generator(self):\n \"\"\"Generates the Tree of processes.\"\"\"\n for proc in pslist.PsList.list_processes(self.context, self.config['primary'], self.config['nt_symbols']):\n\n if not self.config.get('physical', pslist.PsList.PHYSICAL_DEFAULT):\n offset = proc.vol.offset\n else:\n layer_name = self.config['primary']\n memory = self.context.layers[layer_name]\n (_, _, offset, _, _) = list(memory.mapping(offset = proc.vol.offset, length = 0))[0]\n\n self._processes[proc.UniqueProcessId] = proc\n\n # Build the child\/level maps\n for pid in self._processes:\n self.find_level(pid)\n\n def yield_processes(pid):\n proc = self._processes[pid]\n row = (proc.UniqueProcessId, proc.InheritedFromUniqueProcessId,\n proc.ImageFileName.cast(\"string\", max_length = proc.ImageFileName.vol.count, errors = 'replace'),\n format_hints.Hex(offset), proc.ActiveThreads, proc.get_handle_count(), proc.get_session_id(),\n proc.get_is_wow64(), proc.get_create_time(), proc.get_exit_time())\n\n yield (self._levels[pid] - 1, row)\n for child_pid in self._children.get(pid, []):\n yield from yield_processes(child_pid)\n\n for pid in self._levels:\n if self._levels[pid] == 1:\n yield from yield_processes(pid)","function_tokens":["def","_generator","(","self",")",":","for","proc","in","pslist",".","PsList",".","list_processes","(","self",".","context",",","self",".","config","[","'primary'","]",",","self",".","config","[","'nt_symbols'","]",")",":","if","not","self",".","config",".","get","(","'physical'",",","pslist",".","PsList",".","PHYSICAL_DEFAULT",")",":","offset","=","proc",".","vol",".","offset","else",":","layer_name","=","self",".","config","[","'primary'","]","memory","=","self",".","context",".","layers","[","layer_name","]","(","_",",","_",",","offset",",","_",",","_",")","=","list","(","memory",".","mapping","(","offset","=","proc",".","vol",".","offset",",","length","=","0",")",")","[","0","]","self",".","_processes","[","proc",".","UniqueProcessId","]","=","proc","# Build the child\/level maps","for","pid","in","self",".","_processes",":","self",".","find_level","(","pid",")","def","yield_processes","(","pid",")",":","proc","=","self",".","_processes","[","pid","]","row","=","(","proc",".","UniqueProcessId",",","proc",".","InheritedFromUniqueProcessId",",","proc",".","ImageFileName",".","cast","(","\"string\"",",","max_length","=","proc",".","ImageFileName",".","vol",".","count",",","errors","=","'replace'",")",",","format_hints",".","Hex","(","offset",")",",","proc",".","ActiveThreads",",","proc",".","get_handle_count","(",")",",","proc",".","get_session_id","(",")",",","proc",".","get_is_wow64","(",")",",","proc",".","get_create_time","(",")",",","proc",".","get_exit_time","(",")",")","yield","(","self",".","_levels","[","pid","]","-","1",",","row",")","for","child_pid","in","self",".","_children",".","get","(","pid",",","[","]",")",":","yield","from","yield_processes","(","child_pid",")","for","pid","in","self",".","_levels",":","if","self",".","_levels","[","pid","]","==","1",":","yield","from","yield_processes","(","pid",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/pstree.py#L59-L89"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/ssdt.py","language":"python","identifier":"SSDT.build_module_collection","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"return contexts.ModuleCollection(context_modules)","docstring":"Builds a collection of modules.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A Module collection of available modules based on `Modules.list_modules`","docstring_summary":"Builds a collection of modules.","docstring_tokens":["Builds","a","collection","of","modules","."],"function":"def build_module_collection(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str) -> contexts.ModuleCollection:\n \"\"\"Builds a collection of modules.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A Module collection of available modules based on `Modules.list_modules`\n \"\"\"\n\n mods = modules.Modules.list_modules(context, layer_name, symbol_table)\n context_modules = []\n\n for mod in mods:\n\n try:\n module_name_with_ext = mod.BaseDllName.get_string()\n except exceptions.InvalidAddressException:\n # there's no use for a module with no name?\n continue\n\n module_name = os.path.splitext(module_name_with_ext)[0]\n\n symbol_table_name = None\n if module_name in constants.windows.KERNEL_MODULE_NAMES:\n symbol_table_name = symbol_table\n\n context_module = contexts.SizedModule(context,\n module_name,\n layer_name,\n mod.DllBase,\n mod.SizeOfImage,\n symbol_table_name = symbol_table_name)\n\n context_modules.append(context_module)\n\n return contexts.ModuleCollection(context_modules)","function_tokens":["def","build_module_collection","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","contexts",".","ModuleCollection",":","mods","=","modules",".","Modules",".","list_modules","(","context",",","layer_name",",","symbol_table",")","context_modules","=","[","]","for","mod","in","mods",":","try",":","module_name_with_ext","=","mod",".","BaseDllName",".","get_string","(",")","except","exceptions",".","InvalidAddressException",":","# there's no use for a module with no name?","continue","module_name","=","os",".","path",".","splitext","(","module_name_with_ext",")","[","0","]","symbol_table_name","=","None","if","module_name","in","constants",".","windows",".","KERNEL_MODULE_NAMES",":","symbol_table_name","=","symbol_table","context_module","=","contexts",".","SizedModule","(","context",",","module_name",",","layer_name",",","mod",".","DllBase",",","mod",".","SizeOfImage",",","symbol_table_name","=","symbol_table_name",")","context_modules",".","append","(","context_module",")","return","contexts",".","ModuleCollection","(","context_modules",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/ssdt.py#L35-L74"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/virtmap.py","language":"python","identifier":"VirtMap.determine_map","parameters":"(cls, module: interfaces.context.ModuleInterface)","argument_list":"","return_statement":"return result","docstring":"Returns the virtual map from a windows kernel module.","docstring_summary":"Returns the virtual map from a windows kernel module.","docstring_tokens":["Returns","the","virtual","map","from","a","windows","kernel","module","."],"function":"def determine_map(cls, module: interfaces.context.ModuleInterface) -> \\\n Dict[str, List[Tuple[int, int]]]:\n \"\"\"Returns the virtual map from a windows kernel module.\"\"\"\n layer = module.context.layers[module.layer_name]\n if not isinstance(layer, intel.Intel):\n raise\n\n result = {} # type: Dict[str, List[Tuple[int, int]]]\n system_va_type = module.get_enumeration('_MI_SYSTEM_VA_TYPE')\n large_page_size = (layer.page_size ** 2) \/\/ module.get_type(\"_MMPTE\").size\n\n if module.has_symbol('MiVisibleState'):\n symbol = module.get_symbol('MiVisibleState')\n visible_state = module.object(object_type = 'pointer',\n offset = symbol.address,\n subtype = module.get_type('_MI_VISIBLE_STATE')).dereference()\n if hasattr(visible_state, 'SystemVaRegions'):\n for i in range(visible_state.SystemVaRegions.count):\n lookup = system_va_type.lookup(i)\n region_range = result.get(lookup, [])\n region_range.append(\n (visible_state.SystemVaRegions[i].BaseAddress, visible_state.SystemVaRegions[i].NumberOfBytes))\n result[lookup] = region_range\n elif hasattr(visible_state, 'SystemVaType'):\n system_range_start = module.object(object_type = \"pointer\",\n offset = module.get_symbol(\"MmSystemRangeStart\").address)\n result = cls._enumerate_system_va_type(large_page_size, system_range_start, module,\n visible_state.SystemVaType)\n else:\n raise exceptions.SymbolError(None, module.name, \"Required structures not found\")\n elif module.has_symbol('MiSystemVaType'):\n system_range_start = module.object(object_type = \"pointer\",\n offset = module.get_symbol(\"MmSystemRangeStart\").address)\n symbol = module.get_symbol('MiSystemVaType')\n array_count = (0xFFFFFFFF + 1 - system_range_start) \/\/ large_page_size\n type_array = module.object(object_type = 'array',\n offset = symbol.address,\n count = array_count,\n subtype = module.get_type('char'))\n\n result = cls._enumerate_system_va_type(large_page_size, system_range_start, module, type_array)\n else:\n raise exceptions.SymbolError(None, module.name, \"Required structures not found\")\n\n return result","function_tokens":["def","determine_map","(","cls",",","module",":","interfaces",".","context",".","ModuleInterface",")","->","Dict","[","str",",","List","[","Tuple","[","int",",","int","]","]","]",":","layer","=","module",".","context",".","layers","[","module",".","layer_name","]","if","not","isinstance","(","layer",",","intel",".","Intel",")",":","raise","result","=","{","}","# type: Dict[str, List[Tuple[int, int]]]","system_va_type","=","module",".","get_enumeration","(","'_MI_SYSTEM_VA_TYPE'",")","large_page_size","=","(","layer",".","page_size","**","2",")","\/\/","module",".","get_type","(","\"_MMPTE\"",")",".","size","if","module",".","has_symbol","(","'MiVisibleState'",")",":","symbol","=","module",".","get_symbol","(","'MiVisibleState'",")","visible_state","=","module",".","object","(","object_type","=","'pointer'",",","offset","=","symbol",".","address",",","subtype","=","module",".","get_type","(","'_MI_VISIBLE_STATE'",")",")",".","dereference","(",")","if","hasattr","(","visible_state",",","'SystemVaRegions'",")",":","for","i","in","range","(","visible_state",".","SystemVaRegions",".","count",")",":","lookup","=","system_va_type",".","lookup","(","i",")","region_range","=","result",".","get","(","lookup",",","[","]",")","region_range",".","append","(","(","visible_state",".","SystemVaRegions","[","i","]",".","BaseAddress",",","visible_state",".","SystemVaRegions","[","i","]",".","NumberOfBytes",")",")","result","[","lookup","]","=","region_range","elif","hasattr","(","visible_state",",","'SystemVaType'",")",":","system_range_start","=","module",".","object","(","object_type","=","\"pointer\"",",","offset","=","module",".","get_symbol","(","\"MmSystemRangeStart\"",")",".","address",")","result","=","cls",".","_enumerate_system_va_type","(","large_page_size",",","system_range_start",",","module",",","visible_state",".","SystemVaType",")","else",":","raise","exceptions",".","SymbolError","(","None",",","module",".","name",",","\"Required structures not found\"",")","elif","module",".","has_symbol","(","'MiSystemVaType'",")",":","system_range_start","=","module",".","object","(","object_type","=","\"pointer\"",",","offset","=","module",".","get_symbol","(","\"MmSystemRangeStart\"",")",".","address",")","symbol","=","module",".","get_symbol","(","'MiSystemVaType'",")","array_count","=","(","0xFFFFFFFF","+","1","-","system_range_start",")","\/\/","large_page_size","type_array","=","module",".","object","(","object_type","=","'array'",",","offset","=","symbol",".","address",",","count","=","array_count",",","subtype","=","module",".","get_type","(","'char'",")",")","result","=","cls",".","_enumerate_system_va_type","(","large_page_size",",","system_range_start",",","module",",","type_array",")","else",":","raise","exceptions",".","SymbolError","(","None",",","module",".","name",",","\"Required structures not found\"",")","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/virtmap.py#L37-L81"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modscan.py","language":"python","identifier":"ModScan.scan_modules","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"","docstring":"Scans for modules using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of Driver objects as found from the `layer_name` layer based on Driver pool signatures","docstring_summary":"Scans for modules using the poolscanner module and constraints.","docstring_tokens":["Scans","for","modules","using","the","poolscanner","module","and","constraints","."],"function":"def scan_modules(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Scans for modules using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of Driver objects as found from the `layer_name` layer based on Driver pool signatures\n \"\"\"\n\n constraints = poolscanner.PoolScanner.builtin_constraints(symbol_table, [b'MmLd'])\n\n for result in poolscanner.PoolScanner.generate_pool_scan(context, layer_name, symbol_table, constraints):\n\n _constraint, mem_object, _header = result\n yield mem_object","function_tokens":["def","scan_modules","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","constraints","=","poolscanner",".","PoolScanner",".","builtin_constraints","(","symbol_table",",","[","b'MmLd'","]",")","for","result","in","poolscanner",".","PoolScanner",".","generate_pool_scan","(","context",",","layer_name",",","symbol_table",",","constraints",")",":","_constraint",",","mem_object",",","_header","=","result","yield","mem_object"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modscan.py#L42-L63"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modscan.py","language":"python","identifier":"ModScan.get_session_layers","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n pids: List[int] = None)","argument_list":"","return_statement":"","docstring":"Build a cache of possible virtual layers, in priority starting with\n the primary\/kernel layer. Then keep one layer per session by cycling\n through the process list.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n pids: A list of process identifiers to include exclusively or None for no filter\n\n Returns:\n A list of session layer names","docstring_summary":"Build a cache of possible virtual layers, in priority starting with\n the primary\/kernel layer. Then keep one layer per session by cycling\n through the process list.","docstring_tokens":["Build","a","cache","of","possible","virtual","layers","in","priority","starting","with","the","primary","\/","kernel","layer",".","Then","keep","one","layer","per","session","by","cycling","through","the","process","list","."],"function":"def get_session_layers(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n pids: List[int] = None) -> Generator[str, None, None]:\n \"\"\"Build a cache of possible virtual layers, in priority starting with\n the primary\/kernel layer. Then keep one layer per session by cycling\n through the process list.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n pids: A list of process identifiers to include exclusively or None for no filter\n\n Returns:\n A list of session layer names\n \"\"\"\n seen_ids = [] # type: List[interfaces.objects.ObjectInterface]\n filter_func = pslist.PsList.create_pid_filter(pids or [])\n\n for proc in pslist.PsList.list_processes(context = context,\n layer_name = layer_name,\n symbol_table = symbol_table,\n filter_func = filter_func):\n proc_id = \"Unknown\"\n try:\n proc_id = proc.UniqueProcessId\n proc_layer_name = proc.add_process_layer()\n\n # create the session space object in the process' own layer.\n # not all processes have a valid session pointer.\n session_space = context.object(symbol_table + constants.BANG + \"_MM_SESSION_SPACE\",\n layer_name = layer_name,\n offset = proc.Session)\n\n if session_space.SessionId in seen_ids:\n continue\n\n except exceptions.InvalidAddressException:\n vollog.log(\n constants.LOGLEVEL_VVV,\n \"Process {} does not have a valid Session or a layer could not be constructed for it\".format(\n proc_id))\n continue\n\n # save the layer if we haven't seen the session yet\n seen_ids.append(session_space.SessionId)\n yield proc_layer_name","function_tokens":["def","get_session_layers","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","pids",":","List","[","int","]","=","None",")","->","Generator","[","str",",","None",",","None","]",":","seen_ids","=","[","]","# type: List[interfaces.objects.ObjectInterface]","filter_func","=","pslist",".","PsList",".","create_pid_filter","(","pids","or","[","]",")","for","proc","in","pslist",".","PsList",".","list_processes","(","context","=","context",",","layer_name","=","layer_name",",","symbol_table","=","symbol_table",",","filter_func","=","filter_func",")",":","proc_id","=","\"Unknown\"","try",":","proc_id","=","proc",".","UniqueProcessId","proc_layer_name","=","proc",".","add_process_layer","(",")","# create the session space object in the process' own layer.","# not all processes have a valid session pointer.","session_space","=","context",".","object","(","symbol_table","+","constants",".","BANG","+","\"_MM_SESSION_SPACE\"",",","layer_name","=","layer_name",",","offset","=","proc",".","Session",")","if","session_space",".","SessionId","in","seen_ids",":","continue","except","exceptions",".","InvalidAddressException",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Process {} does not have a valid Session or a layer could not be constructed for it\"",".","format","(","proc_id",")",")","continue","# save the layer if we haven't seen the session yet","seen_ids",".","append","(","session_space",".","SessionId",")","yield","proc_layer_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modscan.py#L66-L114"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modscan.py","language":"python","identifier":"ModScan.find_session_layer","parameters":"(cls, context: interfaces.context.ContextInterface, session_layers: Iterable[str],\n base_address: int)","argument_list":"","return_statement":"return None","docstring":"Given a base address and a list of layer names, find a layer that\n can access the specified address.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n session_layers: A list of session layer names\n base_address: The base address to identify the layers that can access it\n\n Returns:\n Layer name or None if no layers that contain the base address can be found","docstring_summary":"Given a base address and a list of layer names, find a layer that\n can access the specified address.","docstring_tokens":["Given","a","base","address","and","a","list","of","layer","names","find","a","layer","that","can","access","the","specified","address","."],"function":"def find_session_layer(cls, context: interfaces.context.ContextInterface, session_layers: Iterable[str],\n base_address: int):\n \"\"\"Given a base address and a list of layer names, find a layer that\n can access the specified address.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n session_layers: A list of session layer names\n base_address: The base address to identify the layers that can access it\n\n Returns:\n Layer name or None if no layers that contain the base address can be found\n \"\"\"\n\n for layer_name in session_layers:\n if context.layers[layer_name].is_valid(base_address):\n return layer_name\n\n return None","function_tokens":["def","find_session_layer","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","session_layers",":","Iterable","[","str","]",",","base_address",":","int",")",":","for","layer_name","in","session_layers",":","if","context",".","layers","[","layer_name","]",".","is_valid","(","base_address",")",":","return","layer_name","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/modscan.py#L117-L137"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/dlllist.py","language":"python","identifier":"DllList.dump_pe","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n pe_table_name: str,\n dll_entry: interfaces.objects.ObjectInterface,\n open_method: Type[interfaces.plugins.FileHandlerInterface],\n layer_name: str = None,\n prefix: str = '')","argument_list":"","return_statement":"return file_handle","docstring":"Extracts the complete data for a process as a FileInterface\n\n Args:\n context: the context to operate upon\n pe_table_name: the name for the symbol table containing the PE format symbols\n dll_entry: the object representing the module\n layer_name: the layer that the DLL lives within\n open_method: class for constructing output files\n\n Returns:\n An open FileHandlerInterface object containing the complete data for the DLL or None in the case of failure","docstring_summary":"Extracts the complete data for a process as a FileInterface","docstring_tokens":["Extracts","the","complete","data","for","a","process","as","a","FileInterface"],"function":"def dump_pe(cls,\n context: interfaces.context.ContextInterface,\n pe_table_name: str,\n dll_entry: interfaces.objects.ObjectInterface,\n open_method: Type[interfaces.plugins.FileHandlerInterface],\n layer_name: str = None,\n prefix: str = '') -> Optional[interfaces.plugins.FileHandlerInterface]:\n \"\"\"Extracts the complete data for a process as a FileInterface\n\n Args:\n context: the context to operate upon\n pe_table_name: the name for the symbol table containing the PE format symbols\n dll_entry: the object representing the module\n layer_name: the layer that the DLL lives within\n open_method: class for constructing output files\n\n Returns:\n An open FileHandlerInterface object containing the complete data for the DLL or None in the case of failure\n \"\"\"\n try:\n try:\n name = dll_entry.FullDllName.get_string()\n except exceptions.InvalidAddressException:\n name = 'UnreadbleDLLName'\n\n if layer_name is None:\n layer_name = dll_entry.vol.layer_name\n\n file_handle = open_method(\"{}{}.{:#x}.{:#x}.dmp\".format(prefix, ntpath.basename(name),\n dll_entry.vol.offset, dll_entry.DllBase))\n\n dos_header = context.object(pe_table_name + constants.BANG + \"_IMAGE_DOS_HEADER\",\n offset = dll_entry.DllBase,\n layer_name = layer_name)\n\n for offset, data in dos_header.reconstruct():\n file_handle.seek(offset)\n file_handle.write(data)\n except (IOError, exceptions.VolatilityException, OverflowError, ValueError) as excp:\n vollog.debug(\"Unable to dump dll at offset {}: {}\".format(dll_entry.DllBase, excp))\n return None\n return file_handle","function_tokens":["def","dump_pe","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","pe_table_name",":","str",",","dll_entry",":","interfaces",".","objects",".","ObjectInterface",",","open_method",":","Type","[","interfaces",".","plugins",".","FileHandlerInterface","]",",","layer_name",":","str","=","None",",","prefix",":","str","=","''",")","->","Optional","[","interfaces",".","plugins",".","FileHandlerInterface","]",":","try",":","try",":","name","=","dll_entry",".","FullDllName",".","get_string","(",")","except","exceptions",".","InvalidAddressException",":","name","=","'UnreadbleDLLName'","if","layer_name","is","None",":","layer_name","=","dll_entry",".","vol",".","layer_name","file_handle","=","open_method","(","\"{}{}.{:#x}.{:#x}.dmp\"",".","format","(","prefix",",","ntpath",".","basename","(","name",")",",","dll_entry",".","vol",".","offset",",","dll_entry",".","DllBase",")",")","dos_header","=","context",".","object","(","pe_table_name","+","constants",".","BANG","+","\"_IMAGE_DOS_HEADER\"",",","offset","=","dll_entry",".","DllBase",",","layer_name","=","layer_name",")","for","offset",",","data","in","dos_header",".","reconstruct","(",")",":","file_handle",".","seek","(","offset",")","file_handle",".","write","(","data",")","except","(","IOError",",","exceptions",".","VolatilityException",",","OverflowError",",","ValueError",")","as","excp",":","vollog",".","debug","(","\"Unable to dump dll at offset {}: {}\"",".","format","(","dll_entry",".","DllBase",",","excp",")",")","return","None","return","file_handle"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/dlllist.py#L47-L88"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/malfind.py","language":"python","identifier":"Malfind.is_vad_empty","parameters":"(cls, proc_layer, vad)","argument_list":"","return_statement":"return True","docstring":"Check if a VAD region is either entirely unavailable due to paging,\n entirely consisting of zeros, or a combination of the two. This helps\n ignore false positives whose VAD flags match task._injection_filter\n requirements but there's no data and thus not worth reporting it.\n\n Args:\n proc_layer: the process layer\n vad: the MMVAD structure to test\n\n Returns:\n A boolean indicating whether a vad is empty or not","docstring_summary":"Check if a VAD region is either entirely unavailable due to paging,\n entirely consisting of zeros, or a combination of the two. This helps\n ignore false positives whose VAD flags match task._injection_filter\n requirements but there's no data and thus not worth reporting it.","docstring_tokens":["Check","if","a","VAD","region","is","either","entirely","unavailable","due","to","paging","entirely","consisting","of","zeros","or","a","combination","of","the","two",".","This","helps","ignore","false","positives","whose","VAD","flags","match","task",".","_injection_filter","requirements","but","there","s","no","data","and","thus","not","worth","reporting","it","."],"function":"def is_vad_empty(cls, proc_layer, vad):\n \"\"\"Check if a VAD region is either entirely unavailable due to paging,\n entirely consisting of zeros, or a combination of the two. This helps\n ignore false positives whose VAD flags match task._injection_filter\n requirements but there's no data and thus not worth reporting it.\n\n Args:\n proc_layer: the process layer\n vad: the MMVAD structure to test\n\n Returns:\n A boolean indicating whether a vad is empty or not\n \"\"\"\n\n CHUNK_SIZE = 0x1000\n all_zero_page = \"\\x00\" * CHUNK_SIZE\n\n offset = 0\n vad_length = vad.get_end() - vad.get_start()\n\n while offset < vad_length:\n next_addr = vad.get_start() + offset\n if proc_layer.is_valid(next_addr, CHUNK_SIZE) and proc_layer.read(next_addr, CHUNK_SIZE) != all_zero_page:\n return False\n offset += CHUNK_SIZE\n\n return True","function_tokens":["def","is_vad_empty","(","cls",",","proc_layer",",","vad",")",":","CHUNK_SIZE","=","0x1000","all_zero_page","=","\"\\x00\"","*","CHUNK_SIZE","offset","=","0","vad_length","=","vad",".","get_end","(",")","-","vad",".","get_start","(",")","while","offset","<","vad_length",":","next_addr","=","vad",".","get_start","(",")","+","offset","if","proc_layer",".","is_valid","(","next_addr",",","CHUNK_SIZE",")","and","proc_layer",".","read","(","next_addr",",","CHUNK_SIZE",")","!=","all_zero_page",":","return","False","offset","+=","CHUNK_SIZE","return","True"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/malfind.py#L43-L69"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/malfind.py","language":"python","identifier":"Malfind.list_injections","parameters":"(\n cls, context: interfaces.context.ContextInterface, kernel_layer_name: str, symbol_table: str,\n proc: interfaces.objects.ObjectInterface)","argument_list":"","return_statement":"","docstring":"Generate memory regions for a process that may contain injected\n code.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n kernel_layer_name: The name of the kernel layer from which to read the VAD protections\n symbol_table: The name of the table containing the kernel symbols\n proc: an _EPROCESS instance\n\n Returns:\n An iterable of VAD instances and the first 64 bytes of data containing in that region","docstring_summary":"Generate memory regions for a process that may contain injected\n code.","docstring_tokens":["Generate","memory","regions","for","a","process","that","may","contain","injected","code","."],"function":"def list_injections(\n cls, context: interfaces.context.ContextInterface, kernel_layer_name: str, symbol_table: str,\n proc: interfaces.objects.ObjectInterface) -> Iterable[Tuple[interfaces.objects.ObjectInterface, bytes]]:\n \"\"\"Generate memory regions for a process that may contain injected\n code.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n kernel_layer_name: The name of the kernel layer from which to read the VAD protections\n symbol_table: The name of the table containing the kernel symbols\n proc: an _EPROCESS instance\n\n Returns:\n An iterable of VAD instances and the first 64 bytes of data containing in that region\n \"\"\"\n proc_id = \"Unknown\"\n try:\n proc_id = proc.UniqueProcessId\n proc_layer_name = proc.add_process_layer()\n except exceptions.InvalidAddressException as excp:\n vollog.debug(\"Process {}: invalid address {} in layer {}\".format(proc_id, excp.invalid_address,\n excp.layer_name))\n return\n\n proc_layer = context.layers[proc_layer_name]\n\n for vad in proc.get_vad_root().traverse():\n protection_string = vad.get_protection(\n vadinfo.VadInfo.protect_values(context, kernel_layer_name, symbol_table), vadinfo.winnt_protections)\n write_exec = \"EXECUTE\" in protection_string and \"WRITE\" in protection_string\n\n # the write\/exec check applies to everything\n if not write_exec:\n continue\n\n if (vad.get_private_memory() == 1\n and vad.get_tag() == \"VadS\") or (vad.get_private_memory() == 0\n and protection_string != \"PAGE_EXECUTE_WRITECOPY\"):\n if cls.is_vad_empty(proc_layer, vad):\n continue\n\n data = proc_layer.read(vad.get_start(), 64, pad = True)\n yield vad, data","function_tokens":["def","list_injections","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","kernel_layer_name",":","str",",","symbol_table",":","str",",","proc",":","interfaces",".","objects",".","ObjectInterface",")","->","Iterable","[","Tuple","[","interfaces",".","objects",".","ObjectInterface",",","bytes","]","]",":","proc_id","=","\"Unknown\"","try",":","proc_id","=","proc",".","UniqueProcessId","proc_layer_name","=","proc",".","add_process_layer","(",")","except","exceptions",".","InvalidAddressException","as","excp",":","vollog",".","debug","(","\"Process {}: invalid address {} in layer {}\"",".","format","(","proc_id",",","excp",".","invalid_address",",","excp",".","layer_name",")",")","return","proc_layer","=","context",".","layers","[","proc_layer_name","]","for","vad","in","proc",".","get_vad_root","(",")",".","traverse","(",")",":","protection_string","=","vad",".","get_protection","(","vadinfo",".","VadInfo",".","protect_values","(","context",",","kernel_layer_name",",","symbol_table",")",",","vadinfo",".","winnt_protections",")","write_exec","=","\"EXECUTE\"","in","protection_string","and","\"WRITE\"","in","protection_string","# the write\/exec check applies to everything","if","not","write_exec",":","continue","if","(","vad",".","get_private_memory","(",")","==","1","and","vad",".","get_tag","(",")","==","\"VadS\"",")","or","(","vad",".","get_private_memory","(",")","==","0","and","protection_string","!=","\"PAGE_EXECUTE_WRITECOPY\"",")",":","if","cls",".","is_vad_empty","(","proc_layer",",","vad",")",":","continue","data","=","proc_layer",".","read","(","vad",".","get_start","(",")",",","64",",","pad","=","True",")","yield","vad",",","data"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/malfind.py#L72-L114"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/poolscanner.py","language":"python","identifier":"PoolScanner.builtin_constraints","parameters":"(symbol_table: str, tags_filter: List[bytes] = None)","argument_list":"","return_statement":"return [constraint for constraint in builtins if constraint.tag in tags_filter]","docstring":"Get built-in PoolConstraints given a list of pool tags.\n\n The tags_filter is a list of pool tags, and the associated\n PoolConstraints are returned. If tags_filter is empty or\n not supplied, then all builtin constraints are returned.\n\n Args:\n symbol_table: The name of the symbol table to prepend to the types used\n tags_filter: List of tags to return or None to return all\n\n Returns:\n A list of well-known constructed PoolConstraints that match the provided tags","docstring_summary":"Get built-in PoolConstraints given a list of pool tags.","docstring_tokens":["Get","built","-","in","PoolConstraints","given","a","list","of","pool","tags","."],"function":"def builtin_constraints(symbol_table: str, tags_filter: List[bytes] = None) -> List[PoolConstraint]:\n \"\"\"Get built-in PoolConstraints given a list of pool tags.\n\n The tags_filter is a list of pool tags, and the associated\n PoolConstraints are returned. If tags_filter is empty or\n not supplied, then all builtin constraints are returned.\n\n Args:\n symbol_table: The name of the symbol table to prepend to the types used\n tags_filter: List of tags to return or None to return all\n\n Returns:\n A list of well-known constructed PoolConstraints that match the provided tags\n \"\"\"\n\n builtins = [\n # atom tables\n PoolConstraint(b'AtmT',\n type_name = symbol_table + constants.BANG + \"_RTL_ATOM_TABLE\",\n size = (200, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # processes on windows before windows 8\n PoolConstraint(b'Pro\\xe3',\n type_name = symbol_table + constants.BANG + \"_EPROCESS\",\n object_type = \"Process\",\n size = (600, None),\n skip_type_test = True,\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # processes on windows starting with windows 8\n PoolConstraint(b'Proc',\n type_name = symbol_table + constants.BANG + \"_EPROCESS\",\n object_type = \"Process\",\n size = (600, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # files on windows before windows 8\n PoolConstraint(b'Fil\\xe5',\n type_name = symbol_table + constants.BANG + \"_FILE_OBJECT\",\n object_type = \"File\",\n size = (150, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # files on windows starting with windows 8\n PoolConstraint(b'File',\n type_name = symbol_table + constants.BANG + \"_FILE_OBJECT\",\n object_type = \"File\",\n size = (150, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # mutants on windows before windows 8\n PoolConstraint(b'Mut\\xe1',\n type_name = symbol_table + constants.BANG + \"_KMUTANT\",\n object_type = \"Mutant\",\n size = (64, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # mutants on windows starting with windows 8\n PoolConstraint(b'Muta',\n type_name = symbol_table + constants.BANG + \"_KMUTANT\",\n object_type = \"Mutant\",\n size = (64, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # drivers on windows before windows 8\n PoolConstraint(b'Dri\\xf6',\n type_name = symbol_table + constants.BANG + \"_DRIVER_OBJECT\",\n object_type = \"Driver\",\n size = (248, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # drivers on windows starting with windows 8\n PoolConstraint(b'Driv',\n type_name = symbol_table + constants.BANG + \"_DRIVER_OBJECT\",\n object_type = \"Driver\",\n size = (248, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # kernel modules\n PoolConstraint(b'MmLd',\n type_name = symbol_table + constants.BANG + \"_LDR_DATA_TABLE_ENTRY\",\n size = (76, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # symlinks on windows before windows 8\n PoolConstraint(b'Sym\\xe2',\n type_name = symbol_table + constants.BANG + \"_OBJECT_SYMBOLIC_LINK\",\n object_type = \"SymbolicLink\",\n size = (72, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # symlinks on windows starting with windows 8\n PoolConstraint(b'Symb',\n type_name = symbol_table + constants.BANG + \"_OBJECT_SYMBOLIC_LINK\",\n object_type = \"SymbolicLink\",\n size = (72, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE),\n # registry hives\n PoolConstraint(b'CM10',\n type_name = symbol_table + constants.BANG + \"_CMHIVE\",\n size = (800, None),\n page_type = PoolType.PAGED | PoolType.NONPAGED | PoolType.FREE,\n skip_type_test = True),\n ]\n\n if not tags_filter:\n return builtins\n\n return [constraint for constraint in builtins if constraint.tag in tags_filter]","function_tokens":["def","builtin_constraints","(","symbol_table",":","str",",","tags_filter",":","List","[","bytes","]","=","None",")","->","List","[","PoolConstraint","]",":","builtins","=","[","# atom tables","PoolConstraint","(","b'AtmT'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_RTL_ATOM_TABLE\"",",","size","=","(","200",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# processes on windows before windows 8","PoolConstraint","(","b'Pro\\xe3'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_EPROCESS\"",",","object_type","=","\"Process\"",",","size","=","(","600",",","None",")",",","skip_type_test","=","True",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# processes on windows starting with windows 8","PoolConstraint","(","b'Proc'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_EPROCESS\"",",","object_type","=","\"Process\"",",","size","=","(","600",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# files on windows before windows 8","PoolConstraint","(","b'Fil\\xe5'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_FILE_OBJECT\"",",","object_type","=","\"File\"",",","size","=","(","150",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# files on windows starting with windows 8","PoolConstraint","(","b'File'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_FILE_OBJECT\"",",","object_type","=","\"File\"",",","size","=","(","150",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# mutants on windows before windows 8","PoolConstraint","(","b'Mut\\xe1'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_KMUTANT\"",",","object_type","=","\"Mutant\"",",","size","=","(","64",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# mutants on windows starting with windows 8","PoolConstraint","(","b'Muta'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_KMUTANT\"",",","object_type","=","\"Mutant\"",",","size","=","(","64",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# drivers on windows before windows 8","PoolConstraint","(","b'Dri\\xf6'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_DRIVER_OBJECT\"",",","object_type","=","\"Driver\"",",","size","=","(","248",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# drivers on windows starting with windows 8","PoolConstraint","(","b'Driv'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_DRIVER_OBJECT\"",",","object_type","=","\"Driver\"",",","size","=","(","248",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# kernel modules","PoolConstraint","(","b'MmLd'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_LDR_DATA_TABLE_ENTRY\"",",","size","=","(","76",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# symlinks on windows before windows 8","PoolConstraint","(","b'Sym\\xe2'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_OBJECT_SYMBOLIC_LINK\"",",","object_type","=","\"SymbolicLink\"",",","size","=","(","72",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# symlinks on windows starting with windows 8","PoolConstraint","(","b'Symb'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_OBJECT_SYMBOLIC_LINK\"",",","object_type","=","\"SymbolicLink\"",",","size","=","(","72",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",")",",","# registry hives","PoolConstraint","(","b'CM10'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_CMHIVE\"",",","size","=","(","800",",","None",")",",","page_type","=","PoolType",".","PAGED","|","PoolType",".","NONPAGED","|","PoolType",".","FREE",",","skip_type_test","=","True",")",",","]","if","not","tags_filter",":","return","builtins","return","[","constraint","for","constraint","in","builtins","if","constraint",".","tag","in","tags_filter","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/poolscanner.py#L154-L252"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/poolscanner.py","language":"python","identifier":"PoolScanner.generate_pool_scan","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n constraints: List[PoolConstraint])","argument_list":"","return_statement":"","docstring":"Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n constraints: List of pool constraints used to limit the scan results\n\n Returns:\n Iterable of tuples, containing the constraint that matched, the object from memory, the object header used to determine the object","docstring_summary":"","docstring_tokens":[],"function":"def generate_pool_scan(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n constraints: List[PoolConstraint]) \\\n -> Generator[Tuple[\n PoolConstraint, interfaces.objects.ObjectInterface, interfaces.objects.ObjectInterface], None, None]:\n \"\"\"\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n constraints: List of pool constraints used to limit the scan results\n\n Returns:\n Iterable of tuples, containing the constraint that matched, the object from memory, the object header used to determine the object\n \"\"\"\n\n # get the object type map\n type_map = handles.Handles.get_type_map(context = context, layer_name = layer_name, symbol_table = symbol_table)\n\n cookie = handles.Handles.find_cookie(context = context, layer_name = layer_name, symbol_table = symbol_table)\n\n is_windows_10 = versions.is_windows_10(context, symbol_table)\n is_windows_8_or_later = versions.is_windows_8_or_later(context, symbol_table)\n\n # start off with the primary virtual layer\n scan_layer = layer_name\n\n # switch to a non-virtual layer if necessary\n if not is_windows_10:\n scan_layer = context.layers[scan_layer].config['memory_layer']\n\n if symbols.symbol_table_is_64bit(context, symbol_table):\n alignment = 0x10\n else:\n alignment = 8\n\n for constraint, header in cls.pool_scan(context, scan_layer, symbol_table, constraints, alignment = alignment):\n\n mem_object = header.get_object(type_name = constraint.type_name,\n use_top_down = is_windows_8_or_later,\n executive = constraint.object_type is not None,\n native_layer_name = 'primary',\n kernel_symbol_table = symbol_table)\n\n if mem_object is None:\n vollog.log(constants.LOGLEVEL_VVV, \"Cannot create an instance of {}\".format(constraint.type_name))\n continue\n\n if constraint.object_type is not None and not constraint.skip_type_test:\n try:\n if mem_object.get_object_header().get_object_type(type_map, cookie) != constraint.object_type:\n continue\n except exceptions.InvalidAddressException:\n vollog.log(constants.LOGLEVEL_VVV,\n \"Cannot test instance type check for {}\".format(constraint.type_name))\n continue\n\n yield constraint, mem_object, header","function_tokens":["def","generate_pool_scan","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","constraints",":","List","[","PoolConstraint","]",")","->","Generator","[","Tuple","[","PoolConstraint",",","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","ObjectInterface","]",",","None",",","None","]",":","# get the object type map","type_map","=","handles",".","Handles",".","get_type_map","(","context","=","context",",","layer_name","=","layer_name",",","symbol_table","=","symbol_table",")","cookie","=","handles",".","Handles",".","find_cookie","(","context","=","context",",","layer_name","=","layer_name",",","symbol_table","=","symbol_table",")","is_windows_10","=","versions",".","is_windows_10","(","context",",","symbol_table",")","is_windows_8_or_later","=","versions",".","is_windows_8_or_later","(","context",",","symbol_table",")","# start off with the primary virtual layer","scan_layer","=","layer_name","# switch to a non-virtual layer if necessary","if","not","is_windows_10",":","scan_layer","=","context",".","layers","[","scan_layer","]",".","config","[","'memory_layer'","]","if","symbols",".","symbol_table_is_64bit","(","context",",","symbol_table",")",":","alignment","=","0x10","else",":","alignment","=","8","for","constraint",",","header","in","cls",".","pool_scan","(","context",",","scan_layer",",","symbol_table",",","constraints",",","alignment","=","alignment",")",":","mem_object","=","header",".","get_object","(","type_name","=","constraint",".","type_name",",","use_top_down","=","is_windows_8_or_later",",","executive","=","constraint",".","object_type","is","not","None",",","native_layer_name","=","'primary'",",","kernel_symbol_table","=","symbol_table",")","if","mem_object","is","None",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Cannot create an instance of {}\"",".","format","(","constraint",".","type_name",")",")","continue","if","constraint",".","object_type","is","not","None","and","not","constraint",".","skip_type_test",":","try",":","if","mem_object",".","get_object_header","(",")",".","get_object_type","(","type_map",",","cookie",")","!=","constraint",".","object_type",":","continue","except","exceptions",".","InvalidAddressException",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Cannot test instance type check for {}\"",".","format","(","constraint",".","type_name",")",")","continue","yield","constraint",",","mem_object",",","header"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/poolscanner.py#L255-L315"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/poolscanner.py","language":"python","identifier":"PoolScanner.pool_scan","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n pool_constraints: List[PoolConstraint],\n alignment: int = 8,\n progress_callback: Optional[constants.ProgressCallback] = None)","argument_list":"","return_statement":"","docstring":"Returns the _POOL_HEADER object (based on the symbol_table template)\n after scanning through layer_name returning all headers that match any\n of the constraints provided. Only one constraint can be provided per\n tag.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n pool_constraints: List of pool constraints used to limit the scan results\n alignment: An optional value that all pool headers will be aligned to\n progress_callback: An optional function to provide progress feedback whilst scanning\n\n Returns:\n An Iterable of pool constraints and the pool headers associated with them","docstring_summary":"Returns the _POOL_HEADER object (based on the symbol_table template)\n after scanning through layer_name returning all headers that match any\n of the constraints provided. Only one constraint can be provided per\n tag.","docstring_tokens":["Returns","the","_POOL_HEADER","object","(","based","on","the","symbol_table","template",")","after","scanning","through","layer_name","returning","all","headers","that","match","any","of","the","constraints","provided",".","Only","one","constraint","can","be","provided","per","tag","."],"function":"def pool_scan(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n pool_constraints: List[PoolConstraint],\n alignment: int = 8,\n progress_callback: Optional[constants.ProgressCallback] = None) \\\n -> Generator[Tuple[PoolConstraint, interfaces.objects.ObjectInterface], None, None]:\n \"\"\"Returns the _POOL_HEADER object (based on the symbol_table template)\n after scanning through layer_name returning all headers that match any\n of the constraints provided. Only one constraint can be provided per\n tag.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n pool_constraints: List of pool constraints used to limit the scan results\n alignment: An optional value that all pool headers will be aligned to\n progress_callback: An optional function to provide progress feedback whilst scanning\n\n Returns:\n An Iterable of pool constraints and the pool headers associated with them\n \"\"\"\n # Setup the pattern\n constraint_lookup = {} # type: Dict[bytes, PoolConstraint]\n for constraint in pool_constraints:\n if constraint.tag in constraint_lookup:\n raise ValueError(\"Constraint tag is used for more than one constraint: {}\".format(repr(constraint.tag)))\n constraint_lookup[constraint.tag] = constraint\n\n pool_header_table_name = cls.get_pool_header_table(context, symbol_table)\n module = context.module(pool_header_table_name, layer_name, offset = 0)\n\n # Run the scan locating the offsets of a particular tag\n layer = context.layers[layer_name]\n scanner = PoolHeaderScanner(module, constraint_lookup, alignment)\n yield from layer.scan(context, scanner, progress_callback)","function_tokens":["def","pool_scan","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","pool_constraints",":","List","[","PoolConstraint","]",",","alignment",":","int","=","8",",","progress_callback",":","Optional","[","constants",".","ProgressCallback","]","=","None",")","->","Generator","[","Tuple","[","PoolConstraint",",","interfaces",".","objects",".","ObjectInterface","]",",","None",",","None","]",":","# Setup the pattern","constraint_lookup","=","{","}","# type: Dict[bytes, PoolConstraint]","for","constraint","in","pool_constraints",":","if","constraint",".","tag","in","constraint_lookup",":","raise","ValueError","(","\"Constraint tag is used for more than one constraint: {}\"",".","format","(","repr","(","constraint",".","tag",")",")",")","constraint_lookup","[","constraint",".","tag","]","=","constraint","pool_header_table_name","=","cls",".","get_pool_header_table","(","context",",","symbol_table",")","module","=","context",".","module","(","pool_header_table_name",",","layer_name",",","offset","=","0",")","# Run the scan locating the offsets of a particular tag","layer","=","context",".","layers","[","layer_name","]","scanner","=","PoolHeaderScanner","(","module",",","constraint_lookup",",","alignment",")","yield","from","layer",".","scan","(","context",",","scanner",",","progress_callback",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/poolscanner.py#L318-L355"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/poolscanner.py","language":"python","identifier":"PoolScanner.get_pool_header_table","parameters":"(cls, context: interfaces.context.ContextInterface, symbol_table: str)","argument_list":"","return_statement":"return table_name","docstring":"Returns the appropriate symbol_table containing a _POOL_HEADER type, even if the original symbol table\n doesn't contain one.\n\n Args:\n context: The context that the symbol tables does (or will) reside in\n symbol_table: The expected symbol_table to contain the _POOL_HEADER type","docstring_summary":"Returns the appropriate symbol_table containing a _POOL_HEADER type, even if the original symbol table\n doesn't contain one.","docstring_tokens":["Returns","the","appropriate","symbol_table","containing","a","_POOL_HEADER","type","even","if","the","original","symbol","table","doesn","t","contain","one","."],"function":"def get_pool_header_table(cls, context: interfaces.context.ContextInterface, symbol_table: str) -> str:\n \"\"\"Returns the appropriate symbol_table containing a _POOL_HEADER type, even if the original symbol table\n doesn't contain one.\n\n Args:\n context: The context that the symbol tables does (or will) reside in\n symbol_table: The expected symbol_table to contain the _POOL_HEADER type\n \"\"\"\n # Setup the pool header and offset differential\n try:\n context.symbol_space.get_type(symbol_table + constants.BANG + \"_POOL_HEADER\")\n table_name = symbol_table\n except exceptions.SymbolError:\n # We have to manually load a symbol table\n\n if symbols.symbol_table_is_64bit(context, symbol_table):\n is_win_7 = versions.is_windows_7(context, symbol_table)\n if is_win_7:\n pool_header_json_filename = \"poolheader-x64-win7\"\n else:\n pool_header_json_filename = \"poolheader-x64\"\n else:\n pool_header_json_filename = \"poolheader-x86\"\n\n # set the class_type to match the normal WindowsKernelIntermedSymbols\n is_vista_or_later = versions.is_vista_or_later(context, symbol_table)\n if is_vista_or_later:\n class_type = extensions.pool.POOL_HEADER_VISTA\n else:\n class_type = extensions.pool.POOL_HEADER\n\n table_name = intermed.IntermediateSymbolTable.create(context = context,\n config_path = configuration.path_join(\n context.symbol_space[symbol_table].config_path,\n \"poolheader\"),\n sub_path = \"windows\",\n filename = pool_header_json_filename,\n table_mapping = {'nt_symbols': symbol_table},\n class_types = {'_POOL_HEADER': class_type})\n return table_name","function_tokens":["def","get_pool_header_table","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","symbol_table",":","str",")","->","str",":","# Setup the pool header and offset differential","try",":","context",".","symbol_space",".","get_type","(","symbol_table","+","constants",".","BANG","+","\"_POOL_HEADER\"",")","table_name","=","symbol_table","except","exceptions",".","SymbolError",":","# We have to manually load a symbol table","if","symbols",".","symbol_table_is_64bit","(","context",",","symbol_table",")",":","is_win_7","=","versions",".","is_windows_7","(","context",",","symbol_table",")","if","is_win_7",":","pool_header_json_filename","=","\"poolheader-x64-win7\"","else",":","pool_header_json_filename","=","\"poolheader-x64\"","else",":","pool_header_json_filename","=","\"poolheader-x86\"","# set the class_type to match the normal WindowsKernelIntermedSymbols","is_vista_or_later","=","versions",".","is_vista_or_later","(","context",",","symbol_table",")","if","is_vista_or_later",":","class_type","=","extensions",".","pool",".","POOL_HEADER_VISTA","else",":","class_type","=","extensions",".","pool",".","POOL_HEADER","table_name","=","intermed",".","IntermediateSymbolTable",".","create","(","context","=","context",",","config_path","=","configuration",".","path_join","(","context",".","symbol_space","[","symbol_table","]",".","config_path",",","\"poolheader\"",")",",","sub_path","=","\"windows\"",",","filename","=","pool_header_json_filename",",","table_mapping","=","{","'nt_symbols'",":","symbol_table","}",",","class_types","=","{","'_POOL_HEADER'",":","class_type","}",")","return","table_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/poolscanner.py#L358-L397"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/cachedump.py","language":"python","identifier":"Cachedump.parse_decrypted_cache","parameters":"(self, dec_data, uname_len, domain_len, domain_name_len)","argument_list":"","return_statement":"return (username, domain, domain_name, hashh)","docstring":"Get the data from the cache and separate it into the username, domain name, and hash data","docstring_summary":"Get the data from the cache and separate it into the username, domain name, and hash data","docstring_tokens":["Get","the","data","from","the","cache","and","separate","it","into","the","username","domain","name","and","hash","data"],"function":"def parse_decrypted_cache(self, dec_data, uname_len, domain_len, domain_name_len):\n \"\"\"Get the data from the cache and separate it into the username, domain name, and hash data\"\"\"\n uname_offset = 72\n pad = 2 * ((uname_len \/ 2) % 2)\n domain_offset = int(uname_offset + uname_len + pad)\n pad = 2 * ((domain_len \/ 2) % 2)\n domain_name_offset = int(domain_offset + domain_len + pad)\n hashh = dec_data[:0x10]\n username = dec_data[uname_offset:uname_offset + uname_len]\n username = username.decode('utf-16-le', 'replace')\n domain = dec_data[domain_offset:domain_offset + domain_len]\n domain = domain.decode('utf-16-le', 'replace')\n domain_name = dec_data[domain_name_offset:domain_name_offset + domain_name_len]\n domain_name = domain_name.decode('utf-16-le', 'replace')\n\n return (username, domain, domain_name, hashh)","function_tokens":["def","parse_decrypted_cache","(","self",",","dec_data",",","uname_len",",","domain_len",",","domain_name_len",")",":","uname_offset","=","72","pad","=","2","*","(","(","uname_len","\/","2",")","%","2",")","domain_offset","=","int","(","uname_offset","+","uname_len","+","pad",")","pad","=","2","*","(","(","domain_len","\/","2",")","%","2",")","domain_name_offset","=","int","(","domain_offset","+","domain_len","+","pad",")","hashh","=","dec_data","[",":","0x10","]","username","=","dec_data","[","uname_offset",":","uname_offset","+","uname_len","]","username","=","username",".","decode","(","'utf-16-le'",",","'replace'",")","domain","=","dec_data","[","domain_offset",":","domain_offset","+","domain_len","]","domain","=","domain",".","decode","(","'utf-16-le'",",","'replace'",")","domain_name","=","dec_data","[","domain_name_offset",":","domain_name_offset","+","domain_name_len","]","domain_name","=","domain_name",".","decode","(","'utf-16-le'",",","'replace'",")","return","(","username",",","domain",",","domain_name",",","hashh",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/cachedump.py#L63-L78"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/svcscan.py","language":"python","identifier":"SvcScan.create_service_table","parameters":"(context: interfaces.context.ContextInterface, symbol_table: str, config_path: str)","argument_list":"","return_statement":"return intermed.IntermediateSymbolTable.create(context,\n config_path,\n \"windows\",\n symbol_filename,\n class_types = services.class_types,\n native_types = native_types)","docstring":"Constructs a symbol table containing the symbols for services\n depending upon the operating system in use.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n symbol_table: The name of the table containing the kernel symbols\n config_path: The configuration path for any settings required by the new table\n\n Returns:\n A symbol table containing the symbols necessary for services","docstring_summary":"Constructs a symbol table containing the symbols for services\n depending upon the operating system in use.","docstring_tokens":["Constructs","a","symbol","table","containing","the","symbols","for","services","depending","upon","the","operating","system","in","use","."],"function":"def create_service_table(context: interfaces.context.ContextInterface, symbol_table: str, config_path: str) -> str:\n \"\"\"Constructs a symbol table containing the symbols for services\n depending upon the operating system in use.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n symbol_table: The name of the table containing the kernel symbols\n config_path: The configuration path for any settings required by the new table\n\n Returns:\n A symbol table containing the symbols necessary for services\n \"\"\"\n native_types = context.symbol_space[symbol_table].natives\n is_64bit = symbols.symbol_table_is_64bit(context, symbol_table)\n\n if versions.is_windows_xp(context = context, symbol_table = symbol_table) and not is_64bit:\n symbol_filename = \"services-xp-x86\"\n elif versions.is_xp_or_2003(context = context, symbol_table = symbol_table) and is_64bit:\n symbol_filename = \"services-xp-2003-x64\"\n elif versions.is_win10_16299_or_later(context = context, symbol_table = symbol_table) and is_64bit:\n symbol_filename = \"services-win10-16299-x64\"\n elif versions.is_win10_16299_or_later(context = context, symbol_table = symbol_table) and not is_64bit:\n symbol_filename = \"services-win10-16299-x86\"\n elif versions.is_win10_up_to_15063(context = context, symbol_table = symbol_table) and is_64bit:\n symbol_filename = \"services-win8-x64\"\n elif versions.is_win10_up_to_15063(context = context, symbol_table = symbol_table) and not is_64bit:\n symbol_filename = \"services-win8-x86\"\n elif versions.is_win10_15063(context = context, symbol_table = symbol_table) and is_64bit:\n symbol_filename = \"services-win10-15063-x64\"\n elif versions.is_win10_15063(context = context, symbol_table = symbol_table) and not is_64bit:\n symbol_filename = \"services-win10-15063-x86\"\n elif versions.is_windows_8_or_later(context = context, symbol_table = symbol_table) and is_64bit:\n symbol_filename = \"services-win8-x64\"\n elif versions.is_windows_8_or_later(context = context, symbol_table = symbol_table) and not is_64bit:\n symbol_filename = \"services-win8-x86\"\n elif versions.is_vista_or_later(context = context, symbol_table = symbol_table) and is_64bit:\n symbol_filename = \"services-vista-x64\"\n elif versions.is_vista_or_later(context = context, symbol_table = symbol_table) and not is_64bit:\n symbol_filename = \"services-vista-x86\"\n else:\n raise NotImplementedError(\"This version of Windows is not supported!\")\n\n return intermed.IntermediateSymbolTable.create(context,\n config_path,\n \"windows\",\n symbol_filename,\n class_types = services.class_types,\n native_types = native_types)","function_tokens":["def","create_service_table","(","context",":","interfaces",".","context",".","ContextInterface",",","symbol_table",":","str",",","config_path",":","str",")","->","str",":","native_types","=","context",".","symbol_space","[","symbol_table","]",".","natives","is_64bit","=","symbols",".","symbol_table_is_64bit","(","context",",","symbol_table",")","if","versions",".","is_windows_xp","(","context","=","context",",","symbol_table","=","symbol_table",")","and","not","is_64bit",":","symbol_filename","=","\"services-xp-x86\"","elif","versions",".","is_xp_or_2003","(","context","=","context",",","symbol_table","=","symbol_table",")","and","is_64bit",":","symbol_filename","=","\"services-xp-2003-x64\"","elif","versions",".","is_win10_16299_or_later","(","context","=","context",",","symbol_table","=","symbol_table",")","and","is_64bit",":","symbol_filename","=","\"services-win10-16299-x64\"","elif","versions",".","is_win10_16299_or_later","(","context","=","context",",","symbol_table","=","symbol_table",")","and","not","is_64bit",":","symbol_filename","=","\"services-win10-16299-x86\"","elif","versions",".","is_win10_up_to_15063","(","context","=","context",",","symbol_table","=","symbol_table",")","and","is_64bit",":","symbol_filename","=","\"services-win8-x64\"","elif","versions",".","is_win10_up_to_15063","(","context","=","context",",","symbol_table","=","symbol_table",")","and","not","is_64bit",":","symbol_filename","=","\"services-win8-x86\"","elif","versions",".","is_win10_15063","(","context","=","context",",","symbol_table","=","symbol_table",")","and","is_64bit",":","symbol_filename","=","\"services-win10-15063-x64\"","elif","versions",".","is_win10_15063","(","context","=","context",",","symbol_table","=","symbol_table",")","and","not","is_64bit",":","symbol_filename","=","\"services-win10-15063-x86\"","elif","versions",".","is_windows_8_or_later","(","context","=","context",",","symbol_table","=","symbol_table",")","and","is_64bit",":","symbol_filename","=","\"services-win8-x64\"","elif","versions",".","is_windows_8_or_later","(","context","=","context",",","symbol_table","=","symbol_table",")","and","not","is_64bit",":","symbol_filename","=","\"services-win8-x86\"","elif","versions",".","is_vista_or_later","(","context","=","context",",","symbol_table","=","symbol_table",")","and","is_64bit",":","symbol_filename","=","\"services-vista-x64\"","elif","versions",".","is_vista_or_later","(","context","=","context",",","symbol_table","=","symbol_table",")","and","not","is_64bit",":","symbol_filename","=","\"services-vista-x86\"","else",":","raise","NotImplementedError","(","\"This version of Windows is not supported!\"",")","return","intermed",".","IntermediateSymbolTable",".","create","(","context",",","config_path",",","\"windows\"",",","symbol_filename",",","class_types","=","services",".","class_types",",","native_types","=","native_types",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/svcscan.py#L46-L93"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/vadyarascan.py","language":"python","identifier":"VadYaraScan.get_vad_maps","parameters":"(task: interfaces.objects.ObjectInterface)","argument_list":"","return_statement":"","docstring":"Creates a map of start\/end addresses within a virtual address\n descriptor tree.\n\n Args:\n task: The EPROCESS object of which to traverse the vad tree\n\n Returns:\n An iterable of tuples containing start and end addresses for each descriptor","docstring_summary":"Creates a map of start\/end addresses within a virtual address\n descriptor tree.","docstring_tokens":["Creates","a","map","of","start","\/","end","addresses","within","a","virtual","address","descriptor","tree","."],"function":"def get_vad_maps(task: interfaces.objects.ObjectInterface) -> Iterable[Tuple[int, int]]:\n \"\"\"Creates a map of start\/end addresses within a virtual address\n descriptor tree.\n\n Args:\n task: The EPROCESS object of which to traverse the vad tree\n\n Returns:\n An iterable of tuples containing start and end addresses for each descriptor\n \"\"\"\n vad_root = task.get_vad_root()\n for vad in vad_root.traverse():\n end = vad.get_end()\n start = vad.get_start()\n yield (start, end - start)","function_tokens":["def","get_vad_maps","(","task",":","interfaces",".","objects",".","ObjectInterface",")","->","Iterable","[","Tuple","[","int",",","int","]","]",":","vad_root","=","task",".","get_vad_root","(",")","for","vad","in","vad_root",".","traverse","(",")",":","end","=","vad",".","get_end","(",")","start","=","vad",".","get_start","(",")","yield","(","start",",","end","-","start",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/vadyarascan.py#L69-L83"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/lsadump.py","language":"python","identifier":"Lsadump.decrypt_aes","parameters":"(cls, secret, key)","argument_list":"","return_statement":"return data","docstring":"Based on code from http:\/\/lab.mediaservice.net\/code\/cachedump.rb","docstring_summary":"Based on code from http:\/\/lab.mediaservice.net\/code\/cachedump.rb","docstring_tokens":["Based","on","code","from","http",":","\/\/","lab",".","mediaservice",".","net","\/","code","\/","cachedump",".","rb"],"function":"def decrypt_aes(cls, secret, key):\n \"\"\"\n Based on code from http:\/\/lab.mediaservice.net\/code\/cachedump.rb\n \"\"\"\n sha = SHA256.new()\n sha.update(key)\n for _i in range(1, 1000 + 1):\n sha.update(secret[28:60])\n aeskey = sha.digest()\n\n data = b\"\"\n for i in range(60, len(secret), 16):\n aes = AES.new(aeskey, AES.MODE_CBC, b'\\x00' * 16)\n buf = secret[i:i + 16]\n if len(buf) < 16:\n buf += (16 - len(buf)) * \"\\00\"\n data += aes.decrypt(buf)\n\n return data","function_tokens":["def","decrypt_aes","(","cls",",","secret",",","key",")",":","sha","=","SHA256",".","new","(",")","sha",".","update","(","key",")","for","_i","in","range","(","1",",","1000","+","1",")",":","sha",".","update","(","secret","[","28",":","60","]",")","aeskey","=","sha",".","digest","(",")","data","=","b\"\"","for","i","in","range","(","60",",","len","(","secret",")",",","16",")",":","aes","=","AES",".","new","(","aeskey",",","AES",".","MODE_CBC",",","b'\\x00'","*","16",")","buf","=","secret","[","i",":","i","+","16","]","if","len","(","buf",")","<","16",":","buf","+=","(","16","-","len","(","buf",")",")","*","\"\\00\"","data","+=","aes",".","decrypt","(","buf",")","return","data"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/lsadump.py#L36-L54"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/lsadump.py","language":"python","identifier":"Lsadump.decrypt_secret","parameters":"(cls, secret, key)","argument_list":"","return_statement":"return decrypted_data[8:8 + dec_data_len]","docstring":"Python implementation of SystemFunction005.\n\n Decrypts a block of data with DES using given key.\n Note that key can be longer than 7 bytes.","docstring_summary":"Python implementation of SystemFunction005.","docstring_tokens":["Python","implementation","of","SystemFunction005","."],"function":"def decrypt_secret(cls, secret, key):\n \"\"\"Python implementation of SystemFunction005.\n\n Decrypts a block of data with DES using given key.\n Note that key can be longer than 7 bytes.\"\"\"\n decrypted_data = b''\n j = 0 # key index\n\n for i in range(0, len(secret), 8):\n enc_block = secret[i:i + 8]\n block_key = key[j:j + 7]\n des_key = hashdump.Hashdump.sidbytes_to_key(block_key)\n des = DES.new(des_key, DES.MODE_ECB)\n enc_block = enc_block + b\"\\x00\" * int(abs(8 - len(enc_block)) % 8)\n decrypted_data += des.decrypt(enc_block)\n j += 7\n if len(key[j:j + 7]) < 7:\n j = len(key[j:j + 7])\n\n (dec_data_len, ) = unpack(\" interfaces.plugins.FileHandlerInterface:\n \"\"\"Extracts the complete data for a process as a FileHandlerInterface\n\n Args:\n context: the context to operate upon\n kernel_table_name: the name for the symbol table containing the kernel's symbols\n pe_table_name: the name for the symbol table containing the PE format symbols\n proc: the process object whose memory should be output\n open_method: class to provide context manager for opening the file\n\n Returns:\n An open FileHandlerInterface object containing the complete data for the process or None in the case of failure\n \"\"\"\n\n file_handle = None\n try:\n proc_layer_name = proc.add_process_layer()\n peb = context.object(kernel_table_name + constants.BANG + \"_PEB\",\n layer_name = proc_layer_name,\n offset = proc.Peb)\n\n dos_header = context.object(pe_table_name + constants.BANG + \"_IMAGE_DOS_HEADER\",\n offset = peb.ImageBaseAddress,\n layer_name = proc_layer_name)\n file_handle = open_method(\"pid.{0}.{1:#x}.dmp\".format(proc.UniqueProcessId, peb.ImageBaseAddress))\n for offset, data in dos_header.reconstruct():\n file_handle.seek(offset)\n file_handle.write(data)\n except Exception as excp:\n vollog.debug(\"Unable to dump PE with pid {}: {}\".format(proc.UniqueProcessId, excp))\n\n return file_handle","function_tokens":["def","process_dump","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","kernel_table_name",":","str",",","pe_table_name",":","str",",","proc",":","interfaces",".","objects",".","ObjectInterface",",","open_method",":","Type","[","interfaces",".","plugins",".","FileHandlerInterface","]",")","->","interfaces",".","plugins",".","FileHandlerInterface",":","file_handle","=","None","try",":","proc_layer_name","=","proc",".","add_process_layer","(",")","peb","=","context",".","object","(","kernel_table_name","+","constants",".","BANG","+","\"_PEB\"",",","layer_name","=","proc_layer_name",",","offset","=","proc",".","Peb",")","dos_header","=","context",".","object","(","pe_table_name","+","constants",".","BANG","+","\"_IMAGE_DOS_HEADER\"",",","offset","=","peb",".","ImageBaseAddress",",","layer_name","=","proc_layer_name",")","file_handle","=","open_method","(","\"pid.{0}.{1:#x}.dmp\"",".","format","(","proc",".","UniqueProcessId",",","peb",".","ImageBaseAddress",")",")","for","offset",",","data","in","dos_header",".","reconstruct","(",")",":","file_handle",".","seek","(","offset",")","file_handle",".","write","(","data",")","except","Exception","as","excp",":","vollog",".","debug","(","\"Unable to dump PE with pid {}: {}\"",".","format","(","proc",".","UniqueProcessId",",","excp",")",")","return","file_handle"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/pslist.py#L49-L83"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/pslist.py","language":"python","identifier":"PsList.create_pid_filter","parameters":"(cls, pid_list: List[int] = None)","argument_list":"","return_statement":"return filter_func","docstring":"A factory for producing filter functions that filter based on a list\n of process IDs.\n\n Args:\n pid_list: A list of process IDs that are acceptable, all other processes will be filtered out\n\n Returns:\n Filter function for passing to the `list_processes` method","docstring_summary":"A factory for producing filter functions that filter based on a list\n of process IDs.","docstring_tokens":["A","factory","for","producing","filter","functions","that","filter","based","on","a","list","of","process","IDs","."],"function":"def create_pid_filter(cls, pid_list: List[int] = None) -> Callable[[interfaces.objects.ObjectInterface], bool]:\n \"\"\"A factory for producing filter functions that filter based on a list\n of process IDs.\n\n Args:\n pid_list: A list of process IDs that are acceptable, all other processes will be filtered out\n\n Returns:\n Filter function for passing to the `list_processes` method\n \"\"\"\n filter_func = lambda _: False\n # FIXME: mypy #4973 or #2608\n pid_list = pid_list or []\n filter_list = [x for x in pid_list if x is not None]\n if filter_list:\n filter_func = lambda x: x.UniqueProcessId not in filter_list\n return filter_func","function_tokens":["def","create_pid_filter","(","cls",",","pid_list",":","List","[","int","]","=","None",")","->","Callable","[","[","interfaces",".","objects",".","ObjectInterface","]",",","bool","]",":","filter_func","=","lambda","_",":","False","# FIXME: mypy #4973 or #2608","pid_list","=","pid_list","or","[","]","filter_list","=","[","x","for","x","in","pid_list","if","x","is","not","None","]","if","filter_list",":","filter_func","=","lambda","x",":","x",".","UniqueProcessId","not","in","filter_list","return","filter_func"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/pslist.py#L86-L102"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/pslist.py","language":"python","identifier":"PsList.create_name_filter","parameters":"(cls, name_list: List[str] = None)","argument_list":"","return_statement":"return filter_func","docstring":"A factory for producing filter functions that filter based on a list\n of process names.\n\n Args:\n name_list: A list of process names that are acceptable, all other processes will be filtered out\n\n Returns:\n Filter function for passing to the `list_processes` method","docstring_summary":"A factory for producing filter functions that filter based on a list\n of process names.","docstring_tokens":["A","factory","for","producing","filter","functions","that","filter","based","on","a","list","of","process","names","."],"function":"def create_name_filter(cls, name_list: List[str] = None) -> Callable[[interfaces.objects.ObjectInterface], bool]:\n \"\"\"A factory for producing filter functions that filter based on a list\n of process names.\n\n Args:\n name_list: A list of process names that are acceptable, all other processes will be filtered out\n\n Returns:\n Filter function for passing to the `list_processes` method\n \"\"\"\n filter_func = lambda _: False\n # FIXME: mypy #4973 or #2608\n name_list = name_list or []\n filter_list = [x for x in name_list if x is not None]\n if filter_list:\n filter_func = lambda x: utility.array_to_string(x.ImageFileName) not in filter_list\n return filter_func","function_tokens":["def","create_name_filter","(","cls",",","name_list",":","List","[","str","]","=","None",")","->","Callable","[","[","interfaces",".","objects",".","ObjectInterface","]",",","bool","]",":","filter_func","=","lambda","_",":","False","# FIXME: mypy #4973 or #2608","name_list","=","name_list","or","[","]","filter_list","=","[","x","for","x","in","name_list","if","x","is","not","None","]","if","filter_list",":","filter_func","=","lambda","x",":","utility",".","array_to_string","(","x",".","ImageFileName",")","not","in","filter_list","return","filter_func"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/pslist.py#L105-L121"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/pslist.py","language":"python","identifier":"PsList.list_processes","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n filter_func: Callable[[interfaces.objects.ObjectInterface], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Lists all the processes in the primary layer that are in the pid\n config option.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n filter_func: A function which takes an EPROCESS object and returns True if the process should be ignored\/filtered\n\n Returns:\n The list of EPROCESS objects from the `layer_name` layer's PsActiveProcessHead list after filtering","docstring_summary":"Lists all the processes in the primary layer that are in the pid\n config option.","docstring_tokens":["Lists","all","the","processes","in","the","primary","layer","that","are","in","the","pid","config","option","."],"function":"def list_processes(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n filter_func: Callable[[interfaces.objects.ObjectInterface], bool] = lambda _: False) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Lists all the processes in the primary layer that are in the pid\n config option.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n filter_func: A function which takes an EPROCESS object and returns True if the process should be ignored\/filtered\n\n Returns:\n The list of EPROCESS objects from the `layer_name` layer's PsActiveProcessHead list after filtering\n \"\"\"\n\n # We only use the object factory to demonstrate how to use one\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n\n ps_aph_offset = ntkrnlmp.get_symbol(\"PsActiveProcessHead\").address\n list_entry = ntkrnlmp.object(object_type = \"_LIST_ENTRY\", offset = ps_aph_offset)\n\n # This is example code to demonstrate how to use symbol_space directly, rather than through a module:\n #\n # ```\n # reloff = self.context.symbol_space.get_type(\n # self.config['nt_symbols'] + constants.BANG + \"_EPROCESS\").relative_child_offset(\n # \"ActiveProcessLinks\")\n # ```\n #\n # Note: \"nt_symbols!_EPROCESS\" could have been used, but would rely on the \"nt_symbols\" symbol table not already\n # having been present. Strictly, the value of the requirement should be joined with the BANG character\n # defined in the constants file\n reloff = ntkrnlmp.get_type(\"_EPROCESS\").relative_child_offset(\"ActiveProcessLinks\")\n eproc = ntkrnlmp.object(object_type = \"_EPROCESS\", offset = list_entry.vol.offset - reloff, absolute = True)\n\n for proc in eproc.ActiveProcessLinks:\n if not filter_func(proc):\n yield proc","function_tokens":["def","list_processes","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","filter_func",":","Callable","[","[","interfaces",".","objects",".","ObjectInterface","]",",","bool","]","=","lambda","_",":","False",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","# We only use the object factory to demonstrate how to use one","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","ps_aph_offset","=","ntkrnlmp",".","get_symbol","(","\"PsActiveProcessHead\"",")",".","address","list_entry","=","ntkrnlmp",".","object","(","object_type","=","\"_LIST_ENTRY\"",",","offset","=","ps_aph_offset",")","# This is example code to demonstrate how to use symbol_space directly, rather than through a module:","#","# ```","# reloff = self.context.symbol_space.get_type(","# self.config['nt_symbols'] + constants.BANG + \"_EPROCESS\").relative_child_offset(","# \"ActiveProcessLinks\")","# ```","#","# Note: \"nt_symbols!_EPROCESS\" could have been used, but would rely on the \"nt_symbols\" symbol table not already","# having been present. Strictly, the value of the requirement should be joined with the BANG character","# defined in the constants file","reloff","=","ntkrnlmp",".","get_type","(","\"_EPROCESS\"",")",".","relative_child_offset","(","\"ActiveProcessLinks\"",")","eproc","=","ntkrnlmp",".","object","(","object_type","=","\"_EPROCESS\"",",","offset","=","list_entry",".","vol",".","offset","-","reloff",",","absolute","=","True",")","for","proc","in","eproc",".","ActiveProcessLinks",":","if","not","filter_func","(","proc",")",":","yield","proc"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/pslist.py#L124-L166"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/bigpools.py","language":"python","identifier":"BigPools.list_big_pools","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n tags: Optional[list] = None)","argument_list":"","return_statement":"","docstring":"Returns the big page pool objects from the kernel PoolBigPageTable array.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n tags: An optional list of pool tags to filter big page pool tags by\n\n Yields:\n A big page pool object","docstring_summary":"Returns the big page pool objects from the kernel PoolBigPageTable array.","docstring_tokens":["Returns","the","big","page","pool","objects","from","the","kernel","PoolBigPageTable","array","."],"function":"def list_big_pools(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n tags: Optional[list] = None):\n \"\"\"Returns the big page pool objects from the kernel PoolBigPageTable array.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n tags: An optional list of pool tags to filter big page pool tags by\n\n Yields:\n A big page pool object\n \"\"\"\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n\n big_page_table_offset = ntkrnlmp.get_symbol(\"PoolBigPageTable\").address\n big_page_table = ntkrnlmp.object(object_type = \"unsigned long long\", offset = big_page_table_offset)\n\n big_page_table_size_offset = ntkrnlmp.get_symbol(\"PoolBigPageTableSize\").address\n big_page_table_size = ntkrnlmp.object(object_type = \"unsigned long\", offset = big_page_table_size_offset)\n\n try:\n big_page_table_type = ntkrnlmp.get_type(\"_POOL_TRACKER_BIG_PAGES\")\n except exceptions.SymbolError:\n # We have to manually load a symbol table\n is_vista_or_later = versions.is_vista_or_later(context, symbol_table)\n is_win10 = versions.is_win10(context, symbol_table)\n if is_win10:\n big_pools_json_filename = \"bigpools-win10\"\n elif is_vista_or_later:\n big_pools_json_filename = \"bigpools-vista\"\n else:\n big_pools_json_filename = \"bigpools\"\n\n if symbols.symbol_table_is_64bit(context, symbol_table):\n big_pools_json_filename += \"-x64\"\n else:\n big_pools_json_filename += \"-x86\"\n\n new_table_name = intermed.IntermediateSymbolTable.create(\n context = context,\n config_path = configuration.path_join(context.symbol_space[symbol_table].config_path, \"bigpools\"),\n sub_path = \"windows\",\n filename = big_pools_json_filename,\n table_mapping = {'nt_symbols': symbol_table},\n class_types = {'_POOL_TRACKER_BIG_PAGES': extensions.pool.POOL_TRACKER_BIG_PAGES})\n module = context.module(new_table_name, layer_name, offset = 0)\n big_page_table_type = module.get_type(\"_POOL_TRACKER_BIG_PAGES\")\n\n big_pools = ntkrnlmp.object(object_type = \"array\",\n offset = big_page_table,\n subtype = big_page_table_type,\n count = big_page_table_size,\n absolute = True)\n\n for big_pool in big_pools:\n if big_pool.is_valid():\n if tags is None or big_pool.get_key() in tags:\n yield big_pool","function_tokens":["def","list_big_pools","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","tags",":","Optional","[","list","]","=","None",")",":","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","big_page_table_offset","=","ntkrnlmp",".","get_symbol","(","\"PoolBigPageTable\"",")",".","address","big_page_table","=","ntkrnlmp",".","object","(","object_type","=","\"unsigned long long\"",",","offset","=","big_page_table_offset",")","big_page_table_size_offset","=","ntkrnlmp",".","get_symbol","(","\"PoolBigPageTableSize\"",")",".","address","big_page_table_size","=","ntkrnlmp",".","object","(","object_type","=","\"unsigned long\"",",","offset","=","big_page_table_size_offset",")","try",":","big_page_table_type","=","ntkrnlmp",".","get_type","(","\"_POOL_TRACKER_BIG_PAGES\"",")","except","exceptions",".","SymbolError",":","# We have to manually load a symbol table","is_vista_or_later","=","versions",".","is_vista_or_later","(","context",",","symbol_table",")","is_win10","=","versions",".","is_win10","(","context",",","symbol_table",")","if","is_win10",":","big_pools_json_filename","=","\"bigpools-win10\"","elif","is_vista_or_later",":","big_pools_json_filename","=","\"bigpools-vista\"","else",":","big_pools_json_filename","=","\"bigpools\"","if","symbols",".","symbol_table_is_64bit","(","context",",","symbol_table",")",":","big_pools_json_filename","+=","\"-x64\"","else",":","big_pools_json_filename","+=","\"-x86\"","new_table_name","=","intermed",".","IntermediateSymbolTable",".","create","(","context","=","context",",","config_path","=","configuration",".","path_join","(","context",".","symbol_space","[","symbol_table","]",".","config_path",",","\"bigpools\"",")",",","sub_path","=","\"windows\"",",","filename","=","big_pools_json_filename",",","table_mapping","=","{","'nt_symbols'",":","symbol_table","}",",","class_types","=","{","'_POOL_TRACKER_BIG_PAGES'",":","extensions",".","pool",".","POOL_TRACKER_BIG_PAGES","}",")","module","=","context",".","module","(","new_table_name",",","layer_name",",","offset","=","0",")","big_page_table_type","=","module",".","get_type","(","\"_POOL_TRACKER_BIG_PAGES\"",")","big_pools","=","ntkrnlmp",".","object","(","object_type","=","\"array\"",",","offset","=","big_page_table",",","subtype","=","big_page_table_type",",","count","=","big_page_table_size",",","absolute","=","True",")","for","big_pool","in","big_pools",":","if","big_pool",".","is_valid","(",")",":","if","tags","is","None","or","big_pool",".","get_key","(",")","in","tags",":","yield","big_pool"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/bigpools.py#L40-L102"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/verinfo.py","language":"python","identifier":"VerInfo.get_version_information","parameters":"(cls, context: interfaces.context.ContextInterface, pe_table_name: str, layer_name: str,\n base_address: int)","argument_list":"","return_statement":"return major, minor, product, build","docstring":"Get File and Product version information from PE files.\n\n Args:\n context: volatility context on which to operate\n pe_table_name: name of the PE table\n layer_name: name of the layer containing the PE file\n base_address: base address of the PE (where MZ is found)","docstring_summary":"Get File and Product version information from PE files.","docstring_tokens":["Get","File","and","Product","version","information","from","PE","files","."],"function":"def get_version_information(cls, context: interfaces.context.ContextInterface, pe_table_name: str, layer_name: str,\n base_address: int) -> Tuple[int, int, int, int]:\n \"\"\"Get File and Product version information from PE files.\n\n Args:\n context: volatility context on which to operate\n pe_table_name: name of the PE table\n layer_name: name of the layer containing the PE file\n base_address: base address of the PE (where MZ is found)\n \"\"\"\n\n if layer_name is None:\n raise TypeError(\"Layer must be a string not None\")\n\n pe_data = io.BytesIO()\n\n dos_header = context.object(pe_table_name + constants.BANG + \"_IMAGE_DOS_HEADER\",\n offset = base_address,\n layer_name = layer_name)\n\n for offset, data in dos_header.reconstruct():\n pe_data.seek(offset)\n pe_data.write(data)\n\n pe = pefile.PE(data = pe_data.getvalue(), fast_load = True)\n pe.parse_data_directories([pefile.DIRECTORY_ENTRY[\"IMAGE_DIRECTORY_ENTRY_RESOURCE\"]])\n\n if isinstance(pe.VS_FIXEDFILEINFO, list):\n # pefile >= 2018.8.8 (estimated)\n version_struct = pe.VS_FIXEDFILEINFO[0]\n else:\n # pefile <= 2017.11.5 (estimated)\n version_struct = pe.VS_FIXEDFILEINFO\n\n major = version_struct.ProductVersionMS >> 16\n minor = version_struct.ProductVersionMS & 0xFFFF\n product = version_struct.ProductVersionLS >> 16\n build = version_struct.ProductVersionLS & 0xFFFF\n\n pe_data.close()\n\n return major, minor, product, build","function_tokens":["def","get_version_information","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","pe_table_name",":","str",",","layer_name",":","str",",","base_address",":","int",")","->","Tuple","[","int",",","int",",","int",",","int","]",":","if","layer_name","is","None",":","raise","TypeError","(","\"Layer must be a string not None\"",")","pe_data","=","io",".","BytesIO","(",")","dos_header","=","context",".","object","(","pe_table_name","+","constants",".","BANG","+","\"_IMAGE_DOS_HEADER\"",",","offset","=","base_address",",","layer_name","=","layer_name",")","for","offset",",","data","in","dos_header",".","reconstruct","(",")",":","pe_data",".","seek","(","offset",")","pe_data",".","write","(","data",")","pe","=","pefile",".","PE","(","data","=","pe_data",".","getvalue","(",")",",","fast_load","=","True",")","pe",".","parse_data_directories","(","[","pefile",".","DIRECTORY_ENTRY","[","\"IMAGE_DIRECTORY_ENTRY_RESOURCE\"","]","]",")","if","isinstance","(","pe",".","VS_FIXEDFILEINFO",",","list",")",":","# pefile >= 2018.8.8 (estimated)","version_struct","=","pe",".","VS_FIXEDFILEINFO","[","0","]","else",":","# pefile <= 2017.11.5 (estimated)","version_struct","=","pe",".","VS_FIXEDFILEINFO","major","=","version_struct",".","ProductVersionMS",">>","16","minor","=","version_struct",".","ProductVersionMS","&","0xFFFF","product","=","version_struct",".","ProductVersionLS",">>","16","build","=","version_struct",".","ProductVersionLS","&","0xFFFF","pe_data",".","close","(",")","return","major",",","minor",",","product",",","build"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/verinfo.py#L45-L86"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/verinfo.py","language":"python","identifier":"VerInfo._generator","parameters":"(self, procs: Generator[interfaces.objects.ObjectInterface, None, None],\n mods: Generator[interfaces.objects.ObjectInterface, None, None], session_layers: Generator[str, None,\n None])","argument_list":"","return_statement":"","docstring":"Generates a list of PE file version info for processes, dlls, and\n modules.\n\n Args:\n procs: of processes\n mods: of modules\n session_layers: of layers in the session to be checked","docstring_summary":"Generates a list of PE file version info for processes, dlls, and\n modules.","docstring_tokens":["Generates","a","list","of","PE","file","version","info","for","processes","dlls","and","modules","."],"function":"def _generator(self, procs: Generator[interfaces.objects.ObjectInterface, None, None],\n mods: Generator[interfaces.objects.ObjectInterface, None, None], session_layers: Generator[str, None,\n None]):\n \"\"\"Generates a list of PE file version info for processes, dlls, and\n modules.\n\n Args:\n procs: of processes\n mods: of modules\n session_layers: of layers in the session to be checked\n \"\"\"\n\n pe_table_name = intermed.IntermediateSymbolTable.create(self.context,\n self.config_path,\n \"windows\",\n \"pe\",\n class_types = pe.class_types)\n\n for mod in mods:\n try:\n BaseDllName = mod.BaseDllName.get_string()\n except exceptions.InvalidAddressException:\n BaseDllName = renderers.UnreadableValue()\n\n session_layer_name = modules.Modules.find_session_layer(self.context, session_layers, mod.DllBase)\n try:\n (major, minor, product, build) = self.get_version_information(self._context, pe_table_name,\n session_layer_name, mod.DllBase)\n except (exceptions.InvalidAddressException, TypeError, AttributeError):\n (major, minor, product, build) = [renderers.UnreadableValue()] * 4\n\n # the pid and process are not applicable for kernel modules\n yield (0, (renderers.NotApplicableValue(), renderers.NotApplicableValue(), format_hints.Hex(mod.DllBase),\n BaseDllName, major, minor, product, build))\n\n # now go through the process and dll lists\n for proc in procs:\n proc_id = \"Unknown\"\n try:\n proc_id = proc.UniqueProcessId\n proc_layer_name = proc.add_process_layer()\n except exceptions.InvalidAddressException as excp:\n vollog.debug(\"Process {}: invalid address {} in layer {}\".format(proc_id, excp.invalid_address,\n excp.layer_name))\n continue\n\n for entry in proc.load_order_modules():\n\n try:\n BaseDllName = entry.BaseDllName.get_string()\n except exceptions.InvalidAddressException:\n BaseDllName = renderers.UnreadableValue()\n\n try:\n DllBase = format_hints.Hex(entry.DllBase)\n except exceptions.InvalidAddressException:\n DllBase = renderers.UnreadableValue()\n\n try:\n (major, minor, product, build) = self.get_version_information(self._context, pe_table_name,\n proc_layer_name, entry.DllBase)\n except (exceptions.InvalidAddressException, ValueError, AttributeError):\n (major, minor, product, build) = [renderers.UnreadableValue()] * 4\n\n yield (0, (proc.UniqueProcessId,\n proc.ImageFileName.cast(\"string\",\n max_length = proc.ImageFileName.vol.count,\n errors = \"replace\"), DllBase, BaseDllName, major, minor, product,\n build))","function_tokens":["def","_generator","(","self",",","procs",":","Generator","[","interfaces",".","objects",".","ObjectInterface",",","None",",","None","]",",","mods",":","Generator","[","interfaces",".","objects",".","ObjectInterface",",","None",",","None","]",",","session_layers",":","Generator","[","str",",","None",",","None","]",")",":","pe_table_name","=","intermed",".","IntermediateSymbolTable",".","create","(","self",".","context",",","self",".","config_path",",","\"windows\"",",","\"pe\"",",","class_types","=","pe",".","class_types",")","for","mod","in","mods",":","try",":","BaseDllName","=","mod",".","BaseDllName",".","get_string","(",")","except","exceptions",".","InvalidAddressException",":","BaseDllName","=","renderers",".","UnreadableValue","(",")","session_layer_name","=","modules",".","Modules",".","find_session_layer","(","self",".","context",",","session_layers",",","mod",".","DllBase",")","try",":","(","major",",","minor",",","product",",","build",")","=","self",".","get_version_information","(","self",".","_context",",","pe_table_name",",","session_layer_name",",","mod",".","DllBase",")","except","(","exceptions",".","InvalidAddressException",",","TypeError",",","AttributeError",")",":","(","major",",","minor",",","product",",","build",")","=","[","renderers",".","UnreadableValue","(",")","]","*","4","# the pid and process are not applicable for kernel modules","yield","(","0",",","(","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",",","format_hints",".","Hex","(","mod",".","DllBase",")",",","BaseDllName",",","major",",","minor",",","product",",","build",")",")","# now go through the process and dll lists","for","proc","in","procs",":","proc_id","=","\"Unknown\"","try",":","proc_id","=","proc",".","UniqueProcessId","proc_layer_name","=","proc",".","add_process_layer","(",")","except","exceptions",".","InvalidAddressException","as","excp",":","vollog",".","debug","(","\"Process {}: invalid address {} in layer {}\"",".","format","(","proc_id",",","excp",".","invalid_address",",","excp",".","layer_name",")",")","continue","for","entry","in","proc",".","load_order_modules","(",")",":","try",":","BaseDllName","=","entry",".","BaseDllName",".","get_string","(",")","except","exceptions",".","InvalidAddressException",":","BaseDllName","=","renderers",".","UnreadableValue","(",")","try",":","DllBase","=","format_hints",".","Hex","(","entry",".","DllBase",")","except","exceptions",".","InvalidAddressException",":","DllBase","=","renderers",".","UnreadableValue","(",")","try",":","(","major",",","minor",",","product",",","build",")","=","self",".","get_version_information","(","self",".","_context",",","pe_table_name",",","proc_layer_name",",","entry",".","DllBase",")","except","(","exceptions",".","InvalidAddressException",",","ValueError",",","AttributeError",")",":","(","major",",","minor",",","product",",","build",")","=","[","renderers",".","UnreadableValue","(",")","]","*","4","yield","(","0",",","(","proc",".","UniqueProcessId",",","proc",".","ImageFileName",".","cast","(","\"string\"",",","max_length","=","proc",".","ImageFileName",".","vol",".","count",",","errors","=","\"replace\"",")",",","DllBase",",","BaseDllName",",","major",",","minor",",","product",",","build",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/verinfo.py#L88-L156"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/callbacks.py","language":"python","identifier":"Callbacks.create_callback_table","parameters":"(context: interfaces.context.ContextInterface, symbol_table: str, config_path: str)","argument_list":"","return_statement":"return intermed.IntermediateSymbolTable.create(context,\n config_path,\n \"windows\",\n symbol_filename,\n native_types = native_types,\n table_mapping = table_mapping)","docstring":"Creates a symbol table for a set of callbacks.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n symbol_table: The name of an existing symbol table containing the kernel symbols\n config_path: The configuration path within the context of the symbol table to create\n\n Returns:\n The name of the constructed callback table","docstring_summary":"Creates a symbol table for a set of callbacks.","docstring_tokens":["Creates","a","symbol","table","for","a","set","of","callbacks","."],"function":"def create_callback_table(context: interfaces.context.ContextInterface, symbol_table: str, config_path: str) -> str:\n \"\"\"Creates a symbol table for a set of callbacks.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n symbol_table: The name of an existing symbol table containing the kernel symbols\n config_path: The configuration path within the context of the symbol table to create\n\n Returns:\n The name of the constructed callback table\n \"\"\"\n native_types = context.symbol_space[symbol_table].natives\n is_64bit = symbols.symbol_table_is_64bit(context, symbol_table)\n table_mapping = {\"nt_symbols\": symbol_table}\n\n if is_64bit:\n symbol_filename = \"callbacks-x64\"\n else:\n symbol_filename = \"callbacks-x86\"\n\n return intermed.IntermediateSymbolTable.create(context,\n config_path,\n \"windows\",\n symbol_filename,\n native_types = native_types,\n table_mapping = table_mapping)","function_tokens":["def","create_callback_table","(","context",":","interfaces",".","context",".","ContextInterface",",","symbol_table",":","str",",","config_path",":","str",")","->","str",":","native_types","=","context",".","symbol_space","[","symbol_table","]",".","natives","is_64bit","=","symbols",".","symbol_table_is_64bit","(","context",",","symbol_table",")","table_mapping","=","{","\"nt_symbols\"",":","symbol_table","}","if","is_64bit",":","symbol_filename","=","\"callbacks-x64\"","else",":","symbol_filename","=","\"callbacks-x86\"","return","intermed",".","IntermediateSymbolTable",".","create","(","context",",","config_path",",","\"windows\"",",","symbol_filename",",","native_types","=","native_types",",","table_mapping","=","table_mapping",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/callbacks.py#L37-L62"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/callbacks.py","language":"python","identifier":"Callbacks.list_notify_routines","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str, symbol_table: str,\n callback_table_name: str)","argument_list":"","return_statement":"","docstring":"Lists all kernel notification routines.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n callback_table_name: The nae of the table containing the callback symbols\n\n Yields:\n A name, location and optional detail string","docstring_summary":"Lists all kernel notification routines.","docstring_tokens":["Lists","all","kernel","notification","routines","."],"function":"def list_notify_routines(cls, context: interfaces.context.ContextInterface, layer_name: str, symbol_table: str,\n callback_table_name: str) -> Iterable[Tuple[str, int, Optional[str]]]:\n \"\"\"Lists all kernel notification routines.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n callback_table_name: The nae of the table containing the callback symbols\n\n Yields:\n A name, location and optional detail string\n \"\"\"\n\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n\n is_vista_or_later = versions.is_vista_or_later(context = context, symbol_table = symbol_table)\n full_type_name = callback_table_name + constants.BANG + \"_GENERIC_CALLBACK\"\n\n symbol_names = [(\"PspLoadImageNotifyRoutine\", False), (\"PspCreateThreadNotifyRoutine\", True),\n (\"PspCreateProcessNotifyRoutine\", True)]\n\n for symbol_name, extended_list in symbol_names:\n\n try:\n symbol_offset = ntkrnlmp.get_symbol(symbol_name).address\n except exceptions.SymbolError:\n vollog.debug(\"Cannot find {}\".format(symbol_name))\n continue\n\n if is_vista_or_later and extended_list:\n count = 64\n else:\n count = 8\n\n fast_refs = ntkrnlmp.object(object_type = \"array\",\n offset = symbol_offset,\n subtype = ntkrnlmp.get_type(\"_EX_FAST_REF\"),\n count = count)\n\n for fast_ref in fast_refs:\n try:\n callback = fast_ref.dereference().cast(full_type_name)\n except exceptions.InvalidAddressException:\n continue\n\n if callback.Callback != 0:\n yield symbol_name, callback.Callback, None","function_tokens":["def","list_notify_routines","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","callback_table_name",":","str",")","->","Iterable","[","Tuple","[","str",",","int",",","Optional","[","str","]","]","]",":","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","is_vista_or_later","=","versions",".","is_vista_or_later","(","context","=","context",",","symbol_table","=","symbol_table",")","full_type_name","=","callback_table_name","+","constants",".","BANG","+","\"_GENERIC_CALLBACK\"","symbol_names","=","[","(","\"PspLoadImageNotifyRoutine\"",",","False",")",",","(","\"PspCreateThreadNotifyRoutine\"",",","True",")",",","(","\"PspCreateProcessNotifyRoutine\"",",","True",")","]","for","symbol_name",",","extended_list","in","symbol_names",":","try",":","symbol_offset","=","ntkrnlmp",".","get_symbol","(","symbol_name",")",".","address","except","exceptions",".","SymbolError",":","vollog",".","debug","(","\"Cannot find {}\"",".","format","(","symbol_name",")",")","continue","if","is_vista_or_later","and","extended_list",":","count","=","64","else",":","count","=","8","fast_refs","=","ntkrnlmp",".","object","(","object_type","=","\"array\"",",","offset","=","symbol_offset",",","subtype","=","ntkrnlmp",".","get_type","(","\"_EX_FAST_REF\"",")",",","count","=","count",")","for","fast_ref","in","fast_refs",":","try",":","callback","=","fast_ref",".","dereference","(",")",".","cast","(","full_type_name",")","except","exceptions",".","InvalidAddressException",":","continue","if","callback",".","Callback","!=","0",":","yield","symbol_name",",","callback",".","Callback",",","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/callbacks.py#L65-L113"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/callbacks.py","language":"python","identifier":"Callbacks.list_registry_callbacks","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str, symbol_table: str,\n callback_table_name: str)","argument_list":"","return_statement":"","docstring":"Lists all registry callbacks.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n callback_table_name: The nae of the table containing the callback symbols\n\n Yields:\n A name, location and optional detail string","docstring_summary":"Lists all registry callbacks.","docstring_tokens":["Lists","all","registry","callbacks","."],"function":"def list_registry_callbacks(cls, context: interfaces.context.ContextInterface, layer_name: str, symbol_table: str,\n callback_table_name: str) -> Iterable[Tuple[str, int, None]]:\n \"\"\"Lists all registry callbacks.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n callback_table_name: The nae of the table containing the callback symbols\n\n Yields:\n A name, location and optional detail string\n \"\"\"\n\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n full_type_name = callback_table_name + constants.BANG + \"_EX_CALLBACK_ROUTINE_BLOCK\"\n\n try:\n symbol_offset = ntkrnlmp.get_symbol(\"CmpCallBackVector\").address\n symbol_count_offset = ntkrnlmp.get_symbol(\"CmpCallBackCount\").address\n except exceptions.SymbolError:\n vollog.debug(\"Cannot find CmpCallBackVector or CmpCallBackCount\")\n return\n\n callback_count = ntkrnlmp.object(object_type = \"unsigned int\", offset = symbol_count_offset)\n\n if callback_count == 0:\n return\n\n fast_refs = ntkrnlmp.object(object_type = \"array\",\n offset = symbol_offset,\n subtype = ntkrnlmp.get_type(\"_EX_FAST_REF\"),\n count = callback_count)\n\n for fast_ref in fast_refs:\n try:\n callback = fast_ref.dereference().cast(full_type_name)\n except exceptions.InvalidAddressException:\n continue\n\n if callback.Function != 0:\n yield \"CmRegisterCallback\", callback.Function, None","function_tokens":["def","list_registry_callbacks","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","callback_table_name",":","str",")","->","Iterable","[","Tuple","[","str",",","int",",","None","]","]",":","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","full_type_name","=","callback_table_name","+","constants",".","BANG","+","\"_EX_CALLBACK_ROUTINE_BLOCK\"","try",":","symbol_offset","=","ntkrnlmp",".","get_symbol","(","\"CmpCallBackVector\"",")",".","address","symbol_count_offset","=","ntkrnlmp",".","get_symbol","(","\"CmpCallBackCount\"",")",".","address","except","exceptions",".","SymbolError",":","vollog",".","debug","(","\"Cannot find CmpCallBackVector or CmpCallBackCount\"",")","return","callback_count","=","ntkrnlmp",".","object","(","object_type","=","\"unsigned int\"",",","offset","=","symbol_count_offset",")","if","callback_count","==","0",":","return","fast_refs","=","ntkrnlmp",".","object","(","object_type","=","\"array\"",",","offset","=","symbol_offset",",","subtype","=","ntkrnlmp",".","get_type","(","\"_EX_FAST_REF\"",")",",","count","=","callback_count",")","for","fast_ref","in","fast_refs",":","try",":","callback","=","fast_ref",".","dereference","(",")",".","cast","(","full_type_name",")","except","exceptions",".","InvalidAddressException",":","continue","if","callback",".","Function","!=","0",":","yield","\"CmRegisterCallback\"",",","callback",".","Function",",","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/callbacks.py#L116-L158"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/callbacks.py","language":"python","identifier":"Callbacks.list_bugcheck_reason_callbacks","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str, callback_table_name: str)","argument_list":"","return_statement":"","docstring":"Lists all kernel bugcheck reason callbacks.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n callback_table_name: The nae of the table containing the callback symbols\n\n Yields:\n A name, location and optional detail string","docstring_summary":"Lists all kernel bugcheck reason callbacks.","docstring_tokens":["Lists","all","kernel","bugcheck","reason","callbacks","."],"function":"def list_bugcheck_reason_callbacks(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str, callback_table_name: str) -> Iterable[Tuple[str, int, str]]:\n \"\"\"Lists all kernel bugcheck reason callbacks.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n callback_table_name: The nae of the table containing the callback symbols\n\n Yields:\n A name, location and optional detail string\n \"\"\"\n\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n\n try:\n list_offset = ntkrnlmp.get_symbol(\"KeBugCheckReasonCallbackListHead\").address\n except exceptions.SymbolError:\n vollog.debug(\"Cannot find KeBugCheckReasonCallbackListHead\")\n return\n\n full_type_name = callback_table_name + constants.BANG + \"_KBUGCHECK_REASON_CALLBACK_RECORD\"\n callback_record = context.object(object_type = full_type_name,\n offset = kvo + list_offset,\n layer_name = layer_name)\n\n for callback in callback_record.Entry:\n if not context.layers[layer_name].is_valid(callback.CallbackRoutine, 64):\n continue\n\n try:\n component = ntkrnlmp.object(\n \"string\", absolute = True, offset = callback.Component, max_length = 64, errors = \"replace\"\n ) # type: Union[interfaces.renderers.BaseAbsentValue, interfaces.objects.ObjectInterface]\n except exceptions.InvalidAddressException:\n component = renderers.UnreadableValue()\n\n yield \"KeBugCheckReasonCallbackListHead\", callback.CallbackRoutine, component","function_tokens":["def","list_bugcheck_reason_callbacks","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","callback_table_name",":","str",")","->","Iterable","[","Tuple","[","str",",","int",",","str","]","]",":","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","try",":","list_offset","=","ntkrnlmp",".","get_symbol","(","\"KeBugCheckReasonCallbackListHead\"",")",".","address","except","exceptions",".","SymbolError",":","vollog",".","debug","(","\"Cannot find KeBugCheckReasonCallbackListHead\"",")","return","full_type_name","=","callback_table_name","+","constants",".","BANG","+","\"_KBUGCHECK_REASON_CALLBACK_RECORD\"","callback_record","=","context",".","object","(","object_type","=","full_type_name",",","offset","=","kvo","+","list_offset",",","layer_name","=","layer_name",")","for","callback","in","callback_record",".","Entry",":","if","not","context",".","layers","[","layer_name","]",".","is_valid","(","callback",".","CallbackRoutine",",","64",")",":","continue","try",":","component","=","ntkrnlmp",".","object","(","\"string\"",",","absolute","=","True",",","offset","=","callback",".","Component",",","max_length","=","64",",","errors","=","\"replace\"",")","# type: Union[interfaces.renderers.BaseAbsentValue, interfaces.objects.ObjectInterface]","except","exceptions",".","InvalidAddressException",":","component","=","renderers",".","UnreadableValue","(",")","yield","\"KeBugCheckReasonCallbackListHead\"",",","callback",".","CallbackRoutine",",","component"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/callbacks.py#L161-L200"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/callbacks.py","language":"python","identifier":"Callbacks.list_bugcheck_callbacks","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str, symbol_table: str,\n callback_table_name: str)","argument_list":"","return_statement":"","docstring":"Lists all kernel bugcheck callbacks.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n callback_table_name: The nae of the table containing the callback symbols\n\n Yields:\n A name, location and optional detail string","docstring_summary":"Lists all kernel bugcheck callbacks.","docstring_tokens":["Lists","all","kernel","bugcheck","callbacks","."],"function":"def list_bugcheck_callbacks(cls, context: interfaces.context.ContextInterface, layer_name: str, symbol_table: str,\n callback_table_name: str) -> Iterable[Tuple[str, int, str]]:\n \"\"\"Lists all kernel bugcheck callbacks.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n callback_table_name: The nae of the table containing the callback symbols\n\n Yields:\n A name, location and optional detail string\n \"\"\"\n\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n\n try:\n list_offset = ntkrnlmp.get_symbol(\"KeBugCheckCallbackListHead\").address\n except exceptions.SymbolError:\n vollog.debug(\"Cannot find KeBugCheckCallbackListHead\")\n return\n\n full_type_name = callback_table_name + constants.BANG + \"_KBUGCHECK_CALLBACK_RECORD\"\n callback_record = context.object(full_type_name, offset = kvo + list_offset, layer_name = layer_name)\n\n for callback in callback_record.Entry:\n\n if not context.layers[layer_name].is_valid(callback.CallbackRoutine, 64):\n continue\n\n try:\n component = context.object(symbol_table + constants.BANG + \"string\",\n layer_name = layer_name,\n offset = callback.Component,\n max_length = 64,\n errors = \"replace\")\n except exceptions.InvalidAddressException:\n component = renderers.UnreadableValue()\n\n yield \"KeBugCheckCallbackListHead\", callback.CallbackRoutine, component","function_tokens":["def","list_bugcheck_callbacks","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","callback_table_name",":","str",")","->","Iterable","[","Tuple","[","str",",","int",",","str","]","]",":","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","try",":","list_offset","=","ntkrnlmp",".","get_symbol","(","\"KeBugCheckCallbackListHead\"",")",".","address","except","exceptions",".","SymbolError",":","vollog",".","debug","(","\"Cannot find KeBugCheckCallbackListHead\"",")","return","full_type_name","=","callback_table_name","+","constants",".","BANG","+","\"_KBUGCHECK_CALLBACK_RECORD\"","callback_record","=","context",".","object","(","full_type_name",",","offset","=","kvo","+","list_offset",",","layer_name","=","layer_name",")","for","callback","in","callback_record",".","Entry",":","if","not","context",".","layers","[","layer_name","]",".","is_valid","(","callback",".","CallbackRoutine",",","64",")",":","continue","try",":","component","=","context",".","object","(","symbol_table","+","constants",".","BANG","+","\"string\"",",","layer_name","=","layer_name",",","offset","=","callback",".","Component",",","max_length","=","64",",","errors","=","\"replace\"",")","except","exceptions",".","InvalidAddressException",":","component","=","renderers",".","UnreadableValue","(",")","yield","\"KeBugCheckCallbackListHead\"",",","callback",".","CallbackRoutine",",","component"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/callbacks.py#L203-L243"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py","language":"python","identifier":"Info.get_depends","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n index: int = 0)","argument_list":"","return_statement":"","docstring":"List the dependencies of a given layer.\n\n Args:\n context: The context to retrieve required layers from\n layer_name: the name of the starting layer\n index: the index\/order of the layer\n\n Returns:\n An iterable containing the levels and layer objects for all dependent layers","docstring_summary":"List the dependencies of a given layer.","docstring_tokens":["List","the","dependencies","of","a","given","layer","."],"function":"def get_depends(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n index: int = 0) -> Iterable[Tuple[int, interfaces.layers.DataLayerInterface]]:\n \"\"\"List the dependencies of a given layer.\n\n Args:\n context: The context to retrieve required layers from\n layer_name: the name of the starting layer\n index: the index\/order of the layer\n\n Returns:\n An iterable containing the levels and layer objects for all dependent layers\n \"\"\"\n layer = context.layers[layer_name]\n yield index, layer\n try:\n for depends in layer.dependencies:\n for j, dep in cls.get_depends(context, depends, index + 1):\n yield j, context.layers[dep.name]\n except AttributeError:\n # FileLayer won't have dependencies\n pass","function_tokens":["def","get_depends","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","index",":","int","=","0",")","->","Iterable","[","Tuple","[","int",",","interfaces",".","layers",".","DataLayerInterface","]","]",":","layer","=","context",".","layers","[","layer_name","]","yield","index",",","layer","try",":","for","depends","in","layer",".","dependencies",":","for","j",",","dep","in","cls",".","get_depends","(","context",",","depends",",","index","+","1",")",":","yield","j",",","context",".","layers","[","dep",".","name","]","except","AttributeError",":","# FileLayer won't have dependencies","pass"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py#L32-L54"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py","language":"python","identifier":"Info.get_kernel_module","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str, symbol_table: str)","argument_list":"","return_statement":"return ntkrnlmp","docstring":"Returns the kernel module based on the layer and symbol_table","docstring_summary":"Returns the kernel module based on the layer and symbol_table","docstring_tokens":["Returns","the","kernel","module","based","on","the","layer","and","symbol_table"],"function":"def get_kernel_module(cls, context: interfaces.context.ContextInterface, layer_name: str, symbol_table: str):\n \"\"\"Returns the kernel module based on the layer and symbol_table\"\"\"\n virtual_layer = context.layers[layer_name]\n if not isinstance(virtual_layer, layers.intel.Intel):\n raise TypeError(\"Virtual Layer is not an intel layer\")\n\n kvo = virtual_layer.config[\"kernel_virtual_offset\"]\n\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n return ntkrnlmp","function_tokens":["def","get_kernel_module","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")",":","virtual_layer","=","context",".","layers","[","layer_name","]","if","not","isinstance","(","virtual_layer",",","layers",".","intel",".","Intel",")",":","raise","TypeError","(","\"Virtual Layer is not an intel layer\"",")","kvo","=","virtual_layer",".","config","[","\"kernel_virtual_offset\"","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","return","ntkrnlmp"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py#L57-L66"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py","language":"python","identifier":"Info.get_kdbg_structure","parameters":"(cls, context: interfaces.context.ContextInterface, config_path: str, layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"return kdbg","docstring":"Returns the KDDEBUGGER_DATA64 structure for a kernel","docstring_summary":"Returns the KDDEBUGGER_DATA64 structure for a kernel","docstring_tokens":["Returns","the","KDDEBUGGER_DATA64","structure","for","a","kernel"],"function":"def get_kdbg_structure(cls, context: interfaces.context.ContextInterface, config_path: str, layer_name: str,\n symbol_table: str) -> interfaces.objects.ObjectInterface:\n \"\"\"Returns the KDDEBUGGER_DATA64 structure for a kernel\"\"\"\n ntkrnlmp = cls.get_kernel_module(context, layer_name, symbol_table)\n\n native_types = context.symbol_space[symbol_table].natives\n\n kdbg_offset = ntkrnlmp.get_symbol(\"KdDebuggerDataBlock\").address\n\n kdbg_table_name = intermed.IntermediateSymbolTable.create(context,\n interfaces.configuration.path_join(\n config_path, 'kdbg'),\n \"windows\",\n \"kdbg\",\n native_types = native_types,\n class_types = extensions.kdbg.class_types)\n\n kdbg = context.object(kdbg_table_name + constants.BANG + \"_KDDEBUGGER_DATA64\",\n offset = ntkrnlmp.offset + kdbg_offset,\n layer_name = layer_name)\n\n return kdbg","function_tokens":["def","get_kdbg_structure","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","layer_name",":","str",",","symbol_table",":","str",")","->","interfaces",".","objects",".","ObjectInterface",":","ntkrnlmp","=","cls",".","get_kernel_module","(","context",",","layer_name",",","symbol_table",")","native_types","=","context",".","symbol_space","[","symbol_table","]",".","natives","kdbg_offset","=","ntkrnlmp",".","get_symbol","(","\"KdDebuggerDataBlock\"",")",".","address","kdbg_table_name","=","intermed",".","IntermediateSymbolTable",".","create","(","context",",","interfaces",".","configuration",".","path_join","(","config_path",",","'kdbg'",")",",","\"windows\"",",","\"kdbg\"",",","native_types","=","native_types",",","class_types","=","extensions",".","kdbg",".","class_types",")","kdbg","=","context",".","object","(","kdbg_table_name","+","constants",".","BANG","+","\"_KDDEBUGGER_DATA64\"",",","offset","=","ntkrnlmp",".","offset","+","kdbg_offset",",","layer_name","=","layer_name",")","return","kdbg"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py#L69-L90"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py","language":"python","identifier":"Info.get_kuser_structure","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"return kuser","docstring":"Returns the _KUSER_SHARED_DATA structure for a kernel","docstring_summary":"Returns the _KUSER_SHARED_DATA structure for a kernel","docstring_tokens":["Returns","the","_KUSER_SHARED_DATA","structure","for","a","kernel"],"function":"def get_kuser_structure(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str) -> interfaces.objects.ObjectInterface:\n \"\"\"Returns the _KUSER_SHARED_DATA structure for a kernel\"\"\"\n virtual_layer = context.layers[layer_name]\n if not isinstance(virtual_layer, layers.intel.Intel):\n raise TypeError(\"Virtual Layer is not an intel layer\")\n\n ntkrnlmp = cls.get_kernel_module(context, layer_name, symbol_table)\n\n # this is a hard-coded address in the Windows OS\n if virtual_layer.bits_per_register == 32:\n kuser_addr = 0xFFDF0000\n else:\n kuser_addr = 0xFFFFF78000000000\n\n kuser = ntkrnlmp.object(object_type = \"_KUSER_SHARED_DATA\",\n layer_name = layer_name,\n offset = kuser_addr,\n absolute = True)\n\n return kuser","function_tokens":["def","get_kuser_structure","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","interfaces",".","objects",".","ObjectInterface",":","virtual_layer","=","context",".","layers","[","layer_name","]","if","not","isinstance","(","virtual_layer",",","layers",".","intel",".","Intel",")",":","raise","TypeError","(","\"Virtual Layer is not an intel layer\"",")","ntkrnlmp","=","cls",".","get_kernel_module","(","context",",","layer_name",",","symbol_table",")","# this is a hard-coded address in the Windows OS","if","virtual_layer",".","bits_per_register","==","32",":","kuser_addr","=","0xFFDF0000","else",":","kuser_addr","=","0xFFFFF78000000000","kuser","=","ntkrnlmp",".","object","(","object_type","=","\"_KUSER_SHARED_DATA\"",",","layer_name","=","layer_name",",","offset","=","kuser_addr",",","absolute","=","True",")","return","kuser"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py#L93-L113"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py","language":"python","identifier":"Info.get_version_structure","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"return vers","docstring":"Returns the KdVersionBlock information from a kernel","docstring_summary":"Returns the KdVersionBlock information from a kernel","docstring_tokens":["Returns","the","KdVersionBlock","information","from","a","kernel"],"function":"def get_version_structure(cls, context: interfaces.context.ContextInterface, layer_name: str,\n symbol_table: str) -> interfaces.objects.ObjectInterface:\n \"\"\"Returns the KdVersionBlock information from a kernel\"\"\"\n ntkrnlmp = cls.get_kernel_module(context, layer_name, symbol_table)\n\n vers_offset = ntkrnlmp.get_symbol(\"KdVersionBlock\").address\n\n vers = ntkrnlmp.object(object_type = \"_DBGKD_GET_VERSION64\", layer_name = layer_name, offset = vers_offset)\n\n return vers","function_tokens":["def","get_version_structure","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","interfaces",".","objects",".","ObjectInterface",":","ntkrnlmp","=","cls",".","get_kernel_module","(","context",",","layer_name",",","symbol_table",")","vers_offset","=","ntkrnlmp",".","get_symbol","(","\"KdVersionBlock\"",")",".","address","vers","=","ntkrnlmp",".","object","(","object_type","=","\"_DBGKD_GET_VERSION64\"",",","layer_name","=","layer_name",",","offset","=","vers_offset",")","return","vers"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py#L116-L125"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py","language":"python","identifier":"Info.get_ntheader_structure","parameters":"(cls, context: interfaces.context.ContextInterface, config_path: str,\n layer_name: str)","argument_list":"","return_statement":"return nt_header","docstring":"Gets the ntheader structure for the kernel of the specified layer","docstring_summary":"Gets the ntheader structure for the kernel of the specified layer","docstring_tokens":["Gets","the","ntheader","structure","for","the","kernel","of","the","specified","layer"],"function":"def get_ntheader_structure(cls, context: interfaces.context.ContextInterface, config_path: str,\n layer_name: str) -> interfaces.objects.ObjectInterface:\n \"\"\"Gets the ntheader structure for the kernel of the specified layer\"\"\"\n virtual_layer = context.layers[layer_name]\n if not isinstance(virtual_layer, layers.intel.Intel):\n raise TypeError(\"Virtual Layer is not an intel layer\")\n\n kvo = virtual_layer.config[\"kernel_virtual_offset\"]\n\n pe_table_name = intermed.IntermediateSymbolTable.create(context,\n interfaces.configuration.path_join(config_path, 'pe'),\n \"windows\",\n \"pe\",\n class_types = extensions.pe.class_types)\n\n dos_header = context.object(pe_table_name + constants.BANG + \"_IMAGE_DOS_HEADER\",\n offset = kvo,\n layer_name = layer_name)\n\n nt_header = dos_header.get_nt_header()\n\n return nt_header","function_tokens":["def","get_ntheader_structure","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","layer_name",":","str",")","->","interfaces",".","objects",".","ObjectInterface",":","virtual_layer","=","context",".","layers","[","layer_name","]","if","not","isinstance","(","virtual_layer",",","layers",".","intel",".","Intel",")",":","raise","TypeError","(","\"Virtual Layer is not an intel layer\"",")","kvo","=","virtual_layer",".","config","[","\"kernel_virtual_offset\"","]","pe_table_name","=","intermed",".","IntermediateSymbolTable",".","create","(","context",",","interfaces",".","configuration",".","path_join","(","config_path",",","'pe'",")",",","\"windows\"",",","\"pe\"",",","class_types","=","extensions",".","pe",".","class_types",")","dos_header","=","context",".","object","(","pe_table_name","+","constants",".","BANG","+","\"_IMAGE_DOS_HEADER\"",",","offset","=","kvo",",","layer_name","=","layer_name",")","nt_header","=","dos_header",".","get_nt_header","(",")","return","nt_header"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/info.py#L128-L149"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/symlinkscan.py","language":"python","identifier":"SymlinkScan.scan_symlinks","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"","docstring":"Scans for links using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of symlink objects found by scanning memory for the Symlink pool signatures","docstring_summary":"Scans for links using the poolscanner module and constraints.","docstring_tokens":["Scans","for","links","using","the","poolscanner","module","and","constraints","."],"function":"def scan_symlinks(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Scans for links using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of symlink objects found by scanning memory for the Symlink pool signatures\n \"\"\"\n\n constraints = poolscanner.PoolScanner.builtin_constraints(symbol_table, [b'Sym\\xe2', b'Symb'])\n\n for result in poolscanner.PoolScanner.generate_pool_scan(context, layer_name, symbol_table, constraints):\n\n _constraint, mem_object, _header = result\n yield mem_object","function_tokens":["def","scan_symlinks","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","constraints","=","poolscanner",".","PoolScanner",".","builtin_constraints","(","symbol_table",",","[","b'Sym\\xe2'",",","b'Symb'","]",")","for","result","in","poolscanner",".","PoolScanner",".","generate_pool_scan","(","context",",","layer_name",",","symbol_table",",","constraints",")",":","_constraint",",","mem_object",",","_header","=","result","yield","mem_object"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/symlinkscan.py#L30-L51"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/netscan.py","language":"python","identifier":"NetScan.create_netscan_constraints","parameters":"(context: interfaces.context.ContextInterface,\n symbol_table: str)","argument_list":"","return_statement":"return [\n # TCP listener\n poolscanner.PoolConstraint(b'TcpL',\n type_name = symbol_table + constants.BANG + \"_TCP_LISTENER\",\n size = (tcpl_size, None),\n page_type = poolscanner.PoolType.NONPAGED | poolscanner.PoolType.FREE),\n # TCP Endpoint\n poolscanner.PoolConstraint(b'TcpE',\n type_name = symbol_table + constants.BANG + \"_TCP_ENDPOINT\",\n size = (tcpe_size, None),\n page_type = poolscanner.PoolType.NONPAGED | poolscanner.PoolType.FREE),\n # UDP Endpoint\n poolscanner.PoolConstraint(b'UdpA',\n type_name = symbol_table + constants.BANG + \"_UDP_ENDPOINT\",\n size = (udpa_size, None),\n page_type = poolscanner.PoolType.NONPAGED | poolscanner.PoolType.FREE)\n ]","docstring":"Creates a list of Pool Tag Constraints for network objects.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n symbol_table: The name of an existing symbol table containing the symbols \/ types\n\n Returns:\n The list containing the built constraints.","docstring_summary":"Creates a list of Pool Tag Constraints for network objects.","docstring_tokens":["Creates","a","list","of","Pool","Tag","Constraints","for","network","objects","."],"function":"def create_netscan_constraints(context: interfaces.context.ContextInterface,\n symbol_table: str) -> List[poolscanner.PoolConstraint]:\n \"\"\"Creates a list of Pool Tag Constraints for network objects.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n symbol_table: The name of an existing symbol table containing the symbols \/ types\n\n Returns:\n The list containing the built constraints.\n \"\"\"\n\n tcpl_size = context.symbol_space.get_type(symbol_table + constants.BANG + \"_TCP_LISTENER\").size\n tcpe_size = context.symbol_space.get_type(symbol_table + constants.BANG + \"_TCP_ENDPOINT\").size\n udpa_size = context.symbol_space.get_type(symbol_table + constants.BANG + \"_UDP_ENDPOINT\").size\n\n # ~ vollog.debug(\"Using pool size constraints: TcpL {}, TcpE {}, UdpA {}\".format(tcpl_size, tcpe_size, udpa_size))\n\n return [\n # TCP listener\n poolscanner.PoolConstraint(b'TcpL',\n type_name = symbol_table + constants.BANG + \"_TCP_LISTENER\",\n size = (tcpl_size, None),\n page_type = poolscanner.PoolType.NONPAGED | poolscanner.PoolType.FREE),\n # TCP Endpoint\n poolscanner.PoolConstraint(b'TcpE',\n type_name = symbol_table + constants.BANG + \"_TCP_ENDPOINT\",\n size = (tcpe_size, None),\n page_type = poolscanner.PoolType.NONPAGED | poolscanner.PoolType.FREE),\n # UDP Endpoint\n poolscanner.PoolConstraint(b'UdpA',\n type_name = symbol_table + constants.BANG + \"_UDP_ENDPOINT\",\n size = (udpa_size, None),\n page_type = poolscanner.PoolType.NONPAGED | poolscanner.PoolType.FREE)\n ]","function_tokens":["def","create_netscan_constraints","(","context",":","interfaces",".","context",".","ContextInterface",",","symbol_table",":","str",")","->","List","[","poolscanner",".","PoolConstraint","]",":","tcpl_size","=","context",".","symbol_space",".","get_type","(","symbol_table","+","constants",".","BANG","+","\"_TCP_LISTENER\"",")",".","size","tcpe_size","=","context",".","symbol_space",".","get_type","(","symbol_table","+","constants",".","BANG","+","\"_TCP_ENDPOINT\"",")",".","size","udpa_size","=","context",".","symbol_space",".","get_type","(","symbol_table","+","constants",".","BANG","+","\"_UDP_ENDPOINT\"",")",".","size","# ~ vollog.debug(\"Using pool size constraints: TcpL {}, TcpE {}, UdpA {}\".format(tcpl_size, tcpe_size, udpa_size))","return","[","# TCP listener","poolscanner",".","PoolConstraint","(","b'TcpL'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_TCP_LISTENER\"",",","size","=","(","tcpl_size",",","None",")",",","page_type","=","poolscanner",".","PoolType",".","NONPAGED","|","poolscanner",".","PoolType",".","FREE",")",",","# TCP Endpoint","poolscanner",".","PoolConstraint","(","b'TcpE'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_TCP_ENDPOINT\"",",","size","=","(","tcpe_size",",","None",")",",","page_type","=","poolscanner",".","PoolType",".","NONPAGED","|","poolscanner",".","PoolType",".","FREE",")",",","# UDP Endpoint","poolscanner",".","PoolConstraint","(","b'UdpA'",",","type_name","=","symbol_table","+","constants",".","BANG","+","\"_UDP_ENDPOINT\"",",","size","=","(","udpa_size",",","None",")",",","page_type","=","poolscanner",".","PoolType",".","NONPAGED","|","poolscanner",".","PoolType",".","FREE",")","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/netscan.py#L46-L80"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/netscan.py","language":"python","identifier":"NetScan.determine_tcpip_version","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n nt_symbol_table: str)","argument_list":"","return_statement":"return filename, class_types","docstring":"Tries to determine which symbol filename to use for the image's tcpip driver. The logic is partially taken from the info plugin.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n nt_symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n The filename of the symbol table to use.","docstring_summary":"Tries to determine which symbol filename to use for the image's tcpip driver. The logic is partially taken from the info plugin.","docstring_tokens":["Tries","to","determine","which","symbol","filename","to","use","for","the","image","s","tcpip","driver",".","The","logic","is","partially","taken","from","the","info","plugin","."],"function":"def determine_tcpip_version(cls, context: interfaces.context.ContextInterface, layer_name: str,\n nt_symbol_table: str) -> str:\n \"\"\"Tries to determine which symbol filename to use for the image's tcpip driver. The logic is partially taken from the info plugin.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n nt_symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n The filename of the symbol table to use.\n \"\"\"\n\n # while the failsafe way to determine the version of tcpip.sys would be to\n # extract the driver and parse its PE header containing the versionstring,\n # unfortunately that header is not guaranteed to persist within memory.\n # therefore we determine the version based on the kernel version as testing\n # with several windows versions has showed this to work out correctly.\n\n is_64bit = symbols.symbol_table_is_64bit(context, nt_symbol_table)\n\n if is_64bit:\n arch = \"x64\"\n else:\n arch = \"x86\"\n\n vers = info.Info.get_version_structure(context, layer_name, nt_symbol_table)\n\n kuser = info.Info.get_kuser_structure(context, layer_name, nt_symbol_table)\n\n try:\n vers_minor_version = int(vers.MinorVersion)\n nt_major_version = int(kuser.NtMajorVersion)\n nt_minor_version = int(kuser.NtMinorVersion)\n except ValueError:\n # vers struct exists, but is not an int anymore?\n raise NotImplementedError(\"Kernel Debug Structure version format not supported!\")\n except:\n # unsure what to raise here. Also, it might be useful to add some kind of fallback,\n # either to a user-provided version or to another method to determine tcpip.sys's version\n raise exceptions.VolatilityException(\n \"Kernel Debug Structure missing VERSION\/KUSER structure, unable to determine Windows version!\")\n\n vollog.debug(\"Determined OS Version: {}.{} {}.{}\".format(kuser.NtMajorVersion, kuser.NtMinorVersion,\n vers.MajorVersion, vers.MinorVersion))\n\n if nt_major_version == 10 and arch == \"x64\":\n # win10 x64 has an additional class type we have to include.\n class_types = network.win10_x64_class_types\n else:\n # default to general class types\n class_types = network.class_types\n\n # these versions are listed explicitly because symbol files differ based on\n # version *and* architecture. this is currently the clearest way to show\n # the differences, even if it introduces a fair bit of redundancy.\n # furthermore, it is easy to append new versions.\n if arch == \"x86\":\n version_dict = {\n (6, 0, 6000): \"netscan-vista-x86\",\n (6, 0, 6001): \"netscan-vista-x86\",\n (6, 0, 6002): \"netscan-vista-x86\",\n (6, 0, 6003): \"netscan-vista-x86\",\n (6, 1, 7600): \"netscan-win7-x86\",\n (6, 1, 7601): \"netscan-win7-x86\",\n (6, 1, 8400): \"netscan-win7-x86\",\n (6, 2, 9200): \"netscan-win8-x86\",\n (6, 3, 9600): \"netscan-win81-x86\",\n (10, 0, 10240): \"netscan-win10-x86\",\n (10, 0, 10586): \"netscan-win10-x86\",\n (10, 0, 14393): \"netscan-win10-14393-x86\",\n (10, 0, 15063): \"netscan-win10-15063-x86\",\n (10, 0, 16299): \"netscan-win10-15063-x86\",\n (10, 0, 17134): \"netscan-win10-15063-x86\",\n (10, 0, 17763): \"netscan-win10-15063-x86\",\n (10, 0, 18362): \"netscan-win10-15063-x86\",\n (10, 0, 18363): \"netscan-win10-15063-x86\"\n }\n else:\n version_dict = {\n (6, 0, 6000): \"netscan-vista-x64\",\n (6, 0, 6001): \"netscan-vista-sp12-x64\",\n (6, 0, 6002): \"netscan-vista-sp12-x64\",\n (6, 0, 6003): \"netscan-vista-sp12-x64\",\n (6, 1, 7600): \"netscan-win7-x64\",\n (6, 1, 7601): \"netscan-win7-x64\",\n (6, 1, 8400): \"netscan-win7-x64\",\n (6, 2, 9200): \"netscan-win8-x64\",\n (6, 3, 9600): \"netscan-win81-x64\",\n (10, 0, 10240): \"netscan-win10-x64\",\n (10, 0, 10586): \"netscan-win10-x64\",\n (10, 0, 14393): \"netscan-win10-x64\",\n (10, 0, 15063): \"netscan-win10-15063-x64\",\n (10, 0, 16299): \"netscan-win10-15063-x64\",\n (10, 0, 17134): \"netscan-win10-15063-x64\",\n (10, 0, 17763): \"netscan-win10-15063-x64\",\n (10, 0, 18362): \"netscan-win10-15063-x64\",\n (10, 0, 18363): \"netscan-win10-15063-x64\"\n }\n\n # when determining the symbol file we have to consider the following cases:\n # the determined version's symbol file is found by intermed.create -> proceed\n # the determined version's symbol file is not found by intermed -> intermed will throw an exc and abort\n # the determined version has no mapped symbol file -> if win10 use latest, otherwise throw exc\n # windows version cannot be determined -> throw exc\n filename = version_dict.get((nt_major_version, nt_minor_version, vers_minor_version))\n if not filename:\n if nt_major_version == 10:\n # NtMajorVersion of 10 without a match means a newer version than listed\n # hence try the latest supported version. If this one throws an error,\n # support has to be added manually.\n win_10_versions = sorted([key for key in list(version_dict.keys()) if key[0] == 10])\n # as win10 MinorVersion counts upwards we can take the last entry\n latest_version = win_10_versions[-1]\n filename = version_dict.get(latest_version)\n vollog.debug(\"Unable to find exact matching symbol file, going with latest: {}\".format(filename))\n else:\n raise NotImplementedError(\"This version of Windows is not supported: {}.{} {}.{}!\".format(\n nt_major_version, nt_minor_version, vers.MajorVersion, vers_minor_version))\n\n vollog.debug(\"Determined symbol filename: {}\".format(filename))\n\n return filename, class_types","function_tokens":["def","determine_tcpip_version","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","nt_symbol_table",":","str",")","->","str",":","# while the failsafe way to determine the version of tcpip.sys would be to","# extract the driver and parse its PE header containing the versionstring,","# unfortunately that header is not guaranteed to persist within memory.","# therefore we determine the version based on the kernel version as testing","# with several windows versions has showed this to work out correctly.","is_64bit","=","symbols",".","symbol_table_is_64bit","(","context",",","nt_symbol_table",")","if","is_64bit",":","arch","=","\"x64\"","else",":","arch","=","\"x86\"","vers","=","info",".","Info",".","get_version_structure","(","context",",","layer_name",",","nt_symbol_table",")","kuser","=","info",".","Info",".","get_kuser_structure","(","context",",","layer_name",",","nt_symbol_table",")","try",":","vers_minor_version","=","int","(","vers",".","MinorVersion",")","nt_major_version","=","int","(","kuser",".","NtMajorVersion",")","nt_minor_version","=","int","(","kuser",".","NtMinorVersion",")","except","ValueError",":","# vers struct exists, but is not an int anymore?","raise","NotImplementedError","(","\"Kernel Debug Structure version format not supported!\"",")","except",":","# unsure what to raise here. Also, it might be useful to add some kind of fallback,","# either to a user-provided version or to another method to determine tcpip.sys's version","raise","exceptions",".","VolatilityException","(","\"Kernel Debug Structure missing VERSION\/KUSER structure, unable to determine Windows version!\"",")","vollog",".","debug","(","\"Determined OS Version: {}.{} {}.{}\"",".","format","(","kuser",".","NtMajorVersion",",","kuser",".","NtMinorVersion",",","vers",".","MajorVersion",",","vers",".","MinorVersion",")",")","if","nt_major_version","==","10","and","arch","==","\"x64\"",":","# win10 x64 has an additional class type we have to include.","class_types","=","network",".","win10_x64_class_types","else",":","# default to general class types","class_types","=","network",".","class_types","# these versions are listed explicitly because symbol files differ based on","# version *and* architecture. this is currently the clearest way to show","# the differences, even if it introduces a fair bit of redundancy.","# furthermore, it is easy to append new versions.","if","arch","==","\"x86\"",":","version_dict","=","{","(","6",",","0",",","6000",")",":","\"netscan-vista-x86\"",",","(","6",",","0",",","6001",")",":","\"netscan-vista-x86\"",",","(","6",",","0",",","6002",")",":","\"netscan-vista-x86\"",",","(","6",",","0",",","6003",")",":","\"netscan-vista-x86\"",",","(","6",",","1",",","7600",")",":","\"netscan-win7-x86\"",",","(","6",",","1",",","7601",")",":","\"netscan-win7-x86\"",",","(","6",",","1",",","8400",")",":","\"netscan-win7-x86\"",",","(","6",",","2",",","9200",")",":","\"netscan-win8-x86\"",",","(","6",",","3",",","9600",")",":","\"netscan-win81-x86\"",",","(","10",",","0",",","10240",")",":","\"netscan-win10-x86\"",",","(","10",",","0",",","10586",")",":","\"netscan-win10-x86\"",",","(","10",",","0",",","14393",")",":","\"netscan-win10-14393-x86\"",",","(","10",",","0",",","15063",")",":","\"netscan-win10-15063-x86\"",",","(","10",",","0",",","16299",")",":","\"netscan-win10-15063-x86\"",",","(","10",",","0",",","17134",")",":","\"netscan-win10-15063-x86\"",",","(","10",",","0",",","17763",")",":","\"netscan-win10-15063-x86\"",",","(","10",",","0",",","18362",")",":","\"netscan-win10-15063-x86\"",",","(","10",",","0",",","18363",")",":","\"netscan-win10-15063-x86\"","}","else",":","version_dict","=","{","(","6",",","0",",","6000",")",":","\"netscan-vista-x64\"",",","(","6",",","0",",","6001",")",":","\"netscan-vista-sp12-x64\"",",","(","6",",","0",",","6002",")",":","\"netscan-vista-sp12-x64\"",",","(","6",",","0",",","6003",")",":","\"netscan-vista-sp12-x64\"",",","(","6",",","1",",","7600",")",":","\"netscan-win7-x64\"",",","(","6",",","1",",","7601",")",":","\"netscan-win7-x64\"",",","(","6",",","1",",","8400",")",":","\"netscan-win7-x64\"",",","(","6",",","2",",","9200",")",":","\"netscan-win8-x64\"",",","(","6",",","3",",","9600",")",":","\"netscan-win81-x64\"",",","(","10",",","0",",","10240",")",":","\"netscan-win10-x64\"",",","(","10",",","0",",","10586",")",":","\"netscan-win10-x64\"",",","(","10",",","0",",","14393",")",":","\"netscan-win10-x64\"",",","(","10",",","0",",","15063",")",":","\"netscan-win10-15063-x64\"",",","(","10",",","0",",","16299",")",":","\"netscan-win10-15063-x64\"",",","(","10",",","0",",","17134",")",":","\"netscan-win10-15063-x64\"",",","(","10",",","0",",","17763",")",":","\"netscan-win10-15063-x64\"",",","(","10",",","0",",","18362",")",":","\"netscan-win10-15063-x64\"",",","(","10",",","0",",","18363",")",":","\"netscan-win10-15063-x64\"","}","# when determining the symbol file we have to consider the following cases:","# the determined version's symbol file is found by intermed.create -> proceed","# the determined version's symbol file is not found by intermed -> intermed will throw an exc and abort","# the determined version has no mapped symbol file -> if win10 use latest, otherwise throw exc","# windows version cannot be determined -> throw exc","filename","=","version_dict",".","get","(","(","nt_major_version",",","nt_minor_version",",","vers_minor_version",")",")","if","not","filename",":","if","nt_major_version","==","10",":","# NtMajorVersion of 10 without a match means a newer version than listed","# hence try the latest supported version. If this one throws an error,","# support has to be added manually.","win_10_versions","=","sorted","(","[","key","for","key","in","list","(","version_dict",".","keys","(",")",")","if","key","[","0","]","==","10","]",")","# as win10 MinorVersion counts upwards we can take the last entry","latest_version","=","win_10_versions","[","-","1","]","filename","=","version_dict",".","get","(","latest_version",")","vollog",".","debug","(","\"Unable to find exact matching symbol file, going with latest: {}\"",".","format","(","filename",")",")","else",":","raise","NotImplementedError","(","\"This version of Windows is not supported: {}.{} {}.{}!\"",".","format","(","nt_major_version",",","nt_minor_version",",","vers",".","MajorVersion",",","vers_minor_version",")",")","vollog",".","debug","(","\"Determined symbol filename: {}\"",".","format","(","filename",")",")","return","filename",",","class_types"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/netscan.py#L83-L205"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/netscan.py","language":"python","identifier":"NetScan.create_netscan_symbol_table","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n nt_symbol_table: str, config_path: str)","argument_list":"","return_statement":"return intermed.IntermediateSymbolTable.create(context,\n config_path,\n \"windows\",\n symbol_filename,\n class_types = class_types,\n table_mapping = table_mapping)","docstring":"Creates a symbol table for TCP Listeners and TCP\/UDP Endpoints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n nt_symbol_table: The name of the table containing the kernel symbols\n config_path: The config path where to find symbol files\n\n Returns:\n The name of the constructed symbol table","docstring_summary":"Creates a symbol table for TCP Listeners and TCP\/UDP Endpoints.","docstring_tokens":["Creates","a","symbol","table","for","TCP","Listeners","and","TCP","\/","UDP","Endpoints","."],"function":"def create_netscan_symbol_table(cls, context: interfaces.context.ContextInterface, layer_name: str,\n nt_symbol_table: str, config_path: str) -> str:\n \"\"\"Creates a symbol table for TCP Listeners and TCP\/UDP Endpoints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n nt_symbol_table: The name of the table containing the kernel symbols\n config_path: The config path where to find symbol files\n\n Returns:\n The name of the constructed symbol table\n \"\"\"\n table_mapping = {\"nt_symbols\": nt_symbol_table}\n\n symbol_filename, class_types = cls.determine_tcpip_version(\n context,\n layer_name,\n nt_symbol_table,\n )\n\n return intermed.IntermediateSymbolTable.create(context,\n config_path,\n \"windows\",\n symbol_filename,\n class_types = class_types,\n table_mapping = table_mapping)","function_tokens":["def","create_netscan_symbol_table","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","nt_symbol_table",":","str",",","config_path",":","str",")","->","str",":","table_mapping","=","{","\"nt_symbols\"",":","nt_symbol_table","}","symbol_filename",",","class_types","=","cls",".","determine_tcpip_version","(","context",",","layer_name",",","nt_symbol_table",",",")","return","intermed",".","IntermediateSymbolTable",".","create","(","context",",","config_path",",","\"windows\"",",","symbol_filename",",","class_types","=","class_types",",","table_mapping","=","table_mapping",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/netscan.py#L208-L234"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/netscan.py","language":"python","identifier":"NetScan.scan","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n nt_symbol_table: str,\n netscan_symbol_table: str)","argument_list":"","return_statement":"","docstring":"Scans for network objects using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n nt_symbol_table: The name of the table containing the kernel symbols\n netscan_symbol_table: The name of the table containing the network object symbols (_TCP_LISTENER etc.)\n\n Returns:\n A list of network objects found by scanning the `layer_name` layer for network pool signatures","docstring_summary":"Scans for network objects using the poolscanner module and constraints.","docstring_tokens":["Scans","for","network","objects","using","the","poolscanner","module","and","constraints","."],"function":"def scan(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n nt_symbol_table: str,\n netscan_symbol_table: str) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Scans for network objects using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n nt_symbol_table: The name of the table containing the kernel symbols\n netscan_symbol_table: The name of the table containing the network object symbols (_TCP_LISTENER etc.)\n\n Returns:\n A list of network objects found by scanning the `layer_name` layer for network pool signatures\n \"\"\"\n\n constraints = cls.create_netscan_constraints(context, netscan_symbol_table)\n\n for result in poolscanner.PoolScanner.generate_pool_scan(context, layer_name, nt_symbol_table, constraints):\n\n _constraint, mem_object, _header = result\n yield mem_object","function_tokens":["def","scan","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","nt_symbol_table",":","str",",","netscan_symbol_table",":","str",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","constraints","=","cls",".","create_netscan_constraints","(","context",",","netscan_symbol_table",")","for","result","in","poolscanner",".","PoolScanner",".","generate_pool_scan","(","context",",","layer_name",",","nt_symbol_table",",","constraints",")",":","_constraint",",","mem_object",",","_header","=","result","yield","mem_object"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/netscan.py#L237-L260"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/netscan.py","language":"python","identifier":"NetScan._generator","parameters":"(self, show_corrupt_results: Optional[bool] = None)","argument_list":"","return_statement":"","docstring":"Generates the network objects for use in rendering.","docstring_summary":"Generates the network objects for use in rendering.","docstring_tokens":["Generates","the","network","objects","for","use","in","rendering","."],"function":"def _generator(self, show_corrupt_results: Optional[bool] = None):\n \"\"\" Generates the network objects for use in rendering. \"\"\"\n\n netscan_symbol_table = self.create_netscan_symbol_table(self.context, self.config[\"primary\"],\n self.config[\"nt_symbols\"], self.config_path)\n\n for netw_obj in self.scan(self.context, self.config['primary'], self.config['nt_symbols'],\n netscan_symbol_table):\n\n vollog.debug(\"Found netw obj @ 0x{:2x} of assumed type {}\".format(netw_obj.vol.offset, type(netw_obj)))\n # objects passed pool header constraints. check for additional constraints if strict flag is set.\n if not show_corrupt_results and not netw_obj.is_valid():\n continue\n\n if isinstance(netw_obj, network._UDP_ENDPOINT):\n vollog.debug(\"Found UDP_ENDPOINT @ 0x{:2x}\".format(netw_obj.vol.offset))\n\n # For UdpA, the state is always blank and the remote end is asterisks\n for ver, laddr, _ in netw_obj.dual_stack_sockets():\n yield (0, (format_hints.Hex(netw_obj.vol.offset), \"UDP\" + ver, laddr, netw_obj.Port, \"*\", 0, \"\",\n netw_obj.get_owner_pid() or renderers.UnreadableValue(), netw_obj.get_owner_procname()\n or renderers.UnreadableValue(), netw_obj.get_create_time()\n or renderers.UnreadableValue()))\n\n elif isinstance(netw_obj, network._TCP_ENDPOINT):\n vollog.debug(\"Found _TCP_ENDPOINT @ 0x{:2x}\".format(netw_obj.vol.offset))\n if netw_obj.get_address_family() == network.AF_INET:\n proto = \"TCPv4\"\n elif netw_obj.get_address_family() == network.AF_INET6:\n proto = \"TCPv6\"\n else:\n proto = \"TCPv?\"\n\n try:\n state = netw_obj.State.description\n except ValueError:\n state = renderers.UnreadableValue()\n\n yield (0, (format_hints.Hex(netw_obj.vol.offset), proto, netw_obj.get_local_address()\n or renderers.UnreadableValue(), netw_obj.LocalPort, netw_obj.get_remote_address()\n or renderers.UnreadableValue(), netw_obj.RemotePort, state, netw_obj.get_owner_pid()\n or renderers.UnreadableValue(), netw_obj.get_owner_procname() or renderers.UnreadableValue(),\n netw_obj.get_create_time() or renderers.UnreadableValue()))\n\n # check for isinstance of tcp listener last, because all other objects are inherited from here\n elif isinstance(netw_obj, network._TCP_LISTENER):\n vollog.debug(\"Found _TCP_LISTENER @ 0x{:2x}\".format(netw_obj.vol.offset))\n\n # For TcpL, the state is always listening and the remote port is zero\n for ver, laddr, raddr in netw_obj.dual_stack_sockets():\n yield (0, (format_hints.Hex(netw_obj.vol.offset), \"TCP\" + ver, laddr, netw_obj.Port, raddr, 0,\n \"LISTENING\", netw_obj.get_owner_pid() or renderers.UnreadableValue(),\n netw_obj.get_owner_procname() or renderers.UnreadableValue(), netw_obj.get_create_time()\n or renderers.UnreadableValue()))\n else:\n # this should not happen therefore we log it.\n vollog.debug(\"Found network object unsure of its type: {} of type {}\".format(netw_obj, type(netw_obj)))","function_tokens":["def","_generator","(","self",",","show_corrupt_results",":","Optional","[","bool","]","=","None",")",":","netscan_symbol_table","=","self",".","create_netscan_symbol_table","(","self",".","context",",","self",".","config","[","\"primary\"","]",",","self",".","config","[","\"nt_symbols\"","]",",","self",".","config_path",")","for","netw_obj","in","self",".","scan","(","self",".","context",",","self",".","config","[","'primary'","]",",","self",".","config","[","'nt_symbols'","]",",","netscan_symbol_table",")",":","vollog",".","debug","(","\"Found netw obj @ 0x{:2x} of assumed type {}\"",".","format","(","netw_obj",".","vol",".","offset",",","type","(","netw_obj",")",")",")","# objects passed pool header constraints. check for additional constraints if strict flag is set.","if","not","show_corrupt_results","and","not","netw_obj",".","is_valid","(",")",":","continue","if","isinstance","(","netw_obj",",","network",".","_UDP_ENDPOINT",")",":","vollog",".","debug","(","\"Found UDP_ENDPOINT @ 0x{:2x}\"",".","format","(","netw_obj",".","vol",".","offset",")",")","# For UdpA, the state is always blank and the remote end is asterisks","for","ver",",","laddr",",","_","in","netw_obj",".","dual_stack_sockets","(",")",":","yield","(","0",",","(","format_hints",".","Hex","(","netw_obj",".","vol",".","offset",")",",","\"UDP\"","+","ver",",","laddr",",","netw_obj",".","Port",",","\"*\"",",","0",",","\"\"",",","netw_obj",".","get_owner_pid","(",")","or","renderers",".","UnreadableValue","(",")",",","netw_obj",".","get_owner_procname","(",")","or","renderers",".","UnreadableValue","(",")",",","netw_obj",".","get_create_time","(",")","or","renderers",".","UnreadableValue","(",")",")",")","elif","isinstance","(","netw_obj",",","network",".","_TCP_ENDPOINT",")",":","vollog",".","debug","(","\"Found _TCP_ENDPOINT @ 0x{:2x}\"",".","format","(","netw_obj",".","vol",".","offset",")",")","if","netw_obj",".","get_address_family","(",")","==","network",".","AF_INET",":","proto","=","\"TCPv4\"","elif","netw_obj",".","get_address_family","(",")","==","network",".","AF_INET6",":","proto","=","\"TCPv6\"","else",":","proto","=","\"TCPv?\"","try",":","state","=","netw_obj",".","State",".","description","except","ValueError",":","state","=","renderers",".","UnreadableValue","(",")","yield","(","0",",","(","format_hints",".","Hex","(","netw_obj",".","vol",".","offset",")",",","proto",",","netw_obj",".","get_local_address","(",")","or","renderers",".","UnreadableValue","(",")",",","netw_obj",".","LocalPort",",","netw_obj",".","get_remote_address","(",")","or","renderers",".","UnreadableValue","(",")",",","netw_obj",".","RemotePort",",","state",",","netw_obj",".","get_owner_pid","(",")","or","renderers",".","UnreadableValue","(",")",",","netw_obj",".","get_owner_procname","(",")","or","renderers",".","UnreadableValue","(",")",",","netw_obj",".","get_create_time","(",")","or","renderers",".","UnreadableValue","(",")",")",")","# check for isinstance of tcp listener last, because all other objects are inherited from here","elif","isinstance","(","netw_obj",",","network",".","_TCP_LISTENER",")",":","vollog",".","debug","(","\"Found _TCP_LISTENER @ 0x{:2x}\"",".","format","(","netw_obj",".","vol",".","offset",")",")","# For TcpL, the state is always listening and the remote port is zero","for","ver",",","laddr",",","raddr","in","netw_obj",".","dual_stack_sockets","(",")",":","yield","(","0",",","(","format_hints",".","Hex","(","netw_obj",".","vol",".","offset",")",",","\"TCP\"","+","ver",",","laddr",",","netw_obj",".","Port",",","raddr",",","0",",","\"LISTENING\"",",","netw_obj",".","get_owner_pid","(",")","or","renderers",".","UnreadableValue","(",")",",","netw_obj",".","get_owner_procname","(",")","or","renderers",".","UnreadableValue","(",")",",","netw_obj",".","get_create_time","(",")","or","renderers",".","UnreadableValue","(",")",")",")","else",":","# this should not happen therefore we log it.","vollog",".","debug","(","\"Found network object unsure of its type: {} of type {}\"",".","format","(","netw_obj",",","type","(","netw_obj",")",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/netscan.py#L262-L318"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/psscan.py","language":"python","identifier":"PsScan.scan_processes","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n filter_func: Callable[[interfaces.objects.ObjectInterface], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Scans for processes using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of processes found by scanning the `layer_name` layer for process pool signatures","docstring_summary":"Scans for processes using the poolscanner module and constraints.","docstring_tokens":["Scans","for","processes","using","the","poolscanner","module","and","constraints","."],"function":"def scan_processes(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n filter_func: Callable[[interfaces.objects.ObjectInterface], bool] = lambda _: False) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Scans for processes using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of processes found by scanning the `layer_name` layer for process pool signatures\n \"\"\"\n\n constraints = poolscanner.PoolScanner.builtin_constraints(symbol_table, [b'Pro\\xe3', b'Proc'])\n\n for result in poolscanner.PoolScanner.generate_pool_scan(context, layer_name, symbol_table, constraints):\n\n _constraint, mem_object, _header = result\n if not filter_func(mem_object):\n yield mem_object","function_tokens":["def","scan_processes","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","filter_func",":","Callable","[","[","interfaces",".","objects",".","ObjectInterface","]",",","bool","]","=","lambda","_",":","False",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","constraints","=","poolscanner",".","PoolScanner",".","builtin_constraints","(","symbol_table",",","[","b'Pro\\xe3'",",","b'Proc'","]",")","for","result","in","poolscanner",".","PoolScanner",".","generate_pool_scan","(","context",",","layer_name",",","symbol_table",",","constraints",")",":","_constraint",",","mem_object",",","_header","=","result","if","not","filter_func","(","mem_object",")",":","yield","mem_object"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/psscan.py#L48-L71"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/psscan.py","language":"python","identifier":"PsScan.virtual_process_from_physical","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n proc: interfaces.objects.ObjectInterface)","argument_list":"","return_statement":"","docstring":"Returns a virtual process from a physical addressed one\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n proc: the process object with phisical address\n\n Returns:\n A process object on virtual address layer","docstring_summary":"Returns a virtual process from a physical addressed one","docstring_tokens":["Returns","a","virtual","process","from","a","physical","addressed","one"],"function":"def virtual_process_from_physical(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n proc: interfaces.objects.ObjectInterface) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\" Returns a virtual process from a physical addressed one\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n proc: the process object with phisical address\n\n Returns:\n A process object on virtual address layer\n\n \"\"\"\n\n # We'll use the first thread to bounce back to the virtual process\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n\n tleoffset = ntkrnlmp.get_type(\"_ETHREAD\").relative_child_offset(\"ThreadListEntry\")\n # Start out with the member offset\n offsets = [tleoffset]\n\n # If (and only if) we're dealing with 64-bit Windows 7 SP1\n # then add the other commonly seen member offset to the list\n kuser = info.Info.get_kuser_structure(context, layer_name, symbol_table)\n nt_major_version = int(kuser.NtMajorVersion)\n nt_minor_version = int(kuser.NtMinorVersion)\n vers = info.Info.get_version_structure(context, layer_name, symbol_table)\n build = vers.MinorVersion\n bits = context.layers[layer_name].bits_per_register\n version = (nt_major_version, nt_minor_version, build)\n if version == (6, 1, 7601) and bits == 64:\n offsets.append(tleoffset + 8)\n\n # Now we can try to bounce back\n for ofs in offsets:\n ethread = ntkrnlmp.object(object_type = \"_ETHREAD\",\n offset = proc.ThreadListHead.Flink - ofs,\n absolute = True)\n\n # Ask for the thread's process to get an _EPROCESS with a virtual address layer\n virtual_process = ethread.owning_process()\n # Sanity check the bounce.\n # This compares the original offset with the new one (translated from virtual layer)\n (_, _, ph_offset, _, _) = list(context.layers[layer_name].mapping(offset = virtual_process.vol.offset,\n length = 0))[0]\n if virtual_process and \\\n proc.vol.offset == ph_offset:\n return virtual_process","function_tokens":["def","virtual_process_from_physical","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","proc",":","interfaces",".","objects",".","ObjectInterface",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","# We'll use the first thread to bounce back to the virtual process","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","tleoffset","=","ntkrnlmp",".","get_type","(","\"_ETHREAD\"",")",".","relative_child_offset","(","\"ThreadListEntry\"",")","# Start out with the member offset","offsets","=","[","tleoffset","]","# If (and only if) we're dealing with 64-bit Windows 7 SP1","# then add the other commonly seen member offset to the list","kuser","=","info",".","Info",".","get_kuser_structure","(","context",",","layer_name",",","symbol_table",")","nt_major_version","=","int","(","kuser",".","NtMajorVersion",")","nt_minor_version","=","int","(","kuser",".","NtMinorVersion",")","vers","=","info",".","Info",".","get_version_structure","(","context",",","layer_name",",","symbol_table",")","build","=","vers",".","MinorVersion","bits","=","context",".","layers","[","layer_name","]",".","bits_per_register","version","=","(","nt_major_version",",","nt_minor_version",",","build",")","if","version","==","(","6",",","1",",","7601",")","and","bits","==","64",":","offsets",".","append","(","tleoffset","+","8",")","# Now we can try to bounce back","for","ofs","in","offsets",":","ethread","=","ntkrnlmp",".","object","(","object_type","=","\"_ETHREAD\"",",","offset","=","proc",".","ThreadListHead",".","Flink","-","ofs",",","absolute","=","True",")","# Ask for the thread's process to get an _EPROCESS with a virtual address layer","virtual_process","=","ethread",".","owning_process","(",")","# Sanity check the bounce.","# This compares the original offset with the new one (translated from virtual layer)","(","_",",","_",",","ph_offset",",","_",",","_",")","=","list","(","context",".","layers","[","layer_name","]",".","mapping","(","offset","=","virtual_process",".","vol",".","offset",",","length","=","0",")",")","[","0","]","if","virtual_process","and","proc",".","vol",".","offset","==","ph_offset",":","return","virtual_process"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/psscan.py#L74-L127"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/strings.py","language":"python","identifier":"Strings._generator","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Generates results from a strings file.","docstring_summary":"Generates results from a strings file.","docstring_tokens":["Generates","results","from","a","strings","file","."],"function":"def _generator(self) -> Generator[Tuple, None, None]:\n \"\"\"Generates results from a strings file.\"\"\"\n revmap = self.generate_mapping(self.config['primary'])\n\n accessor = resources.ResourceAccessor()\n strings_fp = accessor.open(self.config['strings_file'], \"rb\")\n strings_size = path.getsize(strings_fp.file.name)\n\n line = strings_fp.readline()\n last_prog = 0\n while line:\n try:\n offset, string = self._parse_line(line)\n try:\n revmap_list = [name + \":\" + hex(offset) for (name, offset) in revmap[offset >> 12]]\n except (IndexError, KeyError):\n revmap_list = [\"FREE MEMORY\"]\n yield (0, (str(string, 'latin-1'), format_hints.Hex(offset), \", \".join(revmap_list)))\n except ValueError:\n vollog.error(\"Strings file is in the wrong format\")\n return\n line = strings_fp.readline()\n prog = strings_fp.tell() \/ strings_size * 100\n if round(prog, 1) > last_prog:\n last_prog = round(prog, 1)\n self._progress_callback(prog, \"Matching strings in memory\")","function_tokens":["def","_generator","(","self",")","->","Generator","[","Tuple",",","None",",","None","]",":","revmap","=","self",".","generate_mapping","(","self",".","config","[","'primary'","]",")","accessor","=","resources",".","ResourceAccessor","(",")","strings_fp","=","accessor",".","open","(","self",".","config","[","'strings_file'","]",",","\"rb\"",")","strings_size","=","path",".","getsize","(","strings_fp",".","file",".","name",")","line","=","strings_fp",".","readline","(",")","last_prog","=","0","while","line",":","try",":","offset",",","string","=","self",".","_parse_line","(","line",")","try",":","revmap_list","=","[","name","+","\":\"","+","hex","(","offset",")","for","(","name",",","offset",")","in","revmap","[","offset",">>","12","]","]","except","(","IndexError",",","KeyError",")",":","revmap_list","=","[","\"FREE MEMORY\"","]","yield","(","0",",","(","str","(","string",",","'latin-1'",")",",","format_hints",".","Hex","(","offset",")",",","\", \"",".","join","(","revmap_list",")",")",")","except","ValueError",":","vollog",".","error","(","\"Strings file is in the wrong format\"",")","return","line","=","strings_fp",".","readline","(",")","prog","=","strings_fp",".","tell","(",")","\/","strings_size","*","100","if","round","(","prog",",","1",")",">","last_prog",":","last_prog","=","round","(","prog",",","1",")","self",".","_progress_callback","(","prog",",","\"Matching strings in memory\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/strings.py#L41-L66"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/strings.py","language":"python","identifier":"Strings._parse_line","parameters":"(self, line: bytes)","argument_list":"","return_statement":"return int(offset), string","docstring":"Parses a single line from a strings file.\n\n Args:\n line: bytes of the line of a strings file (an offset and a string)\n\n Returns:\n Tuple of the offset and the string found at that offset","docstring_summary":"Parses a single line from a strings file.","docstring_tokens":["Parses","a","single","line","from","a","strings","file","."],"function":"def _parse_line(self, line: bytes) -> Tuple[int, bytes]:\n \"\"\"Parses a single line from a strings file.\n\n Args:\n line: bytes of the line of a strings file (an offset and a string)\n\n Returns:\n Tuple of the offset and the string found at that offset\n \"\"\"\n\n match = self.strings_pattern.search(line)\n if not match:\n raise ValueError(\"Strings file contains invalid strings line\")\n offset, string = match.group(1, 2)\n return int(offset), string","function_tokens":["def","_parse_line","(","self",",","line",":","bytes",")","->","Tuple","[","int",",","bytes","]",":","match","=","self",".","strings_pattern",".","search","(","line",")","if","not","match",":","raise","ValueError","(","\"Strings file contains invalid strings line\"",")","offset",",","string","=","match",".","group","(","1",",","2",")","return","int","(","offset",")",",","string"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/strings.py#L68-L82"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/strings.py","language":"python","identifier":"Strings.generate_mapping","parameters":"(self, layer_name: str)","argument_list":"","return_statement":"return reverse_map","docstring":"Creates a reverse mapping between virtual addresses and physical\n addresses.\n\n Args:\n layer_name: the layer to map against the string lines\n\n Returns:\n A mapping of virtual offsets to strings and physical offsets","docstring_summary":"Creates a reverse mapping between virtual addresses and physical\n addresses.","docstring_tokens":["Creates","a","reverse","mapping","between","virtual","addresses","and","physical","addresses","."],"function":"def generate_mapping(self, layer_name: str) -> Dict[int, Set[Tuple[str, int]]]:\n \"\"\"Creates a reverse mapping between virtual addresses and physical\n addresses.\n\n Args:\n layer_name: the layer to map against the string lines\n\n Returns:\n A mapping of virtual offsets to strings and physical offsets\n \"\"\"\n layer = self._context.layers[layer_name]\n reverse_map = dict() # type: Dict[int, Set[Tuple[str, int]]]\n if isinstance(layer, intel.Intel):\n # We don't care about errors, we just wanted chunks that map correctly\n for mapval in layer.mapping(0x0, layer.maximum_address, ignore_errors = True):\n offset, _, mapped_offset, mapped_size, maplayer = mapval\n for val in range(mapped_offset, mapped_offset + mapped_size, 0x1000):\n cur_set = reverse_map.get(mapped_offset >> 12, set())\n cur_set.add((\"kernel\", offset))\n reverse_map[mapped_offset >> 12] = cur_set\n self._progress_callback((offset * 100) \/ layer.maximum_address, \"Creating reverse kernel map\")\n\n # TODO: Include kernel modules\n\n for process in pslist.PsList.list_processes(self.context, self.config['primary'],\n self.config['nt_symbols']):\n proc_id = \"Unknown\"\n try:\n proc_id = process.UniqueProcessId\n proc_layer_name = process.add_process_layer()\n except exceptions.InvalidAddressException as excp:\n vollog.debug(\"Process {}: invalid address {} in layer {}\".format(\n proc_id, excp.invalid_address, excp.layer_name))\n continue\n\n proc_layer = self.context.layers[proc_layer_name]\n if isinstance(proc_layer, linear.LinearlyMappedLayer):\n for mapval in proc_layer.mapping(0x0, proc_layer.maximum_address, ignore_errors = True):\n mapped_offset, _, offset, mapped_size, maplayer = mapval\n for val in range(mapped_offset, mapped_offset + mapped_size, 0x1000):\n cur_set = reverse_map.get(mapped_offset >> 12, set())\n cur_set.add((\"Process {}\".format(process.UniqueProcessId), offset))\n reverse_map[mapped_offset >> 12] = cur_set\n # FIXME: make the progress for all processes, rather than per-process\n self._progress_callback((offset * 100) \/ layer.maximum_address,\n \"Creating mapping for task {}\".format(process.UniqueProcessId))\n\n return reverse_map","function_tokens":["def","generate_mapping","(","self",",","layer_name",":","str",")","->","Dict","[","int",",","Set","[","Tuple","[","str",",","int","]","]","]",":","layer","=","self",".","_context",".","layers","[","layer_name","]","reverse_map","=","dict","(",")","# type: Dict[int, Set[Tuple[str, int]]]","if","isinstance","(","layer",",","intel",".","Intel",")",":","# We don't care about errors, we just wanted chunks that map correctly","for","mapval","in","layer",".","mapping","(","0x0",",","layer",".","maximum_address",",","ignore_errors","=","True",")",":","offset",",","_",",","mapped_offset",",","mapped_size",",","maplayer","=","mapval","for","val","in","range","(","mapped_offset",",","mapped_offset","+","mapped_size",",","0x1000",")",":","cur_set","=","reverse_map",".","get","(","mapped_offset",">>","12",",","set","(",")",")","cur_set",".","add","(","(","\"kernel\"",",","offset",")",")","reverse_map","[","mapped_offset",">>","12","]","=","cur_set","self",".","_progress_callback","(","(","offset","*","100",")","\/","layer",".","maximum_address",",","\"Creating reverse kernel map\"",")","# TODO: Include kernel modules","for","process","in","pslist",".","PsList",".","list_processes","(","self",".","context",",","self",".","config","[","'primary'","]",",","self",".","config","[","'nt_symbols'","]",")",":","proc_id","=","\"Unknown\"","try",":","proc_id","=","process",".","UniqueProcessId","proc_layer_name","=","process",".","add_process_layer","(",")","except","exceptions",".","InvalidAddressException","as","excp",":","vollog",".","debug","(","\"Process {}: invalid address {} in layer {}\"",".","format","(","proc_id",",","excp",".","invalid_address",",","excp",".","layer_name",")",")","continue","proc_layer","=","self",".","context",".","layers","[","proc_layer_name","]","if","isinstance","(","proc_layer",",","linear",".","LinearlyMappedLayer",")",":","for","mapval","in","proc_layer",".","mapping","(","0x0",",","proc_layer",".","maximum_address",",","ignore_errors","=","True",")",":","mapped_offset",",","_",",","offset",",","mapped_size",",","maplayer","=","mapval","for","val","in","range","(","mapped_offset",",","mapped_offset","+","mapped_size",",","0x1000",")",":","cur_set","=","reverse_map",".","get","(","mapped_offset",">>","12",",","set","(",")",")","cur_set",".","add","(","(","\"Process {}\"",".","format","(","process",".","UniqueProcessId",")",",","offset",")",")","reverse_map","[","mapped_offset",">>","12","]","=","cur_set","# FIXME: make the progress for all processes, rather than per-process","self",".","_progress_callback","(","(","offset","*","100",")","\/","layer",".","maximum_address",",","\"Creating mapping for task {}\"",".","format","(","process",".","UniqueProcessId",")",")","return","reverse_map"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/strings.py#L84-L131"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/hashdump.py","language":"python","identifier":"Hashdump.sid_to_key","parameters":"(cls, sid: int)","argument_list":"","return_statement":"return cls.sidbytes_to_key(bytes(bytestr1)), cls.sidbytes_to_key(bytes(bytestr2))","docstring":"Takes rid of a user and converts it to a key to be used by the DES cipher","docstring_summary":"Takes rid of a user and converts it to a key to be used by the DES cipher","docstring_tokens":["Takes","rid","of","a","user","and","converts","it","to","a","key","to","be","used","by","the","DES","cipher"],"function":"def sid_to_key(cls, sid: int) -> Tuple[bytes, bytes]:\n \"\"\"Takes rid of a user and converts it to a key to be used by the DES cipher\"\"\"\n bytestr1 = [sid & 0xFF, (sid >> 8) & 0xFF, (sid >> 16) & 0xFF, (sid >> 24) & 0xFF]\n bytestr1 += bytestr1[0:3]\n bytestr2 = [bytestr1[3]] + bytestr1[0:3]\n bytestr2 += bytestr2[0:3]\n return cls.sidbytes_to_key(bytes(bytestr1)), cls.sidbytes_to_key(bytes(bytestr2))","function_tokens":["def","sid_to_key","(","cls",",","sid",":","int",")","->","Tuple","[","bytes",",","bytes","]",":","bytestr1","=","[","sid","&","0xFF",",","(","sid",">>","8",")","&","0xFF",",","(","sid",">>","16",")","&","0xFF",",","(","sid",">>","24",")","&","0xFF","]","bytestr1","+=","bytestr1","[","0",":","3","]","bytestr2","=","[","bytestr1","[","3","]","]","+","bytestr1","[","0",":","3","]","bytestr2","+=","bytestr2","[","0",":","3","]","return","cls",".","sidbytes_to_key","(","bytes","(","bytestr1",")",")",",","cls",".","sidbytes_to_key","(","bytes","(","bytestr2",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/hashdump.py#L191-L197"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/hashdump.py","language":"python","identifier":"Hashdump.sidbytes_to_key","parameters":"(cls, s: bytes)","argument_list":"","return_statement":"return bytes(key)","docstring":"Builds final DES key from the strings generated in sid_to_key","docstring_summary":"Builds final DES key from the strings generated in sid_to_key","docstring_tokens":["Builds","final","DES","key","from","the","strings","generated","in","sid_to_key"],"function":"def sidbytes_to_key(cls, s: bytes) -> bytes:\n \"\"\"Builds final DES key from the strings generated in sid_to_key\"\"\"\n key = []\n key.append(s[0] >> 1)\n key.append(((s[0] & 0x01) << 6) | (s[1] >> 2))\n key.append(((s[1] & 0x03) << 5) | (s[2] >> 3))\n key.append(((s[2] & 0x07) << 4) | (s[3] >> 4))\n key.append(((s[3] & 0x0F) << 3) | (s[4] >> 5))\n key.append(((s[4] & 0x1F) << 2) | (s[5] >> 6))\n key.append(((s[5] & 0x3F) << 1) | (s[6] >> 7))\n key.append(s[6] & 0x7F)\n for i in range(8):\n key[i] = (key[i] << 1)\n key[i] = cls.odd_parity[key[i]]\n return bytes(key)","function_tokens":["def","sidbytes_to_key","(","cls",",","s",":","bytes",")","->","bytes",":","key","=","[","]","key",".","append","(","s","[","0","]",">>","1",")","key",".","append","(","(","(","s","[","0","]","&","0x01",")","<<","6",")","|","(","s","[","1","]",">>","2",")",")","key",".","append","(","(","(","s","[","1","]","&","0x03",")","<<","5",")","|","(","s","[","2","]",">>","3",")",")","key",".","append","(","(","(","s","[","2","]","&","0x07",")","<<","4",")","|","(","s","[","3","]",">>","4",")",")","key",".","append","(","(","(","s","[","3","]","&","0x0F",")","<<","3",")","|","(","s","[","4","]",">>","5",")",")","key",".","append","(","(","(","s","[","4","]","&","0x1F",")","<<","2",")","|","(","s","[","5","]",">>","6",")",")","key",".","append","(","(","(","s","[","5","]","&","0x3F",")","<<","1",")","|","(","s","[","6","]",">>","7",")",")","key",".","append","(","s","[","6","]","&","0x7F",")","for","i","in","range","(","8",")",":","key","[","i","]","=","(","key","[","i","]","<<","1",")","key","[","i","]","=","cls",".","odd_parity","[","key","[","i","]","]","return","bytes","(","key",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/hashdump.py#L200-L214"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/envars.py","language":"python","identifier":"Envars._get_silent_vars","parameters":"(self)","argument_list":"","return_statement":"return values","docstring":"Enumerate persistent & common variables.\n\n This function collects the global (all users) and\n user-specific environment variables from the\n registry. Any variables in a process env block that\n does not exist in the persistent list was explicitly\n set with the SetEnvironmentVariable() API.","docstring_summary":"Enumerate persistent & common variables.","docstring_tokens":["Enumerate","persistent","&","common","variables","."],"function":"def _get_silent_vars(self) -> List[str]:\n \"\"\"Enumerate persistent & common variables.\n\n This function collects the global (all users) and\n user-specific environment variables from the\n registry. Any variables in a process env block that\n does not exist in the persistent list was explicitly\n set with the SetEnvironmentVariable() API.\n \"\"\"\n\n values = []\n\n for hive in hivelist.HiveList.list_hives(context = self.context,\n base_config_path = self.config_path,\n layer_name = self.config['primary'],\n symbol_table = self.config['nt_symbols'],\n hive_offsets = None):\n sys = False\n ntuser = False\n\n ## The global variables\n try:\n key = hive.get_key('CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment')\n sys = True\n except KeyError:\n try:\n key = hive.get_key('ControlSet001\\\\Control\\\\Session Manager\\\\Environment')\n sys = True\n except KeyError:\n pass\n if sys:\n try:\n for node in key.get_values():\n try:\n value_node_name = node.get_name()\n if value_node_name:\n values.append(value_node_name)\n except (exceptions.InvalidAddressException, registry.RegistryFormatException) as excp:\n vollog.log(\n constants.LOGLEVEL_VVV,\n \"Error while parsing global environment variables keys (some keys might be excluded)\")\n continue\n except KeyError:\n pass\n\n ## The user-specific variables\n try:\n key = hive.get_key('Environment')\n ntuser = True\n except KeyError:\n pass\n if ntuser:\n try:\n for node in key.get_values():\n try:\n value_node_name = node.get_name()\n if value_node_name:\n values.append(value_node_name)\n except (exceptions.InvalidAddressException, registry.RegistryFormatException) as excp:\n vollog.log(\n constants.LOGLEVEL_VVV,\n \"Error while parsing user environment variables keys (some keys might be excluded)\")\n continue\n except KeyError:\n pass\n\n ## The volatile user variables\n try:\n key = hive.get_key('Volatile Environment')\n except KeyError:\n continue\n try:\n for node in key.get_values():\n try:\n value_node_name = node.get_name()\n if value_node_name:\n values.append(value_node_name)\n except (exceptions.InvalidAddressException, registry.RegistryFormatException) as excp:\n vollog.log(\n constants.LOGLEVEL_VVV,\n \"Error while parsing volatile environment variables keys (some keys might be excluded)\")\n continue\n except KeyError:\n continue\n\n ## These are variables set explicitly but are\n ## common enough to ignore safely.\n values.extend([\n \"ProgramFiles\",\n \"CommonProgramFiles\",\n \"SystemDrive\",\n \"SystemRoot\",\n \"ProgramData\",\n \"PUBLIC\",\n \"ALLUSERSPROFILE\",\n \"COMPUTERNAME\",\n \"SESSIONNAME\",\n \"USERNAME\",\n \"USERPROFILE\",\n \"PROMPT\",\n \"USERDOMAIN\",\n \"AppData\",\n \"CommonFiles\",\n \"CommonDesktop\",\n \"CommonProgramGroups\",\n \"CommonStartMenu\",\n \"CommonStartUp\",\n \"Cookies\",\n \"DesktopDirectory\",\n \"Favorites\",\n \"History\",\n \"NetHood\",\n \"PersonalDocuments\",\n \"RecycleBin\",\n \"StartMenu\",\n \"Templates\",\n \"AltStartup\",\n \"CommonFavorites\",\n \"ConnectionWizard\",\n \"DocAndSettingRoot\",\n \"InternetCache\",\n \"windir\",\n \"Path\",\n \"HOMEDRIVE\",\n \"PROCESSOR_ARCHITECTURE\",\n \"NUMBER_OF_PROCESSORS\",\n \"ProgramFiles(x86)\",\n \"CommonProgramFiles(x86)\",\n \"CommonProgramW6432\",\n \"PSModulePath\",\n \"PROCESSOR_IDENTIFIER\",\n \"FP_NO_HOST_CHECK\",\n \"LOCALAPPDATA\",\n \"TMP\",\n \"ProgramW6432\",\n ])\n\n return values","function_tokens":["def","_get_silent_vars","(","self",")","->","List","[","str","]",":","values","=","[","]","for","hive","in","hivelist",".","HiveList",".","list_hives","(","context","=","self",".","context",",","base_config_path","=","self",".","config_path",",","layer_name","=","self",".","config","[","'primary'","]",",","symbol_table","=","self",".","config","[","'nt_symbols'","]",",","hive_offsets","=","None",")",":","sys","=","False","ntuser","=","False","## The global variables","try",":","key","=","hive",".","get_key","(","'CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment'",")","sys","=","True","except","KeyError",":","try",":","key","=","hive",".","get_key","(","'ControlSet001\\\\Control\\\\Session Manager\\\\Environment'",")","sys","=","True","except","KeyError",":","pass","if","sys",":","try",":","for","node","in","key",".","get_values","(",")",":","try",":","value_node_name","=","node",".","get_name","(",")","if","value_node_name",":","values",".","append","(","value_node_name",")","except","(","exceptions",".","InvalidAddressException",",","registry",".","RegistryFormatException",")","as","excp",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Error while parsing global environment variables keys (some keys might be excluded)\"",")","continue","except","KeyError",":","pass","## The user-specific variables","try",":","key","=","hive",".","get_key","(","'Environment'",")","ntuser","=","True","except","KeyError",":","pass","if","ntuser",":","try",":","for","node","in","key",".","get_values","(",")",":","try",":","value_node_name","=","node",".","get_name","(",")","if","value_node_name",":","values",".","append","(","value_node_name",")","except","(","exceptions",".","InvalidAddressException",",","registry",".","RegistryFormatException",")","as","excp",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Error while parsing user environment variables keys (some keys might be excluded)\"",")","continue","except","KeyError",":","pass","## The volatile user variables","try",":","key","=","hive",".","get_key","(","'Volatile Environment'",")","except","KeyError",":","continue","try",":","for","node","in","key",".","get_values","(",")",":","try",":","value_node_name","=","node",".","get_name","(",")","if","value_node_name",":","values",".","append","(","value_node_name",")","except","(","exceptions",".","InvalidAddressException",",","registry",".","RegistryFormatException",")","as","excp",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Error while parsing volatile environment variables keys (some keys might be excluded)\"",")","continue","except","KeyError",":","continue","## These are variables set explicitly but are","## common enough to ignore safely.","values",".","extend","(","[","\"ProgramFiles\"",",","\"CommonProgramFiles\"",",","\"SystemDrive\"",",","\"SystemRoot\"",",","\"ProgramData\"",",","\"PUBLIC\"",",","\"ALLUSERSPROFILE\"",",","\"COMPUTERNAME\"",",","\"SESSIONNAME\"",",","\"USERNAME\"",",","\"USERPROFILE\"",",","\"PROMPT\"",",","\"USERDOMAIN\"",",","\"AppData\"",",","\"CommonFiles\"",",","\"CommonDesktop\"",",","\"CommonProgramGroups\"",",","\"CommonStartMenu\"",",","\"CommonStartUp\"",",","\"Cookies\"",",","\"DesktopDirectory\"",",","\"Favorites\"",",","\"History\"",",","\"NetHood\"",",","\"PersonalDocuments\"",",","\"RecycleBin\"",",","\"StartMenu\"",",","\"Templates\"",",","\"AltStartup\"",",","\"CommonFavorites\"",",","\"ConnectionWizard\"",",","\"DocAndSettingRoot\"",",","\"InternetCache\"",",","\"windir\"",",","\"Path\"",",","\"HOMEDRIVE\"",",","\"PROCESSOR_ARCHITECTURE\"",",","\"NUMBER_OF_PROCESSORS\"",",","\"ProgramFiles(x86)\"",",","\"CommonProgramFiles(x86)\"",",","\"CommonProgramW6432\"",",","\"PSModulePath\"",",","\"PROCESSOR_IDENTIFIER\"",",","\"FP_NO_HOST_CHECK\"",",","\"LOCALAPPDATA\"",",","\"TMP\"",",","\"ProgramW6432\"",",","]",")","return","values"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/envars.py#L40-L177"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/driverscan.py","language":"python","identifier":"DriverScan.scan_drivers","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"","docstring":"Scans for drivers using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of Driver objects as found from the `layer_name` layer based on Driver pool signatures","docstring_summary":"Scans for drivers using the poolscanner module and constraints.","docstring_tokens":["Scans","for","drivers","using","the","poolscanner","module","and","constraints","."],"function":"def scan_drivers(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Scans for drivers using the poolscanner module and constraints.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of Driver objects as found from the `layer_name` layer based on Driver pool signatures\n \"\"\"\n\n constraints = poolscanner.PoolScanner.builtin_constraints(symbol_table, [b'Dri\\xf6', b'Driv'])\n\n for result in poolscanner.PoolScanner.generate_pool_scan(context, layer_name, symbol_table, constraints):\n\n _constraint, mem_object, _header = result\n yield mem_object","function_tokens":["def","scan_drivers","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","constraints","=","poolscanner",".","PoolScanner",".","builtin_constraints","(","symbol_table",",","[","b'Dri\\xf6'",",","b'Driv'","]",")","for","result","in","poolscanner",".","PoolScanner",".","generate_pool_scan","(","context",",","layer_name",",","symbol_table",",","constraints",")",":","_constraint",",","mem_object",",","_header","=","result","yield","mem_object"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/driverscan.py#L30-L51"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/userassist.py","language":"python","identifier":"UserAssist.parse_userassist_data","parameters":"(self, reg_val)","argument_list":"","return_statement":"return item","docstring":"Reads the raw data of a _CM_KEY_VALUE and returns a dict of\n userassist fields.","docstring_summary":"Reads the raw data of a _CM_KEY_VALUE and returns a dict of\n userassist fields.","docstring_tokens":["Reads","the","raw","data","of","a","_CM_KEY_VALUE","and","returns","a","dict","of","userassist","fields","."],"function":"def parse_userassist_data(self, reg_val):\n \"\"\"Reads the raw data of a _CM_KEY_VALUE and returns a dict of\n userassist fields.\"\"\"\n\n item = {\n \"id\": renderers.UnparsableValue(),\n \"count\": renderers.UnparsableValue(),\n \"focus\": renderers.UnparsableValue(),\n \"time\": renderers.UnparsableValue(),\n \"lastupdated\": renderers.UnparsableValue(),\n \"rawdata\": renderers.UnparsableValue(),\n }\n\n userassist_data = reg_val.decode_data()\n\n if userassist_data is None:\n return item\n\n item[\"rawdata\"] = userassist_data\n\n if self._win7 is None:\n # if OS is still unknown at this point, return the default item which just has the rawdata\n return item\n\n if len(userassist_data) < self._userassist_size:\n return item\n\n userassist_layer_name = self.context.layers.free_layer_name(\"userassist_buffer\")\n buffer = BufferDataLayer(self.context, self._config_path, userassist_layer_name, userassist_data)\n self.context.add_layer(buffer)\n userassist_obj = self.context.object(\n object_type = self._reg_table_name + constants.BANG + self._userassist_type_name,\n layer_name = userassist_layer_name,\n offset = 0)\n\n if self._win7:\n item[\"id\"] = renderers.NotApplicableValue()\n item[\"count\"] = int(userassist_obj.Count)\n\n seconds = (userassist_obj.FocusTime + 500) \/ 1000.0\n time = datetime.timedelta(seconds = seconds) if seconds > 0 else userassist_obj.FocusTime\n item[\"focus\"] = int(userassist_obj.FocusCount)\n item[\"time\"] = str(time)\n\n else:\n item[\"id\"] = int(userassist_obj.ID)\n item[\"count\"] = int(userassist_obj.CountStartingAtFive\n if userassist_obj.CountStartingAtFive < 5 else userassist_obj.CountStartingAtFive - 5)\n item[\"focus\"] = renderers.NotApplicableValue()\n item[\"time\"] = renderers.NotApplicableValue()\n\n item[\"lastupdated\"] = conversion.wintime_to_datetime(userassist_obj.LastUpdated.QuadPart)\n\n return item","function_tokens":["def","parse_userassist_data","(","self",",","reg_val",")",":","item","=","{","\"id\"",":","renderers",".","UnparsableValue","(",")",",","\"count\"",":","renderers",".","UnparsableValue","(",")",",","\"focus\"",":","renderers",".","UnparsableValue","(",")",",","\"time\"",":","renderers",".","UnparsableValue","(",")",",","\"lastupdated\"",":","renderers",".","UnparsableValue","(",")",",","\"rawdata\"",":","renderers",".","UnparsableValue","(",")",",","}","userassist_data","=","reg_val",".","decode_data","(",")","if","userassist_data","is","None",":","return","item","item","[","\"rawdata\"","]","=","userassist_data","if","self",".","_win7","is","None",":","# if OS is still unknown at this point, return the default item which just has the rawdata","return","item","if","len","(","userassist_data",")","<","self",".","_userassist_size",":","return","item","userassist_layer_name","=","self",".","context",".","layers",".","free_layer_name","(","\"userassist_buffer\"",")","buffer","=","BufferDataLayer","(","self",".","context",",","self",".","_config_path",",","userassist_layer_name",",","userassist_data",")","self",".","context",".","add_layer","(","buffer",")","userassist_obj","=","self",".","context",".","object","(","object_type","=","self",".","_reg_table_name","+","constants",".","BANG","+","self",".","_userassist_type_name",",","layer_name","=","userassist_layer_name",",","offset","=","0",")","if","self",".","_win7",":","item","[","\"id\"","]","=","renderers",".","NotApplicableValue","(",")","item","[","\"count\"","]","=","int","(","userassist_obj",".","Count",")","seconds","=","(","userassist_obj",".","FocusTime","+","500",")","\/","1000.0","time","=","datetime",".","timedelta","(","seconds","=","seconds",")","if","seconds",">","0","else","userassist_obj",".","FocusTime","item","[","\"focus\"","]","=","int","(","userassist_obj",".","FocusCount",")","item","[","\"time\"","]","=","str","(","time",")","else",":","item","[","\"id\"","]","=","int","(","userassist_obj",".","ID",")","item","[","\"count\"","]","=","int","(","userassist_obj",".","CountStartingAtFive","if","userassist_obj",".","CountStartingAtFive","<","5","else","userassist_obj",".","CountStartingAtFive","-","5",")","item","[","\"focus\"","]","=","renderers",".","NotApplicableValue","(",")","item","[","\"time\"","]","=","renderers",".","NotApplicableValue","(",")","item","[","\"lastupdated\"","]","=","conversion",".","wintime_to_datetime","(","userassist_obj",".","LastUpdated",".","QuadPart",")","return","item"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/userassist.py#L48-L101"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/userassist.py","language":"python","identifier":"UserAssist._determine_userassist_type","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Determine the userassist type and size depending on the OS\n version.","docstring_summary":"Determine the userassist type and size depending on the OS\n version.","docstring_tokens":["Determine","the","userassist","type","and","size","depending","on","the","OS","version","."],"function":"def _determine_userassist_type(self) -> None:\n \"\"\"Determine the userassist type and size depending on the OS\n version.\"\"\"\n\n if self._win7 is True:\n self._userassist_type_name = \"_VOL_USERASSIST_TYPES_7\"\n elif self._win7 is False:\n self._userassist_type_name = \"_VOL_USERASSIST_TYPES_XP\"\n\n self._userassist_size = self.context.symbol_space.get_type(self._reg_table_name + constants.BANG +\n self._userassist_type_name).size","function_tokens":["def","_determine_userassist_type","(","self",")","->","None",":","if","self",".","_win7","is","True",":","self",".","_userassist_type_name","=","\"_VOL_USERASSIST_TYPES_7\"","elif","self",".","_win7","is","False",":","self",".","_userassist_type_name","=","\"_VOL_USERASSIST_TYPES_XP\"","self",".","_userassist_size","=","self",".","context",".","symbol_space",".","get_type","(","self",".","_reg_table_name","+","constants",".","BANG","+","self",".","_userassist_type_name",")",".","size"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/userassist.py#L103-L113"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/userassist.py","language":"python","identifier":"UserAssist.list_userassist","parameters":"(self, hive: RegistryHive)","argument_list":"","return_statement":"","docstring":"Generate userassist data for a registry hive.","docstring_summary":"Generate userassist data for a registry hive.","docstring_tokens":["Generate","userassist","data","for","a","registry","hive","."],"function":"def list_userassist(self, hive: RegistryHive) -> Generator[Tuple[int, Tuple], None, None]:\n \"\"\"Generate userassist data for a registry hive.\"\"\"\n\n hive_name = hive.hive.cast(self.config[\"nt_symbols\"] + constants.BANG + \"_CMHIVE\").get_name()\n\n if self._win7 is None:\n try:\n self._win7 = self._win7_or_later()\n except exceptions.SymbolError:\n # self._win7 will be None and only registry value rawdata will be output\n pass\n\n self._determine_userassist_type()\n\n userassist_node_path = hive.get_key(\"software\\\\microsoft\\\\windows\\\\currentversion\\\\explorer\\\\userassist\",\n return_list = True)\n\n if not userassist_node_path:\n vollog.warning(\"list_userassist did not find a valid node_path (or None)\")\n return\n\n if not isinstance(userassist_node_path, list):\n vollog.warning(\"userassist_node_path did not return a list as expected\")\n return\n userassist_node = userassist_node_path[-1]\n # iterate through the GUIDs under the userassist key\n for guidkey in userassist_node.get_subkeys():\n # each guid key should have a Count key in it\n for countkey in guidkey.get_subkeys():\n countkey_path = countkey.get_key_path()\n countkey_last_write_time = conversion.wintime_to_datetime(countkey.LastWriteTime.QuadPart)\n\n # output the parent Count key\n result = (\n 0, (renderers.format_hints.Hex(hive.hive_offset), hive_name, countkey_path,\n countkey_last_write_time, \"Key\", renderers.NotApplicableValue(), renderers.NotApplicableValue(),\n renderers.NotApplicableValue(), renderers.NotApplicableValue(), renderers.NotApplicableValue(),\n renderers.NotApplicableValue(), renderers.NotApplicableValue())\n ) # type: Tuple[int, Tuple[format_hints.Hex, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any]]\n yield result\n\n # output any subkeys under Count\n for subkey in countkey.get_subkeys():\n\n subkey_name = subkey.get_name()\n result = (1, (\n renderers.format_hints.Hex(hive.hive_offset),\n hive_name,\n countkey_path,\n countkey_last_write_time,\n \"Subkey\",\n subkey_name,\n renderers.NotApplicableValue(),\n renderers.NotApplicableValue(),\n renderers.NotApplicableValue(),\n renderers.NotApplicableValue(),\n renderers.NotApplicableValue(),\n renderers.NotApplicableValue(),\n ))\n yield result\n\n # output any values under Count\n for value in countkey.get_values():\n\n value_name = value.get_name()\n try:\n value_name = codecs.encode(value_name, \"rot_13\")\n except UnicodeDecodeError:\n pass\n\n if self._win7:\n guid = value_name.split(\"\\\\\")[0]\n if guid in self._folder_guids:\n value_name = value_name.replace(guid, self._folder_guids[guid])\n\n userassist_data_dict = self.parse_userassist_data(value)\n result = (1, (\n renderers.format_hints.Hex(hive.hive_offset),\n hive_name,\n countkey_path,\n countkey_last_write_time,\n \"Value\",\n value_name,\n userassist_data_dict[\"id\"],\n userassist_data_dict[\"count\"],\n userassist_data_dict[\"focus\"],\n userassist_data_dict[\"time\"],\n userassist_data_dict[\"lastupdated\"],\n format_hints.HexBytes(userassist_data_dict[\"rawdata\"]),\n ))\n yield result","function_tokens":["def","list_userassist","(","self",",","hive",":","RegistryHive",")","->","Generator","[","Tuple","[","int",",","Tuple","]",",","None",",","None","]",":","hive_name","=","hive",".","hive",".","cast","(","self",".","config","[","\"nt_symbols\"","]","+","constants",".","BANG","+","\"_CMHIVE\"",")",".","get_name","(",")","if","self",".","_win7","is","None",":","try",":","self",".","_win7","=","self",".","_win7_or_later","(",")","except","exceptions",".","SymbolError",":","# self._win7 will be None and only registry value rawdata will be output","pass","self",".","_determine_userassist_type","(",")","userassist_node_path","=","hive",".","get_key","(","\"software\\\\microsoft\\\\windows\\\\currentversion\\\\explorer\\\\userassist\"",",","return_list","=","True",")","if","not","userassist_node_path",":","vollog",".","warning","(","\"list_userassist did not find a valid node_path (or None)\"",")","return","if","not","isinstance","(","userassist_node_path",",","list",")",":","vollog",".","warning","(","\"userassist_node_path did not return a list as expected\"",")","return","userassist_node","=","userassist_node_path","[","-","1","]","# iterate through the GUIDs under the userassist key","for","guidkey","in","userassist_node",".","get_subkeys","(",")",":","# each guid key should have a Count key in it","for","countkey","in","guidkey",".","get_subkeys","(",")",":","countkey_path","=","countkey",".","get_key_path","(",")","countkey_last_write_time","=","conversion",".","wintime_to_datetime","(","countkey",".","LastWriteTime",".","QuadPart",")","# output the parent Count key","result","=","(","0",",","(","renderers",".","format_hints",".","Hex","(","hive",".","hive_offset",")",",","hive_name",",","countkey_path",",","countkey_last_write_time",",","\"Key\"",",","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",")",")","# type: Tuple[int, Tuple[format_hints.Hex, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any]]","yield","result","# output any subkeys under Count","for","subkey","in","countkey",".","get_subkeys","(",")",":","subkey_name","=","subkey",".","get_name","(",")","result","=","(","1",",","(","renderers",".","format_hints",".","Hex","(","hive",".","hive_offset",")",",","hive_name",",","countkey_path",",","countkey_last_write_time",",","\"Subkey\"",",","subkey_name",",","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",",","renderers",".","NotApplicableValue","(",")",",",")",")","yield","result","# output any values under Count","for","value","in","countkey",".","get_values","(",")",":","value_name","=","value",".","get_name","(",")","try",":","value_name","=","codecs",".","encode","(","value_name",",","\"rot_13\"",")","except","UnicodeDecodeError",":","pass","if","self",".","_win7",":","guid","=","value_name",".","split","(","\"\\\\\"",")","[","0","]","if","guid","in","self",".","_folder_guids",":","value_name","=","value_name",".","replace","(","guid",",","self",".","_folder_guids","[","guid","]",")","userassist_data_dict","=","self",".","parse_userassist_data","(","value",")","result","=","(","1",",","(","renderers",".","format_hints",".","Hex","(","hive",".","hive_offset",")",",","hive_name",",","countkey_path",",","countkey_last_write_time",",","\"Value\"",",","value_name",",","userassist_data_dict","[","\"id\"","]",",","userassist_data_dict","[","\"count\"","]",",","userassist_data_dict","[","\"focus\"","]",",","userassist_data_dict","[","\"time\"","]",",","userassist_data_dict","[","\"lastupdated\"","]",",","format_hints",".","HexBytes","(","userassist_data_dict","[","\"rawdata\"","]",")",",",")",")","yield","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/userassist.py#L121-L211"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/printkey.py","language":"python","identifier":"PrintKey.key_iterator","parameters":"(\n cls,\n hive: RegistryHive,\n node_path: Sequence[objects.StructType] = None,\n recurse: bool = False\n )","argument_list":"","return_statement":"","docstring":"Walks through a set of nodes from a given node (last one in\n node_path). Avoids loops by not traversing into nodes already present\n in the node_path.\n\n Args:\n hive: The registry hive to walk\n node_path: The list of nodes that make up the\n recurse: Traverse down the node tree or stay only on the same level\n\n Yields:\n A tuple of results (depth, is_key, last write time, path, volatile, and the node).","docstring_summary":"Walks through a set of nodes from a given node (last one in\n node_path). Avoids loops by not traversing into nodes already present\n in the node_path.","docstring_tokens":["Walks","through","a","set","of","nodes","from","a","given","node","(","last","one","in","node_path",")",".","Avoids","loops","by","not","traversing","into","nodes","already","present","in","the","node_path","."],"function":"def key_iterator(\n cls,\n hive: RegistryHive,\n node_path: Sequence[objects.StructType] = None,\n recurse: bool = False\n ) -> Iterable[Tuple[int, bool, datetime.datetime, str, bool, interfaces.objects.ObjectInterface]]:\n \"\"\"Walks through a set of nodes from a given node (last one in\n node_path). Avoids loops by not traversing into nodes already present\n in the node_path.\n\n Args:\n hive: The registry hive to walk\n node_path: The list of nodes that make up the\n recurse: Traverse down the node tree or stay only on the same level\n\n Yields:\n A tuple of results (depth, is_key, last write time, path, volatile, and the node).\n \"\"\"\n if not node_path:\n node_path = [hive.get_node(hive.root_cell_offset)]\n if not isinstance(node_path, list) or len(node_path) < 1:\n vollog.warning(\"Hive walker was not passed a valid node_path (or None)\")\n return\n node = node_path[-1]\n key_path_items = [hive] + node_path[1:]\n key_path = '\\\\'.join([k.get_name() for k in key_path_items])\n if node.vol.type_name.endswith(constants.BANG + '_CELL_DATA'):\n raise RegistryFormatException(hive.name, \"Encountered _CELL_DATA instead of _CM_KEY_NODE\")\n last_write_time = conversion.wintime_to_datetime(node.LastWriteTime.QuadPart)\n\n for key_node in node.get_subkeys():\n result = (len(node_path), True, last_write_time, key_path, key_node.get_volatile(), key_node)\n yield result\n\n if recurse:\n if key_node.vol.offset not in [x.vol.offset for x in node_path]:\n try:\n key_node.get_name()\n except exceptions.InvalidAddressException as excp:\n vollog.debug(excp)\n continue\n\n yield from cls.key_iterator(hive, node_path + [key_node], recurse = recurse)\n\n for value_node in node.get_values():\n result = (len(node_path), False, last_write_time, key_path, node.get_volatile(), value_node)\n yield result","function_tokens":["def","key_iterator","(","cls",",","hive",":","RegistryHive",",","node_path",":","Sequence","[","objects",".","StructType","]","=","None",",","recurse",":","bool","=","False",")","->","Iterable","[","Tuple","[","int",",","bool",",","datetime",".","datetime",",","str",",","bool",",","interfaces",".","objects",".","ObjectInterface","]","]",":","if","not","node_path",":","node_path","=","[","hive",".","get_node","(","hive",".","root_cell_offset",")","]","if","not","isinstance","(","node_path",",","list",")","or","len","(","node_path",")","<","1",":","vollog",".","warning","(","\"Hive walker was not passed a valid node_path (or None)\"",")","return","node","=","node_path","[","-","1","]","key_path_items","=","[","hive","]","+","node_path","[","1",":","]","key_path","=","'\\\\'",".","join","(","[","k",".","get_name","(",")","for","k","in","key_path_items","]",")","if","node",".","vol",".","type_name",".","endswith","(","constants",".","BANG","+","'_CELL_DATA'",")",":","raise","RegistryFormatException","(","hive",".","name",",","\"Encountered _CELL_DATA instead of _CM_KEY_NODE\"",")","last_write_time","=","conversion",".","wintime_to_datetime","(","node",".","LastWriteTime",".","QuadPart",")","for","key_node","in","node",".","get_subkeys","(",")",":","result","=","(","len","(","node_path",")",",","True",",","last_write_time",",","key_path",",","key_node",".","get_volatile","(",")",",","key_node",")","yield","result","if","recurse",":","if","key_node",".","vol",".","offset","not","in","[","x",".","vol",".","offset","for","x","in","node_path","]",":","try",":","key_node",".","get_name","(",")","except","exceptions",".","InvalidAddressException","as","excp",":","vollog",".","debug","(","excp",")","continue","yield","from","cls",".","key_iterator","(","hive",",","node_path","+","[","key_node","]",",","recurse","=","recurse",")","for","value_node","in","node",".","get_values","(",")",":","result","=","(","len","(","node_path",")",",","False",",","last_write_time",",","key_path",",","node",".","get_volatile","(",")",",","value_node",")","yield","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/printkey.py#L45-L91"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/printkey.py","language":"python","identifier":"PrintKey._printkey_iterator","parameters":"(self,\n hive: RegistryHive,\n node_path: Sequence[objects.StructType] = None,\n recurse: bool = False)","argument_list":"","return_statement":"","docstring":"Method that wraps the more generic key_iterator, to provide output\n for printkey specifically.\n\n Args:\n hive: The registry hive to walk\n node_path: The list of nodes that make up the\n recurse: Traverse down the node tree or stay only on the same level\n\n Yields:\n The depth, and a tuple of results (last write time, hive offset, type, path, name, data and volatile)","docstring_summary":"Method that wraps the more generic key_iterator, to provide output\n for printkey specifically.","docstring_tokens":["Method","that","wraps","the","more","generic","key_iterator","to","provide","output","for","printkey","specifically","."],"function":"def _printkey_iterator(self,\n hive: RegistryHive,\n node_path: Sequence[objects.StructType] = None,\n recurse: bool = False):\n \"\"\"Method that wraps the more generic key_iterator, to provide output\n for printkey specifically.\n\n Args:\n hive: The registry hive to walk\n node_path: The list of nodes that make up the\n recurse: Traverse down the node tree or stay only on the same level\n\n Yields:\n The depth, and a tuple of results (last write time, hive offset, type, path, name, data and volatile)\n \"\"\"\n for depth, is_key, last_write_time, key_path, volatile, node in self.key_iterator(hive, node_path, recurse):\n if is_key:\n try:\n key_node_name = node.get_name()\n except (exceptions.InvalidAddressException, RegistryFormatException) as excp:\n vollog.debug(excp)\n key_node_name = renderers.UnreadableValue()\n\n yield (depth, (last_write_time, renderers.format_hints.Hex(hive.hive_offset), \"Key\", key_path,\n key_node_name, renderers.NotApplicableValue(), volatile))\n else:\n try:\n value_node_name = node.get_name() or \"(Default)\"\n except (exceptions.InvalidAddressException, RegistryFormatException) as excp:\n vollog.debug(excp)\n value_node_name = renderers.UnreadableValue()\n\n try:\n value_type = RegValueTypes.get(node.Type).name\n except (exceptions.InvalidAddressException, RegistryFormatException) as excp:\n vollog.debug(excp)\n value_type = renderers.UnreadableValue()\n\n if isinstance(value_type, renderers.UnreadableValue):\n vollog.debug(\"Couldn't read registry value type, so data is unreadable\")\n value_data = renderers.UnreadableValue() # type: Union[interfaces.renderers.BaseAbsentValue, bytes]\n else:\n try:\n value_data = node.decode_data()\n\n if isinstance(value_data, int):\n value_data = format_hints.MultiTypeData(value_data, encoding = 'utf-8')\n elif RegValueTypes.get(node.Type) == RegValueTypes.REG_BINARY:\n value_data = format_hints.MultiTypeData(value_data, show_hex = True)\n elif RegValueTypes.get(node.Type) == RegValueTypes.REG_MULTI_SZ:\n value_data = format_hints.MultiTypeData(value_data,\n encoding = 'utf-16-le',\n split_nulls = True)\n else:\n value_data = format_hints.MultiTypeData(value_data, encoding = 'utf-16-le')\n except (ValueError, exceptions.InvalidAddressException, RegistryFormatException) as excp:\n vollog.debug(excp)\n value_data = renderers.UnreadableValue()\n\n result = (depth, (last_write_time, renderers.format_hints.Hex(hive.hive_offset), value_type, key_path,\n value_node_name, value_data, volatile))\n yield result","function_tokens":["def","_printkey_iterator","(","self",",","hive",":","RegistryHive",",","node_path",":","Sequence","[","objects",".","StructType","]","=","None",",","recurse",":","bool","=","False",")",":","for","depth",",","is_key",",","last_write_time",",","key_path",",","volatile",",","node","in","self",".","key_iterator","(","hive",",","node_path",",","recurse",")",":","if","is_key",":","try",":","key_node_name","=","node",".","get_name","(",")","except","(","exceptions",".","InvalidAddressException",",","RegistryFormatException",")","as","excp",":","vollog",".","debug","(","excp",")","key_node_name","=","renderers",".","UnreadableValue","(",")","yield","(","depth",",","(","last_write_time",",","renderers",".","format_hints",".","Hex","(","hive",".","hive_offset",")",",","\"Key\"",",","key_path",",","key_node_name",",","renderers",".","NotApplicableValue","(",")",",","volatile",")",")","else",":","try",":","value_node_name","=","node",".","get_name","(",")","or","\"(Default)\"","except","(","exceptions",".","InvalidAddressException",",","RegistryFormatException",")","as","excp",":","vollog",".","debug","(","excp",")","value_node_name","=","renderers",".","UnreadableValue","(",")","try",":","value_type","=","RegValueTypes",".","get","(","node",".","Type",")",".","name","except","(","exceptions",".","InvalidAddressException",",","RegistryFormatException",")","as","excp",":","vollog",".","debug","(","excp",")","value_type","=","renderers",".","UnreadableValue","(",")","if","isinstance","(","value_type",",","renderers",".","UnreadableValue",")",":","vollog",".","debug","(","\"Couldn't read registry value type, so data is unreadable\"",")","value_data","=","renderers",".","UnreadableValue","(",")","# type: Union[interfaces.renderers.BaseAbsentValue, bytes]","else",":","try",":","value_data","=","node",".","decode_data","(",")","if","isinstance","(","value_data",",","int",")",":","value_data","=","format_hints",".","MultiTypeData","(","value_data",",","encoding","=","'utf-8'",")","elif","RegValueTypes",".","get","(","node",".","Type",")","==","RegValueTypes",".","REG_BINARY",":","value_data","=","format_hints",".","MultiTypeData","(","value_data",",","show_hex","=","True",")","elif","RegValueTypes",".","get","(","node",".","Type",")","==","RegValueTypes",".","REG_MULTI_SZ",":","value_data","=","format_hints",".","MultiTypeData","(","value_data",",","encoding","=","'utf-16-le'",",","split_nulls","=","True",")","else",":","value_data","=","format_hints",".","MultiTypeData","(","value_data",",","encoding","=","'utf-16-le'",")","except","(","ValueError",",","exceptions",".","InvalidAddressException",",","RegistryFormatException",")","as","excp",":","vollog",".","debug","(","excp",")","value_data","=","renderers",".","UnreadableValue","(",")","result","=","(","depth",",","(","last_write_time",",","renderers",".","format_hints",".","Hex","(","hive",".","hive_offset",")",",","value_type",",","key_path",",","value_node_name",",","value_data",",","volatile",")",")","yield","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/printkey.py#L93-L154"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/hivescan.py","language":"python","identifier":"HiveScan.scan_hives","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str)","argument_list":"","return_statement":"","docstring":"Scans for hives using the poolscanner module and constraints or bigpools module with tag.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of Hive objects as found from the `layer_name` layer based on Hive pool signatures","docstring_summary":"Scans for hives using the poolscanner module and constraints or bigpools module with tag.","docstring_tokens":["Scans","for","hives","using","the","poolscanner","module","and","constraints","or","bigpools","module","with","tag","."],"function":"def scan_hives(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Scans for hives using the poolscanner module and constraints or bigpools module with tag.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n\n Returns:\n A list of Hive objects as found from the `layer_name` layer based on Hive pool signatures\n \"\"\"\n\n is_64bit = symbols.symbol_table_is_64bit(context, symbol_table)\n is_windows_8_1_or_later = versions.is_windows_8_1_or_later(context = context, symbol_table = symbol_table)\n\n if is_windows_8_1_or_later and is_64bit:\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n\n for pool in bigpools.BigPools.list_big_pools(context,\n layer_name = layer_name,\n symbol_table = symbol_table,\n tags = [\"CM10\"]):\n cmhive = ntkrnlmp.object(object_type = \"_CMHIVE\", offset = pool.Va, absolute = True)\n yield cmhive\n\n else:\n constraints = poolscanner.PoolScanner.builtin_constraints(symbol_table, [b'CM10'])\n\n for result in poolscanner.PoolScanner.generate_pool_scan(context, layer_name, symbol_table, constraints):\n _constraint, mem_object, _header = result\n yield mem_object","function_tokens":["def","scan_hives","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","is_64bit","=","symbols",".","symbol_table_is_64bit","(","context",",","symbol_table",")","is_windows_8_1_or_later","=","versions",".","is_windows_8_1_or_later","(","context","=","context",",","symbol_table","=","symbol_table",")","if","is_windows_8_1_or_later","and","is_64bit",":","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","for","pool","in","bigpools",".","BigPools",".","list_big_pools","(","context",",","layer_name","=","layer_name",",","symbol_table","=","symbol_table",",","tags","=","[","\"CM10\"","]",")",":","cmhive","=","ntkrnlmp",".","object","(","object_type","=","\"_CMHIVE\"",",","offset","=","pool",".","Va",",","absolute","=","True",")","yield","cmhive","else",":","constraints","=","poolscanner",".","PoolScanner",".","builtin_constraints","(","symbol_table",",","[","b'CM10'","]",")","for","result","in","poolscanner",".","PoolScanner",".","generate_pool_scan","(","context",",","layer_name",",","symbol_table",",","constraints",")",":","_constraint",",","mem_object",",","_header","=","result","yield","mem_object"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/hivescan.py#L33-L68"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/hivelist.py","language":"python","identifier":"HiveList.list_hives","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n base_config_path: str,\n layer_name: str,\n symbol_table: str,\n filter_string: Optional[str] = None,\n hive_offsets: List[int] = None)","argument_list":"","return_statement":"","docstring":"Walks through a registry, hive by hive returning the constructed\n registry layer name.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n base_config_path: The configuration path for any settings required by the new table\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n filter_string: An optional string which must be present in the hive name if specified\n offset: An optional offset to specify a specific hive to iterate over (takes precedence over filter_string)\n\n Yields:\n A registry hive layer name","docstring_summary":"Walks through a registry, hive by hive returning the constructed\n registry layer name.","docstring_tokens":["Walks","through","a","registry","hive","by","hive","returning","the","constructed","registry","layer","name","."],"function":"def list_hives(cls,\n context: interfaces.context.ContextInterface,\n base_config_path: str,\n layer_name: str,\n symbol_table: str,\n filter_string: Optional[str] = None,\n hive_offsets: List[int] = None) -> Iterable[registry.RegistryHive]:\n \"\"\"Walks through a registry, hive by hive returning the constructed\n registry layer name.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n base_config_path: The configuration path for any settings required by the new table\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n filter_string: An optional string which must be present in the hive name if specified\n offset: An optional offset to specify a specific hive to iterate over (takes precedence over filter_string)\n\n Yields:\n A registry hive layer name\n \"\"\"\n if hive_offsets is None:\n try:\n hive_offsets = [\n hive.vol.offset for hive in cls.list_hive_objects(context, layer_name, symbol_table, filter_string)\n ]\n except ImportError:\n vollog.warning(\"Unable to import windows.hivelist plugin, please provide a hive offset\")\n raise ValueError(\"Unable to import windows.hivelist plugin, please provide a hive offset\")\n\n for hive_offset in hive_offsets:\n # Construct the hive\n reg_config_path = cls.make_subconfig(context = context,\n base_config_path = base_config_path,\n hive_offset = hive_offset,\n base_layer = layer_name,\n nt_symbols = symbol_table)\n\n try:\n hive = registry.RegistryHive(context, reg_config_path, name = 'hive' + hex(hive_offset))\n except exceptions.InvalidAddressException:\n vollog.warning(\"Couldn't create RegistryHive layer at offset {}, skipping\".format(hex(hive_offset)))\n continue\n context.layers.add_layer(hive)\n yield hive","function_tokens":["def","list_hives","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","base_config_path",":","str",",","layer_name",":","str",",","symbol_table",":","str",",","filter_string",":","Optional","[","str","]","=","None",",","hive_offsets",":","List","[","int","]","=","None",")","->","Iterable","[","registry",".","RegistryHive","]",":","if","hive_offsets","is","None",":","try",":","hive_offsets","=","[","hive",".","vol",".","offset","for","hive","in","cls",".","list_hive_objects","(","context",",","layer_name",",","symbol_table",",","filter_string",")","]","except","ImportError",":","vollog",".","warning","(","\"Unable to import windows.hivelist plugin, please provide a hive offset\"",")","raise","ValueError","(","\"Unable to import windows.hivelist plugin, please provide a hive offset\"",")","for","hive_offset","in","hive_offsets",":","# Construct the hive","reg_config_path","=","cls",".","make_subconfig","(","context","=","context",",","base_config_path","=","base_config_path",",","hive_offset","=","hive_offset",",","base_layer","=","layer_name",",","nt_symbols","=","symbol_table",")","try",":","hive","=","registry",".","RegistryHive","(","context",",","reg_config_path",",","name","=","'hive'","+","hex","(","hive_offset",")",")","except","exceptions",".","InvalidAddressException",":","vollog",".","warning","(","\"Couldn't create RegistryHive layer at offset {}, skipping\"",".","format","(","hex","(","hive_offset",")",")",")","continue","context",".","layers",".","add_layer","(","hive",")","yield","hive"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/hivelist.py#L105-L149"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/hivelist.py","language":"python","identifier":"HiveList.list_hive_objects","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n filter_string: str = None)","argument_list":"","return_statement":"","docstring":"Lists all the hives in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n filter_string: A string which must be present in the hive name if specified\n\n Returns:\n The list of registry hives from the `layer_name` layer as filtered against using the `filter_string`","docstring_summary":"Lists all the hives in the primary layer.","docstring_tokens":["Lists","all","the","hives","in","the","primary","layer","."],"function":"def list_hive_objects(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n symbol_table: str,\n filter_string: str = None) -> Iterator[interfaces.objects.ObjectInterface]:\n \"\"\"Lists all the hives in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n symbol_table: The name of the table containing the kernel symbols\n filter_string: A string which must be present in the hive name if specified\n\n Returns:\n The list of registry hives from the `layer_name` layer as filtered against using the `filter_string`\n \"\"\"\n\n # We only use the object factory to demonstrate how to use one\n kvo = context.layers[layer_name].config['kernel_virtual_offset']\n ntkrnlmp = context.module(symbol_table, layer_name = layer_name, offset = kvo)\n\n list_head = ntkrnlmp.get_symbol(\"CmpHiveListHead\").address\n list_entry = ntkrnlmp.object(object_type = \"_LIST_ENTRY\", offset = list_head)\n reloff = ntkrnlmp.get_type(\"_CMHIVE\").relative_child_offset(\"HiveList\")\n cmhive = ntkrnlmp.object(object_type = \"_CMHIVE\", offset = list_entry.vol.offset - reloff, absolute = True)\n\n # Run through the list forwards\n seen = set()\n\n hg = HiveGenerator(cmhive, forward = True)\n for hive in hg:\n if hive.vol.offset in seen:\n vollog.debug(\"Hivelist found an already seen offset {} while \" \\\n \"traversing forwards, this should not occur\".format(hex(hive.vol.offset)))\n break\n seen.add(hive.vol.offset)\n if filter_string is None or filter_string.lower() in str(hive.get_name() or \"\").lower():\n if context.layers[layer_name].is_valid(hive.vol.offset):\n yield hive\n\n forward_invalid = hg.invalid\n if forward_invalid:\n vollog.debug(\"Hivelist failed traversing the list forwards at {}, traversing backwards\".format(\n hex(forward_invalid)))\n hg = HiveGenerator(cmhive, forward = False)\n for hive in hg:\n if hive.vol.offset in seen:\n vollog.debug(\"Hivelist found an already seen offset {} while \" \\\n \"traversing backwards, list walking met in the middle\".format(hex(hive.vol.offset)))\n break\n seen.add(hive.vol.offset)\n if filter_string is None or filter_string.lower() in str(hive.get_name() or \"\").lower():\n if context.layers[layer_name].is_valid(hive.vol.offset):\n yield hive\n\n backward_invalid = hg.invalid\n\n if backward_invalid and forward_invalid != backward_invalid:\n # walking forward and backward did not stop at the same offset. they should if:\n # 1) there are no invalid hives, walking forwards would reach the end and backwards is not necessary\n # 2) there is one invalid hive, walking backwards would stop at the same place as forwards\n # therefore, there must be more 2 or more invalid hives, so the middle of the list is not reachable\n # by walking the list, so revert to scanning, and walk the list forwards and backwards from each\n # found hive\n vollog.debug(\"Hivelist failed traversing backwards at {}, a different \" \\\n \"location from forwards, revert to scanning\".format(hex(backward_invalid)))\n for hive in hivescan.HiveScan.scan_hives(context, layer_name, symbol_table):\n try:\n if hive.HiveList.Flink:\n start_hive_offset = hive.HiveList.Flink - reloff\n\n ## Now instantiate the first hive in virtual address space as normal\n start_hive = ntkrnlmp.object(object_type = \"_CMHIVE\",\n offset = start_hive_offset,\n absolute = True)\n for forward in (True, False):\n for linked_hive in start_hive.HiveList.to_list(hive.vol.type_name, \"HiveList\", forward):\n if not linked_hive.is_valid() or linked_hive.vol.offset in seen:\n continue\n seen.add(linked_hive.vol.offset)\n if filter_string is None or filter_string.lower() in str(linked_hive.get_name()\n or \"\").lower():\n if context.layers[layer_name].is_valid(linked_hive.vol.offset):\n yield linked_hive\n except exceptions.InvalidAddressException:\n vollog.debug(\"InvalidAddressException when traversing hive {} found from scan, skipping\".format(\n hex(hive.vol.offset)))","function_tokens":["def","list_hive_objects","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","symbol_table",":","str",",","filter_string",":","str","=","None",")","->","Iterator","[","interfaces",".","objects",".","ObjectInterface","]",":","# We only use the object factory to demonstrate how to use one","kvo","=","context",".","layers","[","layer_name","]",".","config","[","'kernel_virtual_offset'","]","ntkrnlmp","=","context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","list_head","=","ntkrnlmp",".","get_symbol","(","\"CmpHiveListHead\"",")",".","address","list_entry","=","ntkrnlmp",".","object","(","object_type","=","\"_LIST_ENTRY\"",",","offset","=","list_head",")","reloff","=","ntkrnlmp",".","get_type","(","\"_CMHIVE\"",")",".","relative_child_offset","(","\"HiveList\"",")","cmhive","=","ntkrnlmp",".","object","(","object_type","=","\"_CMHIVE\"",",","offset","=","list_entry",".","vol",".","offset","-","reloff",",","absolute","=","True",")","# Run through the list forwards","seen","=","set","(",")","hg","=","HiveGenerator","(","cmhive",",","forward","=","True",")","for","hive","in","hg",":","if","hive",".","vol",".","offset","in","seen",":","vollog",".","debug","(","\"Hivelist found an already seen offset {} while \"","\"traversing forwards, this should not occur\"",".","format","(","hex","(","hive",".","vol",".","offset",")",")",")","break","seen",".","add","(","hive",".","vol",".","offset",")","if","filter_string","is","None","or","filter_string",".","lower","(",")","in","str","(","hive",".","get_name","(",")","or","\"\"",")",".","lower","(",")",":","if","context",".","layers","[","layer_name","]",".","is_valid","(","hive",".","vol",".","offset",")",":","yield","hive","forward_invalid","=","hg",".","invalid","if","forward_invalid",":","vollog",".","debug","(","\"Hivelist failed traversing the list forwards at {}, traversing backwards\"",".","format","(","hex","(","forward_invalid",")",")",")","hg","=","HiveGenerator","(","cmhive",",","forward","=","False",")","for","hive","in","hg",":","if","hive",".","vol",".","offset","in","seen",":","vollog",".","debug","(","\"Hivelist found an already seen offset {} while \"","\"traversing backwards, list walking met in the middle\"",".","format","(","hex","(","hive",".","vol",".","offset",")",")",")","break","seen",".","add","(","hive",".","vol",".","offset",")","if","filter_string","is","None","or","filter_string",".","lower","(",")","in","str","(","hive",".","get_name","(",")","or","\"\"",")",".","lower","(",")",":","if","context",".","layers","[","layer_name","]",".","is_valid","(","hive",".","vol",".","offset",")",":","yield","hive","backward_invalid","=","hg",".","invalid","if","backward_invalid","and","forward_invalid","!=","backward_invalid",":","# walking forward and backward did not stop at the same offset. they should if:","# 1) there are no invalid hives, walking forwards would reach the end and backwards is not necessary","# 2) there is one invalid hive, walking backwards would stop at the same place as forwards","# therefore, there must be more 2 or more invalid hives, so the middle of the list is not reachable","# by walking the list, so revert to scanning, and walk the list forwards and backwards from each","# found hive","vollog",".","debug","(","\"Hivelist failed traversing backwards at {}, a different \"","\"location from forwards, revert to scanning\"",".","format","(","hex","(","backward_invalid",")",")",")","for","hive","in","hivescan",".","HiveScan",".","scan_hives","(","context",",","layer_name",",","symbol_table",")",":","try",":","if","hive",".","HiveList",".","Flink",":","start_hive_offset","=","hive",".","HiveList",".","Flink","-","reloff","## Now instantiate the first hive in virtual address space as normal","start_hive","=","ntkrnlmp",".","object","(","object_type","=","\"_CMHIVE\"",",","offset","=","start_hive_offset",",","absolute","=","True",")","for","forward","in","(","True",",","False",")",":","for","linked_hive","in","start_hive",".","HiveList",".","to_list","(","hive",".","vol",".","type_name",",","\"HiveList\"",",","forward",")",":","if","not","linked_hive",".","is_valid","(",")","or","linked_hive",".","vol",".","offset","in","seen",":","continue","seen",".","add","(","linked_hive",".","vol",".","offset",")","if","filter_string","is","None","or","filter_string",".","lower","(",")","in","str","(","linked_hive",".","get_name","(",")","or","\"\"",")",".","lower","(",")",":","if","context",".","layers","[","layer_name","]",".","is_valid","(","linked_hive",".","vol",".","offset",")",":","yield","linked_hive","except","exceptions",".","InvalidAddressException",":","vollog",".","debug","(","\"InvalidAddressException when traversing hive {} found from scan, skipping\"",".","format","(","hex","(","hive",".","vol",".","offset",")",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/windows\/registry\/hivelist.py#L152-L238"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/netstat.py","language":"python","identifier":"Netstat.list_sockets","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Returns the open socket descriptors of a process\n\n Return values:\n A tuple of 3 elements:\n 1) The name of the process that opened the socket\n 2) The process ID of the processed that opened the socket\n 3) The address of the associated socket structure","docstring_summary":"Returns the open socket descriptors of a process","docstring_tokens":["Returns","the","open","socket","descriptors","of","a","process"],"function":"def list_sockets(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False) -> \\\n Iterable[Tuple[interfaces.objects.ObjectInterface,\n interfaces.objects.ObjectInterface,\n interfaces.objects.ObjectInterface]]:\n \"\"\"\n Returns the open socket descriptors of a process\n\n Return values:\n A tuple of 3 elements:\n 1) The name of the process that opened the socket\n 2) The process ID of the processed that opened the socket\n 3) The address of the associated socket structure\n \"\"\"\n # This is hardcoded, since a change in the default method would change the expected results\n list_tasks = pslist.PsList.get_list_tasks(pslist.PsList.pslist_methods[0])\n for task in list_tasks(context, layer_name, darwin_symbols, filter_func):\n\n task_name = utility.array_to_string(task.p_comm)\n pid = task.p_pid\n\n for filp, _, _ in mac.MacUtilities.files_descriptors_for_process(context, darwin_symbols, task):\n try:\n ftype = filp.f_fglob.get_fg_type()\n except exceptions.InvalidAddressException:\n continue\n\n if ftype != 'SOCKET':\n continue\n\n try:\n socket = filp.f_fglob.fg_data.dereference().cast(\"socket\")\n except exceptions.InvalidAddressException:\n continue\n\n yield task_name, pid, socket","function_tokens":["def","list_sockets","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","darwin_symbols",":","str",",","filter_func",":","Callable","[","[","int","]",",","bool","]","=","lambda","_",":","False",")","->","Iterable","[","Tuple","[","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","ObjectInterface","]","]",":","# This is hardcoded, since a change in the default method would change the expected results","list_tasks","=","pslist",".","PsList",".","get_list_tasks","(","pslist",".","PsList",".","pslist_methods","[","0","]",")","for","task","in","list_tasks","(","context",",","layer_name",",","darwin_symbols",",","filter_func",")",":","task_name","=","utility",".","array_to_string","(","task",".","p_comm",")","pid","=","task",".","p_pid","for","filp",",","_",",","_","in","mac",".","MacUtilities",".","files_descriptors_for_process","(","context",",","darwin_symbols",",","task",")",":","try",":","ftype","=","filp",".","f_fglob",".","get_fg_type","(",")","except","exceptions",".","InvalidAddressException",":","continue","if","ftype","!=","'SOCKET'",":","continue","try",":","socket","=","filp",".","f_fglob",".","fg_data",".","dereference","(",")",".","cast","(","\"socket\"",")","except","exceptions",".","InvalidAddressException",":","continue","yield","task_name",",","pid",",","socket"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/netstat.py#L40-L78"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/kauth_scopes.py","language":"python","identifier":"Kauth_scopes.list_kauth_scopes","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Enumerates the registered kauth scopes and yields each object\n Uses smear-safe enumeration API","docstring_summary":"Enumerates the registered kauth scopes and yields each object\n Uses smear-safe enumeration API","docstring_tokens":["Enumerates","the","registered","kauth","scopes","and","yields","each","object","Uses","smear","-","safe","enumeration","API"],"function":"def list_kauth_scopes(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False) -> \\\n Iterable[Tuple[interfaces.objects.ObjectInterface,\n interfaces.objects.ObjectInterface,\n interfaces.objects.ObjectInterface]]:\n \"\"\"\n Enumerates the registered kauth scopes and yields each object\n Uses smear-safe enumeration API\n \"\"\"\n\n kernel = contexts.Module(context, darwin_symbols, layer_name, 0)\n\n scopes = kernel.object_from_symbol(\"kauth_scopes\")\n\n for scope in mac.MacUtilities.walk_tailq(scopes, \"ks_link\"):\n yield scope","function_tokens":["def","list_kauth_scopes","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","darwin_symbols",":","str",",","filter_func",":","Callable","[","[","int","]",",","bool","]","=","lambda","_",":","False",")","->","Iterable","[","Tuple","[","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","ObjectInterface","]","]",":","kernel","=","contexts",".","Module","(","context",",","darwin_symbols",",","layer_name",",","0",")","scopes","=","kernel",".","object_from_symbol","(","\"kauth_scopes\"",")","for","scope","in","mac",".","MacUtilities",".","walk_tailq","(","scopes",",","\"ks_link\"",")",":","yield","scope"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/kauth_scopes.py#L33-L51"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/kevents.py","language":"python","identifier":"Kevents._walk_klist_array","parameters":"(cls, kernel, fdp, array_pointer_member, array_size_member)","argument_list":"","return_statement":"","docstring":"Convience wrapper for walking an array of lists of kernel events\n Handles invalid address references","docstring_summary":"Convience wrapper for walking an array of lists of kernel events\n Handles invalid address references","docstring_tokens":["Convience","wrapper","for","walking","an","array","of","lists","of","kernel","events","Handles","invalid","address","references"],"function":"def _walk_klist_array(cls, kernel, fdp, array_pointer_member, array_size_member):\n \"\"\"\n Convience wrapper for walking an array of lists of kernel events\n Handles invalid address references\n \"\"\"\n try:\n klist_array_pointer = getattr(fdp, array_pointer_member)\n array_size = getattr(fdp, array_size_member)\n\n klist_array = kernel.object(object_type = \"array\",\n offset = klist_array_pointer,\n count = array_size + 1,\n subtype = kernel.get_type(\"klist\"))\n\n except exceptions.InvalidAddressException:\n return\n\n for klist in klist_array:\n for kn in mac.MacUtilities.walk_slist(klist, \"kn_link\"):\n yield kn","function_tokens":["def","_walk_klist_array","(","cls",",","kernel",",","fdp",",","array_pointer_member",",","array_size_member",")",":","try",":","klist_array_pointer","=","getattr","(","fdp",",","array_pointer_member",")","array_size","=","getattr","(","fdp",",","array_size_member",")","klist_array","=","kernel",".","object","(","object_type","=","\"array\"",",","offset","=","klist_array_pointer",",","count","=","array_size","+","1",",","subtype","=","kernel",".","get_type","(","\"klist\"",")",")","except","exceptions",".","InvalidAddressException",":","return","for","klist","in","klist_array",":","for","kn","in","mac",".","MacUtilities",".","walk_slist","(","klist",",","\"kn_link\"",")",":","yield","kn"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/kevents.py#L76-L95"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/kevents.py","language":"python","identifier":"Kevents._get_task_kevents","parameters":"(cls, kernel, task)","argument_list":"","return_statement":"","docstring":"Enumerates event filters per task.\n Uses smear-safe APIs throughout as these data structures\n see a signifcant amount of smear","docstring_summary":"Enumerates event filters per task.\n Uses smear-safe APIs throughout as these data structures\n see a signifcant amount of smear","docstring_tokens":["Enumerates","event","filters","per","task",".","Uses","smear","-","safe","APIs","throughout","as","these","data","structures","see","a","signifcant","amount","of","smear"],"function":"def _get_task_kevents(cls, kernel, task):\n \"\"\"\n Enumerates event filters per task.\n Uses smear-safe APIs throughout as these data structures\n see a signifcant amount of smear\n \"\"\"\n fdp = task.p_fd\n\n for kn in cls._walk_klist_array(kernel, fdp, \"fd_knlist\", \"fd_knlistsize\"):\n yield kn\n\n for kn in cls._walk_klist_array(kernel, fdp, \"fd_knhash\", \"fd_knhashmask\"):\n yield kn\n\n try:\n p_klist = task.p_klist\n except exceptions.InvalidAddressException:\n return\n\n for kn in mac.MacUtilities.walk_slist(p_klist, \"kn_link\"):\n yield kn","function_tokens":["def","_get_task_kevents","(","cls",",","kernel",",","task",")",":","fdp","=","task",".","p_fd","for","kn","in","cls",".","_walk_klist_array","(","kernel",",","fdp",",","\"fd_knlist\"",",","\"fd_knlistsize\"",")",":","yield","kn","for","kn","in","cls",".","_walk_klist_array","(","kernel",",","fdp",",","\"fd_knhash\"",",","\"fd_knhashmask\"",")",":","yield","kn","try",":","p_klist","=","task",".","p_klist","except","exceptions",".","InvalidAddressException",":","return","for","kn","in","mac",".","MacUtilities",".","walk_slist","(","p_klist",",","\"kn_link\"",")",":","yield","kn"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/kevents.py#L98-L118"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/kevents.py","language":"python","identifier":"Kevents.list_kernel_events","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Returns the kernel event filters registered\n\n Return values:\n A tuple of 3 elements:\n 1) The name of the process that registered the filter\n 2) The process ID of the process that registered the filter\n 3) The object of the associated kernel event filter","docstring_summary":"Returns the kernel event filters registered","docstring_tokens":["Returns","the","kernel","event","filters","registered"],"function":"def list_kernel_events(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False) -> \\\n Iterable[Tuple[interfaces.objects.ObjectInterface,\n interfaces.objects.ObjectInterface,\n interfaces.objects.ObjectInterface]]:\n \"\"\"\n Returns the kernel event filters registered\n\n Return values:\n A tuple of 3 elements:\n 1) The name of the process that registered the filter\n 2) The process ID of the process that registered the filter\n 3) The object of the associated kernel event filter\n \"\"\"\n kernel = contexts.Module(context, darwin_symbols, layer_name, 0)\n\n list_tasks = pslist.PsList.get_list_tasks(pslist.PsList.pslist_methods[0])\n\n for task in list_tasks(context, layer_name, darwin_symbols, filter_func):\n task_name = utility.array_to_string(task.p_comm)\n pid = task.p_pid\n\n for kn in cls._get_task_kevents(kernel, task):\n yield task_name, pid, kn","function_tokens":["def","list_kernel_events","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","darwin_symbols",":","str",",","filter_func",":","Callable","[","[","int","]",",","bool","]","=","lambda","_",":","False",")","->","Iterable","[","Tuple","[","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","ObjectInterface",",","interfaces",".","objects",".","ObjectInterface","]","]",":","kernel","=","contexts",".","Module","(","context",",","darwin_symbols",",","layer_name",",","0",")","list_tasks","=","pslist",".","PsList",".","get_list_tasks","(","pslist",".","PsList",".","pslist_methods","[","0","]",")","for","task","in","list_tasks","(","context",",","layer_name",",","darwin_symbols",",","filter_func",")",":","task_name","=","utility",".","array_to_string","(","task",".","p_comm",")","pid","=","task",".","p_pid","for","kn","in","cls",".","_get_task_kevents","(","kernel",",","task",")",":","yield","task_name",",","pid",",","kn"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/kevents.py#L121-L147"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pstree.py","language":"python","identifier":"PsTree._find_level","parameters":"(self, pid)","argument_list":"","return_statement":"","docstring":"Finds how deep the pid is in the processes list.","docstring_summary":"Finds how deep the pid is in the processes list.","docstring_tokens":["Finds","how","deep","the","pid","is","in","the","processes","list","."],"function":"def _find_level(self, pid):\n \"\"\"Finds how deep the pid is in the processes list.\"\"\"\n seen = set([])\n seen.add(pid)\n level = 0\n proc = self._processes.get(pid, None)\n while proc is not None and proc.vol.offset != 0 and proc.p_ppid != 0 and proc.p_ppid not in seen:\n ppid = int(proc.p_ppid)\n child_list = self._children.get(ppid, set([]))\n child_list.add(proc.p_pid)\n self._children[ppid] = child_list\n proc = self._processes.get(ppid, None)\n level += 1\n self._levels[pid] = level","function_tokens":["def","_find_level","(","self",",","pid",")",":","seen","=","set","(","[","]",")","seen",".","add","(","pid",")","level","=","0","proc","=","self",".","_processes",".","get","(","pid",",","None",")","while","proc","is","not","None","and","proc",".","vol",".","offset","!=","0","and","proc",".","p_ppid","!=","0","and","proc",".","p_ppid","not","in","seen",":","ppid","=","int","(","proc",".","p_ppid",")","child_list","=","self",".","_children",".","get","(","ppid",",","set","(","[","]",")",")","child_list",".","add","(","proc",".","p_pid",")","self",".","_children","[","ppid","]","=","child_list","proc","=","self",".","_processes",".","get","(","ppid",",","None",")","level","+=","1","self",".","_levels","[","pid","]","=","level"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pstree.py#L34-L47"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pstree.py","language":"python","identifier":"PsTree._generator","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Generates the tree list of processes","docstring_summary":"Generates the tree list of processes","docstring_tokens":["Generates","the","tree","list","of","processes"],"function":"def _generator(self):\n \"\"\"Generates the tree list of processes\"\"\"\n list_tasks = pslist.PsList.get_list_tasks(self.config.get('pslist_method', pslist.PsList.pslist_methods[0]))\n\n for proc in list_tasks(self.context, self.config['primary'], self.config['darwin']):\n self._processes[proc.p_pid] = proc\n\n # Build the child\/level maps\n for pid in self._processes:\n self._find_level(pid)\n\n def yield_processes(pid):\n proc = self._processes[pid]\n row = (proc.p_pid, proc.p_ppid, utility.array_to_string(proc.p_comm))\n\n yield (self._levels[pid] - 1, row)\n for child_pid in self._children.get(pid, []):\n yield from yield_processes(child_pid)\n\n for pid in self._levels:\n if self._levels[pid] == 1:\n yield from yield_processes(pid)","function_tokens":["def","_generator","(","self",")",":","list_tasks","=","pslist",".","PsList",".","get_list_tasks","(","self",".","config",".","get","(","'pslist_method'",",","pslist",".","PsList",".","pslist_methods","[","0","]",")",")","for","proc","in","list_tasks","(","self",".","context",",","self",".","config","[","'primary'","]",",","self",".","config","[","'darwin'","]",")",":","self",".","_processes","[","proc",".","p_pid","]","=","proc","# Build the child\/level maps","for","pid","in","self",".","_processes",":","self",".","_find_level","(","pid",")","def","yield_processes","(","pid",")",":","proc","=","self",".","_processes","[","pid","]","row","=","(","proc",".","p_pid",",","proc",".","p_ppid",",","utility",".","array_to_string","(","proc",".","p_comm",")",")","yield","(","self",".","_levels","[","pid","]","-","1",",","row",")","for","child_pid","in","self",".","_children",".","get","(","pid",",","[","]",")",":","yield","from","yield_processes","(","child_pid",")","for","pid","in","self",".","_levels",":","if","self",".","_levels","[","pid","]","==","1",":","yield","from","yield_processes","(","pid",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pstree.py#L49-L70"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/kauth_listeners.py","language":"python","identifier":"Kauth_listeners._generator","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Enumerates the listeners for each kauth scope","docstring_summary":"Enumerates the listeners for each kauth scope","docstring_tokens":["Enumerates","the","listeners","for","each","kauth","scope"],"function":"def _generator(self):\n \"\"\"\n Enumerates the listeners for each kauth scope\n \"\"\"\n kernel = contexts.Module(self.context, self.config['darwin'], self.config['primary'], 0)\n\n mods = lsmod.Lsmod.list_modules(self.context, self.config['primary'], self.config['darwin'])\n\n handlers = mac.MacUtilities.generate_kernel_handler_info(self.context, self.config['primary'], kernel, mods)\n\n for scope in kauth_scopes.Kauth_scopes.list_kauth_scopes(self.context, self.config['primary'],\n self.config['darwin']):\n\n scope_name = utility.pointer_to_string(scope.ks_identifier, 128)\n\n for listener in scope.get_listeners():\n callback = listener.kll_callback\n if callback == 0:\n continue\n\n module_name, symbol_name = mac.MacUtilities.lookup_module_address(self.context, handlers, callback)\n\n yield (0, (scope_name, format_hints.Hex(listener.kll_idata), format_hints.Hex(callback), module_name,\n symbol_name))","function_tokens":["def","_generator","(","self",")",":","kernel","=","contexts",".","Module","(","self",".","context",",","self",".","config","[","'darwin'","]",",","self",".","config","[","'primary'","]",",","0",")","mods","=","lsmod",".","Lsmod",".","list_modules","(","self",".","context",",","self",".","config","[","'primary'","]",",","self",".","config","[","'darwin'","]",")","handlers","=","mac",".","MacUtilities",".","generate_kernel_handler_info","(","self",".","context",",","self",".","config","[","'primary'","]",",","kernel",",","mods",")","for","scope","in","kauth_scopes",".","Kauth_scopes",".","list_kauth_scopes","(","self",".","context",",","self",".","config","[","'primary'","]",",","self",".","config","[","'darwin'","]",")",":","scope_name","=","utility",".","pointer_to_string","(","scope",".","ks_identifier",",","128",")","for","listener","in","scope",".","get_listeners","(",")",":","callback","=","listener",".","kll_callback","if","callback","==","0",":","continue","module_name",",","symbol_name","=","mac",".","MacUtilities",".","lookup_module_address","(","self",".","context",",","handlers",",","callback",")","yield","(","0",",","(","scope_name",",","format_hints",".","Hex","(","listener",".","kll_idata",")",",","format_hints",".","Hex","(","callback",")",",","module_name",",","symbol_name",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/kauth_listeners.py#L32-L55"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/malfind.py","language":"python","identifier":"Malfind._list_injections","parameters":"(self, task)","argument_list":"","return_statement":"","docstring":"Generate memory regions for a process that may contain injected\n code.","docstring_summary":"Generate memory regions for a process that may contain injected\n code.","docstring_tokens":["Generate","memory","regions","for","a","process","that","may","contain","injected","code","."],"function":"def _list_injections(self, task):\n \"\"\"Generate memory regions for a process that may contain injected\n code.\"\"\"\n\n proc_layer_name = task.add_process_layer()\n if proc_layer_name is None:\n return\n\n proc_layer = self.context.layers[proc_layer_name]\n\n for vma in task.get_map_iter():\n if not vma.is_suspicious(self.context, self.config['darwin']):\n data = proc_layer.read(vma.links.start, 64, pad = True)\n yield vma, data","function_tokens":["def","_list_injections","(","self",",","task",")",":","proc_layer_name","=","task",".","add_process_layer","(",")","if","proc_layer_name","is","None",":","return","proc_layer","=","self",".","context",".","layers","[","proc_layer_name","]","for","vma","in","task",".","get_map_iter","(",")",":","if","not","vma",".","is_suspicious","(","self",".","context",",","self",".","config","[","'darwin'","]",")",":","data","=","proc_layer",".","read","(","vma",".","links",".","start",",","64",",","pad","=","True",")","yield","vma",",","data"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/malfind.py#L33-L46"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/list_files.py","language":"python","identifier":"List_Files._add_vnode","parameters":"(cls, vnode, loop_vnodes)","argument_list":"","return_statement":"return added","docstring":"Adds the given vnode to loop_vnodes.\n\n loop_vnodes is key off the address of a vnode\n and holds its name, parent address, and object","docstring_summary":"Adds the given vnode to loop_vnodes.","docstring_tokens":["Adds","the","given","vnode","to","loop_vnodes","."],"function":"def _add_vnode(cls, vnode, loop_vnodes):\n \"\"\"\n Adds the given vnode to loop_vnodes.\n\n loop_vnodes is key off the address of a vnode\n and holds its name, parent address, and object\n \"\"\"\n\n key = vnode\n added = False\n\n if not key in loop_vnodes:\n # We can't do anything with a no-name vnode\n v_name = cls._vnode_name(vnode)\n if v_name is None:\n return added\n\n parent = cls._get_parent(vnode)\n if parent:\n parent_val = parent\n else:\n parent_val = None\n\n loop_vnodes[key] = (v_name, parent_val, vnode)\n\n added = True\n\n return added","function_tokens":["def","_add_vnode","(","cls",",","vnode",",","loop_vnodes",")",":","key","=","vnode","added","=","False","if","not","key","in","loop_vnodes",":","# We can't do anything with a no-name vnode","v_name","=","cls",".","_vnode_name","(","vnode",")","if","v_name","is","None",":","return","added","parent","=","cls",".","_get_parent","(","vnode",")","if","parent",":","parent_val","=","parent","else",":","parent_val","=","None","loop_vnodes","[","key","]","=","(","v_name",",","parent_val",",","vnode",")","added","=","True","return","added"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/list_files.py#L58-L85"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/list_files.py","language":"python","identifier":"List_Files._walk_vnode","parameters":"(cls, vnode, loop_vnodes)","argument_list":"","return_statement":"","docstring":"Iterates over the list of vnodes associated with the given one.\n Also traverses the parent chain for the vnode and adds each one.","docstring_summary":"Iterates over the list of vnodes associated with the given one.\n Also traverses the parent chain for the vnode and adds each one.","docstring_tokens":["Iterates","over","the","list","of","vnodes","associated","with","the","given","one",".","Also","traverses","the","parent","chain","for","the","vnode","and","adds","each","one","."],"function":"def _walk_vnode(cls, vnode, loop_vnodes):\n \"\"\"\n Iterates over the list of vnodes associated with the given one.\n Also traverses the parent chain for the vnode and adds each one.\n \"\"\"\n while vnode:\n if not cls._add_vnode(vnode, loop_vnodes):\n break\n\n parent = cls._get_parent(vnode)\n while parent:\n cls._walk_vnode(parent, loop_vnodes)\n parent = cls._get_parent(parent)\n\n try:\n vnode = vnode.v_mntvnodes.tqe_next\n except exceptions.InvalidAddressException:\n break","function_tokens":["def","_walk_vnode","(","cls",",","vnode",",","loop_vnodes",")",":","while","vnode",":","if","not","cls",".","_add_vnode","(","vnode",",","loop_vnodes",")",":","break","parent","=","cls",".","_get_parent","(","vnode",")","while","parent",":","cls",".","_walk_vnode","(","parent",",","loop_vnodes",")","parent","=","cls",".","_get_parent","(","parent",")","try",":","vnode","=","vnode",".","v_mntvnodes",".","tqe_next","except","exceptions",".","InvalidAddressException",":","break"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/list_files.py#L88-L105"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py","language":"python","identifier":"PsList.get_list_tasks","parameters":"(\n cls, method: str\n )","argument_list":"","return_statement":"return list_tasks","docstring":"Returns the list_tasks method based on the selector\n\n Args:\n method: Must be one fo the available methods in get_task_choices\n\n Returns:\n list_tasks method for listing tasks","docstring_summary":"Returns the list_tasks method based on the selector","docstring_tokens":["Returns","the","list_tasks","method","based","on","the","selector"],"function":"def get_list_tasks(\n cls, method: str\n ) -> Callable[[interfaces.context.ContextInterface, str, str, Callable[[int], bool]],\n Iterable[interfaces.objects.ObjectInterface]]:\n \"\"\"Returns the list_tasks method based on the selector\n\n Args:\n method: Must be one fo the available methods in get_task_choices\n\n Returns:\n list_tasks method for listing tasks\n \"\"\"\n # Ensure method is one of the suitable choices\n if method not in cls.pslist_methods:\n method = cls.pslist_methods[0]\n\n if method == 'allproc':\n list_tasks = cls.list_tasks_allproc\n elif method == 'tasks':\n list_tasks = cls.list_tasks_tasks\n elif method == 'process_group':\n list_tasks = cls.list_tasks_process_group\n elif method == 'sessions':\n list_tasks = cls.list_tasks_sessions\n elif method == 'pid_hash_table':\n list_tasks = cls.list_tasks_pid_hash_table\n else:\n raise ValueError(\"Impossible method choice chosen\")\n vollog.debug(\"Using method {}\".format(method))\n\n return list_tasks","function_tokens":["def","get_list_tasks","(","cls",",","method",":","str",")","->","Callable","[","[","interfaces",".","context",".","ContextInterface",",","str",",","str",",","Callable","[","[","int","]",",","bool","]","]",",","Iterable","[","interfaces",".","objects",".","ObjectInterface","]","]",":","# Ensure method is one of the suitable choices","if","method","not","in","cls",".","pslist_methods",":","method","=","cls",".","pslist_methods","[","0","]","if","method","==","'allproc'",":","list_tasks","=","cls",".","list_tasks_allproc","elif","method","==","'tasks'",":","list_tasks","=","cls",".","list_tasks_tasks","elif","method","==","'process_group'",":","list_tasks","=","cls",".","list_tasks_process_group","elif","method","==","'sessions'",":","list_tasks","=","cls",".","list_tasks_sessions","elif","method","==","'pid_hash_table'",":","list_tasks","=","cls",".","list_tasks_pid_hash_table","else",":","raise","ValueError","(","\"Impossible method choice chosen\"",")","vollog",".","debug","(","\"Using method {}\"",".","format","(","method",")",")","return","list_tasks"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py#L43-L73"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py","language":"python","identifier":"PsList.list_tasks_allproc","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Lists all the processes in the primary layer based on the allproc method\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n filter_func: A function which takes a process object and returns True if the process should be ignored\/filtered\n\n Returns:\n The list of process objects from the processes linked list after filtering","docstring_summary":"Lists all the processes in the primary layer based on the allproc method","docstring_tokens":["Lists","all","the","processes","in","the","primary","layer","based","on","the","allproc","method"],"function":"def list_tasks_allproc(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Lists all the processes in the primary layer based on the allproc method\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n filter_func: A function which takes a process object and returns True if the process should be ignored\/filtered\n\n Returns:\n The list of process objects from the processes linked list after filtering\n \"\"\"\n\n kernel = contexts.Module(context, darwin_symbols, layer_name, 0)\n\n kernel_layer = context.layers[layer_name]\n\n proc = kernel.object_from_symbol(symbol_name = \"allproc\").lh_first\n\n seen = {} # type: Dict[int, int]\n while proc is not None and proc.vol.offset != 0:\n if proc.vol.offset in seen:\n vollog.log(logging.INFO, \"Recursive process list detected (a result of non-atomic acquisition).\")\n break\n else:\n seen[proc.vol.offset] = 1\n\n if kernel_layer.is_valid(proc.vol.offset, proc.vol.size) and not filter_func(proc):\n yield proc\n\n try:\n proc = proc.p_list.le_next.dereference()\n except exceptions.InvalidAddressException:\n break","function_tokens":["def","list_tasks_allproc","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","darwin_symbols",":","str",",","filter_func",":","Callable","[","[","int","]",",","bool","]","=","lambda","_",":","False",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","kernel","=","contexts",".","Module","(","context",",","darwin_symbols",",","layer_name",",","0",")","kernel_layer","=","context",".","layers","[","layer_name","]","proc","=","kernel",".","object_from_symbol","(","symbol_name","=","\"allproc\"",")",".","lh_first","seen","=","{","}","# type: Dict[int, int]","while","proc","is","not","None","and","proc",".","vol",".","offset","!=","0",":","if","proc",".","vol",".","offset","in","seen",":","vollog",".","log","(","logging",".","INFO",",","\"Recursive process list detected (a result of non-atomic acquisition).\"",")","break","else",":","seen","[","proc",".","vol",".","offset","]","=","1","if","kernel_layer",".","is_valid","(","proc",".","vol",".","offset",",","proc",".","vol",".","size",")","and","not","filter_func","(","proc",")",":","yield","proc","try",":","proc","=","proc",".","p_list",".","le_next",".","dereference","(",")","except","exceptions",".","InvalidAddressException",":","break"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py#L103-L141"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py","language":"python","identifier":"PsList.list_tasks_tasks","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Lists all the tasks in the primary layer based on the tasks queue\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n filter_func: A function which takes a task object and returns True if the task should be ignored\/filtered\n\n Returns:\n The list of task objects from the `layer_name` layer's `tasks` list after filtering","docstring_summary":"Lists all the tasks in the primary layer based on the tasks queue","docstring_tokens":["Lists","all","the","tasks","in","the","primary","layer","based","on","the","tasks","queue"],"function":"def list_tasks_tasks(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Lists all the tasks in the primary layer based on the tasks queue\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n filter_func: A function which takes a task object and returns True if the task should be ignored\/filtered\n\n Returns:\n The list of task objects from the `layer_name` layer's `tasks` list after filtering\n \"\"\"\n\n kernel = contexts.Module(context, darwin_symbols, layer_name, 0)\n\n kernel_layer = context.layers[layer_name]\n\n queue_entry = kernel.object_from_symbol(symbol_name = \"tasks\")\n\n seen = {} # type: Dict[int, int]\n for task in queue_entry.walk_list(queue_entry, \"tasks\", \"task\"):\n if task.vol.offset in seen:\n vollog.log(logging.INFO, \"Recursive process list detected (a result of non-atomic acquisition).\")\n break\n else:\n seen[task.vol.offset] = 1\n\n try:\n proc = task.bsd_info.dereference().cast(\"proc\")\n except exceptions.InvalidAddressException:\n continue\n\n if kernel_layer.is_valid(proc.vol.offset, proc.vol.size) and not filter_func(proc):\n yield proc","function_tokens":["def","list_tasks_tasks","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","darwin_symbols",":","str",",","filter_func",":","Callable","[","[","int","]",",","bool","]","=","lambda","_",":","False",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","kernel","=","contexts",".","Module","(","context",",","darwin_symbols",",","layer_name",",","0",")","kernel_layer","=","context",".","layers","[","layer_name","]","queue_entry","=","kernel",".","object_from_symbol","(","symbol_name","=","\"tasks\"",")","seen","=","{","}","# type: Dict[int, int]","for","task","in","queue_entry",".","walk_list","(","queue_entry",",","\"tasks\"",",","\"task\"",")",":","if","task",".","vol",".","offset","in","seen",":","vollog",".","log","(","logging",".","INFO",",","\"Recursive process list detected (a result of non-atomic acquisition).\"",")","break","else",":","seen","[","task",".","vol",".","offset","]","=","1","try",":","proc","=","task",".","bsd_info",".","dereference","(",")",".","cast","(","\"proc\"",")","except","exceptions",".","InvalidAddressException",":","continue","if","kernel_layer",".","is_valid","(","proc",".","vol",".","offset",",","proc",".","vol",".","size",")","and","not","filter_func","(","proc",")",":","yield","proc"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py#L144-L182"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py","language":"python","identifier":"PsList.list_tasks_sessions","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Lists all the tasks in the primary layer using sessions\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n filter_func: A function which takes a task object and returns True if the task should be ignored\/filtered\n\n Returns:\n The list of task objects from the `layer_name` layer's `tasks` list after filtering","docstring_summary":"Lists all the tasks in the primary layer using sessions","docstring_tokens":["Lists","all","the","tasks","in","the","primary","layer","using","sessions"],"function":"def list_tasks_sessions(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Lists all the tasks in the primary layer using sessions\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n filter_func: A function which takes a task object and returns True if the task should be ignored\/filtered\n\n Returns:\n The list of task objects from the `layer_name` layer's `tasks` list after filtering\n \"\"\"\n kernel = contexts.Module(context, darwin_symbols, layer_name, 0)\n\n table_size = kernel.object_from_symbol(symbol_name = \"sesshash\")\n\n sesshashtbl = kernel.object_from_symbol(symbol_name = \"sesshashtbl\")\n\n proc_array = kernel.object(object_type = \"array\",\n offset = sesshashtbl,\n count = table_size + 1,\n subtype = kernel.get_type(\"sesshashhead\"))\n\n for proc_list in proc_array:\n for proc in mac.MacUtilities.walk_list_head(proc_list, \"s_hash\"):\n if proc.s_leader.is_readable() and not filter_func(proc.s_leader):\n yield proc.s_leader","function_tokens":["def","list_tasks_sessions","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","darwin_symbols",":","str",",","filter_func",":","Callable","[","[","int","]",",","bool","]","=","lambda","_",":","False",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","kernel","=","contexts",".","Module","(","context",",","darwin_symbols",",","layer_name",",","0",")","table_size","=","kernel",".","object_from_symbol","(","symbol_name","=","\"sesshash\"",")","sesshashtbl","=","kernel",".","object_from_symbol","(","symbol_name","=","\"sesshashtbl\"",")","proc_array","=","kernel",".","object","(","object_type","=","\"array\"",",","offset","=","sesshashtbl",",","count","=","table_size","+","1",",","subtype","=","kernel",".","get_type","(","\"sesshashhead\"",")",")","for","proc_list","in","proc_array",":","for","proc","in","mac",".","MacUtilities",".","walk_list_head","(","proc_list",",","\"s_hash\"",")",":","if","proc",".","s_leader",".","is_readable","(",")","and","not","filter_func","(","proc",".","s_leader",")",":","yield","proc",".","s_leader"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py#L185-L216"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py","language":"python","identifier":"PsList.list_tasks_process_group","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Lists all the tasks in the primary layer using process groups\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n filter_func: A function which takes a task object and returns True if the task should be ignored\/filtered\n\n Returns:\n The list of task objects from the `layer_name` layer's `tasks` list after filtering","docstring_summary":"Lists all the tasks in the primary layer using process groups","docstring_tokens":["Lists","all","the","tasks","in","the","primary","layer","using","process","groups"],"function":"def list_tasks_process_group(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Lists all the tasks in the primary layer using process groups\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n filter_func: A function which takes a task object and returns True if the task should be ignored\/filtered\n\n Returns:\n The list of task objects from the `layer_name` layer's `tasks` list after filtering\n \"\"\"\n\n kernel = contexts.Module(context, darwin_symbols, layer_name, 0)\n\n table_size = kernel.object_from_symbol(symbol_name = \"pgrphash\")\n\n pgrphashtbl = kernel.object_from_symbol(symbol_name = \"pgrphashtbl\")\n\n proc_array = kernel.object(object_type = \"array\",\n offset = pgrphashtbl,\n count = table_size + 1,\n subtype = kernel.get_type(\"pgrphashhead\"))\n\n for proc_list in proc_array:\n for pgrp in mac.MacUtilities.walk_list_head(proc_list, \"pg_hash\"):\n for proc in mac.MacUtilities.walk_list_head(pgrp.pg_members, \"p_pglist\"):\n if not filter_func(proc):\n yield proc","function_tokens":["def","list_tasks_process_group","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","darwin_symbols",":","str",",","filter_func",":","Callable","[","[","int","]",",","bool","]","=","lambda","_",":","False",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","kernel","=","contexts",".","Module","(","context",",","darwin_symbols",",","layer_name",",","0",")","table_size","=","kernel",".","object_from_symbol","(","symbol_name","=","\"pgrphash\"",")","pgrphashtbl","=","kernel",".","object_from_symbol","(","symbol_name","=","\"pgrphashtbl\"",")","proc_array","=","kernel",".","object","(","object_type","=","\"array\"",",","offset","=","pgrphashtbl",",","count","=","table_size","+","1",",","subtype","=","kernel",".","get_type","(","\"pgrphashhead\"",")",")","for","proc_list","in","proc_array",":","for","pgrp","in","mac",".","MacUtilities",".","walk_list_head","(","proc_list",",","\"pg_hash\"",")",":","for","proc","in","mac",".","MacUtilities",".","walk_list_head","(","pgrp",".","pg_members",",","\"p_pglist\"",")",":","if","not","filter_func","(","proc",")",":","yield","proc"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py#L219-L252"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py","language":"python","identifier":"PsList.list_tasks_pid_hash_table","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Lists all the tasks in the primary layer using the pid hash table\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n filter_func: A function which takes a task object and returns True if the task should be ignored\/filtered\n\n Returns:\n The list of task objects from the `layer_name` layer's `tasks` list after filtering","docstring_summary":"Lists all the tasks in the primary layer using the pid hash table","docstring_tokens":["Lists","all","the","tasks","in","the","primary","layer","using","the","pid","hash","table"],"function":"def list_tasks_pid_hash_table(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n darwin_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False) -> \\\n Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Lists all the tasks in the primary layer using the pid hash table\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n filter_func: A function which takes a task object and returns True if the task should be ignored\/filtered\n\n Returns:\n The list of task objects from the `layer_name` layer's `tasks` list after filtering\n \"\"\"\n\n kernel = contexts.Module(context, darwin_symbols, layer_name, 0)\n\n table_size = kernel.object_from_symbol(symbol_name = \"pidhash\")\n\n pidhashtbl = kernel.object_from_symbol(symbol_name = \"pidhashtbl\")\n\n proc_array = kernel.object(object_type = \"array\",\n offset = pidhashtbl,\n count = table_size + 1,\n subtype = kernel.get_type(\"pidhashhead\"))\n\n for proc_list in proc_array:\n for proc in mac.MacUtilities.walk_list_head(proc_list, \"p_hash\"):\n if not filter_func(proc):\n yield proc","function_tokens":["def","list_tasks_pid_hash_table","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","darwin_symbols",":","str",",","filter_func",":","Callable","[","[","int","]",",","bool","]","=","lambda","_",":","False",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","kernel","=","contexts",".","Module","(","context",",","darwin_symbols",",","layer_name",",","0",")","table_size","=","kernel",".","object_from_symbol","(","symbol_name","=","\"pidhash\"",")","pidhashtbl","=","kernel",".","object_from_symbol","(","symbol_name","=","\"pidhashtbl\"",")","proc_array","=","kernel",".","object","(","object_type","=","\"array\"",",","offset","=","pidhashtbl",",","count","=","table_size","+","1",",","subtype","=","kernel",".","get_type","(","\"pidhashhead\"",")",")","for","proc_list","in","proc_array",":","for","proc","in","mac",".","MacUtilities",".","walk_list_head","(","proc_list",",","\"p_hash\"",")",":","if","not","filter_func","(","proc",")",":","yield","proc"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/pslist.py#L255-L287"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/lsmod.py","language":"python","identifier":"Lsmod.list_modules","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str, darwin_symbols: str)","argument_list":"","return_statement":"","docstring":"Lists all the modules in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n\n Returns:\n A list of modules from the `layer_name` layer","docstring_summary":"Lists all the modules in the primary layer.","docstring_tokens":["Lists","all","the","modules","in","the","primary","layer","."],"function":"def list_modules(cls, context: interfaces.context.ContextInterface, layer_name: str, darwin_symbols: str):\n \"\"\"Lists all the modules in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n\n Returns:\n A list of modules from the `layer_name` layer\n \"\"\"\n kernel = contexts.Module(context, darwin_symbols, layer_name, 0)\n\n kmod_ptr = kernel.object_from_symbol(symbol_name = \"kmod\")\n\n # TODO - use smear-proof list walking API after dev release\n kmod = kmod_ptr.dereference().cast(\"kmod_info\")\n while kmod != 0:\n yield kmod\n kmod = kmod.next","function_tokens":["def","list_modules","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","darwin_symbols",":","str",")",":","kernel","=","contexts",".","Module","(","context",",","darwin_symbols",",","layer_name",",","0",")","kmod_ptr","=","kernel",".","object_from_symbol","(","symbol_name","=","\"kmod\"",")","# TODO - use smear-proof list walking API after dev release","kmod","=","kmod_ptr",".","dereference","(",")",".","cast","(","\"kmod_info\"",")","while","kmod","!=","0",":","yield","kmod","kmod","=","kmod",".","next"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/lsmod.py#L30-L49"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/mount.py","language":"python","identifier":"Mount.list_mounts","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str, darwin_symbols: str)","argument_list":"","return_statement":"","docstring":"Lists all the mount structures in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n\n Returns:\n A list of mount structures from the `layer_name` layer","docstring_summary":"Lists all the mount structures in the primary layer.","docstring_tokens":["Lists","all","the","mount","structures","in","the","primary","layer","."],"function":"def list_mounts(cls, context: interfaces.context.ContextInterface, layer_name: str, darwin_symbols: str):\n \"\"\"Lists all the mount structures in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n darwin_symbols: The name of the table containing the kernel symbols\n\n Returns:\n A list of mount structures from the `layer_name` layer\n \"\"\"\n kernel = contexts.Module(context, darwin_symbols, layer_name, 0)\n\n list_head = kernel.object_from_symbol(symbol_name = \"mountlist\")\n\n for mount in mac.MacUtilities.walk_tailq(list_head, \"mnt_list\"):\n yield mount","function_tokens":["def","list_mounts","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","darwin_symbols",":","str",")",":","kernel","=","contexts",".","Module","(","context",",","darwin_symbols",",","layer_name",",","0",")","list_head","=","kernel",".","object_from_symbol","(","symbol_name","=","\"mountlist\"",")","for","mount","in","mac",".","MacUtilities",".","walk_tailq","(","list_head",",","\"mnt_list\"",")",":","yield","mount"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/mount.py#L32-L48"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/vfsevents.py","language":"python","identifier":"VFSevents._generator","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Lists the registered VFS event watching processes\n Also lists which event(s) a process is registered for","docstring_summary":"Lists the registered VFS event watching processes\n Also lists which event(s) a process is registered for","docstring_tokens":["Lists","the","registered","VFS","event","watching","processes","Also","lists","which","event","(","s",")","a","process","is","registered","for"],"function":"def _generator(self):\n \"\"\"\n Lists the registered VFS event watching processes\n Also lists which event(s) a process is registered for\n \"\"\"\n\n kernel = contexts.Module(self.context, self.config['darwin'], self.config['primary'], 0)\n\n watcher_table = kernel.object_from_symbol(\"watcher_table\")\n\n for watcher in watcher_table:\n if watcher == 0:\n continue\n\n task_name = utility.array_to_string(watcher.proc_name)\n task_pid = watcher.pid\n\n events = []\n\n try:\n event_array = kernel.object(object_type = \"array\",\n offset = watcher.event_list,\n count = 13,\n subtype = kernel.get_type(\"unsigned char\"))\n\n except exceptions.InvalidAddressException:\n continue\n\n for i, event in enumerate(event_array):\n if event == 1:\n events.append(self.event_types[i])\n\n if events != []:\n yield (0, (task_name, task_pid, \",\".join(events)))","function_tokens":["def","_generator","(","self",")",":","kernel","=","contexts",".","Module","(","self",".","context",",","self",".","config","[","'darwin'","]",",","self",".","config","[","'primary'","]",",","0",")","watcher_table","=","kernel",".","object_from_symbol","(","\"watcher_table\"",")","for","watcher","in","watcher_table",":","if","watcher","==","0",":","continue","task_name","=","utility",".","array_to_string","(","watcher",".","proc_name",")","task_pid","=","watcher",".","pid","events","=","[","]","try",":","event_array","=","kernel",".","object","(","object_type","=","\"array\"",",","offset","=","watcher",".","event_list",",","count","=","13",",","subtype","=","kernel",".","get_type","(","\"unsigned char\"",")",")","except","exceptions",".","InvalidAddressException",":","continue","for","i",",","event","in","enumerate","(","event_array",")",":","if","event","==","1",":","events",".","append","(","self",".","event_types","[","i","]",")","if","events","!=","[","]",":","yield","(","0",",","(","task_name",",","task_pid",",","\",\"",".","join","(","events",")",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/mac\/vfsevents.py#L29-L62"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/check_syscall.py","language":"python","identifier":"Check_syscall._get_table_size_next_symbol","parameters":"(self, table_addr, ptr_sz, vmlinux)","argument_list":"","return_statement":"return ret","docstring":"Returns the size of the table based on the next symbol.","docstring_summary":"Returns the size of the table based on the next symbol.","docstring_tokens":["Returns","the","size","of","the","table","based","on","the","next","symbol","."],"function":"def _get_table_size_next_symbol(self, table_addr, ptr_sz, vmlinux):\n \"\"\"Returns the size of the table based on the next symbol.\"\"\"\n ret = 0\n\n sym_table = self.context.symbol_space[vmlinux.name]\n\n sorted_symbols = sorted([(sym_table.get_symbol(sn).address, sn) for sn in sym_table.symbols])\n\n sym_address = 0\n\n for tmp_sym_address, sym_name in sorted_symbols:\n if tmp_sym_address > table_addr:\n sym_address = tmp_sym_address\n break\n\n if sym_address > 0:\n ret = int((sym_address - table_addr) \/ ptr_sz)\n\n return ret","function_tokens":["def","_get_table_size_next_symbol","(","self",",","table_addr",",","ptr_sz",",","vmlinux",")",":","ret","=","0","sym_table","=","self",".","context",".","symbol_space","[","vmlinux",".","name","]","sorted_symbols","=","sorted","(","[","(","sym_table",".","get_symbol","(","sn",")",".","address",",","sn",")","for","sn","in","sym_table",".","symbols","]",")","sym_address","=","0","for","tmp_sym_address",",","sym_name","in","sorted_symbols",":","if","tmp_sym_address",">","table_addr",":","sym_address","=","tmp_sym_address","break","if","sym_address",">","0",":","ret","=","int","(","(","sym_address","-","table_addr",")","\/","ptr_sz",")","return","ret"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/check_syscall.py#L39-L57"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/check_syscall.py","language":"python","identifier":"Check_syscall._get_table_size_meta","parameters":"(self, vmlinux)","argument_list":"","return_statement":"return len(\n [sym for sym in self.context.symbol_space[vmlinux.name].symbols if sym.startswith(\"__syscall_meta__\")])","docstring":"returns the number of symbols that start with __syscall_meta__ this\n is a fast way to determine the number of system calls, but not the most\n accurate.","docstring_summary":"returns the number of symbols that start with __syscall_meta__ this\n is a fast way to determine the number of system calls, but not the most\n accurate.","docstring_tokens":["returns","the","number","of","symbols","that","start","with","__syscall_meta__","this","is","a","fast","way","to","determine","the","number","of","system","calls","but","not","the","most","accurate","."],"function":"def _get_table_size_meta(self, vmlinux):\n \"\"\"returns the number of symbols that start with __syscall_meta__ this\n is a fast way to determine the number of system calls, but not the most\n accurate.\"\"\"\n\n return len(\n [sym for sym in self.context.symbol_space[vmlinux.name].symbols if sym.startswith(\"__syscall_meta__\")])","function_tokens":["def","_get_table_size_meta","(","self",",","vmlinux",")",":","return","len","(","[","sym","for","sym","in","self",".","context",".","symbol_space","[","vmlinux",".","name","]",".","symbols","if","sym",".","startswith","(","\"__syscall_meta__\"",")","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/check_syscall.py#L59-L65"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/check_syscall.py","language":"python","identifier":"Check_syscall._get_table_info_disassembly","parameters":"(self, ptr_sz, vmlinux)","argument_list":"","return_statement":"return table_size","docstring":"Find the size of the system call table by disassembling functions\n that immediately reference it in their first isntruction This is in the\n form 'cmp reg,NR_syscalls'.","docstring_summary":"Find the size of the system call table by disassembling functions\n that immediately reference it in their first isntruction This is in the\n form 'cmp reg,NR_syscalls'.","docstring_tokens":["Find","the","size","of","the","system","call","table","by","disassembling","functions","that","immediately","reference","it","in","their","first","isntruction","This","is","in","the","form","cmp","reg","NR_syscalls","."],"function":"def _get_table_info_disassembly(self, ptr_sz, vmlinux):\n \"\"\"Find the size of the system call table by disassembling functions\n that immediately reference it in their first isntruction This is in the\n form 'cmp reg,NR_syscalls'.\"\"\"\n table_size = 0\n\n if not has_capstone:\n return table_size\n\n if ptr_sz == 4:\n syscall_entry_func = \"sysenter_do_call\"\n mode = capstone.CS_MODE_32\n else:\n syscall_entry_func = \"system_call_fastpath\"\n mode = capstone.CS_MODE_64\n\n md = capstone.Cs(capstone.CS_ARCH_X86, mode)\n\n try:\n func_addr = self.context.symbol_space.get_symbol(vmlinux.name + constants.BANG + syscall_entry_func).address\n except exceptions.SymbolError as e:\n # if we can't find the disassemble function then bail and rely on a different method\n return 0\n\n data = self.context.layers.read(self.config['primary'], func_addr, 6)\n\n for (address, size, mnemonic, op_str) in md.disasm_lite(data, func_addr):\n if mnemonic == 'CMP':\n table_size = int(op_str.split(\",\")[1].strip()) & 0xffff\n break\n\n return table_size","function_tokens":["def","_get_table_info_disassembly","(","self",",","ptr_sz",",","vmlinux",")",":","table_size","=","0","if","not","has_capstone",":","return","table_size","if","ptr_sz","==","4",":","syscall_entry_func","=","\"sysenter_do_call\"","mode","=","capstone",".","CS_MODE_32","else",":","syscall_entry_func","=","\"system_call_fastpath\"","mode","=","capstone",".","CS_MODE_64","md","=","capstone",".","Cs","(","capstone",".","CS_ARCH_X86",",","mode",")","try",":","func_addr","=","self",".","context",".","symbol_space",".","get_symbol","(","vmlinux",".","name","+","constants",".","BANG","+","syscall_entry_func",")",".","address","except","exceptions",".","SymbolError","as","e",":","# if we can't find the disassemble function then bail and rely on a different method","return","0","data","=","self",".","context",".","layers",".","read","(","self",".","config","[","'primary'","]",",","func_addr",",","6",")","for","(","address",",","size",",","mnemonic",",","op_str",")","in","md",".","disasm_lite","(","data",",","func_addr",")",":","if","mnemonic","==","'CMP'",":","table_size","=","int","(","op_str",".","split","(","\",\"",")","[","1","]",".","strip","(",")",")","&","0xffff","break","return","table_size"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/check_syscall.py#L77-L108"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/pstree.py","language":"python","identifier":"PsTree.find_level","parameters":"(self, pid)","argument_list":"","return_statement":"","docstring":"Finds how deep the pid is in the processes list.","docstring_summary":"Finds how deep the pid is in the processes list.","docstring_tokens":["Finds","how","deep","the","pid","is","in","the","processes","list","."],"function":"def find_level(self, pid):\n \"\"\"Finds how deep the pid is in the processes list.\"\"\"\n seen = set([])\n seen.add(pid)\n level = 0\n proc = self._processes.get(pid, None)\n while proc is not None and proc.parent != 0 and proc.parent.pid not in seen:\n ppid = int(proc.parent.pid)\n\n child_list = self._children.get(ppid, set([]))\n child_list.add(proc.pid)\n self._children[ppid] = child_list\n proc = self._processes.get(ppid, None)\n level += 1\n self._levels[pid] = level","function_tokens":["def","find_level","(","self",",","pid",")",":","seen","=","set","(","[","]",")","seen",".","add","(","pid",")","level","=","0","proc","=","self",".","_processes",".","get","(","pid",",","None",")","while","proc","is","not","None","and","proc",".","parent","!=","0","and","proc",".","parent",".","pid","not","in","seen",":","ppid","=","int","(","proc",".","parent",".","pid",")","child_list","=","self",".","_children",".","get","(","ppid",",","set","(","[","]",")",")","child_list",".","add","(","proc",".","pid",")","self",".","_children","[","ppid","]","=","child_list","proc","=","self",".","_processes",".","get","(","ppid",",","None",")","level","+=","1","self",".","_levels","[","pid","]","=","level"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/pstree.py#L21-L35"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/pstree.py","language":"python","identifier":"PsTree._generator","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Generates the.","docstring_summary":"Generates the.","docstring_tokens":["Generates","the","."],"function":"def _generator(self):\n \"\"\"Generates the.\"\"\"\n for proc in self.list_tasks(self.context, self.config['primary'], self.config['vmlinux']):\n self._processes[proc.pid] = proc\n\n # Build the child\/level maps\n for pid in self._processes:\n self.find_level(pid)\n\n def yield_processes(pid):\n proc = self._processes[pid]\n row = (proc.pid, proc.parent.pid, utility.array_to_string(proc.comm))\n\n yield (self._levels[pid] - 1, row)\n for child_pid in self._children.get(pid, []):\n yield from yield_processes(child_pid)\n\n for pid in self._levels:\n if self._levels[pid] == 1:\n yield from yield_processes(pid)","function_tokens":["def","_generator","(","self",")",":","for","proc","in","self",".","list_tasks","(","self",".","context",",","self",".","config","[","'primary'","]",",","self",".","config","[","'vmlinux'","]",")",":","self",".","_processes","[","proc",".","pid","]","=","proc","# Build the child\/level maps","for","pid","in","self",".","_processes",":","self",".","find_level","(","pid",")","def","yield_processes","(","pid",")",":","proc","=","self",".","_processes","[","pid","]","row","=","(","proc",".","pid",",","proc",".","parent",".","pid",",","utility",".","array_to_string","(","proc",".","comm",")",")","yield","(","self",".","_levels","[","pid","]","-","1",",","row",")","for","child_pid","in","self",".","_children",".","get","(","pid",",","[","]",")",":","yield","from","yield_processes","(","child_pid",")","for","pid","in","self",".","_levels",":","if","self",".","_levels","[","pid","]","==","1",":","yield","from","yield_processes","(","pid",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/pstree.py#L37-L56"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/malfind.py","language":"python","identifier":"Malfind._list_injections","parameters":"(self, task)","argument_list":"","return_statement":"","docstring":"Generate memory regions for a process that may contain injected\n code.","docstring_summary":"Generate memory regions for a process that may contain injected\n code.","docstring_tokens":["Generate","memory","regions","for","a","process","that","may","contain","injected","code","."],"function":"def _list_injections(self, task):\n \"\"\"Generate memory regions for a process that may contain injected\n code.\"\"\"\n\n proc_layer_name = task.add_process_layer()\n if not proc_layer_name:\n return\n\n proc_layer = self.context.layers[proc_layer_name]\n\n for vma in task.mm.get_mmap_iter():\n if vma.is_suspicious() and vma.get_name(self.context, task) != \"[vdso]\":\n data = proc_layer.read(vma.vm_start, 64, pad = True)\n yield vma, data","function_tokens":["def","_list_injections","(","self",",","task",")",":","proc_layer_name","=","task",".","add_process_layer","(",")","if","not","proc_layer_name",":","return","proc_layer","=","self",".","context",".","layers","[","proc_layer_name","]","for","vma","in","task",".","mm",".","get_mmap_iter","(",")",":","if","vma",".","is_suspicious","(",")","and","vma",".","get_name","(","self",".","context",",","task",")","!=","\"[vdso]\"",":","data","=","proc_layer",".","read","(","vma",".","vm_start",",","64",",","pad","=","True",")","yield","vma",",","data"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/malfind.py#L34-L47"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/pslist.py","language":"python","identifier":"PsList.create_pid_filter","parameters":"(cls, pid_list: List[int] = None)","argument_list":"","return_statement":"","docstring":"Constructs a filter function for process IDs.\n\n Args:\n pid_list: List of process IDs that are acceptable (or None if all are acceptable)\n\n Returns:\n Function which, when provided a process object, returns True if the process is to be filtered out of the list","docstring_summary":"Constructs a filter function for process IDs.","docstring_tokens":["Constructs","a","filter","function","for","process","IDs","."],"function":"def create_pid_filter(cls, pid_list: List[int] = None) -> Callable[[Any], bool]:\n \"\"\"Constructs a filter function for process IDs.\n\n Args:\n pid_list: List of process IDs that are acceptable (or None if all are acceptable)\n\n Returns:\n Function which, when provided a process object, returns True if the process is to be filtered out of the list\n \"\"\"\n # FIXME: mypy #4973 or #2608\n pid_list = pid_list or []\n filter_list = [x for x in pid_list if x is not None]\n if filter_list:\n\n def filter_func(x):\n return x.pid not in filter_list\n\n return filter_func\n else:\n return lambda _: False","function_tokens":["def","create_pid_filter","(","cls",",","pid_list",":","List","[","int","]","=","None",")","->","Callable","[","[","Any","]",",","bool","]",":","# FIXME: mypy #4973 or #2608","pid_list","=","pid_list","or","[","]","filter_list","=","[","x","for","x","in","pid_list","if","x","is","not","None","]","if","filter_list",":","def","filter_func","(","x",")",":","return","x",".","pid","not","in","filter_list","return","filter_func","else",":","return","lambda","_",":","False"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/pslist.py#L33-L52"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/pslist.py","language":"python","identifier":"PsList.list_tasks","parameters":"(\n cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n vmlinux_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False)","argument_list":"","return_statement":"","docstring":"Lists all the tasks in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n vmlinux_symbols: The name of the table containing the kernel symbols\n\n Yields:\n Process objects","docstring_summary":"Lists all the tasks in the primary layer.","docstring_tokens":["Lists","all","the","tasks","in","the","primary","layer","."],"function":"def list_tasks(\n cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n vmlinux_symbols: str,\n filter_func: Callable[[int], bool] = lambda _: False) -> Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Lists all the tasks in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n vmlinux_symbols: The name of the table containing the kernel symbols\n\n Yields:\n Process objects\n \"\"\"\n vmlinux = contexts.Module(context, vmlinux_symbols, layer_name, 0)\n\n init_task = vmlinux.object_from_symbol(symbol_name = \"init_task\")\n\n for task in init_task.tasks:\n if not filter_func(task):\n yield task","function_tokens":["def","list_tasks","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","vmlinux_symbols",":","str",",","filter_func",":","Callable","[","[","int","]",",","bool","]","=","lambda","_",":","False",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","vmlinux","=","contexts",".","Module","(","context",",","vmlinux_symbols",",","layer_name",",","0",")","init_task","=","vmlinux",".","object_from_symbol","(","symbol_name","=","\"init_task\"",")","for","task","in","init_task",".","tasks",":","if","not","filter_func","(","task",")",":","yield","task"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/pslist.py#L67-L89"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/lsmod.py","language":"python","identifier":"Lsmod.list_modules","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n vmlinux_symbols: str)","argument_list":"","return_statement":"","docstring":"Lists all the modules in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n vmlinux_symbols: The name of the table containing the kernel symbols\n\n Yields:\n The modules present in the `layer_name` layer's modules list\n\n This function will throw a SymbolError exception if kernel module support is not enabled.","docstring_summary":"Lists all the modules in the primary layer.","docstring_tokens":["Lists","all","the","modules","in","the","primary","layer","."],"function":"def list_modules(cls, context: interfaces.context.ContextInterface, layer_name: str,\n vmlinux_symbols: str) -> Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Lists all the modules in the primary layer.\n\n Args:\n context: The context to retrieve required elements (layers, symbol tables) from\n layer_name: The name of the layer on which to operate\n vmlinux_symbols: The name of the table containing the kernel symbols\n\n Yields:\n The modules present in the `layer_name` layer's modules list\n\n This function will throw a SymbolError exception if kernel module support is not enabled.\n \"\"\"\n vmlinux = contexts.Module(context, vmlinux_symbols, layer_name, 0)\n\n modules = vmlinux.object_from_symbol(symbol_name = \"modules\").cast(\"list_head\")\n\n table_name = modules.vol.type_name.split(constants.BANG)[0]\n\n for module in modules.to_list(table_name + constants.BANG + \"module\", \"list\"):\n yield module","function_tokens":["def","list_modules","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","vmlinux_symbols",":","str",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","vmlinux","=","contexts",".","Module","(","context",",","vmlinux_symbols",",","layer_name",",","0",")","modules","=","vmlinux",".","object_from_symbol","(","symbol_name","=","\"modules\"",")",".","cast","(","\"list_head\"",")","table_name","=","modules",".","vol",".","type_name",".","split","(","constants",".","BANG",")","[","0","]","for","module","in","modules",".","to_list","(","table_name","+","constants",".","BANG","+","\"module\"",",","\"list\"",")",":","yield","module"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/plugins\/linux\/lsmod.py#L36-L57"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"ListRequirement.__init__","parameters":"(self,\n element_type: Type[interfaces.configuration.SimpleTypes] = str,\n max_elements: Optional[int] = 0,\n min_elements: Optional[int] = None,\n *args,\n **kwargs)","argument_list":"","return_statement":"","docstring":"Constructs the object.\n\n Args:\n element_type: The (requirement) type of each element within the list\n max_elements; The maximum number of acceptable elements this list can contain\n min_elements: The minimum number of acceptable elements this list can contain","docstring_summary":"Constructs the object.","docstring_tokens":["Constructs","the","object","."],"function":"def __init__(self,\n element_type: Type[interfaces.configuration.SimpleTypes] = str,\n max_elements: Optional[int] = 0,\n min_elements: Optional[int] = None,\n *args,\n **kwargs) -> None:\n \"\"\"Constructs the object.\n\n Args:\n element_type: The (requirement) type of each element within the list\n max_elements; The maximum number of acceptable elements this list can contain\n min_elements: The minimum number of acceptable elements this list can contain\n \"\"\"\n super().__init__(*args, **kwargs)\n if not issubclass(element_type, interfaces.configuration.BasicTypes):\n raise TypeError(\"ListRequirements can only be populated with simple InstanceRequirements\")\n self.element_type = element_type # type: Type\n self.min_elements = min_elements or 0 # type: int\n self.max_elements = max_elements","function_tokens":["def","__init__","(","self",",","element_type",":","Type","[","interfaces",".","configuration",".","SimpleTypes","]","=","str",",","max_elements",":","Optional","[","int","]","=","0",",","min_elements",":","Optional","[","int","]","=","None",",","*","args",",","*","*","kwargs",")","->","None",":","super","(",")",".","__init__","(","*","args",",","*","*","kwargs",")","if","not","issubclass","(","element_type",",","interfaces",".","configuration",".","BasicTypes",")",":","raise","TypeError","(","\"ListRequirements can only be populated with simple InstanceRequirements\"",")","self",".","element_type","=","element_type","# type: Type","self",".","min_elements","=","min_elements","or","0","# type: int","self",".","max_elements","=","max_elements"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L70-L88"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"ListRequirement.unsatisfied","parameters":"(self, context: interfaces.context.ContextInterface,\n config_path: str)","argument_list":"","return_statement":"return {}","docstring":"Check the types on each of the returned values and their number and\n then call the element type's check for each one.","docstring_summary":"Check the types on each of the returned values and their number and\n then call the element type's check for each one.","docstring_tokens":["Check","the","types","on","each","of","the","returned","values","and","their","number","and","then","call","the","element","type","s","check","for","each","one","."],"function":"def unsatisfied(self, context: interfaces.context.ContextInterface,\n config_path: str) -> Dict[str, interfaces.configuration.RequirementInterface]:\n \"\"\"Check the types on each of the returned values and their number and\n then call the element type's check for each one.\"\"\"\n config_path = interfaces.configuration.path_join(config_path, self.name)\n default = None\n value = self.config_value(context, config_path, default)\n if not value and self.min_elements > 0:\n vollog.log(constants.LOGLEVEL_V, \"ListRequirement Unsatisfied - ListRequirement has non-zero min_elements\")\n return {config_path: self}\n if value is None and not self.optional:\n # We need to differentiate between no value and an empty list\n vollog.log(constants.LOGLEVEL_V, \"ListRequirement Unsatisfied - Value was not specified\")\n return {config_path: self}\n elif value is None:\n context.config[config_path] = []\n if not isinstance(value, list):\n # TODO: Check this is the correct response for an error\n raise TypeError(\"Unexpected config value found: {}\".format(repr(value)))\n if not (self.min_elements <= len(value)):\n vollog.log(constants.LOGLEVEL_V, \"TypeError - Too few values provided to list option.\")\n return {config_path: self}\n if self.max_elements and not (len(value) < self.max_elements):\n vollog.log(constants.LOGLEVEL_V, \"TypeError - Too many values provided to list option.\")\n return {config_path: self}\n if not all([isinstance(element, self.element_type) for element in value]):\n vollog.log(constants.LOGLEVEL_V, \"TypeError - At least one element in the list is not of the correct type.\")\n return {config_path: self}\n return {}","function_tokens":["def","unsatisfied","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",")","->","Dict","[","str",",","interfaces",".","configuration",".","RequirementInterface","]",":","config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","self",".","name",")","default","=","None","value","=","self",".","config_value","(","context",",","config_path",",","default",")","if","not","value","and","self",".","min_elements",">","0",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"ListRequirement Unsatisfied - ListRequirement has non-zero min_elements\"",")","return","{","config_path",":","self","}","if","value","is","None","and","not","self",".","optional",":","# We need to differentiate between no value and an empty list","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"ListRequirement Unsatisfied - Value was not specified\"",")","return","{","config_path",":","self","}","elif","value","is","None",":","context",".","config","[","config_path","]","=","[","]","if","not","isinstance","(","value",",","list",")",":","# TODO: Check this is the correct response for an error","raise","TypeError","(","\"Unexpected config value found: {}\"",".","format","(","repr","(","value",")",")",")","if","not","(","self",".","min_elements","<=","len","(","value",")",")",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"TypeError - Too few values provided to list option.\"",")","return","{","config_path",":","self","}","if","self",".","max_elements","and","not","(","len","(","value",")","<","self",".","max_elements",")",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"TypeError - Too many values provided to list option.\"",")","return","{","config_path",":","self","}","if","not","all","(","[","isinstance","(","element",",","self",".","element_type",")","for","element","in","value","]",")",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"TypeError - At least one element in the list is not of the correct type.\"",")","return","{","config_path",":","self","}","return","{","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L90-L118"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"ChoiceRequirement.__init__","parameters":"(self, choices: List[str], *args, **kwargs)","argument_list":"","return_statement":"","docstring":"Constructs the object.\n\n Args:\n choices: A list of possible string options that can be chosen from","docstring_summary":"Constructs the object.","docstring_tokens":["Constructs","the","object","."],"function":"def __init__(self, choices: List[str], *args, **kwargs) -> None:\n \"\"\"Constructs the object.\n\n Args:\n choices: A list of possible string options that can be chosen from\n \"\"\"\n super().__init__(*args, **kwargs)\n if not isinstance(choices, list) or any([not isinstance(choice, str) for choice in choices]):\n raise TypeError(\"ChoiceRequirement takes a list of strings as choices\")\n self.choices = choices","function_tokens":["def","__init__","(","self",",","choices",":","List","[","str","]",",","*","args",",","*","*","kwargs",")","->","None",":","super","(",")",".","__init__","(","*","args",",","*","*","kwargs",")","if","not","isinstance","(","choices",",","list",")","or","any","(","[","not","isinstance","(","choice",",","str",")","for","choice","in","choices","]",")",":","raise","TypeError","(","\"ChoiceRequirement takes a list of strings as choices\"",")","self",".","choices","=","choices"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L124-L133"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"ChoiceRequirement.unsatisfied","parameters":"(self, context: interfaces.context.ContextInterface,\n config_path: str)","argument_list":"","return_statement":"return {}","docstring":"Validates the provided value to ensure it is one of the available\n choices.","docstring_summary":"Validates the provided value to ensure it is one of the available\n choices.","docstring_tokens":["Validates","the","provided","value","to","ensure","it","is","one","of","the","available","choices","."],"function":"def unsatisfied(self, context: interfaces.context.ContextInterface,\n config_path: str) -> Dict[str, interfaces.configuration.RequirementInterface]:\n \"\"\"Validates the provided value to ensure it is one of the available\n choices.\"\"\"\n config_path = interfaces.configuration.path_join(config_path, self.name)\n value = self.config_value(context, config_path)\n if value not in self.choices:\n vollog.log(constants.LOGLEVEL_V, \"ValueError - Value is not within the set of available choices\")\n return {config_path: self}\n return {}","function_tokens":["def","unsatisfied","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",")","->","Dict","[","str",",","interfaces",".","configuration",".","RequirementInterface","]",":","config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","self",".","name",")","value","=","self",".","config_value","(","context",",","config_path",")","if","value","not","in","self",".","choices",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"ValueError - Value is not within the set of available choices\"",")","return","{","config_path",":","self","}","return","{","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L135-L144"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"ComplexListRequirement.unsatisfied","parameters":"(self, context: interfaces.context.ContextInterface,\n config_path: str)","argument_list":"","return_statement":"return {}","docstring":"Validates the provided value to ensure it is one of the available\n choices.","docstring_summary":"Validates the provided value to ensure it is one of the available\n choices.","docstring_tokens":["Validates","the","provided","value","to","ensure","it","is","one","of","the","available","choices","."],"function":"def unsatisfied(self, context: interfaces.context.ContextInterface,\n config_path: str) -> Dict[str, interfaces.configuration.RequirementInterface]:\n \"\"\"Validates the provided value to ensure it is one of the available\n choices.\"\"\"\n config_path = interfaces.configuration.path_join(config_path, self.name)\n ret_list = super().unsatisfied(context, config_path)\n if ret_list:\n return ret_list\n if (self.config_value(context, config_path, None) is None\n or self.config_value(context, interfaces.configuration.path_join(config_path, 'number_of_elements'))):\n return {config_path: self}\n return {}","function_tokens":["def","unsatisfied","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",")","->","Dict","[","str",",","interfaces",".","configuration",".","RequirementInterface","]",":","config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","self",".","name",")","ret_list","=","super","(",")",".","unsatisfied","(","context",",","config_path",")","if","ret_list",":","return","ret_list","if","(","self",".","config_value","(","context",",","config_path",",","None",")","is","None","or","self",".","config_value","(","context",",","interfaces",".","configuration",".","path_join","(","config_path",",","'number_of_elements'",")",")",")",":","return","{","config_path",":","self","}","return","{","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L152-L163"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"ComplexListRequirement.construct","parameters":"(self, context: interfaces.context.ContextInterface, config_path: str)","argument_list":"","return_statement":"","docstring":"Method for constructing within the context any required elements\n from subrequirements.","docstring_summary":"Method for constructing within the context any required elements\n from subrequirements.","docstring_tokens":["Method","for","constructing","within","the","context","any","required","elements","from","subrequirements","."],"function":"def construct(self, context: interfaces.context.ContextInterface, config_path: str) -> None:\n \"\"\"Method for constructing within the context any required elements\n from subrequirements.\"\"\"","function_tokens":["def","construct","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L175-L177"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"ComplexListRequirement.new_requirement","parameters":"(self, index)","argument_list":"","return_statement":"","docstring":"Builds a new requirement based on the specified index.","docstring_summary":"Builds a new requirement based on the specified index.","docstring_tokens":["Builds","a","new","requirement","based","on","the","specified","index","."],"function":"def new_requirement(self, index) -> interfaces.configuration.RequirementInterface:\n \"\"\"Builds a new requirement based on the specified index.\"\"\"","function_tokens":["def","new_requirement","(","self",",","index",")","->","interfaces",".","configuration",".","RequirementInterface",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L180-L181"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"LayerListRequirement.construct","parameters":"(self, context: interfaces.context.ContextInterface, config_path: str)","argument_list":"","return_statement":"","docstring":"Method for constructing within the context any required elements\n from subrequirements.","docstring_summary":"Method for constructing within the context any required elements\n from subrequirements.","docstring_tokens":["Method","for","constructing","within","the","context","any","required","elements","from","subrequirements","."],"function":"def construct(self, context: interfaces.context.ContextInterface, config_path: str) -> None:\n \"\"\"Method for constructing within the context any required elements\n from subrequirements.\"\"\"\n new_config_path = interfaces.configuration.path_join(config_path, self.name)\n num_layers_path = interfaces.configuration.path_join(new_config_path, \"number_of_elements\")\n number_of_layers = context.config[num_layers_path]\n\n # Build all the layers that can be built\n for i in range(number_of_layers):\n layer_req = self.requirements.get(self.name + str(i), None)\n if layer_req is not None and isinstance(layer_req, TranslationLayerRequirement):\n layer_req.construct(context, new_config_path)","function_tokens":["def","construct","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",")","->","None",":","new_config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","self",".","name",")","num_layers_path","=","interfaces",".","configuration",".","path_join","(","new_config_path",",","\"number_of_elements\"",")","number_of_layers","=","context",".","config","[","num_layers_path","]","# Build all the layers that can be built","for","i","in","range","(","number_of_layers",")",":","layer_req","=","self",".","requirements",".","get","(","self",".","name","+","str","(","i",")",",","None",")","if","layer_req","is","not","None","and","isinstance","(","layer_req",",","TranslationLayerRequirement",")",":","layer_req",".","construct","(","context",",","new_config_path",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L204-L215"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"LayerListRequirement.new_requirement","parameters":"(self, index)","argument_list":"","return_statement":"return TranslationLayerRequirement(name = self.name + str(index),\n description = \"Layer for swap space\",\n optional = False)","docstring":"Constructs a new requirement based on the specified index.","docstring_summary":"Constructs a new requirement based on the specified index.","docstring_tokens":["Constructs","a","new","requirement","based","on","the","specified","index","."],"function":"def new_requirement(self, index) -> interfaces.configuration.RequirementInterface:\n \"\"\"Constructs a new requirement based on the specified index.\"\"\"\n return TranslationLayerRequirement(name = self.name + str(index),\n description = \"Layer for swap space\",\n optional = False)","function_tokens":["def","new_requirement","(","self",",","index",")","->","interfaces",".","configuration",".","RequirementInterface",":","return","TranslationLayerRequirement","(","name","=","self",".","name","+","str","(","index",")",",","description","=","\"Layer for swap space\"",",","optional","=","False",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L217-L221"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"TranslationLayerRequirement.__init__","parameters":"(self,\n name: str,\n description: str = None,\n default: interfaces.configuration.ConfigSimpleType = None,\n optional: bool = False,\n oses: List = None,\n architectures: List = None)","argument_list":"","return_statement":"","docstring":"Constructs a Translation Layer Requirement.\n\n The configuration option's value will be the name of the layer once it exists in the store\n\n Args:\n name: Name of the configuration requirement\n description: Description of the configuration requirement\n default: A default value (should not be used for TranslationLayers)\n optional: Whether the translation layer is required or not\n oses: A list of valid operating systems which can satisfy this requirement\n architectures: A list of valid architectures which can satisfy this requirement","docstring_summary":"Constructs a Translation Layer Requirement.","docstring_tokens":["Constructs","a","Translation","Layer","Requirement","."],"function":"def __init__(self,\n name: str,\n description: str = None,\n default: interfaces.configuration.ConfigSimpleType = None,\n optional: bool = False,\n oses: List = None,\n architectures: List = None) -> None:\n \"\"\"Constructs a Translation Layer Requirement.\n\n The configuration option's value will be the name of the layer once it exists in the store\n\n Args:\n name: Name of the configuration requirement\n description: Description of the configuration requirement\n default: A default value (should not be used for TranslationLayers)\n optional: Whether the translation layer is required or not\n oses: A list of valid operating systems which can satisfy this requirement\n architectures: A list of valid architectures which can satisfy this requirement\n \"\"\"\n if oses is None:\n oses = []\n if architectures is None:\n architectures = []\n self.oses = oses\n self.architectures = architectures\n super().__init__(name, description, default, optional)","function_tokens":["def","__init__","(","self",",","name",":","str",",","description",":","str","=","None",",","default",":","interfaces",".","configuration",".","ConfigSimpleType","=","None",",","optional",":","bool","=","False",",","oses",":","List","=","None",",","architectures",":","List","=","None",")","->","None",":","if","oses","is","None",":","oses","=","[","]","if","architectures","is","None",":","architectures","=","[","]","self",".","oses","=","oses","self",".","architectures","=","architectures","super","(",")",".","__init__","(","name",",","description",",","default",",","optional",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L229-L254"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"TranslationLayerRequirement.unsatisfied","parameters":"(self, context: interfaces.context.ContextInterface,\n config_path: str)","argument_list":"","return_statement":"return {config_path: self}","docstring":"Validate that the value is a valid layer name and that the layer\n adheres to the requirements.","docstring_summary":"Validate that the value is a valid layer name and that the layer\n adheres to the requirements.","docstring_tokens":["Validate","that","the","value","is","a","valid","layer","name","and","that","the","layer","adheres","to","the","requirements","."],"function":"def unsatisfied(self, context: interfaces.context.ContextInterface,\n config_path: str) -> Dict[str, interfaces.configuration.RequirementInterface]:\n \"\"\"Validate that the value is a valid layer name and that the layer\n adheres to the requirements.\"\"\"\n config_path = interfaces.configuration.path_join(config_path, self.name)\n value = self.config_value(context, config_path, None)\n if isinstance(value, str):\n if value not in context.layers:\n vollog.log(constants.LOGLEVEL_V, \"IndexError - Layer not found in memory space: {}\".format(value))\n return {config_path: self}\n if self.oses and context.layers[value].metadata.get('os', None) not in self.oses:\n vollog.log(constants.LOGLEVEL_V, \"TypeError - Layer is not the required OS: {}\".format(value))\n return {config_path: self}\n if (self.architectures\n and context.layers[value].metadata.get('architecture', None) not in self.architectures):\n vollog.log(constants.LOGLEVEL_V, \"TypeError - Layer is not the required Architecture: {}\".format(value))\n return {config_path: self}\n return {}\n\n if value is not None:\n vollog.log(constants.LOGLEVEL_V,\n \"TypeError - Translation Layer Requirement only accepts string labels: {}\".format(repr(value)))\n return {config_path: self}\n\n # TODO: check that the space in the context lives up to the requirements for arch\/os etc\n\n ### NOTE: This validate method has side effects (the dependencies can change)!!!\n\n self._validate_class(context, interfaces.configuration.parent_path(config_path))\n vollog.log(constants.LOGLEVEL_V, \"IndexError - No configuration provided: {}\".format(config_path))\n return {config_path: self}","function_tokens":["def","unsatisfied","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",")","->","Dict","[","str",",","interfaces",".","configuration",".","RequirementInterface","]",":","config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","self",".","name",")","value","=","self",".","config_value","(","context",",","config_path",",","None",")","if","isinstance","(","value",",","str",")",":","if","value","not","in","context",".","layers",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"IndexError - Layer not found in memory space: {}\"",".","format","(","value",")",")","return","{","config_path",":","self","}","if","self",".","oses","and","context",".","layers","[","value","]",".","metadata",".","get","(","'os'",",","None",")","not","in","self",".","oses",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"TypeError - Layer is not the required OS: {}\"",".","format","(","value",")",")","return","{","config_path",":","self","}","if","(","self",".","architectures","and","context",".","layers","[","value","]",".","metadata",".","get","(","'architecture'",",","None",")","not","in","self",".","architectures",")",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"TypeError - Layer is not the required Architecture: {}\"",".","format","(","value",")",")","return","{","config_path",":","self","}","return","{","}","if","value","is","not","None",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"TypeError - Translation Layer Requirement only accepts string labels: {}\"",".","format","(","repr","(","value",")",")",")","return","{","config_path",":","self","}","# TODO: check that the space in the context lives up to the requirements for arch\/os etc","### NOTE: This validate method has side effects (the dependencies can change)!!!","self",".","_validate_class","(","context",",","interfaces",".","configuration",".","parent_path","(","config_path",")",")","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"IndexError - No configuration provided: {}\"",".","format","(","config_path",")",")","return","{","config_path",":","self","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L256-L286"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"TranslationLayerRequirement.construct","parameters":"(self, context: interfaces.context.ContextInterface, config_path: str)","argument_list":"","return_statement":"return None","docstring":"Constructs the appropriate layer and adds it based on the class\n parameter.","docstring_summary":"Constructs the appropriate layer and adds it based on the class\n parameter.","docstring_tokens":["Constructs","the","appropriate","layer","and","adds","it","based","on","the","class","parameter","."],"function":"def construct(self, context: interfaces.context.ContextInterface, config_path: str) -> None:\n \"\"\"Constructs the appropriate layer and adds it based on the class\n parameter.\"\"\"\n config_path = interfaces.configuration.path_join(config_path, self.name)\n\n # Determine the layer name\n name = self.name\n counter = 2\n while name in context.layers:\n name = self.name + str(counter)\n counter += 1\n\n args = {\"context\": context, \"config_path\": config_path, \"name\": name}\n\n if any(\n [subreq.unsatisfied(context, config_path) for subreq in self.requirements.values() if not subreq.optional]):\n return None\n\n obj = self._construct_class(context, config_path, args)\n if obj is not None and isinstance(obj, interfaces.layers.DataLayerInterface):\n context.add_layer(obj)\n # This should already be done by the _construct_class method\n # context.config[config_path] = obj.name\n return None","function_tokens":["def","construct","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",")","->","None",":","config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","self",".","name",")","# Determine the layer name","name","=","self",".","name","counter","=","2","while","name","in","context",".","layers",":","name","=","self",".","name","+","str","(","counter",")","counter","+=","1","args","=","{","\"context\"",":","context",",","\"config_path\"",":","config_path",",","\"name\"",":","name","}","if","any","(","[","subreq",".","unsatisfied","(","context",",","config_path",")","for","subreq","in","self",".","requirements",".","values","(",")","if","not","subreq",".","optional","]",")",":","return","None","obj","=","self",".","_construct_class","(","context",",","config_path",",","args",")","if","obj","is","not","None","and","isinstance","(","obj",",","interfaces",".","layers",".","DataLayerInterface",")",":","context",".","add_layer","(","obj",")","# This should already be done by the _construct_class method","# context.config[config_path] = obj.name","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L288-L311"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"TranslationLayerRequirement.build_configuration","parameters":"(self, context: interfaces.context.ContextInterface, _: str,\n value: Any)","argument_list":"","return_statement":"return context.layers[value].build_configuration()","docstring":"Builds the appropriate configuration for the specified\n requirement.","docstring_summary":"Builds the appropriate configuration for the specified\n requirement.","docstring_tokens":["Builds","the","appropriate","configuration","for","the","specified","requirement","."],"function":"def build_configuration(self, context: interfaces.context.ContextInterface, _: str,\n value: Any) -> interfaces.configuration.HierarchicalDict:\n \"\"\"Builds the appropriate configuration for the specified\n requirement.\"\"\"\n return context.layers[value].build_configuration()","function_tokens":["def","build_configuration","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","_",":","str",",","value",":","Any",")","->","interfaces",".","configuration",".","HierarchicalDict",":","return","context",".","layers","[","value","]",".","build_configuration","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L313-L317"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"SymbolTableRequirement.unsatisfied","parameters":"(self, context: interfaces.context.ContextInterface,\n config_path: str)","argument_list":"","return_statement":"return {config_path: self}","docstring":"Validate that the value is a valid within the symbol space of the\n provided context.","docstring_summary":"Validate that the value is a valid within the symbol space of the\n provided context.","docstring_tokens":["Validate","that","the","value","is","a","valid","within","the","symbol","space","of","the","provided","context","."],"function":"def unsatisfied(self, context: interfaces.context.ContextInterface,\n config_path: str) -> Dict[str, interfaces.configuration.RequirementInterface]:\n \"\"\"Validate that the value is a valid within the symbol space of the\n provided context.\"\"\"\n config_path = interfaces.configuration.path_join(config_path, self.name)\n value = self.config_value(context, config_path, None)\n if not isinstance(value, str) and value is not None:\n vollog.log(constants.LOGLEVEL_V,\n \"TypeError - SymbolTableRequirement only accepts string labels: {}\".format(repr(value)))\n return {config_path: self}\n if value and value in context.symbol_space:\n # This is an expected situation, so return rather than raise\n return {}\n elif value:\n vollog.log(constants.LOGLEVEL_V, \"IndexError - Value not present in the symbol space: {}\".format(value\n or \"\"))\n\n ### NOTE: This validate method has side effects (the dependencies can change)!!!\n\n self._validate_class(context, interfaces.configuration.parent_path(config_path))\n vollog.log(constants.LOGLEVEL_V, \"Symbol table requirement not yet fulfilled: {}\".format(config_path))\n return {config_path: self}","function_tokens":["def","unsatisfied","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",")","->","Dict","[","str",",","interfaces",".","configuration",".","RequirementInterface","]",":","config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","self",".","name",")","value","=","self",".","config_value","(","context",",","config_path",",","None",")","if","not","isinstance","(","value",",","str",")","and","value","is","not","None",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"TypeError - SymbolTableRequirement only accepts string labels: {}\"",".","format","(","repr","(","value",")",")",")","return","{","config_path",":","self","}","if","value","and","value","in","context",".","symbol_space",":","# This is an expected situation, so return rather than raise","return","{","}","elif","value",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"IndexError - Value not present in the symbol space: {}\"",".","format","(","value","or","\"\"",")",")","### NOTE: This validate method has side effects (the dependencies can change)!!!","self",".","_validate_class","(","context",",","interfaces",".","configuration",".","parent_path","(","config_path",")",")","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"Symbol table requirement not yet fulfilled: {}\"",".","format","(","config_path",")",")","return","{","config_path",":","self","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L325-L346"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"SymbolTableRequirement.construct","parameters":"(self, context: interfaces.context.ContextInterface, config_path: str)","argument_list":"","return_statement":"return None","docstring":"Constructs the symbol space within the context based on the\n subrequirements.","docstring_summary":"Constructs the symbol space within the context based on the\n subrequirements.","docstring_tokens":["Constructs","the","symbol","space","within","the","context","based","on","the","subrequirements","."],"function":"def construct(self, context: interfaces.context.ContextInterface, config_path: str) -> None:\n \"\"\"Constructs the symbol space within the context based on the\n subrequirements.\"\"\"\n config_path = interfaces.configuration.path_join(config_path, self.name)\n # Determine the space name\n name = context.symbol_space.free_table_name(self.name)\n\n args = {\"context\": context, \"config_path\": config_path, \"name\": name}\n\n if any(\n [subreq.unsatisfied(context, config_path) for subreq in self.requirements.values() if not subreq.optional]):\n return None\n\n # Fill out the parameter for class creation\n if not isinstance(self.requirements[\"class\"], interfaces.configuration.ClassRequirement):\n raise TypeError(\"Class requirement is not of type ClassRequirement: {}\".format(\n repr(self.requirements[\"class\"])))\n cls = self.requirements[\"class\"].cls\n node_config = context.config.branch(config_path)\n for req in cls.get_requirements():\n if req.name in node_config.data and req.name != \"class\":\n args[req.name] = node_config.data[req.name]\n\n obj = self._construct_class(context, config_path, args)\n if obj is not None and isinstance(obj, interfaces.symbols.SymbolTableInterface):\n context.symbol_space.append(obj)\n return None","function_tokens":["def","construct","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",")","->","None",":","config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","self",".","name",")","# Determine the space name","name","=","context",".","symbol_space",".","free_table_name","(","self",".","name",")","args","=","{","\"context\"",":","context",",","\"config_path\"",":","config_path",",","\"name\"",":","name","}","if","any","(","[","subreq",".","unsatisfied","(","context",",","config_path",")","for","subreq","in","self",".","requirements",".","values","(",")","if","not","subreq",".","optional","]",")",":","return","None","# Fill out the parameter for class creation","if","not","isinstance","(","self",".","requirements","[","\"class\"","]",",","interfaces",".","configuration",".","ClassRequirement",")",":","raise","TypeError","(","\"Class requirement is not of type ClassRequirement: {}\"",".","format","(","repr","(","self",".","requirements","[","\"class\"","]",")",")",")","cls","=","self",".","requirements","[","\"class\"","]",".","cls","node_config","=","context",".","config",".","branch","(","config_path",")","for","req","in","cls",".","get_requirements","(",")",":","if","req",".","name","in","node_config",".","data","and","req",".","name","!=","\"class\"",":","args","[","req",".","name","]","=","node_config",".","data","[","req",".","name","]","obj","=","self",".","_construct_class","(","context",",","config_path",",","args",")","if","obj","is","not","None","and","isinstance","(","obj",",","interfaces",".","symbols",".","SymbolTableInterface",")",":","context",".","symbol_space",".","append","(","obj",")","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L348-L374"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py","language":"python","identifier":"SymbolTableRequirement.build_configuration","parameters":"(self, context: interfaces.context.ContextInterface, _: str,\n value: Any)","argument_list":"","return_statement":"return context.symbol_space[value].build_configuration()","docstring":"Builds the appropriate configuration for the specified\n requirement.","docstring_summary":"Builds the appropriate configuration for the specified\n requirement.","docstring_tokens":["Builds","the","appropriate","configuration","for","the","specified","requirement","."],"function":"def build_configuration(self, context: interfaces.context.ContextInterface, _: str,\n value: Any) -> interfaces.configuration.HierarchicalDict:\n \"\"\"Builds the appropriate configuration for the specified\n requirement.\"\"\"\n return context.symbol_space[value].build_configuration()","function_tokens":["def","build_configuration","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","_",":","str",",","value",":","Any",")","->","interfaces",".","configuration",".","HierarchicalDict",":","return","context",".","symbol_space","[","value","]",".","build_configuration","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/configuration\/requirements.py#L376-L380"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeNode._validate_values","parameters":"(self, values: List[interfaces.renderers.BaseTypes])","argument_list":"","return_statement":"","docstring":"A function for raising exceptions if a given set of values is\n invalid according to the column properties.","docstring_summary":"A function for raising exceptions if a given set of values is\n invalid according to the column properties.","docstring_tokens":["A","function","for","raising","exceptions","if","a","given","set","of","values","is","invalid","according","to","the","column","properties","."],"function":"def _validate_values(self, values: List[interfaces.renderers.BaseTypes]) -> None:\n \"\"\"A function for raising exceptions if a given set of values is\n invalid according to the column properties.\"\"\"\n if not (isinstance(values, collections.abc.Sequence) and len(values) == len(self._treegrid.columns)):\n raise TypeError(\n \"Values must be a list of objects made up of simple types and number the same as the columns\")\n for index in range(len(self._treegrid.columns)):\n column = self._treegrid.columns[index]\n val = values[index]\n if not isinstance(val, (column.type, interfaces.renderers.BaseAbsentValue)):\n raise TypeError(\n \"Values item with index {} is the wrong type for column {} (got {} but expected {})\".format(\n index, column.name, type(val), column.type))","function_tokens":["def","_validate_values","(","self",",","values",":","List","[","interfaces",".","renderers",".","BaseTypes","]",")","->","None",":","if","not","(","isinstance","(","values",",","collections",".","abc",".","Sequence",")","and","len","(","values",")","==","len","(","self",".","_treegrid",".","columns",")",")",":","raise","TypeError","(","\"Values must be a list of objects made up of simple types and number the same as the columns\"",")","for","index","in","range","(","len","(","self",".","_treegrid",".","columns",")",")",":","column","=","self",".","_treegrid",".","columns","[","index","]","val","=","values","[","index","]","if","not","isinstance","(","val",",","(","column",".","type",",","interfaces",".","renderers",".","BaseAbsentValue",")",")",":","raise","TypeError","(","\"Values item with index {} is the wrong type for column {} (got {} but expected {})\"",".","format","(","index",",","column",".","name",",","type","(","val",")",",","column",".","type",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L70-L82"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeNode.values","parameters":"(self)","argument_list":"","return_statement":"return self._values","docstring":"Returns the list of values from the particular node, based on column\n index.","docstring_summary":"Returns the list of values from the particular node, based on column\n index.","docstring_tokens":["Returns","the","list","of","values","from","the","particular","node","based","on","column","index","."],"function":"def values(self) -> List[interfaces.renderers.BaseTypes]:\n \"\"\"Returns the list of values from the particular node, based on column\n index.\"\"\"\n return self._values","function_tokens":["def","values","(","self",")","->","List","[","interfaces",".","renderers",".","BaseTypes","]",":","return","self",".","_values"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L88-L91"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeNode.path","parameters":"(self)","argument_list":"","return_statement":"return self._path","docstring":"Returns a path identifying string.\n\n This should be seen as opaque by external classes, Parsing of\n path locations based on this string are not guaranteed to remain\n stable.","docstring_summary":"Returns a path identifying string.","docstring_tokens":["Returns","a","path","identifying","string","."],"function":"def path(self) -> str:\n \"\"\"Returns a path identifying string.\n\n This should be seen as opaque by external classes, Parsing of\n path locations based on this string are not guaranteed to remain\n stable.\n \"\"\"\n return self._path","function_tokens":["def","path","(","self",")","->","str",":","return","self",".","_path"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L94-L101"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeNode.parent","parameters":"(self)","argument_list":"","return_statement":"return self._parent","docstring":"Returns the parent node of this node or None.","docstring_summary":"Returns the parent node of this node or None.","docstring_tokens":["Returns","the","parent","node","of","this","node","or","None","."],"function":"def parent(self) -> Optional['TreeNode']:\n \"\"\"Returns the parent node of this node or None.\"\"\"\n return self._parent","function_tokens":["def","parent","(","self",")","->","Optional","[","'TreeNode'","]",":","return","self",".","_parent"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L104-L106"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeNode.path_depth","parameters":"(self)","argument_list":"","return_statement":"return len(self.path.split(TreeGrid.path_sep))","docstring":"Return the path depth of the current node.","docstring_summary":"Return the path depth of the current node.","docstring_tokens":["Return","the","path","depth","of","the","current","node","."],"function":"def path_depth(self) -> int:\n \"\"\"Return the path depth of the current node.\"\"\"\n return len(self.path.split(TreeGrid.path_sep))","function_tokens":["def","path_depth","(","self",")","->","int",":","return","len","(","self",".","path",".","split","(","TreeGrid",".","path_sep",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L109-L111"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeNode.path_changed","parameters":"(self, path: str, added: bool = False)","argument_list":"","return_statement":"","docstring":"Updates the path based on the addition or removal of a node higher\n up in the tree.\n\n This should only be called by the containing TreeGrid and\n expects to only be called for affected nodes.","docstring_summary":"Updates the path based on the addition or removal of a node higher\n up in the tree.","docstring_tokens":["Updates","the","path","based","on","the","addition","or","removal","of","a","node","higher","up","in","the","tree","."],"function":"def path_changed(self, path: str, added: bool = False) -> None:\n \"\"\"Updates the path based on the addition or removal of a node higher\n up in the tree.\n\n This should only be called by the containing TreeGrid and\n expects to only be called for affected nodes.\n \"\"\"\n components = self._path.split(TreeGrid.path_sep)\n changed = path.split(TreeGrid.path_sep)\n changed_index = len(changed) - 1\n if int(components[changed_index]) >= int(changed[-1]):\n components[changed_index] = str(int(components[changed_index]) + (1 if added else -1))\n self._path = TreeGrid.path_sep.join(components)","function_tokens":["def","path_changed","(","self",",","path",":","str",",","added",":","bool","=","False",")","->","None",":","components","=","self",".","_path",".","split","(","TreeGrid",".","path_sep",")","changed","=","path",".","split","(","TreeGrid",".","path_sep",")","changed_index","=","len","(","changed",")","-","1","if","int","(","components","[","changed_index","]",")",">=","int","(","changed","[","-","1","]",")",":","components","[","changed_index","]","=","str","(","int","(","components","[","changed_index","]",")","+","(","1","if","added","else","-","1",")",")","self",".","_path","=","TreeGrid",".","path_sep",".","join","(","components",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L113-L125"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid.__init__","parameters":"(self, columns: List[Tuple[str, interfaces.renderers.BaseTypes]],\n generator: Optional[Iterable[Tuple[int, Tuple]]])","argument_list":"","return_statement":"","docstring":"Constructs a TreeGrid object using a specific set of columns.\n\n The TreeGrid itself is a root element, that can have children but no values.\n The TreeGrid does *not* contain any information about formatting,\n these are up to the renderers and plugins.\n\n Args:\n columns: A list of column tuples made up of (name, type).\n generator: An iterable containing row for a tree grid, each row contains a indent level followed by the values for each column in order.","docstring_summary":"Constructs a TreeGrid object using a specific set of columns.","docstring_tokens":["Constructs","a","TreeGrid","object","using","a","specific","set","of","columns","."],"function":"def __init__(self, columns: List[Tuple[str, interfaces.renderers.BaseTypes]],\n generator: Optional[Iterable[Tuple[int, Tuple]]]) -> None:\n \"\"\"Constructs a TreeGrid object using a specific set of columns.\n\n The TreeGrid itself is a root element, that can have children but no values.\n The TreeGrid does *not* contain any information about formatting,\n these are up to the renderers and plugins.\n\n Args:\n columns: A list of column tuples made up of (name, type).\n generator: An iterable containing row for a tree grid, each row contains a indent level followed by the values for each column in order.\n \"\"\"\n self._populated = False\n self._row_count = 0\n self._children = [] # type: List[TreeNode]\n converted_columns = [] # type: List[interfaces.renderers.Column]\n if len(columns) < 1:\n raise ValueError(\"Columns must be a list containing at least one column\")\n for (name, column_type) in columns:\n is_simple_type = issubclass(column_type, self.base_types)\n if not is_simple_type:\n raise TypeError(\"Column {}'s type is not a simple type: {}\".format(name,\n column_type.__class__.__name__))\n converted_columns.append(interfaces.renderers.Column(name, column_type))\n self.RowStructure = RowStructureConstructor([column.name for column in converted_columns])\n self._columns = converted_columns\n if generator is None:\n generator = []\n generator = iter(generator)\n\n self._generator = generator","function_tokens":["def","__init__","(","self",",","columns",":","List","[","Tuple","[","str",",","interfaces",".","renderers",".","BaseTypes","]","]",",","generator",":","Optional","[","Iterable","[","Tuple","[","int",",","Tuple","]","]","]",")","->","None",":","self",".","_populated","=","False","self",".","_row_count","=","0","self",".","_children","=","[","]","# type: List[TreeNode]","converted_columns","=","[","]","# type: List[interfaces.renderers.Column]","if","len","(","columns",")","<","1",":","raise","ValueError","(","\"Columns must be a list containing at least one column\"",")","for","(","name",",","column_type",")","in","columns",":","is_simple_type","=","issubclass","(","column_type",",","self",".","base_types",")","if","not","is_simple_type",":","raise","TypeError","(","\"Column {}'s type is not a simple type: {}\"",".","format","(","name",",","column_type",".","__class__",".","__name__",")",")","converted_columns",".","append","(","interfaces",".","renderers",".","Column","(","name",",","column_type",")",")","self",".","RowStructure","=","RowStructureConstructor","(","[","column",".","name","for","column","in","converted_columns","]",")","self",".","_columns","=","converted_columns","if","generator","is","None",":","generator","=","[","]","generator","=","iter","(","generator",")","self",".","_generator","=","generator"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L147-L177"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid.populate","parameters":"(self,\n function: interfaces.renderers.VisitorSignature = None,\n initial_accumulator: Any = None,\n fail_on_errors: bool = True)","argument_list":"","return_statement":"return None","docstring":"Populates the tree by consuming the TreeGrid's construction\n generator Func is called on every node, so can be used to create output\n on demand.\n\n This is equivalent to a one-time visit.\n\n Args:\n function: The visitor to be called on each row of the treegrid\n initial_accumulator: The initial value for an accumulator passed to the visitor to allow it to maintain state\n fail_on_errors: A boolean defining whether exceptions should be caught or bubble up","docstring_summary":"Populates the tree by consuming the TreeGrid's construction\n generator Func is called on every node, so can be used to create output\n on demand.","docstring_tokens":["Populates","the","tree","by","consuming","the","TreeGrid","s","construction","generator","Func","is","called","on","every","node","so","can","be","used","to","create","output","on","demand","."],"function":"def populate(self,\n function: interfaces.renderers.VisitorSignature = None,\n initial_accumulator: Any = None,\n fail_on_errors: bool = True) -> Optional[Exception]:\n \"\"\"Populates the tree by consuming the TreeGrid's construction\n generator Func is called on every node, so can be used to create output\n on demand.\n\n This is equivalent to a one-time visit.\n\n Args:\n function: The visitor to be called on each row of the treegrid\n initial_accumulator: The initial value for an accumulator passed to the visitor to allow it to maintain state\n fail_on_errors: A boolean defining whether exceptions should be caught or bubble up\n \"\"\"\n accumulator = initial_accumulator\n if function is None:\n\n def function(_x: interfaces.renderers.TreeNode, _y: Any) -> Any:\n return None\n\n if not self.populated:\n try:\n prev_nodes = [] # type: List[TreeNode]\n for (level, item) in self._generator:\n parent_index = min(len(prev_nodes), level)\n parent = prev_nodes[parent_index - 1] if parent_index > 0 else None\n treenode = self._append(parent, item)\n prev_nodes = prev_nodes[0:parent_index] + [treenode]\n if function is not None:\n accumulator = function(treenode, accumulator)\n self._row_count += 1\n except Exception as excp:\n if fail_on_errors:\n raise\n vollog.debug(\"Exception during population: {}\".format(excp))\n self._populated = True\n return excp\n self._populated = True\n return None","function_tokens":["def","populate","(","self",",","function",":","interfaces",".","renderers",".","VisitorSignature","=","None",",","initial_accumulator",":","Any","=","None",",","fail_on_errors",":","bool","=","True",")","->","Optional","[","Exception","]",":","accumulator","=","initial_accumulator","if","function","is","None",":","def","function","(","_x",":","interfaces",".","renderers",".","TreeNode",",","_y",":","Any",")","->","Any",":","return","None","if","not","self",".","populated",":","try",":","prev_nodes","=","[","]","# type: List[TreeNode]","for","(","level",",","item",")","in","self",".","_generator",":","parent_index","=","min","(","len","(","prev_nodes",")",",","level",")","parent","=","prev_nodes","[","parent_index","-","1","]","if","parent_index",">","0","else","None","treenode","=","self",".","_append","(","parent",",","item",")","prev_nodes","=","prev_nodes","[","0",":","parent_index","]","+","[","treenode","]","if","function","is","not","None",":","accumulator","=","function","(","treenode",",","accumulator",")","self",".","_row_count","+=","1","except","Exception","as","excp",":","if","fail_on_errors",":","raise","vollog",".","debug","(","\"Exception during population: {}\"",".","format","(","excp",")",")","self",".","_populated","=","True","return","excp","self",".","_populated","=","True","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L187-L226"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid.populated","parameters":"(self)","argument_list":"","return_statement":"return self._populated","docstring":"Indicates that population has completed and the tree may now be\n manipulated separately.","docstring_summary":"Indicates that population has completed and the tree may now be\n manipulated separately.","docstring_tokens":["Indicates","that","population","has","completed","and","the","tree","may","now","be","manipulated","separately","."],"function":"def populated(self):\n \"\"\"Indicates that population has completed and the tree may now be\n manipulated separately.\"\"\"\n return self._populated","function_tokens":["def","populated","(","self",")",":","return","self",".","_populated"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L229-L232"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid.columns","parameters":"(self)","argument_list":"","return_statement":"return self._columns","docstring":"Returns the available columns and their ordering and types.","docstring_summary":"Returns the available columns and their ordering and types.","docstring_tokens":["Returns","the","available","columns","and","their","ordering","and","types","."],"function":"def columns(self) -> List[interfaces.renderers.Column]:\n \"\"\"Returns the available columns and their ordering and types.\"\"\"\n return self._columns","function_tokens":["def","columns","(","self",")","->","List","[","interfaces",".","renderers",".","Column","]",":","return","self",".","_columns"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L235-L237"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid.row_count","parameters":"(self)","argument_list":"","return_statement":"return self._row_count","docstring":"Returns the number of rows populated.","docstring_summary":"Returns the number of rows populated.","docstring_tokens":["Returns","the","number","of","rows","populated","."],"function":"def row_count(self) -> int:\n \"\"\"Returns the number of rows populated.\"\"\"\n return self._row_count","function_tokens":["def","row_count","(","self",")","->","int",":","return","self",".","_row_count"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L240-L242"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid.children","parameters":"(self, node)","argument_list":"","return_statement":"return [node for node, _ in self._find_children(node)]","docstring":"Returns the subnodes of a particular node in order.","docstring_summary":"Returns the subnodes of a particular node in order.","docstring_tokens":["Returns","the","subnodes","of","a","particular","node","in","order","."],"function":"def children(self, node) -> List[interfaces.renderers.TreeNode]:\n \"\"\"Returns the subnodes of a particular node in order.\"\"\"\n return [node for node, _ in self._find_children(node)]","function_tokens":["def","children","(","self",",","node",")","->","List","[","interfaces",".","renderers",".","TreeNode","]",":","return","[","node","for","node",",","_","in","self",".","_find_children","(","node",")","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L244-L246"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid._find_children","parameters":"(self, node)","argument_list":"","return_statement":"return children","docstring":"Returns the children list associated with a particular node.\n\n Returns None if the node does not exist","docstring_summary":"Returns the children list associated with a particular node.","docstring_tokens":["Returns","the","children","list","associated","with","a","particular","node","."],"function":"def _find_children(self, node):\n \"\"\"Returns the children list associated with a particular node.\n\n Returns None if the node does not exist\n \"\"\"\n children = self._children\n try:\n if node is not None:\n for path_component in node.path.split(self.path_sep):\n _, children = children[int(path_component)]\n except IndexError:\n return []\n return children","function_tokens":["def","_find_children","(","self",",","node",")",":","children","=","self",".","_children","try",":","if","node","is","not","None",":","for","path_component","in","node",".","path",".","split","(","self",".","path_sep",")",":","_",",","children","=","children","[","int","(","path_component",")","]","except","IndexError",":","return","[","]","return","children"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L248-L260"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid.values","parameters":"(self, node)","argument_list":"","return_statement":"return node.values","docstring":"Returns the values for a particular node.\n\n The values returned are mutable,","docstring_summary":"Returns the values for a particular node.","docstring_tokens":["Returns","the","values","for","a","particular","node","."],"function":"def values(self, node):\n \"\"\"Returns the values for a particular node.\n\n The values returned are mutable,\n \"\"\"\n if node is None:\n raise TypeError(\"Node must be a valid node within the TreeGrid\")\n return node.values","function_tokens":["def","values","(","self",",","node",")",":","if","node","is","None",":","raise","TypeError","(","\"Node must be a valid node within the TreeGrid\"",")","return","node",".","values"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L262-L269"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid._append","parameters":"(self, parent, values)","argument_list":"","return_statement":"return self._insert(parent, len(children), values)","docstring":"Adds a new node at the top level if parent is None, or under the\n parent node otherwise, after all other children.","docstring_summary":"Adds a new node at the top level if parent is None, or under the\n parent node otherwise, after all other children.","docstring_tokens":["Adds","a","new","node","at","the","top","level","if","parent","is","None","or","under","the","parent","node","otherwise","after","all","other","children","."],"function":"def _append(self, parent, values):\n \"\"\"Adds a new node at the top level if parent is None, or under the\n parent node otherwise, after all other children.\"\"\"\n children = self.children(parent)\n return self._insert(parent, len(children), values)","function_tokens":["def","_append","(","self",",","parent",",","values",")",":","children","=","self",".","children","(","parent",")","return","self",".","_insert","(","parent",",","len","(","children",")",",","values",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L271-L275"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid._insert","parameters":"(self, parent, position, values)","argument_list":"","return_statement":"return tree_item","docstring":"Inserts an element into the tree at a specific position.","docstring_summary":"Inserts an element into the tree at a specific position.","docstring_tokens":["Inserts","an","element","into","the","tree","at","a","specific","position","."],"function":"def _insert(self, parent, position, values):\n \"\"\"Inserts an element into the tree at a specific position.\"\"\"\n parent_path = \"\"\n children = self._find_children(parent)\n if parent is not None:\n parent_path = parent.path + self.path_sep\n newpath = parent_path + str(position)\n tree_item = TreeNode(newpath, self, parent, values)\n for node, _ in children[position:]:\n self.visit(node, lambda child, _: child.path_changed(newpath, True), None)\n children.insert(position, (tree_item, []))\n return tree_item","function_tokens":["def","_insert","(","self",",","parent",",","position",",","values",")",":","parent_path","=","\"\"","children","=","self",".","_find_children","(","parent",")","if","parent","is","not","None",":","parent_path","=","parent",".","path","+","self",".","path_sep","newpath","=","parent_path","+","str","(","position",")","tree_item","=","TreeNode","(","newpath",",","self",",","parent",",","values",")","for","node",",","_","in","children","[","position",":","]",":","self",".","visit","(","node",",","lambda","child",",","_",":","child",".","path_changed","(","newpath",",","True",")",",","None",")","children",".","insert","(","position",",","(","tree_item",",","[","]",")",")","return","tree_item"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L277-L288"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid.is_ancestor","parameters":"(self, node, descendant)","argument_list":"","return_statement":"return descendant.path.startswith(node.path)","docstring":"Returns true if descendent is a child, grandchild, etc of node.","docstring_summary":"Returns true if descendent is a child, grandchild, etc of node.","docstring_tokens":["Returns","true","if","descendent","is","a","child","grandchild","etc","of","node","."],"function":"def is_ancestor(self, node, descendant):\n \"\"\"Returns true if descendent is a child, grandchild, etc of node.\"\"\"\n return descendant.path.startswith(node.path)","function_tokens":["def","is_ancestor","(","self",",","node",",","descendant",")",":","return","descendant",".","path",".","startswith","(","node",".","path",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L290-L292"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid.max_depth","parameters":"(self)","argument_list":"","return_statement":"return self.visit(None, lambda n, a: max(a, self.path_depth(n)), 0)","docstring":"Returns the maximum depth of the tree.","docstring_summary":"Returns the maximum depth of the tree.","docstring_tokens":["Returns","the","maximum","depth","of","the","tree","."],"function":"def max_depth(self):\n \"\"\"Returns the maximum depth of the tree.\"\"\"\n return self.visit(None, lambda n, a: max(a, self.path_depth(n)), 0)","function_tokens":["def","max_depth","(","self",")",":","return","self",".","visit","(","None",",","lambda","n",",","a",":","max","(","a",",","self",".","path_depth","(","n",")",")",",","0",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L294-L296"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid.visit","parameters":"(self,\n node: Optional[interfaces.renderers.TreeNode],\n function: Callable[[interfaces.renderers.TreeNode, _T], _T],\n initial_accumulator: _T,\n sort_key: Optional[interfaces.renderers.ColumnSortKey] = None)","argument_list":"","return_statement":"return accumulator","docstring":"Visits all the nodes in a tree, calling function on each one.\n\n function should have the signature function(node, accumulator) and return new_accumulator\n If accumulators are not needed, the function must still accept a second parameter.\n\n The order of that the nodes are visited is always depth first, however, the order children are traversed can\n be set based on a sort_key function which should accept a node's values and return something that can be\n sorted to receive the desired order (similar to the sort\/sorted key).\n\n We use the private _find_children function so that we don't have to re-traverse the tree\n for every node we descend further down","docstring_summary":"Visits all the nodes in a tree, calling function on each one.","docstring_tokens":["Visits","all","the","nodes","in","a","tree","calling","function","on","each","one","."],"function":"def visit(self,\n node: Optional[interfaces.renderers.TreeNode],\n function: Callable[[interfaces.renderers.TreeNode, _T], _T],\n initial_accumulator: _T,\n sort_key: Optional[interfaces.renderers.ColumnSortKey] = None):\n \"\"\"Visits all the nodes in a tree, calling function on each one.\n\n function should have the signature function(node, accumulator) and return new_accumulator\n If accumulators are not needed, the function must still accept a second parameter.\n\n The order of that the nodes are visited is always depth first, however, the order children are traversed can\n be set based on a sort_key function which should accept a node's values and return something that can be\n sorted to receive the desired order (similar to the sort\/sorted key).\n\n We use the private _find_children function so that we don't have to re-traverse the tree\n for every node we descend further down\n \"\"\"\n if not self.populated:\n self.populate()\n\n # Find_nodes is path dependent, whereas _visit is not\n # So in case the function modifies the node's path, find the nodes first\n children = self._find_children(node)\n accumulator = initial_accumulator\n # We split visit into two, so that we don't have to keep calling find_children to traverse the tree\n if node is not None:\n accumulator = function(node, initial_accumulator)\n if children is not None:\n if sort_key is not None:\n sort_key_not_none = sort_key # Only necessary because of mypy\n children = sorted(children, key = lambda x: sort_key_not_none(x[0].values))\n if not sort_key.ascending:\n children = reversed(children)\n accumulator = self._visit(children, function, accumulator, sort_key)\n return accumulator","function_tokens":["def","visit","(","self",",","node",":","Optional","[","interfaces",".","renderers",".","TreeNode","]",",","function",":","Callable","[","[","interfaces",".","renderers",".","TreeNode",",","_T","]",",","_T","]",",","initial_accumulator",":","_T",",","sort_key",":","Optional","[","interfaces",".","renderers",".","ColumnSortKey","]","=","None",")",":","if","not","self",".","populated",":","self",".","populate","(",")","# Find_nodes is path dependent, whereas _visit is not","# So in case the function modifies the node's path, find the nodes first","children","=","self",".","_find_children","(","node",")","accumulator","=","initial_accumulator","# We split visit into two, so that we don't have to keep calling find_children to traverse the tree","if","node","is","not","None",":","accumulator","=","function","(","node",",","initial_accumulator",")","if","children","is","not","None",":","if","sort_key","is","not","None",":","sort_key_not_none","=","sort_key","# Only necessary because of mypy","children","=","sorted","(","children",",","key","=","lambda","x",":","sort_key_not_none","(","x","[","0","]",".","values",")",")","if","not","sort_key",".","ascending",":","children","=","reversed","(","children",")","accumulator","=","self",".","_visit","(","children",",","function",",","accumulator",",","sort_key",")","return","accumulator"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L300-L334"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"TreeGrid._visit","parameters":"(self,\n list_of_children: List['TreeNode'],\n function: Callable,\n accumulator: _T,\n sort_key: Optional[interfaces.renderers.ColumnSortKey] = None)","argument_list":"","return_statement":"return accumulator","docstring":"Visits all the nodes in a tree, calling function on each one.","docstring_summary":"Visits all the nodes in a tree, calling function on each one.","docstring_tokens":["Visits","all","the","nodes","in","a","tree","calling","function","on","each","one","."],"function":"def _visit(self,\n list_of_children: List['TreeNode'],\n function: Callable,\n accumulator: _T,\n sort_key: Optional[interfaces.renderers.ColumnSortKey] = None) -> _T:\n \"\"\"Visits all the nodes in a tree, calling function on each one.\"\"\"\n if list_of_children is not None:\n for n, children in list_of_children:\n accumulator = function(n, accumulator)\n if sort_key is not None:\n sort_key_not_none = sort_key # Only necessary because of mypy\n children = sorted(children, key = lambda x: sort_key_not_none(x[0].values))\n if not sort_key.ascending:\n children = reversed(children)\n accumulator = self._visit(children, function, accumulator, sort_key)\n return accumulator","function_tokens":["def","_visit","(","self",",","list_of_children",":","List","[","'TreeNode'","]",",","function",":","Callable",",","accumulator",":","_T",",","sort_key",":","Optional","[","interfaces",".","renderers",".","ColumnSortKey","]","=","None",")","->","_T",":","if","list_of_children","is","not","None",":","for","n",",","children","in","list_of_children",":","accumulator","=","function","(","n",",","accumulator",")","if","sort_key","is","not","None",":","sort_key_not_none","=","sort_key","# Only necessary because of mypy","children","=","sorted","(","children",",","key","=","lambda","x",":","sort_key_not_none","(","x","[","0","]",".","values",")",")","if","not","sort_key",".","ascending",":","children","=","reversed","(","children",")","accumulator","=","self",".","_visit","(","children",",","function",",","accumulator",",","sort_key",")","return","accumulator"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L336-L351"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py","language":"python","identifier":"ColumnSortKey.__call__","parameters":"(self, values: List[Any])","argument_list":"","return_statement":"return value","docstring":"The key function passed as the sort key.","docstring_summary":"The key function passed as the sort key.","docstring_tokens":["The","key","function","passed","as","the","sort","key","."],"function":"def __call__(self, values: List[Any]) -> Any:\n \"\"\"The key function passed as the sort key.\"\"\"\n value = values[self._index]\n if isinstance(value, interfaces.renderers.BaseAbsentValue):\n if self._type == datetime.datetime:\n value = datetime.datetime.min\n elif self._type in [int, float]:\n value = -1\n elif self._type == bool:\n value = False\n elif self._type in [str, renderers.Disassembly]:\n value = \"-\"\n elif self._type == bytes:\n value = b\"\"\n return value","function_tokens":["def","__call__","(","self",",","values",":","List","[","Any","]",")","->","Any",":","value","=","values","[","self",".","_index","]","if","isinstance","(","value",",","interfaces",".","renderers",".","BaseAbsentValue",")",":","if","self",".","_type","==","datetime",".","datetime",":","value","=","datetime",".","datetime",".","min","elif","self",".","_type","in","[","int",",","float","]",":","value","=","-","1","elif","self",".","_type","==","bool",":","value","=","False","elif","self",".","_type","in","[","str",",","renderers",".","Disassembly","]",":","value","=","\"-\"","elif","self",".","_type","==","bytes",":","value","=","b\"\"","return","value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/__init__.py#L369-L383"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/conversion.py","language":"python","identifier":"round","parameters":"(addr: int, align: int, up: bool = False)","argument_list":"","return_statement":"","docstring":"Round an address up or down based on an alignment.\n\n Args:\n addr: the address\n align: the alignment value\n up: Whether to round up or not\n\n Returns:\n The aligned address","docstring_summary":"Round an address up or down based on an alignment.","docstring_tokens":["Round","an","address","up","or","down","based","on","an","alignment","."],"function":"def round(addr: int, align: int, up: bool = False) -> int:\n \"\"\"Round an address up or down based on an alignment.\n\n Args:\n addr: the address\n align: the alignment value\n up: Whether to round up or not\n\n Returns:\n The aligned address\n \"\"\"\n\n if addr % align == 0:\n return addr\n else:\n if up:\n return (addr + (align - (addr % align)))\n return (addr - (addr % align))","function_tokens":["def","round","(","addr",":","int",",","align",":","int",",","up",":","bool","=","False",")","->","int",":","if","addr","%","align","==","0",":","return","addr","else",":","if","up",":","return","(","addr","+","(","align","-","(","addr","%","align",")",")",")","return","(","addr","-","(","addr","%","align",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/conversion.py#L38-L55"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/conversion.py","language":"python","identifier":"convert_network_four_tuple","parameters":"(family, four_tuple)","argument_list":"","return_statement":"return ret","docstring":"Converts the connection four_tuple: (source ip, source port, dest ip,\n dest port)\n\n into their string equivalents. IP addresses are expected as a tuple\n of unsigned shorts Ports are converted to proper endianess as well","docstring_summary":"Converts the connection four_tuple: (source ip, source port, dest ip,\n dest port)","docstring_tokens":["Converts","the","connection","four_tuple",":","(","source","ip","source","port","dest","ip","dest","port",")"],"function":"def convert_network_four_tuple(family, four_tuple):\n \"\"\"Converts the connection four_tuple: (source ip, source port, dest ip,\n dest port)\n\n into their string equivalents. IP addresses are expected as a tuple\n of unsigned shorts Ports are converted to proper endianess as well\n \"\"\"\n\n if family == socket.AF_INET:\n ret = (convert_ipv4(four_tuple[0]), convert_port(four_tuple[1]), convert_ipv4(four_tuple[2]),\n convert_port(four_tuple[3]))\n elif family == socket.AF_INET6:\n ret = (convert_ipv6(four_tuple[0]), convert_port(four_tuple[1]), convert_ipv6(four_tuple[2]),\n convert_port(four_tuple[3]))\n else:\n ret = None\n\n return ret","function_tokens":["def","convert_network_four_tuple","(","family",",","four_tuple",")",":","if","family","==","socket",".","AF_INET",":","ret","=","(","convert_ipv4","(","four_tuple","[","0","]",")",",","convert_port","(","four_tuple","[","1","]",")",",","convert_ipv4","(","four_tuple","[","2","]",")",",","convert_port","(","four_tuple","[","3","]",")",")","elif","family","==","socket",".","AF_INET6",":","ret","=","(","convert_ipv6","(","four_tuple","[","0","]",")",",","convert_port","(","four_tuple","[","1","]",")",",","convert_ipv6","(","four_tuple","[","2","]",")",",","convert_port","(","four_tuple","[","3","]",")",")","else",":","ret","=","None","return","ret"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/renderers\/conversion.py#L94-L111"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/elf.py","language":"python","identifier":"Elf64Layer._load_segments","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Load the segments from based on the PT_LOAD segments of the Elf64 format","docstring_summary":"Load the segments from based on the PT_LOAD segments of the Elf64 format","docstring_tokens":["Load","the","segments","from","based","on","the","PT_LOAD","segments","of","the","Elf64","format"],"function":"def _load_segments(self) -> None:\n \"\"\"Load the segments from based on the PT_LOAD segments of the Elf64 format\"\"\"\n ehdr = self.context.object(self._elf_table_name + constants.BANG + \"Elf64_Ehdr\",\n layer_name = self._base_layer,\n offset = 0)\n\n segments = []\n\n for pindex in range(ehdr.e_phnum):\n phdr = self.context.object(self._elf_table_name + constants.BANG + \"Elf64_Phdr\",\n layer_name = self._base_layer,\n offset = ehdr.e_phoff + (pindex * ehdr.e_phentsize))\n # We only want PT_TYPES with valid sizes\n if phdr.p_type.lookup() == \"PT_LOAD\" and phdr.p_filesz == phdr.p_memsz and phdr.p_filesz > 0:\n # Cast these to ints to ensure the offsets don't need reconstructing\n segments.append((int(phdr.p_paddr), int(phdr.p_offset), int(phdr.p_memsz), int(phdr.p_memsz)))\n\n if len(segments) == 0:\n raise ElfFormatException(self.name, \"No ELF segments defined in {}\".format(self._base_layer))\n\n self._segments = segments","function_tokens":["def","_load_segments","(","self",")","->","None",":","ehdr","=","self",".","context",".","object","(","self",".","_elf_table_name","+","constants",".","BANG","+","\"Elf64_Ehdr\"",",","layer_name","=","self",".","_base_layer",",","offset","=","0",")","segments","=","[","]","for","pindex","in","range","(","ehdr",".","e_phnum",")",":","phdr","=","self",".","context",".","object","(","self",".","_elf_table_name","+","constants",".","BANG","+","\"Elf64_Phdr\"",",","layer_name","=","self",".","_base_layer",",","offset","=","ehdr",".","e_phoff","+","(","pindex","*","ehdr",".","e_phentsize",")",")","# We only want PT_TYPES with valid sizes","if","phdr",".","p_type",".","lookup","(",")","==","\"PT_LOAD\"","and","phdr",".","p_filesz","==","phdr",".","p_memsz","and","phdr",".","p_filesz",">","0",":","# Cast these to ints to ensure the offsets don't need reconstructing","segments",".","append","(","(","int","(","phdr",".","p_paddr",")",",","int","(","phdr",".","p_offset",")",",","int","(","phdr",".","p_memsz",")",",","int","(","phdr",".","p_memsz",")",")",")","if","len","(","segments",")","==","0",":","raise","ElfFormatException","(","self",".","name",",","\"No ELF segments defined in {}\"",".","format","(","self",".","_base_layer",")",")","self",".","_segments","=","segments"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/elf.py#L31-L51"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/msf.py","language":"python","identifier":"PdbMultiStreamFormat._check_header","parameters":"(self)","argument_list":"","return_statement":"return None","docstring":"Verifies the header of the PDB file and returns the version of the\n file.","docstring_summary":"Verifies the header of the PDB file and returns the version of the\n file.","docstring_tokens":["Verifies","the","header","of","the","PDB","file","and","returns","the","version","of","the","file","."],"function":"def _check_header(self) -> Optional[Tuple[str, interfaces.objects.ObjectInterface]]:\n \"\"\"Verifies the header of the PDB file and returns the version of the\n file.\"\"\"\n for header in self._headers:\n header_type = self.pdb_symbol_table + constants.BANG + header\n current_header = self.context.object(header_type, self._base_layer, 0)\n if utility.array_to_string(current_header.Magic) == self._headers[header]:\n if not (current_header.PageSize < 0x100 or current_header.PageSize > (128 * 0x10000)):\n return header, current_header\n return None","function_tokens":["def","_check_header","(","self",")","->","Optional","[","Tuple","[","str",",","interfaces",".","objects",".","ObjectInterface","]","]",":","for","header","in","self",".","_headers",":","header_type","=","self",".","pdb_symbol_table","+","constants",".","BANG","+","header","current_header","=","self",".","context",".","object","(","header_type",",","self",".","_base_layer",",","0",")","if","utility",".","array_to_string","(","current_header",".","Magic",")","==","self",".","_headers","[","header","]",":","if","not","(","current_header",".","PageSize","<","0x100","or","current_header",".","PageSize",">","(","128","*","0x10000",")",")",":","return","header",",","current_header","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/msf.py#L103-L112"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/msf.py","language":"python","identifier":"PdbMultiStreamFormat.dependencies","parameters":"(self)","argument_list":"","return_statement":"return [self._base_layer]","docstring":"Returns a list of the lower layers that this layer is dependent\n upon.","docstring_summary":"Returns a list of the lower layers that this layer is dependent\n upon.","docstring_tokens":["Returns","a","list","of","the","lower","layers","that","this","layer","is","dependent","upon","."],"function":"def dependencies(self) -> List[str]:\n \"\"\"Returns a list of the lower layers that this layer is dependent\n upon.\"\"\"\n return [self._base_layer]","function_tokens":["def","dependencies","(","self",")","->","List","[","str","]",":","return","[","self",".","_base_layer","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/msf.py#L119-L122"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py","language":"python","identifier":"Intel.page_size","parameters":"(cls)","argument_list":"","return_statement":"return 1 << cls._page_size_in_bits","docstring":"Page size for the intel memory layers.\n\n All Intel layers work on 4096 byte pages","docstring_summary":"Page size for the intel memory layers.","docstring_tokens":["Page","size","for","the","intel","memory","layers","."],"function":"def page_size(cls) -> int:\n \"\"\"Page size for the intel memory layers.\n\n All Intel layers work on 4096 byte pages\n \"\"\"\n return 1 << cls._page_size_in_bits","function_tokens":["def","page_size","(","cls",")","->","int",":","return","1","<<","cls",".","_page_size_in_bits"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py#L54-L59"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py","language":"python","identifier":"Intel.bits_per_register","parameters":"(cls)","argument_list":"","return_statement":"return cls._bits_per_register","docstring":"Returns the bits_per_register to determine the range of an\n IntelTranslationLayer.","docstring_summary":"Returns the bits_per_register to determine the range of an\n IntelTranslationLayer.","docstring_tokens":["Returns","the","bits_per_register","to","determine","the","range","of","an","IntelTranslationLayer","."],"function":"def bits_per_register(cls) -> int:\n \"\"\"Returns the bits_per_register to determine the range of an\n IntelTranslationLayer.\"\"\"\n return cls._bits_per_register","function_tokens":["def","bits_per_register","(","cls",")","->","int",":","return","cls",".","_bits_per_register"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py#L62-L65"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py","language":"python","identifier":"Intel._mask","parameters":"(value: int, high_bit: int, low_bit: int)","argument_list":"","return_statement":"return value & mask","docstring":"Returns the bits of a value between highbit and lowbit inclusive.","docstring_summary":"Returns the bits of a value between highbit and lowbit inclusive.","docstring_tokens":["Returns","the","bits","of","a","value","between","highbit","and","lowbit","inclusive","."],"function":"def _mask(value: int, high_bit: int, low_bit: int) -> int:\n \"\"\"Returns the bits of a value between highbit and lowbit inclusive.\"\"\"\n high_mask = (1 << (high_bit + 1)) - 1\n low_mask = (1 << low_bit) - 1\n mask = (high_mask ^ low_mask)\n # print(high_bit, low_bit, bin(mask), bin(value))\n return value & mask","function_tokens":["def","_mask","(","value",":","int",",","high_bit",":","int",",","low_bit",":","int",")","->","int",":","high_mask","=","(","1","<<","(","high_bit","+","1",")",")","-","1","low_mask","=","(","1","<<","low_bit",")","-","1","mask","=","(","high_mask","^","low_mask",")","# print(high_bit, low_bit, bin(mask), bin(value))","return","value","&","mask"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py#L80-L86"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py","language":"python","identifier":"Intel._page_is_valid","parameters":"(entry: int)","argument_list":"","return_statement":"return bool(entry & 1)","docstring":"Returns whether a particular page is valid based on its entry.","docstring_summary":"Returns whether a particular page is valid based on its entry.","docstring_tokens":["Returns","whether","a","particular","page","is","valid","based","on","its","entry","."],"function":"def _page_is_valid(entry: int) -> bool:\n \"\"\"Returns whether a particular page is valid based on its entry.\"\"\"\n return bool(entry & 1)","function_tokens":["def","_page_is_valid","(","entry",":","int",")","->","bool",":","return","bool","(","entry","&","1",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py#L89-L91"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py","language":"python","identifier":"Intel._translate","parameters":"(self, offset: int)","argument_list":"","return_statement":"return page, 1 << (position + 1), self._base_layer","docstring":"Translates a specific offset based on paging tables.\n\n Returns the translated offset, the contiguous pagesize that the\n translated address lives in and the layer_name that the address\n lives in","docstring_summary":"Translates a specific offset based on paging tables.","docstring_tokens":["Translates","a","specific","offset","based","on","paging","tables","."],"function":"def _translate(self, offset: int) -> Tuple[int, int, str]:\n \"\"\"Translates a specific offset based on paging tables.\n\n Returns the translated offset, the contiguous pagesize that the\n translated address lives in and the layer_name that the address\n lives in\n \"\"\"\n entry, position = self._translate_entry(offset)\n\n # Now we're done\n if not self._page_is_valid(entry):\n raise exceptions.PagedInvalidAddressException(self.name, offset, position + 1, entry,\n \"Page Fault at entry {} in page entry\".format(hex(entry)))\n page = self._mask(entry, self._maxphyaddr - 1, position + 1) | self._mask(offset, position, 0)\n\n return page, 1 << (position + 1), self._base_layer","function_tokens":["def","_translate","(","self",",","offset",":","int",")","->","Tuple","[","int",",","int",",","str","]",":","entry",",","position","=","self",".","_translate_entry","(","offset",")","# Now we're done","if","not","self",".","_page_is_valid","(","entry",")",":","raise","exceptions",".","PagedInvalidAddressException","(","self",".","name",",","offset",",","position","+","1",",","entry",",","\"Page Fault at entry {} in page entry\"",".","format","(","hex","(","entry",")",")",")","page","=","self",".","_mask","(","entry",",","self",".","_maxphyaddr","-","1",",","position","+","1",")","|","self",".","_mask","(","offset",",","position",",","0",")","return","page",",","1","<<","(","position","+","1",")",",","self",".","_base_layer"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py#L93-L108"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py","language":"python","identifier":"Intel._translate_entry","parameters":"(self, offset)","argument_list":"","return_statement":"return entry, position","docstring":"Translates a specific offset based on paging tables.\n\n Returns the translated entry value","docstring_summary":"Translates a specific offset based on paging tables.","docstring_tokens":["Translates","a","specific","offset","based","on","paging","tables","."],"function":"def _translate_entry(self, offset):\n \"\"\"Translates a specific offset based on paging tables.\n\n Returns the translated entry value\n \"\"\"\n # Setup the entry and how far we are through the offset\n # Position maintains the number of bits left to process\n # We or with 0x1 to ensure our page_map_offset is always valid\n position = self._initial_position\n entry = self._initial_entry\n\n # Run through the offset in various chunks\n for (name, size, large_page) in self._structure:\n # Check we're valid\n if not self._page_is_valid(entry):\n raise exceptions.PagedInvalidAddressException(self.name, offset, position + 1, entry,\n \"Page Fault at entry \" + hex(entry) + \" in table \" + name)\n # Check if we're a large page\n if large_page and (entry & (1 << 7)):\n # We're a large page, the rest is finished below\n # If we want to implement PSE-36, it would need to be done here\n break\n # Figure out how much of the offset we should be using\n start = position\n position -= size\n index = self._mask(offset, start, position + 1) >> (position + 1)\n\n # Grab the base address of the table we'll be getting the next entry from\n base_address = self._mask(entry, self._maxphyaddr - 1, size + self._index_shift)\n\n table = self._get_valid_table(base_address)\n if table is None:\n raise exceptions.PagedInvalidAddressException(self.name, offset, position + 1, entry,\n \"Page Fault at entry \" + hex(entry) + \" in table \" + name)\n\n # Read the data for the next entry\n entry_data = table[(index << self._index_shift):(index << self._index_shift) + self._entry_size]\n\n # Read out the new entry from memory\n entry, = struct.unpack(self._entry_format, entry_data)\n\n return entry, position","function_tokens":["def","_translate_entry","(","self",",","offset",")",":","# Setup the entry and how far we are through the offset","# Position maintains the number of bits left to process","# We or with 0x1 to ensure our page_map_offset is always valid","position","=","self",".","_initial_position","entry","=","self",".","_initial_entry","# Run through the offset in various chunks","for","(","name",",","size",",","large_page",")","in","self",".","_structure",":","# Check we're valid","if","not","self",".","_page_is_valid","(","entry",")",":","raise","exceptions",".","PagedInvalidAddressException","(","self",".","name",",","offset",",","position","+","1",",","entry",",","\"Page Fault at entry \"","+","hex","(","entry",")","+","\" in table \"","+","name",")","# Check if we're a large page","if","large_page","and","(","entry","&","(","1","<<","7",")",")",":","# We're a large page, the rest is finished below","# If we want to implement PSE-36, it would need to be done here","break","# Figure out how much of the offset we should be using","start","=","position","position","-=","size","index","=","self",".","_mask","(","offset",",","start",",","position","+","1",")",">>","(","position","+","1",")","# Grab the base address of the table we'll be getting the next entry from","base_address","=","self",".","_mask","(","entry",",","self",".","_maxphyaddr","-","1",",","size","+","self",".","_index_shift",")","table","=","self",".","_get_valid_table","(","base_address",")","if","table","is","None",":","raise","exceptions",".","PagedInvalidAddressException","(","self",".","name",",","offset",",","position","+","1",",","entry",",","\"Page Fault at entry \"","+","hex","(","entry",")","+","\" in table \"","+","name",")","# Read the data for the next entry","entry_data","=","table","[","(","index","<<","self",".","_index_shift",")",":","(","index","<<","self",".","_index_shift",")","+","self",".","_entry_size","]","# Read out the new entry from memory","entry",",","=","struct",".","unpack","(","self",".","_entry_format",",","entry_data",")","return","entry",",","position"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py#L110-L151"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py","language":"python","identifier":"Intel._get_valid_table","parameters":"(self, base_address: int)","argument_list":"","return_statement":"return table","docstring":"Extracts the table, validates it and returns it if it's valid.","docstring_summary":"Extracts the table, validates it and returns it if it's valid.","docstring_tokens":["Extracts","the","table","validates","it","and","returns","it","if","it","s","valid","."],"function":"def _get_valid_table(self, base_address: int) -> Optional[bytes]:\n \"\"\"Extracts the table, validates it and returns it if it's valid.\"\"\"\n table = self._context.layers.read(self._base_layer, base_address, self.page_size)\n\n # If the table is entirely duplicates, then mark the whole table as bad\n if (table == table[:self._entry_size] * self._entry_number):\n return None\n return table","function_tokens":["def","_get_valid_table","(","self",",","base_address",":","int",")","->","Optional","[","bytes","]",":","table","=","self",".","_context",".","layers",".","read","(","self",".","_base_layer",",","base_address",",","self",".","page_size",")","# If the table is entirely duplicates, then mark the whole table as bad","if","(","table","==","table","[",":","self",".","_entry_size","]","*","self",".","_entry_number",")",":","return","None","return","table"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py#L154-L161"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py","language":"python","identifier":"Intel.is_valid","parameters":"(self, offset: int, length: int = 1)","argument_list":"","return_statement":"","docstring":"Returns whether the address offset can be translated to a valid\n address.","docstring_summary":"Returns whether the address offset can be translated to a valid\n address.","docstring_tokens":["Returns","whether","the","address","offset","can","be","translated","to","a","valid","address","."],"function":"def is_valid(self, offset: int, length: int = 1) -> bool:\n \"\"\"Returns whether the address offset can be translated to a valid\n address.\"\"\"\n try:\n # TODO: Consider reimplementing this, since calls to mapping can call is_valid\n return all([\n self._context.layers[layer].is_valid(mapped_offset)\n for _, _, mapped_offset, _, layer in self.mapping(offset, length)\n ])\n except exceptions.InvalidAddressException:\n return False","function_tokens":["def","is_valid","(","self",",","offset",":","int",",","length",":","int","=","1",")","->","bool",":","try",":","# TODO: Consider reimplementing this, since calls to mapping can call is_valid","return","all","(","[","self",".","_context",".","layers","[","layer","]",".","is_valid","(","mapped_offset",")","for","_",",","_",",","mapped_offset",",","_",",","layer","in","self",".","mapping","(","offset",",","length",")","]",")","except","exceptions",".","InvalidAddressException",":","return","False"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py#L163-L173"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py","language":"python","identifier":"Intel.mapping","parameters":"(self,\n offset: int,\n length: int,\n ignore_errors: bool = False)","argument_list":"","return_statement":"","docstring":"Returns a sorted iterable of (offset, sublength, mapped_offset, mapped_length, layer)\n mappings.\n\n This allows translation layers to provide maps of contiguous\n regions in one layer","docstring_summary":"Returns a sorted iterable of (offset, sublength, mapped_offset, mapped_length, layer)\n mappings.","docstring_tokens":["Returns","a","sorted","iterable","of","(","offset","sublength","mapped_offset","mapped_length","layer",")","mappings","."],"function":"def mapping(self,\n offset: int,\n length: int,\n ignore_errors: bool = False) -> Iterable[Tuple[int, int, int, int, str]]:\n \"\"\"Returns a sorted iterable of (offset, sublength, mapped_offset, mapped_length, layer)\n mappings.\n\n This allows translation layers to provide maps of contiguous\n regions in one layer\n \"\"\"\n if length == 0:\n try:\n mapped_offset, _, layer_name = self._translate(offset)\n if not self._context.layers[layer_name].is_valid(mapped_offset):\n raise exceptions.InvalidAddressException(layer_name = layer_name, invalid_address = mapped_offset)\n except exceptions.InvalidAddressException:\n if not ignore_errors:\n raise\n return\n yield offset, length, mapped_offset, length, layer_name\n return\n while length > 0:\n try:\n chunk_offset, page_size, layer_name = self._translate(offset)\n chunk_size = min(page_size - (chunk_offset % page_size), length)\n if not self._context.layers[layer_name].is_valid(chunk_offset, chunk_size):\n raise exceptions.InvalidAddressException(layer_name = layer_name, invalid_address = chunk_offset)\n except (exceptions.PagedInvalidAddressException, exceptions.InvalidAddressException) as excp:\n if not ignore_errors:\n raise\n # We can jump more if we know where the page fault failed\n if isinstance(excp, exceptions.PagedInvalidAddressException):\n mask = (1 << excp.invalid_bits) - 1\n else:\n mask = (1 << self._page_size_in_bits) - 1\n length_diff = (mask + 1 - (offset & mask))\n length -= length_diff\n offset += length_diff\n else:\n yield offset, chunk_size, chunk_offset, chunk_size, layer_name\n length -= chunk_size\n offset += chunk_size","function_tokens":["def","mapping","(","self",",","offset",":","int",",","length",":","int",",","ignore_errors",":","bool","=","False",")","->","Iterable","[","Tuple","[","int",",","int",",","int",",","int",",","str","]","]",":","if","length","==","0",":","try",":","mapped_offset",",","_",",","layer_name","=","self",".","_translate","(","offset",")","if","not","self",".","_context",".","layers","[","layer_name","]",".","is_valid","(","mapped_offset",")",":","raise","exceptions",".","InvalidAddressException","(","layer_name","=","layer_name",",","invalid_address","=","mapped_offset",")","except","exceptions",".","InvalidAddressException",":","if","not","ignore_errors",":","raise","return","yield","offset",",","length",",","mapped_offset",",","length",",","layer_name","return","while","length",">","0",":","try",":","chunk_offset",",","page_size",",","layer_name","=","self",".","_translate","(","offset",")","chunk_size","=","min","(","page_size","-","(","chunk_offset","%","page_size",")",",","length",")","if","not","self",".","_context",".","layers","[","layer_name","]",".","is_valid","(","chunk_offset",",","chunk_size",")",":","raise","exceptions",".","InvalidAddressException","(","layer_name","=","layer_name",",","invalid_address","=","chunk_offset",")","except","(","exceptions",".","PagedInvalidAddressException",",","exceptions",".","InvalidAddressException",")","as","excp",":","if","not","ignore_errors",":","raise","# We can jump more if we know where the page fault failed","if","isinstance","(","excp",",","exceptions",".","PagedInvalidAddressException",")",":","mask","=","(","1","<<","excp",".","invalid_bits",")","-","1","else",":","mask","=","(","1","<<","self",".","_page_size_in_bits",")","-","1","length_diff","=","(","mask","+","1","-","(","offset","&","mask",")",")","length","-=","length_diff","offset","+=","length_diff","else",":","yield","offset",",","chunk_size",",","chunk_offset",",","chunk_size",",","layer_name","length","-=","chunk_size","offset","+=","chunk_size"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py#L175-L216"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py","language":"python","identifier":"Intel.dependencies","parameters":"(self)","argument_list":"","return_statement":"return [self._base_layer] + self._swap_layers","docstring":"Returns a list of the lower layer names that this layer is dependent\n upon.","docstring_summary":"Returns a list of the lower layer names that this layer is dependent\n upon.","docstring_tokens":["Returns","a","list","of","the","lower","layer","names","that","this","layer","is","dependent","upon","."],"function":"def dependencies(self) -> List[str]:\n \"\"\"Returns a list of the lower layer names that this layer is dependent\n upon.\"\"\"\n return [self._base_layer] + self._swap_layers","function_tokens":["def","dependencies","(","self",")","->","List","[","str","]",":","return","[","self",".","_base_layer","]","+","self",".","_swap_layers"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py#L219-L222"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py","language":"python","identifier":"WindowsMixin._page_is_valid","parameters":"(entry: int)","argument_list":"","return_statement":"return bool((entry & 1) or ((entry & 1 << 11) and not entry & 1 << 10))","docstring":"Returns whether a particular page is valid based on its entry.\n\n Windows uses additional \"available\" bits to store flags\n These flags allow windows to determine whether a page is still valid\n\n Bit 11 is the transition flag, and Bit 10 is the prototype flag\n\n For more information, see Windows Internals (6th Ed, Part 2, pages 268-269)","docstring_summary":"Returns whether a particular page is valid based on its entry.","docstring_tokens":["Returns","whether","a","particular","page","is","valid","based","on","its","entry","."],"function":"def _page_is_valid(entry: int) -> bool:\n \"\"\"Returns whether a particular page is valid based on its entry.\n\n Windows uses additional \"available\" bits to store flags\n These flags allow windows to determine whether a page is still valid\n\n Bit 11 is the transition flag, and Bit 10 is the prototype flag\n\n For more information, see Windows Internals (6th Ed, Part 2, pages 268-269)\n \"\"\"\n return bool((entry & 1) or ((entry & 1 << 11) and not entry & 1 << 10))","function_tokens":["def","_page_is_valid","(","entry",":","int",")","->","bool",":","return","bool","(","(","entry","&","1",")","or","(","(","entry","&","1","<<","11",")","and","not","entry","&","1","<<","10",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/intel.py#L262-L272"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/linear.py","language":"python","identifier":"LinearlyMappedLayer.read","parameters":"(self, offset: int, length: int, pad: bool = False)","argument_list":"","return_statement":"return recovered_data + b\"\\x00\" * (length - len(recovered_data))","docstring":"Reads an offset for length bytes and returns 'bytes' (not 'str') of\n length size.","docstring_summary":"Reads an offset for length bytes and returns 'bytes' (not 'str') of\n length size.","docstring_tokens":["Reads","an","offset","for","length","bytes","and","returns","bytes","(","not","str",")","of","length","size","."],"function":"def read(self, offset: int, length: int, pad: bool = False) -> bytes:\n \"\"\"Reads an offset for length bytes and returns 'bytes' (not 'str') of\n length size.\"\"\"\n current_offset = offset\n output = [] # type: List[bytes]\n for (offset, _, mapped_offset, mapped_length, layer) in self.mapping(offset, length, ignore_errors = pad):\n if not pad and offset > current_offset:\n raise exceptions.InvalidAddressException(\n self.name, current_offset, \"Layer {} cannot map offset: {}\".format(self.name, current_offset))\n elif offset > current_offset:\n output += [b\"\\x00\" * (offset - current_offset)]\n current_offset = offset\n elif offset < current_offset:\n raise exceptions.LayerException(self.name, \"Mapping returned an overlapping element\")\n if mapped_length > 0:\n output += [self._context.layers.read(layer, mapped_offset, mapped_length, pad)]\n current_offset += mapped_length\n recovered_data = b\"\".join(output)\n return recovered_data + b\"\\x00\" * (length - len(recovered_data))","function_tokens":["def","read","(","self",",","offset",":","int",",","length",":","int",",","pad",":","bool","=","False",")","->","bytes",":","current_offset","=","offset","output","=","[","]","# type: List[bytes]","for","(","offset",",","_",",","mapped_offset",",","mapped_length",",","layer",")","in","self",".","mapping","(","offset",",","length",",","ignore_errors","=","pad",")",":","if","not","pad","and","offset",">","current_offset",":","raise","exceptions",".","InvalidAddressException","(","self",".","name",",","current_offset",",","\"Layer {} cannot map offset: {}\"",".","format","(","self",".","name",",","current_offset",")",")","elif","offset",">","current_offset",":","output","+=","[","b\"\\x00\"","*","(","offset","-","current_offset",")","]","current_offset","=","offset","elif","offset","<","current_offset",":","raise","exceptions",".","LayerException","(","self",".","name",",","\"Mapping returned an overlapping element\"",")","if","mapped_length",">","0",":","output","+=","[","self",".","_context",".","layers",".","read","(","layer",",","mapped_offset",",","mapped_length",",","pad",")","]","current_offset","+=","mapped_length","recovered_data","=","b\"\"",".","join","(","output",")","return","recovered_data","+","b\"\\x00\"","*","(","length","-","len","(","recovered_data",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/linear.py#L33-L51"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/linear.py","language":"python","identifier":"LinearlyMappedLayer.write","parameters":"(self, offset: int, value: bytes)","argument_list":"","return_statement":"","docstring":"Writes a value at offset, distributing the writing across any\n underlying mapping.","docstring_summary":"Writes a value at offset, distributing the writing across any\n underlying mapping.","docstring_tokens":["Writes","a","value","at","offset","distributing","the","writing","across","any","underlying","mapping","."],"function":"def write(self, offset: int, value: bytes) -> None:\n \"\"\"Writes a value at offset, distributing the writing across any\n underlying mapping.\"\"\"\n current_offset = offset\n length = len(value)\n for (offset, _, mapped_offset, length, layer) in self.mapping(offset, length):\n if offset > current_offset:\n raise exceptions.InvalidAddressException(\n self.name, current_offset, \"Layer {} cannot map offset: {}\".format(self.name, current_offset))\n elif offset < current_offset:\n raise exceptions.LayerException(self.name, \"Mapping returned an overlapping element\")\n self._context.layers.write(layer, mapped_offset, value[:length])\n value = value[length:]\n current_offset += length","function_tokens":["def","write","(","self",",","offset",":","int",",","value",":","bytes",")","->","None",":","current_offset","=","offset","length","=","len","(","value",")","for","(","offset",",","_",",","mapped_offset",",","length",",","layer",")","in","self",".","mapping","(","offset",",","length",")",":","if","offset",">","current_offset",":","raise","exceptions",".","InvalidAddressException","(","self",".","name",",","current_offset",",","\"Layer {} cannot map offset: {}\"",".","format","(","self",".","name",",","current_offset",")",")","elif","offset","<","current_offset",":","raise","exceptions",".","LayerException","(","self",".","name",",","\"Mapping returned an overlapping element\"",")","self",".","_context",".","layers",".","write","(","layer",",","mapped_offset",",","value","[",":","length","]",")","value","=","value","[","length",":","]","current_offset","+=","length"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/linear.py#L53-L66"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/resources.py","language":"python","identifier":"cascadeCloseFile","parameters":"(new_fp, original_fp)","argument_list":"","return_statement":"return new_fp","docstring":"Really horrible solution for ensuring files aren't left open\n\n Args:\n new_fp: The file pointer constructed based on the original file pointer\n original_fp: The original file pointer that should be closed when the new file pointer is closed, but isn't","docstring_summary":"Really horrible solution for ensuring files aren't left open","docstring_tokens":["Really","horrible","solution","for","ensuring","files","aren","t","left","open"],"function":"def cascadeCloseFile(new_fp, original_fp):\n \"\"\"Really horrible solution for ensuring files aren't left open\n\n Args:\n new_fp: The file pointer constructed based on the original file pointer\n original_fp: The original file pointer that should be closed when the new file pointer is closed, but isn't\n \"\"\"\n\n def close():\n original_fp.close()\n return new_fp.__class__.close(new_fp)\n\n new_fp.close = close\n return new_fp","function_tokens":["def","cascadeCloseFile","(","new_fp",",","original_fp",")",":","def","close","(",")",":","original_fp",".","close","(",")","return","new_fp",".","__class__",".","close","(","new_fp",")","new_fp",".","close","=","close","return","new_fp"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/resources.py#L42-L55"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/resources.py","language":"python","identifier":"ResourceAccessor.__init__","parameters":"(self,\n progress_callback: Optional[constants.ProgressCallback] = None,\n context: Optional[ssl.SSLContext] = None)","argument_list":"","return_statement":"","docstring":"Creates a resource accessor.\n\n Note: context is an SSL context, not a volatility context","docstring_summary":"Creates a resource accessor.","docstring_tokens":["Creates","a","resource","accessor","."],"function":"def __init__(self,\n progress_callback: Optional[constants.ProgressCallback] = None,\n context: Optional[ssl.SSLContext] = None) -> None:\n \"\"\"Creates a resource accessor.\n\n Note: context is an SSL context, not a volatility context\n \"\"\"\n self._progress_callback = progress_callback\n self._context = context\n self._handlers = list(framework.class_subclasses(urllib.request.BaseHandler))\n if self.list_handlers:\n vollog.log(constants.LOGLEVEL_VVV,\n \"Available URL handlers: {}\".format(\", \".join([x.__name__ for x in self._handlers])))\n self.__class__.list_handlers = False","function_tokens":["def","__init__","(","self",",","progress_callback",":","Optional","[","constants",".","ProgressCallback","]","=","None",",","context",":","Optional","[","ssl",".","SSLContext","]","=","None",")","->","None",":","self",".","_progress_callback","=","progress_callback","self",".","_context","=","context","self",".","_handlers","=","list","(","framework",".","class_subclasses","(","urllib",".","request",".","BaseHandler",")",")","if","self",".","list_handlers",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Available URL handlers: {}\"",".","format","(","\", \"",".","join","(","[","x",".","__name__","for","x","in","self",".","_handlers","]",")",")",")","self",".","__class__",".","list_handlers","=","False"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/resources.py#L64-L77"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/resources.py","language":"python","identifier":"ResourceAccessor.uses_cache","parameters":"(self, url: str)","argument_list":"","return_statement":"return not parsed_url.scheme in ['file', 'jar']","docstring":"Determines whether a URLs contents should be cached","docstring_summary":"Determines whether a URLs contents should be cached","docstring_tokens":["Determines","whether","a","URLs","contents","should","be","cached"],"function":"def uses_cache(self, url: str) -> bool:\n \"\"\"Determines whether a URLs contents should be cached\"\"\"\n parsed_url = urllib.parse.urlparse(url)\n\n return not parsed_url.scheme in ['file', 'jar']","function_tokens":["def","uses_cache","(","self",",","url",":","str",")","->","bool",":","parsed_url","=","urllib",".","parse",".","urlparse","(","url",")","return","not","parsed_url",".","scheme","in","[","'file'",",","'jar'","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/resources.py#L79-L83"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/resources.py","language":"python","identifier":"ResourceAccessor.open","parameters":"(self, url: str, mode: str = \"rb\")","argument_list":"","return_statement":"return curfile","docstring":"Returns a file-like object for a particular URL opened in mode.\n\n If the file is remote, it will be downloaded and locally cached","docstring_summary":"Returns a file-like object for a particular URL opened in mode.","docstring_tokens":["Returns","a","file","-","like","object","for","a","particular","URL","opened","in","mode","."],"function":"def open(self, url: str, mode: str = \"rb\") -> Any:\n \"\"\"Returns a file-like object for a particular URL opened in mode.\n\n If the file is remote, it will be downloaded and locally cached\n \"\"\"\n urllib.request.install_opener(urllib.request.build_opener(*self._handlers))\n\n try:\n fp = urllib.request.urlopen(url, context = self._context)\n except error.URLError as excp:\n if excp.args:\n # TODO: As of python3.7 this can be removed\n unverified_retrieval = (hasattr(ssl, \"SSLCertVerificationError\") and isinstance(\n excp.args[0], ssl.SSLCertVerificationError)) or (isinstance(excp.args[0], ssl.SSLError) and\n excp.args[0].reason == \"CERTIFICATE_VERIFY_FAILED\")\n if unverified_retrieval:\n vollog.warning(\"SSL certificate verification failed: attempting UNVERIFIED retrieval\")\n non_verifying_ctx = ssl.SSLContext()\n non_verifying_ctx.check_hostname = False\n non_verifying_ctx.verify_mode = ssl.CERT_NONE\n fp = urllib.request.urlopen(url, context = non_verifying_ctx)\n else:\n raise excp\n else:\n raise excp\n\n with contextlib.closing(fp) as fp:\n # Cache the file locally\n\n if not self.uses_cache(url):\n # ZipExtFiles (files in zips) cannot seek, so must be cached in order to use and\/or decompress\n curfile = urllib.request.urlopen(url, context = self._context)\n else:\n # TODO: find a way to check if we already have this file (look at http headers?)\n block_size = 1028 * 8\n temp_filename = os.path.join(\n constants.CACHE_PATH,\n \"data_\" + hashlib.sha512(bytes(url, 'raw_unicode_escape')).hexdigest() + \".cache\")\n\n if not os.path.exists(temp_filename):\n vollog.debug(\"Caching file at: {}\".format(temp_filename))\n\n try:\n content_length = fp.info().get('Content-Length', -1)\n except AttributeError:\n # If our fp doesn't have an info member, carry on gracefully\n content_length = -1\n cache_file = open(temp_filename, \"wb\")\n\n count = 0\n block = fp.read(block_size)\n while block:\n count += len(block)\n if self._progress_callback:\n self._progress_callback(count * 100 \/ max(count, int(content_length)),\n \"Reading file {}\".format(url))\n cache_file.write(block)\n block = fp.read(block_size)\n cache_file.close()\n # Re-open the cache with a different mode\n curfile = open(temp_filename, mode = \"rb\")\n\n # Determine whether the file is a particular type of file, and if so, open it as such\n IMPORTED_MAGIC = False\n if HAS_MAGIC:\n stop = False\n while not stop:\n detected = None\n try:\n # Detect the content\n detected = magic.detect_from_fobj(curfile)\n IMPORTED_MAGIC = True\n # This is because python-magic and file provide a magic module\n # Only file's python has magic.detect_from_fobj\n except (AttributeError, IOError):\n pass\n\n if detected:\n if detected.mime_type == 'application\/x-xz':\n curfile = cascadeCloseFile(lzma.LZMAFile(curfile, mode), curfile)\n elif detected.mime_type == 'application\/x-bzip2':\n curfile = cascadeCloseFile(bz2.BZ2File(curfile, mode), curfile)\n elif detected.mime_type == 'application\/x-gzip':\n curfile = cascadeCloseFile(gzip.GzipFile(fileobj = curfile, mode = mode), curfile)\n if detected.mime_type in ['application\/x-xz', 'application\/x-bzip2', 'application\/x-gzip']:\n # Read and rewind to ensure we're inside any compressed file layers\n curfile.read(1)\n curfile.seek(0)\n else:\n stop = True\n else:\n stop = True\n\n if not IMPORTED_MAGIC:\n # Somewhat of a hack, but prevents a hard dependency on the magic module\n parsed_url = urllib.parse.urlparse(url)\n url_path = parsed_url.path\n stop = False\n while not stop:\n url_path_split = url_path.split(\".\")\n url_path_list, extension = url_path_split[:-1], url_path_split[-1]\n url_path = \".\".join(url_path_list)\n if extension == \"xz\":\n curfile = cascadeCloseFile(lzma.LZMAFile(curfile, mode), curfile)\n elif extension == \"bz2\":\n curfile = cascadeCloseFile(bz2.BZ2File(curfile, mode), curfile)\n elif extension == \"gz\":\n curfile = cascadeCloseFile(gzip.GzipFile(fileobj = curfile, mode = mode), curfile)\n else:\n stop = True\n\n # Fallback in case the file doesn't exist\n if curfile is None:\n raise ValueError(\"URL does not reference an openable file\")\n return curfile","function_tokens":["def","open","(","self",",","url",":","str",",","mode",":","str","=","\"rb\"",")","->","Any",":","urllib",".","request",".","install_opener","(","urllib",".","request",".","build_opener","(","*","self",".","_handlers",")",")","try",":","fp","=","urllib",".","request",".","urlopen","(","url",",","context","=","self",".","_context",")","except","error",".","URLError","as","excp",":","if","excp",".","args",":","# TODO: As of python3.7 this can be removed","unverified_retrieval","=","(","hasattr","(","ssl",",","\"SSLCertVerificationError\"",")","and","isinstance","(","excp",".","args","[","0","]",",","ssl",".","SSLCertVerificationError",")",")","or","(","isinstance","(","excp",".","args","[","0","]",",","ssl",".","SSLError",")","and","excp",".","args","[","0","]",".","reason","==","\"CERTIFICATE_VERIFY_FAILED\"",")","if","unverified_retrieval",":","vollog",".","warning","(","\"SSL certificate verification failed: attempting UNVERIFIED retrieval\"",")","non_verifying_ctx","=","ssl",".","SSLContext","(",")","non_verifying_ctx",".","check_hostname","=","False","non_verifying_ctx",".","verify_mode","=","ssl",".","CERT_NONE","fp","=","urllib",".","request",".","urlopen","(","url",",","context","=","non_verifying_ctx",")","else",":","raise","excp","else",":","raise","excp","with","contextlib",".","closing","(","fp",")","as","fp",":","# Cache the file locally","if","not","self",".","uses_cache","(","url",")",":","# ZipExtFiles (files in zips) cannot seek, so must be cached in order to use and\/or decompress","curfile","=","urllib",".","request",".","urlopen","(","url",",","context","=","self",".","_context",")","else",":","# TODO: find a way to check if we already have this file (look at http headers?)","block_size","=","1028","*","8","temp_filename","=","os",".","path",".","join","(","constants",".","CACHE_PATH",",","\"data_\"","+","hashlib",".","sha512","(","bytes","(","url",",","'raw_unicode_escape'",")",")",".","hexdigest","(",")","+","\".cache\"",")","if","not","os",".","path",".","exists","(","temp_filename",")",":","vollog",".","debug","(","\"Caching file at: {}\"",".","format","(","temp_filename",")",")","try",":","content_length","=","fp",".","info","(",")",".","get","(","'Content-Length'",",","-","1",")","except","AttributeError",":","# If our fp doesn't have an info member, carry on gracefully","content_length","=","-","1","cache_file","=","open","(","temp_filename",",","\"wb\"",")","count","=","0","block","=","fp",".","read","(","block_size",")","while","block",":","count","+=","len","(","block",")","if","self",".","_progress_callback",":","self",".","_progress_callback","(","count","*","100","\/","max","(","count",",","int","(","content_length",")",")",",","\"Reading file {}\"",".","format","(","url",")",")","cache_file",".","write","(","block",")","block","=","fp",".","read","(","block_size",")","cache_file",".","close","(",")","# Re-open the cache with a different mode","curfile","=","open","(","temp_filename",",","mode","=","\"rb\"",")","# Determine whether the file is a particular type of file, and if so, open it as such","IMPORTED_MAGIC","=","False","if","HAS_MAGIC",":","stop","=","False","while","not","stop",":","detected","=","None","try",":","# Detect the content","detected","=","magic",".","detect_from_fobj","(","curfile",")","IMPORTED_MAGIC","=","True","# This is because python-magic and file provide a magic module","# Only file's python has magic.detect_from_fobj","except","(","AttributeError",",","IOError",")",":","pass","if","detected",":","if","detected",".","mime_type","==","'application\/x-xz'",":","curfile","=","cascadeCloseFile","(","lzma",".","LZMAFile","(","curfile",",","mode",")",",","curfile",")","elif","detected",".","mime_type","==","'application\/x-bzip2'",":","curfile","=","cascadeCloseFile","(","bz2",".","BZ2File","(","curfile",",","mode",")",",","curfile",")","elif","detected",".","mime_type","==","'application\/x-gzip'",":","curfile","=","cascadeCloseFile","(","gzip",".","GzipFile","(","fileobj","=","curfile",",","mode","=","mode",")",",","curfile",")","if","detected",".","mime_type","in","[","'application\/x-xz'",",","'application\/x-bzip2'",",","'application\/x-gzip'","]",":","# Read and rewind to ensure we're inside any compressed file layers","curfile",".","read","(","1",")","curfile",".","seek","(","0",")","else",":","stop","=","True","else",":","stop","=","True","if","not","IMPORTED_MAGIC",":","# Somewhat of a hack, but prevents a hard dependency on the magic module","parsed_url","=","urllib",".","parse",".","urlparse","(","url",")","url_path","=","parsed_url",".","path","stop","=","False","while","not","stop",":","url_path_split","=","url_path",".","split","(","\".\"",")","url_path_list",",","extension","=","url_path_split","[",":","-","1","]",",","url_path_split","[","-","1","]","url_path","=","\".\"",".","join","(","url_path_list",")","if","extension","==","\"xz\"",":","curfile","=","cascadeCloseFile","(","lzma",".","LZMAFile","(","curfile",",","mode",")",",","curfile",")","elif","extension","==","\"bz2\"",":","curfile","=","cascadeCloseFile","(","bz2",".","BZ2File","(","curfile",",","mode",")",",","curfile",")","elif","extension","==","\"gz\"",":","curfile","=","cascadeCloseFile","(","gzip",".","GzipFile","(","fileobj","=","curfile",",","mode","=","mode",")",",","curfile",")","else",":","stop","=","True","# Fallback in case the file doesn't exist","if","curfile","is","None",":","raise","ValueError","(","\"URL does not reference an openable file\"",")","return","curfile"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/resources.py#L86-L200"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/resources.py","language":"python","identifier":"JarHandler.default_open","parameters":"(req: urllib.request.Request)","argument_list":"","return_statement":"return None","docstring":"Handles the request if it's the jar scheme.","docstring_summary":"Handles the request if it's the jar scheme.","docstring_tokens":["Handles","the","request","if","it","s","the","jar","scheme","."],"function":"def default_open(req: urllib.request.Request) -> Optional[Any]:\n \"\"\"Handles the request if it's the jar scheme.\"\"\"\n if req.type == 'jar':\n subscheme, remainder = req.full_url.split(\":\")[1], \":\".join(req.full_url.split(\":\")[2:])\n if subscheme != 'file':\n vollog.log(constants.LOGLEVEL_VVV, \"Unsupported jar subscheme {}\".format(subscheme))\n return None\n\n zipsplit = remainder.split(\"!\")\n if len(zipsplit) != 2:\n vollog.log(constants.LOGLEVEL_VVV,\n \"Path did not contain exactly one fragment indicator: {}\".format(remainder))\n return None\n\n zippath, filepath = zipsplit\n return zipfile.ZipFile(zippath).open(filepath)\n return None","function_tokens":["def","default_open","(","req",":","urllib",".","request",".","Request",")","->","Optional","[","Any","]",":","if","req",".","type","==","'jar'",":","subscheme",",","remainder","=","req",".","full_url",".","split","(","\":\"",")","[","1","]",",","\":\"",".","join","(","req",".","full_url",".","split","(","\":\"",")","[","2",":","]",")","if","subscheme","!=","'file'",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Unsupported jar subscheme {}\"",".","format","(","subscheme",")",")","return","None","zipsplit","=","remainder",".","split","(","\"!\"",")","if","len","(","zipsplit",")","!=","2",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Path did not contain exactly one fragment indicator: {}\"",".","format","(","remainder",")",")","return","None","zippath",",","filepath","=","zipsplit","return","zipfile",".","ZipFile","(","zippath",")",".","open","(","filepath",")","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/resources.py#L214-L230"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/qemu.py","language":"python","identifier":"QemuSuspendLayer._read_configuration","parameters":"(self, base_layer: interfaces.layers.DataLayerInterface, name: str)","argument_list":"","return_statement":"","docstring":"Reads the JSON configuration from the end of the file","docstring_summary":"Reads the JSON configuration from the end of the file","docstring_tokens":["Reads","the","JSON","configuration","from","the","end","of","the","file"],"function":"def _read_configuration(self, base_layer: interfaces.layers.DataLayerInterface, name: str) -> Any:\n \"\"\"Reads the JSON configuration from the end of the file\"\"\"\n chunk_size = 0x4096\n data = b''\n for i in range(base_layer.maximum_address, base_layer.minimum_address, -chunk_size):\n if i != base_layer.maximum_address:\n data = base_layer.read(i, chunk_size) + data\n if b'\\x00' in data:\n start = data.rfind(b'\\x00')\n data = data[data.find(b'{', start):]\n return json.loads(data)\n raise exceptions.LayerException(name, \"Could not load JSON configuration from the end of the file\")","function_tokens":["def","_read_configuration","(","self",",","base_layer",":","interfaces",".","layers",".","DataLayerInterface",",","name",":","str",")","->","Any",":","chunk_size","=","0x4096","data","=","b''","for","i","in","range","(","base_layer",".","maximum_address",",","base_layer",".","minimum_address",",","-","chunk_size",")",":","if","i","!=","base_layer",".","maximum_address",":","data","=","base_layer",".","read","(","i",",","chunk_size",")","+","data","if","b'\\x00'","in","data",":","start","=","data",".","rfind","(","b'\\x00'",")","data","=","data","[","data",".","find","(","b'{'",",","start",")",":","]","return","json",".","loads","(","data",")","raise","exceptions",".","LayerException","(","name",",","\"Could not load JSON configuration from the end of the file\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/qemu.py#L55-L66"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/qemu.py","language":"python","identifier":"QemuSuspendLayer._get_ram_segments","parameters":"(self, index: int, page_size: int)","argument_list":"","return_statement":"return segments, index","docstring":"Recovers the new index and any sections of memory from a ram section","docstring_summary":"Recovers the new index and any sections of memory from a ram section","docstring_tokens":["Recovers","the","new","index","and","any","sections","of","memory","from","a","ram","section"],"function":"def _get_ram_segments(self, index: int, page_size: int) -> Tuple[List[Tuple[int, int, int, int]], int]:\n \"\"\"Recovers the new index and any sections of memory from a ram section\"\"\"\n done = None\n segments = []\n\n base_layer = self.context.layers[self._base_layer]\n\n while not done:\n addr = self.context.object(self._qemu_table_name + constants.BANG + 'unsigned long long',\n offset = index,\n layer_name = self._base_layer)\n flags = addr & (page_size - 1)\n page_size_bits = int(math.log(page_size, 2))\n addr = (addr >> page_size_bits) << page_size_bits\n index += 8\n\n if flags & self.SEGMENT_FLAG_MEM_SIZE:\n namelen = self._context.object(self._qemu_table_name + constants.BANG + 'unsigned char',\n offset = index,\n layer_name = self._base_layer)\n while namelen != 0:\n # if base_layer.read(index + 1, namelen) == b'pc.ram':\n # total_size = self._context.object(self._qemu_table_name + constants.BANG + 'unsigned long long',\n # offset = index + 1 + namelen,\n # layer_name = self._base_layer)\n index += 1 + namelen + 8\n namelen = self._context.object(self._qemu_table_name + constants.BANG + 'unsigned char',\n offset = index,\n layer_name = self._base_layer)\n if flags & (self.SEGMENT_FLAG_COMPRESS | self.SEGMENT_FLAG_PAGE):\n if not (flags & self.SEGMENT_FLAG_CONTINUE):\n namelen = self._context.object(self._qemu_table_name + constants.BANG + 'unsigned char',\n offset = index,\n layer_name = self._base_layer)\n self._current_segment_name = base_layer.read(index + 1, namelen)\n index += 1 + namelen\n if flags & self.SEGMENT_FLAG_COMPRESS:\n if self._current_segment_name == b'pc.ram':\n segments.append((addr, index, page_size, 1))\n self._compressed.add(addr)\n index += 1\n else:\n if self._current_segment_name == b'pc.ram':\n segments.append((addr, index, page_size, page_size))\n index += page_size\n if flags & self.SEGMENT_FLAG_XBZRLE:\n raise exceptions.LayerException(self.name, \"XBZRLE compression not supported\")\n if flags & self.SEGMENT_FLAG_EOS:\n done = True\n return segments, index","function_tokens":["def","_get_ram_segments","(","self",",","index",":","int",",","page_size",":","int",")","->","Tuple","[","List","[","Tuple","[","int",",","int",",","int",",","int","]","]",",","int","]",":","done","=","None","segments","=","[","]","base_layer","=","self",".","context",".","layers","[","self",".","_base_layer","]","while","not","done",":","addr","=","self",".","context",".","object","(","self",".","_qemu_table_name","+","constants",".","BANG","+","'unsigned long long'",",","offset","=","index",",","layer_name","=","self",".","_base_layer",")","flags","=","addr","&","(","page_size","-","1",")","page_size_bits","=","int","(","math",".","log","(","page_size",",","2",")",")","addr","=","(","addr",">>","page_size_bits",")","<<","page_size_bits","index","+=","8","if","flags","&","self",".","SEGMENT_FLAG_MEM_SIZE",":","namelen","=","self",".","_context",".","object","(","self",".","_qemu_table_name","+","constants",".","BANG","+","'unsigned char'",",","offset","=","index",",","layer_name","=","self",".","_base_layer",")","while","namelen","!=","0",":","# if base_layer.read(index + 1, namelen) == b'pc.ram':","# total_size = self._context.object(self._qemu_table_name + constants.BANG + 'unsigned long long',","# offset = index + 1 + namelen,","# layer_name = self._base_layer)","index","+=","1","+","namelen","+","8","namelen","=","self",".","_context",".","object","(","self",".","_qemu_table_name","+","constants",".","BANG","+","'unsigned char'",",","offset","=","index",",","layer_name","=","self",".","_base_layer",")","if","flags","&","(","self",".","SEGMENT_FLAG_COMPRESS","|","self",".","SEGMENT_FLAG_PAGE",")",":","if","not","(","flags","&","self",".","SEGMENT_FLAG_CONTINUE",")",":","namelen","=","self",".","_context",".","object","(","self",".","_qemu_table_name","+","constants",".","BANG","+","'unsigned char'",",","offset","=","index",",","layer_name","=","self",".","_base_layer",")","self",".","_current_segment_name","=","base_layer",".","read","(","index","+","1",",","namelen",")","index","+=","1","+","namelen","if","flags","&","self",".","SEGMENT_FLAG_COMPRESS",":","if","self",".","_current_segment_name","==","b'pc.ram'",":","segments",".","append","(","(","addr",",","index",",","page_size",",","1",")",")","self",".","_compressed",".","add","(","addr",")","index","+=","1","else",":","if","self",".","_current_segment_name","==","b'pc.ram'",":","segments",".","append","(","(","addr",",","index",",","page_size",",","page_size",")",")","index","+=","page_size","if","flags","&","self",".","SEGMENT_FLAG_XBZRLE",":","raise","exceptions",".","LayerException","(","self",".","name",",","\"XBZRLE compression not supported\"",")","if","flags","&","self",".","SEGMENT_FLAG_EOS",":","done","=","True","return","segments",",","index"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/qemu.py#L68-L117"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/segmented.py","language":"python","identifier":"NonLinearlySegmentedLayer._load_segments","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Populates the _segments variable.\n\n Segments must be (address, mapped address, length) and must be\n sorted by address when this method exits","docstring_summary":"Populates the _segments variable.","docstring_tokens":["Populates","the","_segments","variable","."],"function":"def _load_segments(self) -> None:\n \"\"\"Populates the _segments variable.\n\n Segments must be (address, mapped address, length) and must be\n sorted by address when this method exits\n \"\"\"","function_tokens":["def","_load_segments","(","self",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/segmented.py#L35-L40"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/segmented.py","language":"python","identifier":"NonLinearlySegmentedLayer.is_valid","parameters":"(self, offset: int, length: int = 1)","argument_list":"","return_statement":"","docstring":"Returns whether the address offset can be translated to a valid\n address.","docstring_summary":"Returns whether the address offset can be translated to a valid\n address.","docstring_tokens":["Returns","whether","the","address","offset","can","be","translated","to","a","valid","address","."],"function":"def is_valid(self, offset: int, length: int = 1) -> bool:\n \"\"\"Returns whether the address offset can be translated to a valid\n address.\"\"\"\n try:\n base_layer = self._context.layers[self._base_layer]\n return all(\n [base_layer.is_valid(mapped_offset) for _i, _i, mapped_offset, _i, _s in self.mapping(offset, length)])\n except exceptions.InvalidAddressException:\n return False","function_tokens":["def","is_valid","(","self",",","offset",":","int",",","length",":","int","=","1",")","->","bool",":","try",":","base_layer","=","self",".","_context",".","layers","[","self",".","_base_layer","]","return","all","(","[","base_layer",".","is_valid","(","mapped_offset",")","for","_i",",","_i",",","mapped_offset",",","_i",",","_s","in","self",".","mapping","(","offset",",","length",")","]",")","except","exceptions",".","InvalidAddressException",":","return","False"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/segmented.py#L42-L50"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/segmented.py","language":"python","identifier":"NonLinearlySegmentedLayer._find_segment","parameters":"(self, offset: int, next: bool = False)","argument_list":"","return_statement":"","docstring":"Finds the segment containing a given offset.\n\n Returns the segment tuple (offset, mapped_offset, length, mapped_length)","docstring_summary":"Finds the segment containing a given offset.","docstring_tokens":["Finds","the","segment","containing","a","given","offset","."],"function":"def _find_segment(self, offset: int, next: bool = False) -> Tuple[int, int, int, int]:\n \"\"\"Finds the segment containing a given offset.\n\n Returns the segment tuple (offset, mapped_offset, length, mapped_length)\n \"\"\"\n\n if not self._segments:\n self._load_segments()\n\n # Find rightmost value less than or equal to x\n i = bisect_right(self._segments, (offset, self.context.layers[self._base_layer].maximum_address))\n if i and not next:\n segment = self._segments[i - 1]\n if segment[0] <= offset < segment[0] + segment[2]:\n return segment\n if next:\n if i < len(self._segments):\n return self._segments[i]\n raise exceptions.InvalidAddressException(self.name, offset, \"Invalid address at {:0x}\".format(offset))","function_tokens":["def","_find_segment","(","self",",","offset",":","int",",","next",":","bool","=","False",")","->","Tuple","[","int",",","int",",","int",",","int","]",":","if","not","self",".","_segments",":","self",".","_load_segments","(",")","# Find rightmost value less than or equal to x","i","=","bisect_right","(","self",".","_segments",",","(","offset",",","self",".","context",".","layers","[","self",".","_base_layer","]",".","maximum_address",")",")","if","i","and","not","next",":","segment","=","self",".","_segments","[","i","-","1","]","if","segment","[","0","]","<=","offset","<","segment","[","0","]","+","segment","[","2","]",":","return","segment","if","next",":","if","i","<","len","(","self",".","_segments",")",":","return","self",".","_segments","[","i","]","raise","exceptions",".","InvalidAddressException","(","self",".","name",",","offset",",","\"Invalid address at {:0x}\"",".","format","(","offset",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/segmented.py#L52-L70"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/segmented.py","language":"python","identifier":"NonLinearlySegmentedLayer.mapping","parameters":"(self,\n offset: int,\n length: int,\n ignore_errors: bool = False)","argument_list":"","return_statement":"","docstring":"Returns a sorted iterable of (offset, length, mapped_offset, mapped_length, layer)\n mappings.","docstring_summary":"Returns a sorted iterable of (offset, length, mapped_offset, mapped_length, layer)\n mappings.","docstring_tokens":["Returns","a","sorted","iterable","of","(","offset","length","mapped_offset","mapped_length","layer",")","mappings","."],"function":"def mapping(self,\n offset: int,\n length: int,\n ignore_errors: bool = False) -> Iterable[Tuple[int, int, int, int, str]]:\n \"\"\"Returns a sorted iterable of (offset, length, mapped_offset, mapped_length, layer)\n mappings.\"\"\"\n done = False\n current_offset = offset\n while not done:\n try:\n # Search for the appropriate segment that contains the current_offset\n logical_offset, mapped_offset, size, mapped_size = self._find_segment(current_offset)\n # If it starts before the current_offset, bring the lower edge up to the right place\n if current_offset > logical_offset:\n difference = current_offset - logical_offset\n logical_offset += difference\n mapped_offset += difference\n size -= difference\n except exceptions.InvalidAddressException:\n if not ignore_errors:\n # If we're not ignoring errors, raise the invalid address exception\n raise\n try:\n # Find the next valid segment after our current_offset\n logical_offset, mapped_offset, size, mapped_size = self._find_segment(current_offset, next = True)\n # We know that the logical_offset must be greater than current_offset so skip to that value\n current_offset = logical_offset\n # If it starts too late then we're done\n if logical_offset > offset + length:\n return\n except exceptions.InvalidAddressException:\n return\n # Crop it to the amount we need left\n chunk_size = min(size, length + offset - logical_offset)\n yield logical_offset, chunk_size, mapped_offset, chunk_size, self._base_layer\n current_offset += chunk_size\n # Terminate if we've gone (or reached) our required limit\n if current_offset >= offset + length:\n done = True","function_tokens":["def","mapping","(","self",",","offset",":","int",",","length",":","int",",","ignore_errors",":","bool","=","False",")","->","Iterable","[","Tuple","[","int",",","int",",","int",",","int",",","str","]","]",":","done","=","False","current_offset","=","offset","while","not","done",":","try",":","# Search for the appropriate segment that contains the current_offset","logical_offset",",","mapped_offset",",","size",",","mapped_size","=","self",".","_find_segment","(","current_offset",")","# If it starts before the current_offset, bring the lower edge up to the right place","if","current_offset",">","logical_offset",":","difference","=","current_offset","-","logical_offset","logical_offset","+=","difference","mapped_offset","+=","difference","size","-=","difference","except","exceptions",".","InvalidAddressException",":","if","not","ignore_errors",":","# If we're not ignoring errors, raise the invalid address exception","raise","try",":","# Find the next valid segment after our current_offset","logical_offset",",","mapped_offset",",","size",",","mapped_size","=","self",".","_find_segment","(","current_offset",",","next","=","True",")","# We know that the logical_offset must be greater than current_offset so skip to that value","current_offset","=","logical_offset","# If it starts too late then we're done","if","logical_offset",">","offset","+","length",":","return","except","exceptions",".","InvalidAddressException",":","return","# Crop it to the amount we need left","chunk_size","=","min","(","size",",","length","+","offset","-","logical_offset",")","yield","logical_offset",",","chunk_size",",","mapped_offset",",","chunk_size",",","self",".","_base_layer","current_offset","+=","chunk_size","# Terminate if we've gone (or reached) our required limit","if","current_offset",">=","offset","+","length",":","done","=","True"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/segmented.py#L72-L110"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/segmented.py","language":"python","identifier":"NonLinearlySegmentedLayer.dependencies","parameters":"(self)","argument_list":"","return_statement":"return [self._base_layer]","docstring":"Returns a list of the lower layers that this layer is dependent\n upon.","docstring_summary":"Returns a list of the lower layers that this layer is dependent\n upon.","docstring_tokens":["Returns","a","list","of","the","lower","layers","that","this","layer","is","dependent","upon","."],"function":"def dependencies(self) -> List[str]:\n \"\"\"Returns a list of the lower layers that this layer is dependent\n upon.\"\"\"\n return [self._base_layer]","function_tokens":["def","dependencies","(","self",")","->","List","[","str","]",":","return","[","self",".","_base_layer","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/segmented.py#L131-L134"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py","language":"python","identifier":"RegistryHive.address_mask","parameters":"(self)","argument_list":"","return_statement":"return super().address_mask | 0x80000000","docstring":"Return a mask that allows for the volatile bit to be set.","docstring_summary":"Return a mask that allows for the volatile bit to be set.","docstring_tokens":["Return","a","mask","that","allows","for","the","volatile","bit","to","be","set","."],"function":"def address_mask(self) -> int:\n \"\"\"Return a mask that allows for the volatile bit to be set.\"\"\"\n return super().address_mask | 0x80000000","function_tokens":["def","address_mask","(","self",")","->","int",":","return","super","(",")",".","address_mask","|","0x80000000"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py#L88-L90"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py","language":"python","identifier":"RegistryHive.root_cell_offset","parameters":"(self)","argument_list":"","return_statement":"return 0x20","docstring":"Returns the offset for the root cell in this hive.","docstring_summary":"Returns the offset for the root cell in this hive.","docstring_tokens":["Returns","the","offset","for","the","root","cell","in","this","hive","."],"function":"def root_cell_offset(self) -> int:\n \"\"\"Returns the offset for the root cell in this hive.\"\"\"\n try:\n if self._base_block.Signature.cast(\"string\", max_length = 4, encoding = \"latin-1\") == 'regf':\n return self._base_block.RootCell\n except InvalidAddressException:\n pass\n return 0x20","function_tokens":["def","root_cell_offset","(","self",")","->","int",":","try",":","if","self",".","_base_block",".","Signature",".","cast","(","\"string\"",",","max_length","=","4",",","encoding","=","\"latin-1\"",")","==","'regf'",":","return","self",".","_base_block",".","RootCell","except","InvalidAddressException",":","pass","return","0x20"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py#L93-L100"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py","language":"python","identifier":"RegistryHive.get_cell","parameters":"(self, cell_offset: int)","argument_list":"","return_statement":"return cell","docstring":"Returns the appropriate Cell value for a cell offset.","docstring_summary":"Returns the appropriate Cell value for a cell offset.","docstring_tokens":["Returns","the","appropriate","Cell","value","for","a","cell","offset","."],"function":"def get_cell(self, cell_offset: int) -> 'objects.StructType':\n \"\"\"Returns the appropriate Cell value for a cell offset.\"\"\"\n # This would be an _HCELL containing CELL_DATA, but to save time we skip the size of the HCELL\n cell = self._context.object(object_type = self._table_name + constants.BANG + \"_CELL_DATA\",\n offset = cell_offset + 4,\n layer_name = self.name)\n return cell","function_tokens":["def","get_cell","(","self",",","cell_offset",":","int",")","->","'objects.StructType'",":","# This would be an _HCELL containing CELL_DATA, but to save time we skip the size of the HCELL","cell","=","self",".","_context",".","object","(","object_type","=","self",".","_table_name","+","constants",".","BANG","+","\"_CELL_DATA\"",",","offset","=","cell_offset","+","4",",","layer_name","=","self",".","name",")","return","cell"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py#L102-L108"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py","language":"python","identifier":"RegistryHive.get_node","parameters":"(self, cell_offset: int)","argument_list":"","return_statement":"","docstring":"Returns the appropriate Node, interpreted from the Cell based on its\n Signature.","docstring_summary":"Returns the appropriate Node, interpreted from the Cell based on its\n Signature.","docstring_tokens":["Returns","the","appropriate","Node","interpreted","from","the","Cell","based","on","its","Signature","."],"function":"def get_node(self, cell_offset: int) -> 'objects.StructType':\n \"\"\"Returns the appropriate Node, interpreted from the Cell based on its\n Signature.\"\"\"\n cell = self.get_cell(cell_offset)\n signature = cell.cast('string', max_length = 2, encoding = 'latin-1')\n if signature == 'nk':\n return cell.u.KeyNode\n elif signature == 'sk':\n return cell.u.KeySecurity\n elif signature == 'vk':\n return cell.u.KeyValue\n elif signature == 'db':\n # Big Data\n return cell.u.ValueData\n elif signature == 'lf' or signature == 'lh' or signature == 'ri':\n # Fast Leaf, Hash Leaf, Index Root\n return cell.u.KeyIndex\n else:\n # It doesn't matter that we use KeyNode, we're just after the first two bytes\n vollog.debug(\"Unknown Signature {} (0x{:x}) at offset {}\".format(signature, cell.u.KeyNode.Signature,\n cell_offset))\n return cell","function_tokens":["def","get_node","(","self",",","cell_offset",":","int",")","->","'objects.StructType'",":","cell","=","self",".","get_cell","(","cell_offset",")","signature","=","cell",".","cast","(","'string'",",","max_length","=","2",",","encoding","=","'latin-1'",")","if","signature","==","'nk'",":","return","cell",".","u",".","KeyNode","elif","signature","==","'sk'",":","return","cell",".","u",".","KeySecurity","elif","signature","==","'vk'",":","return","cell",".","u",".","KeyValue","elif","signature","==","'db'",":","# Big Data","return","cell",".","u",".","ValueData","elif","signature","==","'lf'","or","signature","==","'lh'","or","signature","==","'ri'",":","# Fast Leaf, Hash Leaf, Index Root","return","cell",".","u",".","KeyIndex","else",":","# It doesn't matter that we use KeyNode, we're just after the first two bytes","vollog",".","debug","(","\"Unknown Signature {} (0x{:x}) at offset {}\"",".","format","(","signature",",","cell",".","u",".","KeyNode",".","Signature",",","cell_offset",")",")","return","cell"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py#L110-L131"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py","language":"python","identifier":"RegistryHive.get_key","parameters":"(self, key: str, return_list: bool = False)","argument_list":"","return_statement":"return node_key[-1]","docstring":"Gets a specific registry key by key path.\n\n return_list specifies whether the return result will be a single\n node (default) or a list of nodes from root to the current node\n (if return_list is true).","docstring_summary":"Gets a specific registry key by key path.","docstring_tokens":["Gets","a","specific","registry","key","by","key","path","."],"function":"def get_key(self, key: str, return_list: bool = False) -> Union[List[objects.StructType], objects.StructType]:\n \"\"\"Gets a specific registry key by key path.\n\n return_list specifies whether the return result will be a single\n node (default) or a list of nodes from root to the current node\n (if return_list is true).\n \"\"\"\n node_key = [self.get_node(self.root_cell_offset)]\n if key.endswith(\"\\\\\"):\n key = key[:-1]\n key_array = key.split('\\\\')\n found_key = [] # type: List[str]\n while key_array and node_key:\n subkeys = node_key[-1].get_subkeys()\n for subkey in subkeys:\n # registry keys are not case sensitive so compare lowercase\n # https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms724946(v=vs.85).aspx\n if subkey.get_name().lower() == key_array[0].lower():\n node_key = node_key + [subkey]\n found_key, key_array = found_key + [key_array[0]], key_array[1:]\n break\n else:\n node_key = []\n if not node_key:\n raise KeyError(\"Key {} not found under {}\".format(key_array[0], '\\\\'.join(found_key)))\n if return_list:\n return node_key\n return node_key[-1]","function_tokens":["def","get_key","(","self",",","key",":","str",",","return_list",":","bool","=","False",")","->","Union","[","List","[","objects",".","StructType","]",",","objects",".","StructType","]",":","node_key","=","[","self",".","get_node","(","self",".","root_cell_offset",")","]","if","key",".","endswith","(","\"\\\\\"",")",":","key","=","key","[",":","-","1","]","key_array","=","key",".","split","(","'\\\\'",")","found_key","=","[","]","# type: List[str]","while","key_array","and","node_key",":","subkeys","=","node_key","[","-","1","]",".","get_subkeys","(",")","for","subkey","in","subkeys",":","# registry keys are not case sensitive so compare lowercase","# https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms724946(v=vs.85).aspx","if","subkey",".","get_name","(",")",".","lower","(",")","==","key_array","[","0","]",".","lower","(",")",":","node_key","=","node_key","+","[","subkey","]","found_key",",","key_array","=","found_key","+","[","key_array","[","0","]","]",",","key_array","[","1",":","]","break","else",":","node_key","=","[","]","if","not","node_key",":","raise","KeyError","(","\"Key {} not found under {}\"",".","format","(","key_array","[","0","]",",","'\\\\'",".","join","(","found_key",")",")",")","if","return_list",":","return","node_key","return","node_key","[","-","1","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py#L133-L160"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py","language":"python","identifier":"RegistryHive.visit_nodes","parameters":"(self,\n visitor: Callable[[objects.StructType], None],\n node: Optional[objects.StructType] = None)","argument_list":"","return_statement":"","docstring":"Applies a callable (visitor) to all nodes within the registry tree\n from a given node.","docstring_summary":"Applies a callable (visitor) to all nodes within the registry tree\n from a given node.","docstring_tokens":["Applies","a","callable","(","visitor",")","to","all","nodes","within","the","registry","tree","from","a","given","node","."],"function":"def visit_nodes(self,\n visitor: Callable[[objects.StructType], None],\n node: Optional[objects.StructType] = None) -> None:\n \"\"\"Applies a callable (visitor) to all nodes within the registry tree\n from a given node.\"\"\"\n if not node:\n node = self.get_node(self.root_cell_offset)\n visitor(node)\n for node in node.get_subkeys():\n self.visit_nodes(visitor, node)","function_tokens":["def","visit_nodes","(","self",",","visitor",":","Callable","[","[","objects",".","StructType","]",",","None","]",",","node",":","Optional","[","objects",".","StructType","]","=","None",")","->","None",":","if","not","node",":","node","=","self",".","get_node","(","self",".","root_cell_offset",")","visitor","(","node",")","for","node","in","node",".","get_subkeys","(",")",":","self",".","visit_nodes","(","visitor",",","node",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py#L162-L171"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py","language":"python","identifier":"RegistryHive._mask","parameters":"(value: int, high_bit: int, low_bit: int)","argument_list":"","return_statement":"return value & mask","docstring":"Returns the bits of a value between highbit and lowbit inclusive.","docstring_summary":"Returns the bits of a value between highbit and lowbit inclusive.","docstring_tokens":["Returns","the","bits","of","a","value","between","highbit","and","lowbit","inclusive","."],"function":"def _mask(value: int, high_bit: int, low_bit: int) -> int:\n \"\"\"Returns the bits of a value between highbit and lowbit inclusive.\"\"\"\n high_mask = (2 ** (high_bit + 1)) - 1\n low_mask = (2 ** low_bit) - 1\n mask = (high_mask ^ low_mask)\n # print(high_bit, low_bit, bin(mask), bin(value))\n return value & mask","function_tokens":["def","_mask","(","value",":","int",",","high_bit",":","int",",","low_bit",":","int",")","->","int",":","high_mask","=","(","2","**","(","high_bit","+","1",")",")","-","1","low_mask","=","(","2","**","low_bit",")","-","1","mask","=","(","high_mask","^","low_mask",")","# print(high_bit, low_bit, bin(mask), bin(value))","return","value","&","mask"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py#L174-L180"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py","language":"python","identifier":"RegistryHive._translate","parameters":"(self, offset: int)","argument_list":"","return_statement":"return entry.get_block_offset() + suboffset","docstring":"Translates a single cell index to a cell memory offset and the\n suboffset within it.","docstring_summary":"Translates a single cell index to a cell memory offset and the\n suboffset within it.","docstring_tokens":["Translates","a","single","cell","index","to","a","cell","memory","offset","and","the","suboffset","within","it","."],"function":"def _translate(self, offset: int) -> int:\n \"\"\"Translates a single cell index to a cell memory offset and the\n suboffset within it.\"\"\"\n\n # Ignore the volatile bit when determining maxaddr validity\n volatile = self._mask(offset, 31, 31) >> 31\n if offset & 0x7fffffff > self._get_hive_maxaddr(volatile):\n raise RegistryInvalidIndex(self.name, \"Mapping request for value greater than maxaddr\")\n\n storage = self.hive.Storage[volatile]\n dir_index = self._mask(offset, 30, 21) >> 21\n table_index = self._mask(offset, 20, 12) >> 12\n suboffset = self._mask(offset, 11, 0) >> 0\n\n table = storage.Map.Directory[dir_index]\n entry = table.Table[table_index]\n return entry.get_block_offset() + suboffset","function_tokens":["def","_translate","(","self",",","offset",":","int",")","->","int",":","# Ignore the volatile bit when determining maxaddr validity","volatile","=","self",".","_mask","(","offset",",","31",",","31",")",">>","31","if","offset","&","0x7fffffff",">","self",".","_get_hive_maxaddr","(","volatile",")",":","raise","RegistryInvalidIndex","(","self",".","name",",","\"Mapping request for value greater than maxaddr\"",")","storage","=","self",".","hive",".","Storage","[","volatile","]","dir_index","=","self",".","_mask","(","offset",",","30",",","21",")",">>","21","table_index","=","self",".","_mask","(","offset",",","20",",","12",")",">>","12","suboffset","=","self",".","_mask","(","offset",",","11",",","0",")",">>","0","table","=","storage",".","Map",".","Directory","[","dir_index","]","entry","=","table",".","Table","[","table_index","]","return","entry",".","get_block_offset","(",")","+","suboffset"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py#L195-L211"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py","language":"python","identifier":"RegistryHive.dependencies","parameters":"(self)","argument_list":"","return_statement":"return [self.config['base_layer']]","docstring":"Returns a list of layer names that this layer translates onto.","docstring_summary":"Returns a list of layer names that this layer translates onto.","docstring_tokens":["Returns","a","list","of","layer","names","that","this","layer","translates","onto","."],"function":"def dependencies(self) -> List[str]:\n \"\"\"Returns a list of layer names that this layer translates onto.\"\"\"\n return [self.config['base_layer']]","function_tokens":["def","dependencies","(","self",")","->","List","[","str","]",":","return","[","self",".","config","[","'base_layer'","]","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py#L242-L244"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py","language":"python","identifier":"RegistryHive.is_valid","parameters":"(self, offset: int, length: int = 1)","argument_list":"","return_statement":"","docstring":"Returns a boolean based on whether the offset is valid or not.","docstring_summary":"Returns a boolean based on whether the offset is valid or not.","docstring_tokens":["Returns","a","boolean","based","on","whether","the","offset","is","valid","or","not","."],"function":"def is_valid(self, offset: int, length: int = 1) -> bool:\n \"\"\"Returns a boolean based on whether the offset is valid or not.\"\"\"\n try:\n # Pass this to the lower layers for now\n return all([\n self.context.layers[layer].is_valid(offset, length)\n for (_, _, offset, length, layer) in self.mapping(offset, length)\n ])\n except exceptions.InvalidAddressException:\n return False","function_tokens":["def","is_valid","(","self",",","offset",":","int",",","length",":","int","=","1",")","->","bool",":","try",":","# Pass this to the lower layers for now","return","all","(","[","self",".","context",".","layers","[","layer","]",".","is_valid","(","offset",",","length",")","for","(","_",",","_",",","offset",",","length",",","layer",")","in","self",".","mapping","(","offset",",","length",")","]",")","except","exceptions",".","InvalidAddressException",":","return","False"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/registry.py#L246-L255"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/crash.py","language":"python","identifier":"WindowsCrashDump32Layer._load_segments","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Loads up the segments from the meta_layer.","docstring_summary":"Loads up the segments from the meta_layer.","docstring_tokens":["Loads","up","the","segments","from","the","meta_layer","."],"function":"def _load_segments(self) -> None:\n \"\"\"Loads up the segments from the meta_layer.\"\"\"\n header = self.context.object(self._crash_table_name + constants.BANG + self.dump_header_name,\n offset = 0,\n layer_name = self._base_layer)\n\n segments = []\n\n offset = self.headerpages\n header.PhysicalMemoryBlockBuffer.Run.count = header.PhysicalMemoryBlockBuffer.NumberOfRuns\n for x in header.PhysicalMemoryBlockBuffer.Run:\n segments.append((x.BasePage * 0x1000, offset * 0x1000, x.PageCount * 0x1000, x.PageCount * 0x1000))\n # print(\"Segments {:x} {:x} {:x}\".format(x.BasePage * 0x1000,\n # offset * 0x1000,\n # x.PageCount * 0x1000))\n offset += x.PageCount\n\n if len(segments) == 0:\n raise WindowsCrashDumpFormatException(self.name, \"No Crash segments defined in {}\".format(self._base_layer))\n\n self._segments = segments","function_tokens":["def","_load_segments","(","self",")","->","None",":","header","=","self",".","context",".","object","(","self",".","_crash_table_name","+","constants",".","BANG","+","self",".","dump_header_name",",","offset","=","0",",","layer_name","=","self",".","_base_layer",")","segments","=","[","]","offset","=","self",".","headerpages","header",".","PhysicalMemoryBlockBuffer",".","Run",".","count","=","header",".","PhysicalMemoryBlockBuffer",".","NumberOfRuns","for","x","in","header",".","PhysicalMemoryBlockBuffer",".","Run",":","segments",".","append","(","(","x",".","BasePage","*","0x1000",",","offset","*","0x1000",",","x",".","PageCount","*","0x1000",",","x",".","PageCount","*","0x1000",")",")","# print(\"Segments {:x} {:x} {:x}\".format(x.BasePage * 0x1000,","# offset * 0x1000,","# x.PageCount * 0x1000))","offset","+=","x",".","PageCount","if","len","(","segments",")","==","0",":","raise","WindowsCrashDumpFormatException","(","self",".","name",",","\"No Crash segments defined in {}\"",".","format","(","self",".","_base_layer",")",")","self",".","_segments","=","segments"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/crash.py#L72-L92"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/crash.py","language":"python","identifier":"WindowsCrashDump64Layer._load_segments","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Loads up the segments from the meta_layer.","docstring_summary":"Loads up the segments from the meta_layer.","docstring_tokens":["Loads","up","the","segments","from","the","meta_layer","."],"function":"def _load_segments(self) -> None:\n \"\"\"Loads up the segments from the meta_layer.\"\"\"\n\n segments = []\n\n summary_header = self.context.object(self._crash_table_name + constants.BANG + \"_SUMMARY_DUMP64\",\n offset = 0x2000,\n layer_name = self._base_layer)\n\n if self.dump_type == 0x1:\n header = self.context.object(self._crash_table_name + constants.BANG + self.dump_header_name,\n offset = 0,\n layer_name = self._base_layer)\n\n offset = self.headerpages\n header.PhysicalMemoryBlockBuffer.Run.count = header.PhysicalMemoryBlockBuffer.NumberOfRuns\n for x in header.PhysicalMemoryBlockBuffer.Run:\n segments.append((x.BasePage * 0x1000, offset * 0x1000, x.PageCount * 0x1000, x.PageCount * 0x1000))\n offset += x.PageCount\n\n elif self.dump_type == 0x05:\n summary_header.BufferLong.count = (summary_header.BitmapSize + 31) \/\/ 32\n previous_bit = 0\n start_position = 0\n # We cast as an int because we don't want to carry the context around with us for infinite loop reasons\n mapped_offset = int(summary_header.HeaderSize)\n current_word = None\n for bit_position in range(len(summary_header.BufferLong) * 32):\n if (bit_position % 32) == 0:\n current_word = summary_header.BufferLong[bit_position \/\/ 32]\n current_bit = (current_word >> (bit_position % 32)) & 1\n if current_bit != previous_bit:\n if previous_bit == 0:\n # Start\n start_position = bit_position\n else:\n # Finish\n length = (bit_position - start_position) * 0x1000\n segments.append((start_position * 0x1000, mapped_offset, length, length))\n mapped_offset += length\n\n # Finish it off\n if bit_position == (len(summary_header.BufferLong) * 32) - 1 and current_bit == 1:\n length = (bit_position - start_position) * 0x1000\n segments.append((start_position * 0x1000, mapped_offset, length, length))\n mapped_offset += length\n\n previous_bit = current_bit\n else:\n vollog.log(constants.LOGLEVEL_VVVV, \"unsupported dump format 0x{:x}\".format(self.dump_type))\n raise WindowsCrashDumpFormatException(self.name, \"unsupported dump format 0x{:x}\".format(self.dump_type))\n\n if len(segments) == 0:\n raise WindowsCrashDumpFormatException(self.name, \"No Crash segments defined in {}\".format(self._base_layer))\n\n self._segments = segments","function_tokens":["def","_load_segments","(","self",")","->","None",":","segments","=","[","]","summary_header","=","self",".","context",".","object","(","self",".","_crash_table_name","+","constants",".","BANG","+","\"_SUMMARY_DUMP64\"",",","offset","=","0x2000",",","layer_name","=","self",".","_base_layer",")","if","self",".","dump_type","==","0x1",":","header","=","self",".","context",".","object","(","self",".","_crash_table_name","+","constants",".","BANG","+","self",".","dump_header_name",",","offset","=","0",",","layer_name","=","self",".","_base_layer",")","offset","=","self",".","headerpages","header",".","PhysicalMemoryBlockBuffer",".","Run",".","count","=","header",".","PhysicalMemoryBlockBuffer",".","NumberOfRuns","for","x","in","header",".","PhysicalMemoryBlockBuffer",".","Run",":","segments",".","append","(","(","x",".","BasePage","*","0x1000",",","offset","*","0x1000",",","x",".","PageCount","*","0x1000",",","x",".","PageCount","*","0x1000",")",")","offset","+=","x",".","PageCount","elif","self",".","dump_type","==","0x05",":","summary_header",".","BufferLong",".","count","=","(","summary_header",".","BitmapSize","+","31",")","\/\/","32","previous_bit","=","0","start_position","=","0","# We cast as an int because we don't want to carry the context around with us for infinite loop reasons","mapped_offset","=","int","(","summary_header",".","HeaderSize",")","current_word","=","None","for","bit_position","in","range","(","len","(","summary_header",".","BufferLong",")","*","32",")",":","if","(","bit_position","%","32",")","==","0",":","current_word","=","summary_header",".","BufferLong","[","bit_position","\/\/","32","]","current_bit","=","(","current_word",">>","(","bit_position","%","32",")",")","&","1","if","current_bit","!=","previous_bit",":","if","previous_bit","==","0",":","# Start","start_position","=","bit_position","else",":","# Finish","length","=","(","bit_position","-","start_position",")","*","0x1000","segments",".","append","(","(","start_position","*","0x1000",",","mapped_offset",",","length",",","length",")",")","mapped_offset","+=","length","# Finish it off","if","bit_position","==","(","len","(","summary_header",".","BufferLong",")","*","32",")","-","1","and","current_bit","==","1",":","length","=","(","bit_position","-","start_position",")","*","0x1000","segments",".","append","(","(","start_position","*","0x1000",",","mapped_offset",",","length",",","length",")",")","mapped_offset","+=","length","previous_bit","=","current_bit","else",":","vollog",".","log","(","constants",".","LOGLEVEL_VVVV",",","\"unsupported dump format 0x{:x}\"",".","format","(","self",".","dump_type",")",")","raise","WindowsCrashDumpFormatException","(","self",".","name",",","\"unsupported dump format 0x{:x}\"",".","format","(","self",".","dump_type",")",")","if","len","(","segments",")","==","0",":","raise","WindowsCrashDumpFormatException","(","self",".","name",",","\"No Crash segments defined in {}\"",".","format","(","self",".","_base_layer",")",")","self",".","_segments","=","segments"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/crash.py#L128-L183"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"BufferDataLayer.maximum_address","parameters":"(self)","argument_list":"","return_statement":"return len(self._buffer) - 1","docstring":"Returns the largest available address in the space.","docstring_summary":"Returns the largest available address in the space.","docstring_tokens":["Returns","the","largest","available","address","in","the","space","."],"function":"def maximum_address(self) -> int:\n \"\"\"Returns the largest available address in the space.\"\"\"\n return len(self._buffer) - 1","function_tokens":["def","maximum_address","(","self",")","->","int",":","return","len","(","self",".","_buffer",")","-","1"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L26-L28"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"BufferDataLayer.minimum_address","parameters":"(self)","argument_list":"","return_statement":"return 0","docstring":"Returns the smallest available address in the space.","docstring_summary":"Returns the smallest available address in the space.","docstring_tokens":["Returns","the","smallest","available","address","in","the","space","."],"function":"def minimum_address(self) -> int:\n \"\"\"Returns the smallest available address in the space.\"\"\"\n return 0","function_tokens":["def","minimum_address","(","self",")","->","int",":","return","0"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L31-L33"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"BufferDataLayer.is_valid","parameters":"(self, offset: int, length: int = 1)","argument_list":"","return_statement":"return bool(self.minimum_address <= offset <= self.maximum_address\n and self.minimum_address <= offset + length - 1 <= self.maximum_address)","docstring":"Returns whether the offset is valid or not.","docstring_summary":"Returns whether the offset is valid or not.","docstring_tokens":["Returns","whether","the","offset","is","valid","or","not","."],"function":"def is_valid(self, offset: int, length: int = 1) -> bool:\n \"\"\"Returns whether the offset is valid or not.\"\"\"\n return bool(self.minimum_address <= offset <= self.maximum_address\n and self.minimum_address <= offset + length - 1 <= self.maximum_address)","function_tokens":["def","is_valid","(","self",",","offset",":","int",",","length",":","int","=","1",")","->","bool",":","return","bool","(","self",".","minimum_address","<=","offset","<=","self",".","maximum_address","and","self",".","minimum_address","<=","offset","+","length","-","1","<=","self",".","maximum_address",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L35-L38"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"BufferDataLayer.read","parameters":"(self, address: int, length: int, pad: bool = False)","argument_list":"","return_statement":"return self._buffer[address:address + length]","docstring":"Reads the data from the buffer.","docstring_summary":"Reads the data from the buffer.","docstring_tokens":["Reads","the","data","from","the","buffer","."],"function":"def read(self, address: int, length: int, pad: bool = False) -> bytes:\n \"\"\"Reads the data from the buffer.\"\"\"\n if not self.is_valid(address, length):\n invalid_address = address\n if self.minimum_address < address <= self.maximum_address:\n invalid_address = self.maximum_address + 1\n raise exceptions.InvalidAddressException(self.name, invalid_address,\n \"Offset outside of the buffer boundaries\")\n return self._buffer[address:address + length]","function_tokens":["def","read","(","self",",","address",":","int",",","length",":","int",",","pad",":","bool","=","False",")","->","bytes",":","if","not","self",".","is_valid","(","address",",","length",")",":","invalid_address","=","address","if","self",".","minimum_address","<","address","<=","self",".","maximum_address",":","invalid_address","=","self",".","maximum_address","+","1","raise","exceptions",".","InvalidAddressException","(","self",".","name",",","invalid_address",",","\"Offset outside of the buffer boundaries\"",")","return","self",".","_buffer","[","address",":","address","+","length","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L40-L48"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"BufferDataLayer.write","parameters":"(self, address: int, data: bytes)","argument_list":"","return_statement":"","docstring":"Writes the data from to the buffer.","docstring_summary":"Writes the data from to the buffer.","docstring_tokens":["Writes","the","data","from","to","the","buffer","."],"function":"def write(self, address: int, data: bytes):\n \"\"\"Writes the data from to the buffer.\"\"\"\n self._buffer = self._buffer[:address] + data + self._buffer[address + len(data):]","function_tokens":["def","write","(","self",",","address",":","int",",","data",":","bytes",")",":","self",".","_buffer","=","self",".","_buffer","[",":","address","]","+","data","+","self",".","_buffer","[","address","+","len","(","data",")",":","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L50-L52"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"FileLayer.location","parameters":"(self)","argument_list":"","return_statement":"return self._location","docstring":"Returns the location on which this Layer abstracts.","docstring_summary":"Returns the location on which this Layer abstracts.","docstring_tokens":["Returns","the","location","on","which","this","Layer","abstracts","."],"function":"def location(self) -> str:\n \"\"\"Returns the location on which this Layer abstracts.\"\"\"\n return self._location","function_tokens":["def","location","(","self",")","->","str",":","return","self",".","_location"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L95-L97"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"FileLayer._file","parameters":"(self)","argument_list":"","return_statement":"return self._file_","docstring":"Property to prevent the initializer storing an unserializable open\n file (for context cloning)","docstring_summary":"Property to prevent the initializer storing an unserializable open\n file (for context cloning)","docstring_tokens":["Property","to","prevent","the","initializer","storing","an","unserializable","open","file","(","for","context","cloning",")"],"function":"def _file(self) -> IO[Any]:\n \"\"\"Property to prevent the initializer storing an unserializable open\n file (for context cloning)\"\"\"\n # FIXME: Add \"+\" to the mode once we've determined whether write mode is enabled\n mode = \"rb\"\n self._file_ = self._file_ or self._accessor.open(self._location, mode)\n return self._file_","function_tokens":["def","_file","(","self",")","->","IO","[","Any","]",":","# FIXME: Add \"+\" to the mode once we've determined whether write mode is enabled","mode","=","\"rb\"","self",".","_file_","=","self",".","_file_","or","self",".","_accessor",".","open","(","self",".","_location",",","mode",")","return","self",".","_file_"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L100-L106"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"FileLayer.maximum_address","parameters":"(self)","argument_list":"","return_statement":"return self._size","docstring":"Returns the largest available address in the space.","docstring_summary":"Returns the largest available address in the space.","docstring_tokens":["Returns","the","largest","available","address","in","the","space","."],"function":"def maximum_address(self) -> int:\n \"\"\"Returns the largest available address in the space.\"\"\"\n # Zero based, so we return the size of the file minus 1\n if self._size:\n return self._size\n with self._lock:\n orig = self._file.tell()\n self._file.seek(0, 2)\n self._size = self._file.tell()\n self._file.seek(orig)\n return self._size","function_tokens":["def","maximum_address","(","self",")","->","int",":","# Zero based, so we return the size of the file minus 1","if","self",".","_size",":","return","self",".","_size","with","self",".","_lock",":","orig","=","self",".","_file",".","tell","(",")","self",".","_file",".","seek","(","0",",","2",")","self",".","_size","=","self",".","_file",".","tell","(",")","self",".","_file",".","seek","(","orig",")","return","self",".","_size"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L109-L119"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"FileLayer.minimum_address","parameters":"(self)","argument_list":"","return_statement":"return 0","docstring":"Returns the smallest available address in the space.","docstring_summary":"Returns the smallest available address in the space.","docstring_tokens":["Returns","the","smallest","available","address","in","the","space","."],"function":"def minimum_address(self) -> int:\n \"\"\"Returns the smallest available address in the space.\"\"\"\n return 0","function_tokens":["def","minimum_address","(","self",")","->","int",":","return","0"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L122-L124"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"FileLayer.is_valid","parameters":"(self, offset: int, length: int = 1)","argument_list":"","return_statement":"return bool(self.minimum_address <= offset <= self.maximum_address\n and self.minimum_address <= offset + length - 1 <= self.maximum_address)","docstring":"Returns whether the offset is valid or not.","docstring_summary":"Returns whether the offset is valid or not.","docstring_tokens":["Returns","whether","the","offset","is","valid","or","not","."],"function":"def is_valid(self, offset: int, length: int = 1) -> bool:\n \"\"\"Returns whether the offset is valid or not.\"\"\"\n if length <= 0:\n raise ValueError(\"Length must be positive\")\n return bool(self.minimum_address <= offset <= self.maximum_address\n and self.minimum_address <= offset + length - 1 <= self.maximum_address)","function_tokens":["def","is_valid","(","self",",","offset",":","int",",","length",":","int","=","1",")","->","bool",":","if","length","<=","0",":","raise","ValueError","(","\"Length must be positive\"",")","return","bool","(","self",".","minimum_address","<=","offset","<=","self",".","maximum_address","and","self",".","minimum_address","<=","offset","+","length","-","1","<=","self",".","maximum_address",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L126-L131"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"FileLayer.read","parameters":"(self, offset: int, length: int, pad: bool = False)","argument_list":"","return_statement":"return data","docstring":"Reads from the file at offset for length.","docstring_summary":"Reads from the file at offset for length.","docstring_tokens":["Reads","from","the","file","at","offset","for","length","."],"function":"def read(self, offset: int, length: int, pad: bool = False) -> bytes:\n \"\"\"Reads from the file at offset for length.\"\"\"\n if not self.is_valid(offset, length):\n invalid_address = offset\n if self.minimum_address < offset <= self.maximum_address:\n invalid_address = self.maximum_address + 1\n raise exceptions.InvalidAddressException(self.name, invalid_address,\n \"Offset outside of the buffer boundaries\")\n\n # TODO: implement locking for multi-threading\n with self._lock:\n self._file.seek(offset)\n data = self._file.read(length)\n\n if len(data) < length:\n if pad:\n data += (b\"\\x00\" * (length - len(data)))\n else:\n raise exceptions.InvalidAddressException(\n self.name, offset + len(data), \"Could not read sufficient bytes from the \" + self.name + \" file\")\n return data","function_tokens":["def","read","(","self",",","offset",":","int",",","length",":","int",",","pad",":","bool","=","False",")","->","bytes",":","if","not","self",".","is_valid","(","offset",",","length",")",":","invalid_address","=","offset","if","self",".","minimum_address","<","offset","<=","self",".","maximum_address",":","invalid_address","=","self",".","maximum_address","+","1","raise","exceptions",".","InvalidAddressException","(","self",".","name",",","invalid_address",",","\"Offset outside of the buffer boundaries\"",")","# TODO: implement locking for multi-threading","with","self",".","_lock",":","self",".","_file",".","seek","(","offset",")","data","=","self",".","_file",".","read","(","length",")","if","len","(","data",")","<","length",":","if","pad",":","data","+=","(","b\"\\x00\"","*","(","length","-","len","(","data",")",")",")","else",":","raise","exceptions",".","InvalidAddressException","(","self",".","name",",","offset","+","len","(","data",")",",","\"Could not read sufficient bytes from the \"","+","self",".","name","+","\" file\"",")","return","data"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L133-L153"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"FileLayer.write","parameters":"(self, offset: int, data: bytes)","argument_list":"","return_statement":"","docstring":"Writes to the file.\n\n This will technically allow writes beyond the extent of the file","docstring_summary":"Writes to the file.","docstring_tokens":["Writes","to","the","file","."],"function":"def write(self, offset: int, data: bytes) -> None:\n \"\"\"Writes to the file.\n\n This will technically allow writes beyond the extent of the file\n \"\"\"\n if not self.is_valid(offset, len(data)):\n invalid_address = offset\n if self.minimum_address < offset <= self.maximum_address:\n invalid_address = self.maximum_address + 1\n raise exceptions.InvalidAddressException(self.name, invalid_address,\n \"Data segment outside of the \" + self.name + \" file boundaries\")\n with self._lock:\n self._file.seek(offset)\n self._file.write(data)","function_tokens":["def","write","(","self",",","offset",":","int",",","data",":","bytes",")","->","None",":","if","not","self",".","is_valid","(","offset",",","len","(","data",")",")",":","invalid_address","=","offset","if","self",".","minimum_address","<","offset","<=","self",".","maximum_address",":","invalid_address","=","self",".","maximum_address","+","1","raise","exceptions",".","InvalidAddressException","(","self",".","name",",","invalid_address",",","\"Data segment outside of the \"","+","self",".","name","+","\" file boundaries\"",")","with","self",".","_lock",":","self",".","_file",".","seek","(","offset",")","self",".","_file",".","write","(","data",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L155-L168"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"FileLayer.__getstate__","parameters":"(self)","argument_list":"","return_statement":"return self.__dict__","docstring":"Do not store the open _file_ attribute, our property will ensure the\n file is open when needed.\n\n This is necessary for multi-processing","docstring_summary":"Do not store the open _file_ attribute, our property will ensure the\n file is open when needed.","docstring_tokens":["Do","not","store","the","open","_file_","attribute","our","property","will","ensure","the","file","is","open","when","needed","."],"function":"def __getstate__(self) -> Dict[str, Any]:\n \"\"\"Do not store the open _file_ attribute, our property will ensure the\n file is open when needed.\n\n This is necessary for multi-processing\n \"\"\"\n self._file_ = None\n return self.__dict__","function_tokens":["def","__getstate__","(","self",")","->","Dict","[","str",",","Any","]",":","self",".","_file_","=","None","return","self",".","__dict__"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L170-L177"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py","language":"python","identifier":"FileLayer.destroy","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Closes the file handle.","docstring_summary":"Closes the file handle.","docstring_tokens":["Closes","the","file","handle","."],"function":"def destroy(self) -> None:\n \"\"\"Closes the file handle.\"\"\"\n self._file.close()","function_tokens":["def","destroy","(","self",")","->","None",":","self",".","_file",".","close","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/physical.py#L179-L181"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/vmware.py","language":"python","identifier":"VmwareLayer._load_segments","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Loads up the segments from the meta_layer.","docstring_summary":"Loads up the segments from the meta_layer.","docstring_tokens":["Loads","up","the","segments","from","the","meta_layer","."],"function":"def _load_segments(self) -> None:\n \"\"\"Loads up the segments from the meta_layer.\"\"\"\n self._read_header()","function_tokens":["def","_load_segments","(","self",")","->","None",":","self",".","_read_header","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/vmware.py#L35-L37"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/vmware.py","language":"python","identifier":"VmwareLayer._read_header","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Checks the vmware header to make sure it's valid.","docstring_summary":"Checks the vmware header to make sure it's valid.","docstring_tokens":["Checks","the","vmware","header","to","make","sure","it","s","valid","."],"function":"def _read_header(self) -> None:\n \"\"\"Checks the vmware header to make sure it's valid.\"\"\"\n if \"vmware\" not in self._context.symbol_space:\n self._context.symbol_space.append(native.NativeTable(\"vmware\", native.std_ctypes))\n\n meta_layer = self.context.layers.get(self._meta_layer, None)\n header_size = struct.calcsize(self.header_structure)\n data = meta_layer.read(0, header_size)\n magic, unknown, groupCount = struct.unpack(self.header_structure, data)\n if magic not in [b\"\\xD2\\xBE\\xD2\\xBE\"]:\n raise VmwareFormatException(self.name, \"Wrong magic bytes for Vmware layer: {}\".format(repr(magic)))\n\n # TODO: Change certain structure sizes based on the version\n # version = magic[1] & 0xf\n\n group_size = struct.calcsize(self.group_structure)\n\n groups = {}\n for group in range(groupCount):\n name, tag_location, _unknown = struct.unpack(\n self.group_structure, meta_layer.read(header_size + (group * group_size), group_size))\n name = name.rstrip(b\"\\x00\")\n groups[name] = tag_location\n memory = groups[b\"memory\"]\n\n tags_read = False\n offset = memory\n tags = {}\n index_len = self._context.symbol_space.get_type(\"vmware!unsigned int\").size\n while not tags_read:\n flags = ord(meta_layer.read(offset, 1))\n name_len = ord(meta_layer.read(offset + 1, 1))\n tags_read = (flags == 0) and (name_len == 0)\n if not tags_read:\n name = self._context.object(\"vmware!string\",\n layer_name = self._meta_layer,\n offset = offset + 2,\n max_length = name_len)\n indicies_len = (flags >> 6) & 3\n indicies = []\n for index in range(indicies_len):\n indicies.append(\n self._context.object(\"vmware!unsigned int\",\n offset = offset + name_len + 2 + (index * index_len),\n layer_name = self._meta_layer))\n data = self._context.object(\"vmware!unsigned int\",\n layer_name = self._meta_layer,\n offset = offset + 2 + name_len + (indicies_len * index_len))\n tags[(name, tuple(indicies))] = (flags, data)\n offset += 2 + name_len + (indicies_len *\n index_len) + self._context.symbol_space.get_type(\"vmware!unsigned int\").size\n\n if tags[(\"regionsCount\", ())][1] == 0:\n raise VmwareFormatException(self.name, \"VMware VMEM is not split into regions\")\n for region in range(tags[(\"regionsCount\", ())][1]):\n offset = tags[(\"regionPPN\", (region,))][1] * self._page_size\n mapped_offset = tags[(\"regionPageNum\", (region,))][1] * self._page_size\n length = tags[(\"regionSize\", (region,))][1] * self._page_size\n self._segments.append((offset, mapped_offset, length, length))","function_tokens":["def","_read_header","(","self",")","->","None",":","if","\"vmware\"","not","in","self",".","_context",".","symbol_space",":","self",".","_context",".","symbol_space",".","append","(","native",".","NativeTable","(","\"vmware\"",",","native",".","std_ctypes",")",")","meta_layer","=","self",".","context",".","layers",".","get","(","self",".","_meta_layer",",","None",")","header_size","=","struct",".","calcsize","(","self",".","header_structure",")","data","=","meta_layer",".","read","(","0",",","header_size",")","magic",",","unknown",",","groupCount","=","struct",".","unpack","(","self",".","header_structure",",","data",")","if","magic","not","in","[","b\"\\xD2\\xBE\\xD2\\xBE\"","]",":","raise","VmwareFormatException","(","self",".","name",",","\"Wrong magic bytes for Vmware layer: {}\"",".","format","(","repr","(","magic",")",")",")","# TODO: Change certain structure sizes based on the version","# version = magic[1] & 0xf","group_size","=","struct",".","calcsize","(","self",".","group_structure",")","groups","=","{","}","for","group","in","range","(","groupCount",")",":","name",",","tag_location",",","_unknown","=","struct",".","unpack","(","self",".","group_structure",",","meta_layer",".","read","(","header_size","+","(","group","*","group_size",")",",","group_size",")",")","name","=","name",".","rstrip","(","b\"\\x00\"",")","groups","[","name","]","=","tag_location","memory","=","groups","[","b\"memory\"","]","tags_read","=","False","offset","=","memory","tags","=","{","}","index_len","=","self",".","_context",".","symbol_space",".","get_type","(","\"vmware!unsigned int\"",")",".","size","while","not","tags_read",":","flags","=","ord","(","meta_layer",".","read","(","offset",",","1",")",")","name_len","=","ord","(","meta_layer",".","read","(","offset","+","1",",","1",")",")","tags_read","=","(","flags","==","0",")","and","(","name_len","==","0",")","if","not","tags_read",":","name","=","self",".","_context",".","object","(","\"vmware!string\"",",","layer_name","=","self",".","_meta_layer",",","offset","=","offset","+","2",",","max_length","=","name_len",")","indicies_len","=","(","flags",">>","6",")","&","3","indicies","=","[","]","for","index","in","range","(","indicies_len",")",":","indicies",".","append","(","self",".","_context",".","object","(","\"vmware!unsigned int\"",",","offset","=","offset","+","name_len","+","2","+","(","index","*","index_len",")",",","layer_name","=","self",".","_meta_layer",")",")","data","=","self",".","_context",".","object","(","\"vmware!unsigned int\"",",","layer_name","=","self",".","_meta_layer",",","offset","=","offset","+","2","+","name_len","+","(","indicies_len","*","index_len",")",")","tags","[","(","name",",","tuple","(","indicies",")",")","]","=","(","flags",",","data",")","offset","+=","2","+","name_len","+","(","indicies_len","*","index_len",")","+","self",".","_context",".","symbol_space",".","get_type","(","\"vmware!unsigned int\"",")",".","size","if","tags","[","(","\"regionsCount\"",",","(",")",")","]","[","1","]","==","0",":","raise","VmwareFormatException","(","self",".","name",",","\"VMware VMEM is not split into regions\"",")","for","region","in","range","(","tags","[","(","\"regionsCount\"",",","(",")",")","]","[","1","]",")",":","offset","=","tags","[","(","\"regionPPN\"",",","(","region",",",")",")","]","[","1","]","*","self",".","_page_size","mapped_offset","=","tags","[","(","\"regionPageNum\"",",","(","region",",",")",")","]","[","1","]","*","self",".","_page_size","length","=","tags","[","(","\"regionSize\"",",","(","region",",",")",")","]","[","1","]","*","self",".","_page_size","self",".","_segments",".","append","(","(","offset",",","mapped_offset",",","length",",","length",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/vmware.py#L39-L97"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/vmware.py","language":"python","identifier":"VmwareLayer.get_requirements","parameters":"(cls)","argument_list":"","return_statement":"return [\n requirements.TranslationLayerRequirement(name = 'base_layer', optional = False),\n requirements.TranslationLayerRequirement(name = 'meta_layer', optional = False)\n ]","docstring":"This vmware translation layer always requires a separate metadata\n layer.","docstring_summary":"This vmware translation layer always requires a separate metadata\n layer.","docstring_tokens":["This","vmware","translation","layer","always","requires","a","separate","metadata","layer","."],"function":"def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]:\n \"\"\"This vmware translation layer always requires a separate metadata\n layer.\"\"\"\n return [\n requirements.TranslationLayerRequirement(name = 'base_layer', optional = False),\n requirements.TranslationLayerRequirement(name = 'meta_layer', optional = False)\n ]","function_tokens":["def","get_requirements","(","cls",")","->","List","[","interfaces",".","configuration",".","RequirementInterface","]",":","return","[","requirements",".","TranslationLayerRequirement","(","name","=","'base_layer'",",","optional","=","False",")",",","requirements",".","TranslationLayerRequirement","(","name","=","'meta_layer'",",","optional","=","False",")","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/vmware.py#L104-L110"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/vmware.py","language":"python","identifier":"VmwareStacker.stack","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return None","docstring":"Attempt to stack this based on the starting information.","docstring_summary":"Attempt to stack this based on the starting information.","docstring_tokens":["Attempt","to","stack","this","based","on","the","starting","information","."],"function":"def stack(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None) -> Optional[interfaces.layers.DataLayerInterface]:\n \"\"\"Attempt to stack this based on the starting information.\"\"\"\n memlayer = context.layers[layer_name]\n if not isinstance(memlayer, physical.FileLayer):\n return None\n location = memlayer.location\n if location.endswith(\".vmem\"):\n vmss = location[:-5] + \".vmss\"\n vmsn = location[:-5] + \".vmsn\"\n current_layer_name = context.layers.free_layer_name(\"VmwareMetaLayer\")\n current_config_path = interfaces.configuration.path_join(\"automagic\", \"layer_stacker\", \"stack\",\n current_layer_name)\n\n try:\n _ = resources.ResourceAccessor().open(vmss).read(10)\n context.config[interfaces.configuration.path_join(current_config_path, \"location\")] = vmss\n context.layers.add_layer(physical.FileLayer(context, current_config_path, current_layer_name))\n vmss_success = True\n except IOError:\n vmss_success = False\n\n if not vmss_success:\n try:\n _ = resources.ResourceAccessor().open(vmsn).read(10)\n context.config[interfaces.configuration.path_join(current_config_path, \"location\")] = vmsn\n context.layers.add_layer(physical.FileLayer(context, current_config_path, current_layer_name))\n vmsn_success = True\n except IOError:\n vmsn_success = False\n\n if not vmss_success and not vmsn_success:\n return None\n new_layer_name = context.layers.free_layer_name(\"VmwareLayer\")\n context.config[interfaces.configuration.path_join(current_config_path, \"base_layer\")] = layer_name\n context.config[interfaces.configuration.path_join(current_config_path, \"meta_layer\")] = current_layer_name\n new_layer = VmwareLayer(context, current_config_path, new_layer_name)\n return new_layer\n return None","function_tokens":["def","stack","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","Optional","[","interfaces",".","layers",".","DataLayerInterface","]",":","memlayer","=","context",".","layers","[","layer_name","]","if","not","isinstance","(","memlayer",",","physical",".","FileLayer",")",":","return","None","location","=","memlayer",".","location","if","location",".","endswith","(","\".vmem\"",")",":","vmss","=","location","[",":","-","5","]","+","\".vmss\"","vmsn","=","location","[",":","-","5","]","+","\".vmsn\"","current_layer_name","=","context",".","layers",".","free_layer_name","(","\"VmwareMetaLayer\"",")","current_config_path","=","interfaces",".","configuration",".","path_join","(","\"automagic\"",",","\"layer_stacker\"",",","\"stack\"",",","current_layer_name",")","try",":","_","=","resources",".","ResourceAccessor","(",")",".","open","(","vmss",")",".","read","(","10",")","context",".","config","[","interfaces",".","configuration",".","path_join","(","current_config_path",",","\"location\"",")","]","=","vmss","context",".","layers",".","add_layer","(","physical",".","FileLayer","(","context",",","current_config_path",",","current_layer_name",")",")","vmss_success","=","True","except","IOError",":","vmss_success","=","False","if","not","vmss_success",":","try",":","_","=","resources",".","ResourceAccessor","(",")",".","open","(","vmsn",")",".","read","(","10",")","context",".","config","[","interfaces",".","configuration",".","path_join","(","current_config_path",",","\"location\"",")","]","=","vmsn","context",".","layers",".","add_layer","(","physical",".","FileLayer","(","context",",","current_config_path",",","current_layer_name",")",")","vmsn_success","=","True","except","IOError",":","vmsn_success","=","False","if","not","vmss_success","and","not","vmsn_success",":","return","None","new_layer_name","=","context",".","layers",".","free_layer_name","(","\"VmwareLayer\"",")","context",".","config","[","interfaces",".","configuration",".","path_join","(","current_config_path",",","\"base_layer\"",")","]","=","layer_name","context",".","config","[","interfaces",".","configuration",".","path_join","(","current_config_path",",","\"meta_layer\"",")","]","=","current_layer_name","new_layer","=","VmwareLayer","(","context",",","current_config_path",",","new_layer_name",")","return","new_layer","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/vmware.py#L117-L157"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/scanners\/__init__.py","language":"python","identifier":"BytesScanner.__call__","parameters":"(self, data: bytes, data_offset: int)","argument_list":"","return_statement":"","docstring":"Runs through the data looking for the needle, and yields all offsets\n where the needle is found.","docstring_summary":"Runs through the data looking for the needle, and yields all offsets\n where the needle is found.","docstring_tokens":["Runs","through","the","data","looking","for","the","needle","and","yields","all","offsets","where","the","needle","is","found","."],"function":"def __call__(self, data: bytes, data_offset: int) -> Generator[int, None, None]:\n \"\"\"Runs through the data looking for the needle, and yields all offsets\n where the needle is found.\"\"\"\n find_pos = data.find(self.needle)\n while find_pos >= 0:\n if find_pos < self.chunk_size:\n yield find_pos + data_offset\n find_pos = data.find(self.needle, find_pos + 1)","function_tokens":["def","__call__","(","self",",","data",":","bytes",",","data_offset",":","int",")","->","Generator","[","int",",","None",",","None","]",":","find_pos","=","data",".","find","(","self",".","needle",")","while","find_pos",">=","0",":","if","find_pos","<","self",".","chunk_size",":","yield","find_pos","+","data_offset","find_pos","=","data",".","find","(","self",".","needle",",","find_pos","+","1",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/scanners\/__init__.py#L19-L26"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/scanners\/__init__.py","language":"python","identifier":"RegExScanner.__call__","parameters":"(self, data: bytes, data_offset: int)","argument_list":"","return_statement":"","docstring":"Runs through the data looking for the needle, and yields all offsets\n where the needle is found.","docstring_summary":"Runs through the data looking for the needle, and yields all offsets\n where the needle is found.","docstring_tokens":["Runs","through","the","data","looking","for","the","needle","and","yields","all","offsets","where","the","needle","is","found","."],"function":"def __call__(self, data: bytes, data_offset: int) -> Generator[int, None, None]:\n \"\"\"Runs through the data looking for the needle, and yields all offsets\n where the needle is found.\"\"\"\n find_pos = self.regex.finditer(data)\n for match in find_pos:\n offset = match.start()\n if offset < self.chunk_size:\n yield offset + data_offset","function_tokens":["def","__call__","(","self",",","data",":","bytes",",","data_offset",":","int",")","->","Generator","[","int",",","None",",","None","]",":","find_pos","=","self",".","regex",".","finditer","(","data",")","for","match","in","find_pos",":","offset","=","match",".","start","(",")","if","offset","<","self",".","chunk_size",":","yield","offset","+","data_offset"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/scanners\/__init__.py#L36-L43"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/scanners\/__init__.py","language":"python","identifier":"MultiStringScanner.__call__","parameters":"(self, data: bytes, data_offset: int)","argument_list":"","return_statement":"","docstring":"Runs through the data looking for the needles.","docstring_summary":"Runs through the data looking for the needles.","docstring_tokens":["Runs","through","the","data","looking","for","the","needles","."],"function":"def __call__(self, data: bytes, data_offset: int) -> Generator[Tuple[int, bytes], None, None]:\n \"\"\"Runs through the data looking for the needles.\"\"\"\n for offset, pattern in self._patterns.search(data):\n if offset < self.chunk_size:\n yield offset + data_offset, pattern","function_tokens":["def","__call__","(","self",",","data",":","bytes",",","data_offset",":","int",")","->","Generator","[","Tuple","[","int",",","bytes","]",",","None",",","None","]",":","for","offset",",","pattern","in","self",".","_patterns",".","search","(","data",")",":","if","offset","<","self",".","chunk_size",":","yield","offset","+","data_offset",",","pattern"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/layers\/scanners\/__init__.py#L56-L60"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"convert_data_to_value","parameters":"(data: bytes, struct_type: Type[TUnion[int, float, bytes, str, bool]],\n data_format: DataFormatInfo)","argument_list":"","return_statement":"return struct.unpack(struct_format, data)[0]","docstring":"Converts a series of bytes to a particular type of value.","docstring_summary":"Converts a series of bytes to a particular type of value.","docstring_tokens":["Converts","a","series","of","bytes","to","a","particular","type","of","value","."],"function":"def convert_data_to_value(data: bytes, struct_type: Type[TUnion[int, float, bytes, str, bool]],\n data_format: DataFormatInfo) -> TUnion[int, float, bytes, str, bool]:\n \"\"\"Converts a series of bytes to a particular type of value.\"\"\"\n if struct_type == int:\n return int.from_bytes(data, byteorder = data_format.byteorder, signed = data_format.signed)\n if struct_type == bool:\n struct_format = \"?\"\n elif struct_type == float:\n float_vals = \"zzezfzzzd\"\n if data_format.length > len(float_vals) or float_vals[data_format.length] not in \"efd\":\n raise ValueError(\"Invalid float size\")\n struct_format = (\"<\" if data_format.byteorder == 'little' else \">\") + float_vals[data_format.length]\n elif struct_type in [bytes, str]:\n struct_format = str(data_format.length) + \"s\"\n else:\n raise TypeError(\"Cannot construct struct format for type {}\".format(type(struct_type)))\n\n return struct.unpack(struct_format, data)[0]","function_tokens":["def","convert_data_to_value","(","data",":","bytes",",","struct_type",":","Type","[","TUnion","[","int",",","float",",","bytes",",","str",",","bool","]","]",",","data_format",":","DataFormatInfo",")","->","TUnion","[","int",",","float",",","bytes",",","str",",","bool","]",":","if","struct_type","==","int",":","return","int",".","from_bytes","(","data",",","byteorder","=","data_format",".","byteorder",",","signed","=","data_format",".","signed",")","if","struct_type","==","bool",":","struct_format","=","\"?\"","elif","struct_type","==","float",":","float_vals","=","\"zzezfzzzd\"","if","data_format",".","length",">","len","(","float_vals",")","or","float_vals","[","data_format",".","length","]","not","in","\"efd\"",":","raise","ValueError","(","\"Invalid float size\"",")","struct_format","=","(","\"<\"","if","data_format",".","byteorder","==","'little'","else","\">\"",")","+","float_vals","[","data_format",".","length","]","elif","struct_type","in","[","bytes",",","str","]",":","struct_format","=","str","(","data_format",".","length",")","+","\"s\"","else",":","raise","TypeError","(","\"Cannot construct struct format for type {}\"",".","format","(","type","(","struct_type",")",")",")","return","struct",".","unpack","(","struct_format",",","data",")","[","0","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L18-L35"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"convert_value_to_data","parameters":"(value: TUnion[int, float, bytes, str, bool], struct_type: Type[TUnion[int, float, bytes, str,\n bool]],\n data_format: DataFormatInfo)","argument_list":"","return_statement":"return struct.pack(struct_format, value)","docstring":"Converts a particular value to a series of bytes.","docstring_summary":"Converts a particular value to a series of bytes.","docstring_tokens":["Converts","a","particular","value","to","a","series","of","bytes","."],"function":"def convert_value_to_data(value: TUnion[int, float, bytes, str, bool], struct_type: Type[TUnion[int, float, bytes, str,\n bool]],\n data_format: DataFormatInfo) -> bytes:\n \"\"\"Converts a particular value to a series of bytes.\"\"\"\n if not isinstance(value, struct_type):\n raise TypeError(\"Written value is not of the correct type for {}\".format(struct_type.__class__.__name__))\n\n if struct_type == int and isinstance(value, int):\n # Doubling up on the isinstance is for mypy\n return int.to_bytes(value,\n length = data_format.length,\n byteorder = data_format.byteorder,\n signed = data_format.signed)\n if struct_type == bool:\n struct_format = \"?\"\n elif struct_type == float:\n float_vals = \"zzezfzzzd\"\n if data_format.length > len(float_vals) or float_vals[data_format.length] not in \"efd\":\n raise ValueError(\"Invalid float size\")\n struct_format = (\"<\" if data_format.byteorder == 'little' else \">\") + float_vals[data_format.length]\n elif struct_type in [bytes, str]:\n struct_format = str(data_format.length) + \"s\"\n else:\n raise TypeError(\"Cannot construct struct format for type {}\".format(type(struct_type)))\n\n return struct.pack(struct_format, value)","function_tokens":["def","convert_value_to_data","(","value",":","TUnion","[","int",",","float",",","bytes",",","str",",","bool","]",",","struct_type",":","Type","[","TUnion","[","int",",","float",",","bytes",",","str",",","bool","]","]",",","data_format",":","DataFormatInfo",")","->","bytes",":","if","not","isinstance","(","value",",","struct_type",")",":","raise","TypeError","(","\"Written value is not of the correct type for {}\"",".","format","(","struct_type",".","__class__",".","__name__",")",")","if","struct_type","==","int","and","isinstance","(","value",",","int",")",":","# Doubling up on the isinstance is for mypy","return","int",".","to_bytes","(","value",",","length","=","data_format",".","length",",","byteorder","=","data_format",".","byteorder",",","signed","=","data_format",".","signed",")","if","struct_type","==","bool",":","struct_format","=","\"?\"","elif","struct_type","==","float",":","float_vals","=","\"zzezfzzzd\"","if","data_format",".","length",">","len","(","float_vals",")","or","float_vals","[","data_format",".","length","]","not","in","\"efd\"",":","raise","ValueError","(","\"Invalid float size\"",")","struct_format","=","(","\"<\"","if","data_format",".","byteorder","==","'little'","else","\">\"",")","+","float_vals","[","data_format",".","length","]","elif","struct_type","in","[","bytes",",","str","]",":","struct_format","=","str","(","data_format",".","length",")","+","\"s\"","else",":","raise","TypeError","(","\"Cannot construct struct format for type {}\"",".","format","(","type","(","struct_type",")",")",")","return","struct",".","pack","(","struct_format",",","value",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L38-L63"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Void.write","parameters":"(self, value: Any)","argument_list":"","return_statement":"","docstring":"Dummy method that does nothing for Void objects.","docstring_summary":"Dummy method that does nothing for Void objects.","docstring_tokens":["Dummy","method","that","does","nothing","for","Void","objects","."],"function":"def write(self, value: Any) -> None:\n \"\"\"Dummy method that does nothing for Void objects.\"\"\"\n raise TypeError(\"Cannot write data to a void, recast as another object\")","function_tokens":["def","write","(","self",",","value",":","Any",")","->","None",":","raise","TypeError","(","\"Cannot write data to a void, recast as another object\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L83-L85"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"PrimitiveObject.__new__","parameters":"(cls: Type,\n context: interfaces.context.ContextInterface,\n type_name: str,\n object_info: interfaces.objects.ObjectInformation,\n data_format: DataFormatInfo,\n new_value: TUnion[int, float, bool, bytes, str] = None,\n **kwargs)","argument_list":"","return_statement":"return result","docstring":"Creates the appropriate class and returns it so that the native type\n is inherited.\n\n The only reason the kwargs is added, is so that the inherriting types can override __init__\n without needing to override __new__\n\n We also sneak in new_value, so that we don't have to do expensive (read: impossible) context reads\n when unpickling.","docstring_summary":"Creates the appropriate class and returns it so that the native type\n is inherited.","docstring_tokens":["Creates","the","appropriate","class","and","returns","it","so","that","the","native","type","is","inherited","."],"function":"def __new__(cls: Type,\n context: interfaces.context.ContextInterface,\n type_name: str,\n object_info: interfaces.objects.ObjectInformation,\n data_format: DataFormatInfo,\n new_value: TUnion[int, float, bool, bytes, str] = None,\n **kwargs) -> 'PrimitiveObject':\n \"\"\"Creates the appropriate class and returns it so that the native type\n is inherited.\n\n The only reason the kwargs is added, is so that the inherriting types can override __init__\n without needing to override __new__\n\n We also sneak in new_value, so that we don't have to do expensive (read: impossible) context reads\n when unpickling.\n \"\"\"\n if new_value is None:\n value = cls._unmarshall(context, data_format, object_info)\n else:\n value = new_value\n result = cls._struct_type.__new__(cls, value)\n # This prevents us having to go read a context layer when recreating after unpickling\n # Mypy complains that result doesn't have a __new_value, but using setattr causes pycharm to complain further down\n result.__new_value = value # type: ignore\n return result","function_tokens":["def","__new__","(","cls",":","Type",",","context",":","interfaces",".","context",".","ContextInterface",",","type_name",":","str",",","object_info",":","interfaces",".","objects",".","ObjectInformation",",","data_format",":","DataFormatInfo",",","new_value",":","TUnion","[","int",",","float",",","bool",",","bytes",",","str","]","=","None",",","*","*","kwargs",")","->","'PrimitiveObject'",":","if","new_value","is","None",":","value","=","cls",".","_unmarshall","(","context",",","data_format",",","object_info",")","else",":","value","=","new_value","result","=","cls",".","_struct_type",".","__new__","(","cls",",","value",")","# This prevents us having to go read a context layer when recreating after unpickling","# Mypy complains that result doesn't have a __new_value, but using setattr causes pycharm to complain further down","result",".","__new_value","=","value","# type: ignore","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L102-L126"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"PrimitiveObject.__getnewargs_ex__","parameters":"(self)","argument_list":"","return_statement":"return (self._context, self._vol.maps[-2]['type_name'], self._vol.maps[-3], self._data_format), kwargs","docstring":"Make sure that when pickling, all appropiate parameters for new are\n provided.","docstring_summary":"Make sure that when pickling, all appropiate parameters for new are\n provided.","docstring_tokens":["Make","sure","that","when","pickling","all","appropiate","parameters","for","new","are","provided","."],"function":"def __getnewargs_ex__(self):\n \"\"\"Make sure that when pickling, all appropiate parameters for new are\n provided.\"\"\"\n kwargs = {}\n for k, v in self._vol.maps[-1].items():\n if k not in [\"context\", \"data_format\", \"object_info\", \"type_name\"]:\n kwargs[k] = v\n kwargs['new_value'] = self.__new_value\n return (self._context, self._vol.maps[-2]['type_name'], self._vol.maps[-3], self._data_format), kwargs","function_tokens":["def","__getnewargs_ex__","(","self",")",":","kwargs","=","{","}","for","k",",","v","in","self",".","_vol",".","maps","[","-","1","]",".","items","(",")",":","if","k","not","in","[","\"context\"",",","\"data_format\"",",","\"object_info\"",",","\"type_name\"","]",":","kwargs","[","k","]","=","v","kwargs","[","'new_value'","]","=","self",".","__new_value","return","(","self",".","_context",",","self",".","_vol",".","maps","[","-","2","]","[","'type_name'","]",",","self",".","_vol",".","maps","[","-","3","]",",","self",".","_data_format",")",",","kwargs"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L128-L136"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"PrimitiveObject.write","parameters":"(self, value: TUnion[int, float, bool, bytes, str])","argument_list":"","return_statement":"return self._context.layers.write(self.vol.layer_name, self.vol.offset, data)","docstring":"Writes the object into the layer of the context at the current\n offset.","docstring_summary":"Writes the object into the layer of the context at the current\n offset.","docstring_tokens":["Writes","the","object","into","the","layer","of","the","context","at","the","current","offset","."],"function":"def write(self, value: TUnion[int, float, bool, bytes, str]) -> None:\n \"\"\"Writes the object into the layer of the context at the current\n offset.\"\"\"\n data = convert_value_to_data(value, self._struct_type, self._data_format)\n return self._context.layers.write(self.vol.layer_name, self.vol.offset, data)","function_tokens":["def","write","(","self",",","value",":","TUnion","[","int",",","float",",","bool",",","bytes",",","str","]",")","->","None",":","data","=","convert_value_to_data","(","value",",","self",".","_struct_type",",","self",".","_data_format",")","return","self",".","_context",".","layers",".","write","(","self",".","vol",".","layer_name",",","self",".","vol",".","offset",",","data",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L151-L155"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Bytes.__new__","parameters":"(cls: Type,\n context: interfaces.context.ContextInterface,\n type_name: str,\n object_info: interfaces.objects.ObjectInformation,\n length: int = 1,\n **kwargs)","argument_list":"","return_statement":"return cls._struct_type.__new__(\n cls, cls._unmarshall(context, data_format = DataFormatInfo(length, \"big\", False),\n object_info = object_info))","docstring":"Creates the appropriate class and returns it so that the native type\n is inherritted.\n\n The only reason the kwargs is added, is so that the\n inherriting types can override __init__ without needing to\n override __new__","docstring_summary":"Creates the appropriate class and returns it so that the native type\n is inherritted.","docstring_tokens":["Creates","the","appropriate","class","and","returns","it","so","that","the","native","type","is","inherritted","."],"function":"def __new__(cls: Type,\n context: interfaces.context.ContextInterface,\n type_name: str,\n object_info: interfaces.objects.ObjectInformation,\n length: int = 1,\n **kwargs) -> 'Bytes':\n \"\"\"Creates the appropriate class and returns it so that the native type\n is inherritted.\n\n The only reason the kwargs is added, is so that the\n inherriting types can override __init__ without needing to\n override __new__\n \"\"\"\n return cls._struct_type.__new__(\n cls, cls._unmarshall(context, data_format = DataFormatInfo(length, \"big\", False),\n object_info = object_info))","function_tokens":["def","__new__","(","cls",":","Type",",","context",":","interfaces",".","context",".","ContextInterface",",","type_name",":","str",",","object_info",":","interfaces",".","objects",".","ObjectInformation",",","length",":","int","=","1",",","*","*","kwargs",")","->","'Bytes'",":","return","cls",".","_struct_type",".","__new__","(","cls",",","cls",".","_unmarshall","(","context",",","data_format","=","DataFormatInfo","(","length",",","\"big\"",",","False",")",",","object_info","=","object_info",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L195-L210"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"String.__new__","parameters":"(cls: Type,\n context: interfaces.context.ContextInterface,\n type_name: str,\n object_info: interfaces.objects.ObjectInformation,\n max_length: int = 1,\n encoding: str = \"utf-8\",\n errors: str = \"strict\",\n **kwargs)","argument_list":"","return_statement":"return value","docstring":"Creates the appropriate class and returns it so that the native type\n is inherited.\n\n The only reason the kwargs is added, is so that the\n inherriting types can override __init__ without needing to\n override __new__","docstring_summary":"Creates the appropriate class and returns it so that the native type\n is inherited.","docstring_tokens":["Creates","the","appropriate","class","and","returns","it","so","that","the","native","type","is","inherited","."],"function":"def __new__(cls: Type,\n context: interfaces.context.ContextInterface,\n type_name: str,\n object_info: interfaces.objects.ObjectInformation,\n max_length: int = 1,\n encoding: str = \"utf-8\",\n errors: str = \"strict\",\n **kwargs) -> 'String':\n \"\"\"Creates the appropriate class and returns it so that the native type\n is inherited.\n\n The only reason the kwargs is added, is so that the\n inherriting types can override __init__ without needing to\n override __new__\n \"\"\"\n params = {}\n if encoding:\n params['encoding'] = encoding\n if errors:\n params['errors'] = errors\n # Pass the encoding and error parameters to the string constructor to appropriately encode the string\n value = cls._struct_type.__new__(\n cls,\n cls._unmarshall(context, data_format = DataFormatInfo(max_length, \"big\", False), object_info = object_info),\n **params)\n if value.find('\\x00') >= 0:\n value = value[:value.find('\\x00')]\n return value","function_tokens":["def","__new__","(","cls",":","Type",",","context",":","interfaces",".","context",".","ContextInterface",",","type_name",":","str",",","object_info",":","interfaces",".","objects",".","ObjectInformation",",","max_length",":","int","=","1",",","encoding",":","str","=","\"utf-8\"",",","errors",":","str","=","\"strict\"",",","*","*","kwargs",")","->","'String'",":","params","=","{","}","if","encoding",":","params","[","'encoding'","]","=","encoding","if","errors",":","params","[","'errors'","]","=","errors","# Pass the encoding and error parameters to the string constructor to appropriately encode the string","value","=","cls",".","_struct_type",".","__new__","(","cls",",","cls",".","_unmarshall","(","context",",","data_format","=","DataFormatInfo","(","max_length",",","\"big\"",",","False",")",",","object_info","=","object_info",")",",","*","*","params",")","if","value",".","find","(","'\\x00'",")",">=","0",":","value","=","value","[",":","value",".","find","(","'\\x00'",")","]","return","value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L243-L270"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Pointer._unmarshall","parameters":"(cls, context: interfaces.context.ContextInterface, data_format: DataFormatInfo,\n object_info: interfaces.objects.ObjectInformation)","argument_list":"","return_statement":"return value & mask","docstring":"Ensure that pointer values always fall within the domain of the\n layer they're constructed on.\n\n If there's a need for all the data within the address, the\n pointer should be recast. The \"pointer\" must always live within\n the space (even if the data provided is invalid).","docstring_summary":"Ensure that pointer values always fall within the domain of the\n layer they're constructed on.","docstring_tokens":["Ensure","that","pointer","values","always","fall","within","the","domain","of","the","layer","they","re","constructed","on","."],"function":"def _unmarshall(cls, context: interfaces.context.ContextInterface, data_format: DataFormatInfo,\n object_info: interfaces.objects.ObjectInformation) -> Any:\n \"\"\"Ensure that pointer values always fall within the domain of the\n layer they're constructed on.\n\n If there's a need for all the data within the address, the\n pointer should be recast. The \"pointer\" must always live within\n the space (even if the data provided is invalid).\n \"\"\"\n length, endian, signed = data_format\n if signed:\n raise ValueError(\"Pointers cannot have signed values\")\n mask = context.layers[object_info.native_layer_name].address_mask\n data = context.layers.read(object_info.layer_name, object_info.offset, length)\n value = int.from_bytes(data, byteorder = endian, signed = signed)\n return value & mask","function_tokens":["def","_unmarshall","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","data_format",":","DataFormatInfo",",","object_info",":","interfaces",".","objects",".","ObjectInformation",")","->","Any",":","length",",","endian",",","signed","=","data_format","if","signed",":","raise","ValueError","(","\"Pointers cannot have signed values\"",")","mask","=","context",".","layers","[","object_info",".","native_layer_name","]",".","address_mask","data","=","context",".","layers",".","read","(","object_info",".","layer_name",",","object_info",".","offset",",","length",")","value","=","int",".","from_bytes","(","data",",","byteorder","=","endian",",","signed","=","signed",")","return","value","&","mask"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L293-L308"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Pointer.dereference","parameters":"(self, layer_name: Optional[str] = None)","argument_list":"","return_statement":"return self.vol.subtype(context = self._context,\n object_info = interfaces.objects.ObjectInformation(layer_name = layer_name,\n offset = offset,\n parent = self,\n size = self.vol.subtype.size))","docstring":"Dereferences the pointer.\n\n Layer_name is identifies the appropriate layer within the\n context that the pointer points to. If layer_name is None, it\n defaults to the same layer that the pointer is currently\n instantiated in.","docstring_summary":"Dereferences the pointer.","docstring_tokens":["Dereferences","the","pointer","."],"function":"def dereference(self, layer_name: Optional[str] = None) -> interfaces.objects.ObjectInterface:\n \"\"\"Dereferences the pointer.\n\n Layer_name is identifies the appropriate layer within the\n context that the pointer points to. If layer_name is None, it\n defaults to the same layer that the pointer is currently\n instantiated in.\n \"\"\"\n layer_name = layer_name or self.vol.native_layer_name\n mask = self._context.layers[layer_name].address_mask\n offset = self & mask\n return self.vol.subtype(context = self._context,\n object_info = interfaces.objects.ObjectInformation(layer_name = layer_name,\n offset = offset,\n parent = self,\n size = self.vol.subtype.size))","function_tokens":["def","dereference","(","self",",","layer_name",":","Optional","[","str","]","=","None",")","->","interfaces",".","objects",".","ObjectInterface",":","layer_name","=","layer_name","or","self",".","vol",".","native_layer_name","mask","=","self",".","_context",".","layers","[","layer_name","]",".","address_mask","offset","=","self","&","mask","return","self",".","vol",".","subtype","(","context","=","self",".","_context",",","object_info","=","interfaces",".","objects",".","ObjectInformation","(","layer_name","=","layer_name",",","offset","=","offset",",","parent","=","self",",","size","=","self",".","vol",".","subtype",".","size",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L310-L325"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Pointer.is_readable","parameters":"(self, layer_name: Optional[str] = None)","argument_list":"","return_statement":"return self._context.layers[layer_name].is_valid(self, self.vol.subtype.size)","docstring":"Determines whether the address of this pointer can be read from\n memory.","docstring_summary":"Determines whether the address of this pointer can be read from\n memory.","docstring_tokens":["Determines","whether","the","address","of","this","pointer","can","be","read","from","memory","."],"function":"def is_readable(self, layer_name: Optional[str] = None) -> bool:\n \"\"\"Determines whether the address of this pointer can be read from\n memory.\"\"\"\n layer_name = layer_name or self.vol.layer_name\n return self._context.layers[layer_name].is_valid(self, self.vol.subtype.size)","function_tokens":["def","is_readable","(","self",",","layer_name",":","Optional","[","str","]","=","None",")","->","bool",":","layer_name","=","layer_name","or","self",".","vol",".","layer_name","return","self",".","_context",".","layers","[","layer_name","]",".","is_valid","(","self",",","self",".","vol",".","subtype",".","size",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L327-L331"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Pointer.__getattr__","parameters":"(self, attr: str)","argument_list":"","return_statement":"return getattr(self.dereference(), attr)","docstring":"Convenience function to access unknown attributes by getting them\n from the subtype object.","docstring_summary":"Convenience function to access unknown attributes by getting them\n from the subtype object.","docstring_tokens":["Convenience","function","to","access","unknown","attributes","by","getting","them","from","the","subtype","object","."],"function":"def __getattr__(self, attr: str) -> Any:\n \"\"\"Convenience function to access unknown attributes by getting them\n from the subtype object.\"\"\"\n if attr in ['vol', '_vol']:\n raise AttributeError(\"Pointer not initialized before use\")\n return getattr(self.dereference(), attr)","function_tokens":["def","__getattr__","(","self",",","attr",":","str",")","->","Any",":","if","attr","in","[","'vol'",",","'_vol'","]",":","raise","AttributeError","(","\"Pointer not initialized before use\"",")","return","getattr","(","self",".","dereference","(",")",",","attr",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L333-L338"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Pointer.has_member","parameters":"(self, member_name: str)","argument_list":"","return_statement":"return self._vol['subtype'].has_member(member_name)","docstring":"Returns whether the dereferenced type has this member.","docstring_summary":"Returns whether the dereferenced type has this member.","docstring_tokens":["Returns","whether","the","dereferenced","type","has","this","member","."],"function":"def has_member(self, member_name: str) -> bool:\n \"\"\"Returns whether the dereferenced type has this member.\"\"\"\n return self._vol['subtype'].has_member(member_name)","function_tokens":["def","has_member","(","self",",","member_name",":","str",")","->","bool",":","return","self",".","_vol","[","'subtype'","]",".","has_member","(","member_name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L340-L342"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Enumeration.__eq__","parameters":"(self, other)","argument_list":"","return_statement":"return int(self) == other","docstring":"An enumeration must be equivalent to its value, even if the other value is not an enumeration","docstring_summary":"An enumeration must be equivalent to its value, even if the other value is not an enumeration","docstring_tokens":["An","enumeration","must","be","equivalent","to","its","value","even","if","the","other","value","is","not","an","enumeration"],"function":"def __eq__(self, other):\n \"\"\"An enumeration must be equivalent to its value, even if the other value is not an enumeration\"\"\"\n return int(self) == other","function_tokens":["def","__eq__","(","self",",","other",")",":","return","int","(","self",")","==","other"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L440-L442"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Enumeration.__hash__","parameters":"(self)","argument_list":"","return_statement":"return super().__hash__()","docstring":"Enumerations must be hashed as equivalent to their integer counterparts","docstring_summary":"Enumerations must be hashed as equivalent to their integer counterparts","docstring_tokens":["Enumerations","must","be","hashed","as","equivalent","to","their","integer","counterparts"],"function":"def __hash__(self):\n \"\"\"Enumerations must be hashed as equivalent to their integer counterparts\"\"\"\n return super().__hash__()","function_tokens":["def","__hash__","(","self",")",":","return","super","(",")",".","__hash__","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L444-L446"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Enumeration._generate_inverse_choices","parameters":"(cls, choices: Dict[str, int])","argument_list":"","return_statement":"return inverse_choices","docstring":"Generates the inverse choices for the object.","docstring_summary":"Generates the inverse choices for the object.","docstring_tokens":["Generates","the","inverse","choices","for","the","object","."],"function":"def _generate_inverse_choices(cls, choices: Dict[str, int]) -> Dict[int, str]:\n \"\"\"Generates the inverse choices for the object.\"\"\"\n inverse_choices = {} # type: Dict[int, str]\n for k, v in choices.items():\n if v in inverse_choices:\n # Technically this shouldn't be a problem, but since we inverse cache\n # and can't map one value to two possibilities we throw an exception during build\n # We can remove\/work around this if it proves a common issue\n raise ValueError(\"Enumeration value {} duplicated as {} and {}\".format(v, k, inverse_choices[v]))\n inverse_choices[v] = k\n return inverse_choices","function_tokens":["def","_generate_inverse_choices","(","cls",",","choices",":","Dict","[","str",",","int","]",")","->","Dict","[","int",",","str","]",":","inverse_choices","=","{","}","# type: Dict[int, str]","for","k",",","v","in","choices",".","items","(",")",":","if","v","in","inverse_choices",":","# Technically this shouldn't be a problem, but since we inverse cache","# and can't map one value to two possibilities we throw an exception during build","# We can remove\/work around this if it proves a common issue","raise","ValueError","(","\"Enumeration value {} duplicated as {} and {}\"",".","format","(","v",",","k",",","inverse_choices","[","v","]",")",")","inverse_choices","[","v","]","=","k","return","inverse_choices"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L449-L459"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Enumeration.lookup","parameters":"(self, value: int = None)","argument_list":"","return_statement":"","docstring":"Looks up an individual value and returns the associated name.","docstring_summary":"Looks up an individual value and returns the associated name.","docstring_tokens":["Looks","up","an","individual","value","and","returns","the","associated","name","."],"function":"def lookup(self, value: int = None) -> str:\n \"\"\"Looks up an individual value and returns the associated name.\"\"\"\n if value is None:\n return self.lookup(self)\n if value in self._inverse_choices:\n return self._inverse_choices[value]\n raise ValueError(\"The value of the enumeration is outside the possible choices\")","function_tokens":["def","lookup","(","self",",","value",":","int","=","None",")","->","str",":","if","value","is","None",":","return","self",".","lookup","(","self",")","if","value","in","self",".","_inverse_choices",":","return","self",".","_inverse_choices","[","value","]","raise","ValueError","(","\"The value of the enumeration is outside the possible choices\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L461-L467"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Enumeration.description","parameters":"(self)","argument_list":"","return_statement":"return self.lookup(self)","docstring":"Returns the chosen name for the value this object contains.","docstring_summary":"Returns the chosen name for the value this object contains.","docstring_tokens":["Returns","the","chosen","name","for","the","value","this","object","contains","."],"function":"def description(self) -> str:\n \"\"\"Returns the chosen name for the value this object contains.\"\"\"\n return self.lookup(self)","function_tokens":["def","description","(","self",")","->","str",":","return","self",".","lookup","(","self",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L470-L472"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Enumeration.is_valid_choice","parameters":"(self)","argument_list":"","return_statement":"return self in self.choices.values()","docstring":"Returns whether the value for the object is a valid choice","docstring_summary":"Returns whether the value for the object is a valid choice","docstring_tokens":["Returns","whether","the","value","for","the","object","is","a","valid","choice"],"function":"def is_valid_choice(self) -> bool:\n \"\"\"Returns whether the value for the object is a valid choice\"\"\"\n return self in self.choices.values()","function_tokens":["def","is_valid_choice","(","self",")","->","bool",":","return","self","in","self",".","choices",".","values","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L479-L481"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Enumeration.__getattr__","parameters":"(self, attr: str)","argument_list":"","return_statement":"","docstring":"Returns the value for a specific name.","docstring_summary":"Returns the value for a specific name.","docstring_tokens":["Returns","the","value","for","a","specific","name","."],"function":"def __getattr__(self, attr: str) -> str:\n \"\"\"Returns the value for a specific name.\"\"\"\n if attr in self._vol['choices']:\n return self._vol['choices'][attr]\n raise AttributeError(\"Unknown attribute {} for Enumeration {}\".format(attr, self._vol['type_name']))","function_tokens":["def","__getattr__","(","self",",","attr",":","str",")","->","str",":","if","attr","in","self",".","_vol","[","'choices'","]",":","return","self",".","_vol","[","'choices'","]","[","attr","]","raise","AttributeError","(","\"Unknown attribute {} for Enumeration {}\"",".","format","(","attr",",","self",".","_vol","[","'type_name'","]",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L483-L487"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Array.count","parameters":"(self)","argument_list":"","return_statement":"return self.vol.count","docstring":"Returns the count dynamically.","docstring_summary":"Returns the count dynamically.","docstring_tokens":["Returns","the","count","dynamically","."],"function":"def count(self) -> int:\n \"\"\"Returns the count dynamically.\"\"\"\n return self.vol.count","function_tokens":["def","count","(","self",")","->","int",":","return","self",".","vol",".","count"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L542-L544"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Array.count","parameters":"(self, value: int)","argument_list":"","return_statement":"","docstring":"Sets the count to a specific value.","docstring_summary":"Sets the count to a specific value.","docstring_tokens":["Sets","the","count","to","a","specific","value","."],"function":"def count(self, value: int) -> None:\n \"\"\"Sets the count to a specific value.\"\"\"\n self._vol['count'] = value\n self._vol['size'] = value * self._vol['subtype'].size","function_tokens":["def","count","(","self",",","value",":","int",")","->","None",":","self",".","_vol","[","'count'","]","=","value","self",".","_vol","[","'size'","]","=","value","*","self",".","_vol","[","'subtype'","]",".","size"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L547-L550"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Array.__getitem__","parameters":"(self, i)","argument_list":"","return_statement":"return result","docstring":"Returns the i-th item from the array.","docstring_summary":"Returns the i-th item from the array.","docstring_tokens":["Returns","the","i","-","th","item","from","the","array","."],"function":"def __getitem__(self, i):\n \"\"\"Returns the i-th item from the array.\"\"\"\n result = [] # type: List[interfaces.objects.Template]\n mask = self._context.layers[self.vol.layer_name].address_mask\n # We use the range function to deal with slices for us\n series = range(self.vol.count)[i]\n return_list = True\n if isinstance(series, int):\n return_list = False\n series = [series]\n for index in series:\n object_info = interfaces.objects.ObjectInformation(\n layer_name = self.vol.layer_name,\n offset = mask & (self.vol.offset + (self.vol.subtype.size * index)),\n parent = self,\n native_layer_name = self.vol.native_layer_name,\n size = self.vol.subtype.size)\n result += [self.vol.subtype(context = self._context, object_info = object_info)]\n if not return_list:\n return result[0]\n return result","function_tokens":["def","__getitem__","(","self",",","i",")",":","result","=","[","]","# type: List[interfaces.objects.Template]","mask","=","self",".","_context",".","layers","[","self",".","vol",".","layer_name","]",".","address_mask","# We use the range function to deal with slices for us","series","=","range","(","self",".","vol",".","count",")","[","i","]","return_list","=","True","if","isinstance","(","series",",","int",")",":","return_list","=","False","series","=","[","series","]","for","index","in","series",":","object_info","=","interfaces",".","objects",".","ObjectInformation","(","layer_name","=","self",".","vol",".","layer_name",",","offset","=","mask","&","(","self",".","vol",".","offset","+","(","self",".","vol",".","subtype",".","size","*","index",")",")",",","parent","=","self",",","native_layer_name","=","self",".","vol",".","native_layer_name",",","size","=","self",".","vol",".","subtype",".","size",")","result","+=","[","self",".","vol",".","subtype","(","context","=","self",".","_context",",","object_info","=","object_info",")","]","if","not","return_list",":","return","result","[","0","]","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L593-L613"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"Array.__len__","parameters":"(self)","argument_list":"","return_statement":"return self.vol.count","docstring":"Returns the length of the array.","docstring_summary":"Returns the length of the array.","docstring_tokens":["Returns","the","length","of","the","array","."],"function":"def __len__(self) -> int:\n \"\"\"Returns the length of the array.\"\"\"\n return self.vol.count","function_tokens":["def","__len__","(","self",")","->","int",":","return","self",".","vol",".","count"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L615-L617"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"AggregateType.has_member","parameters":"(self, member_name: str)","argument_list":"","return_statement":"return member_name in self.vol.members","docstring":"Returns whether the object would contain a member called\n member_name.","docstring_summary":"Returns whether the object would contain a member called\n member_name.","docstring_tokens":["Returns","whether","the","object","would","contain","a","member","called","member_name","."],"function":"def has_member(self, member_name: str) -> bool:\n \"\"\"Returns whether the object would contain a member called\n member_name.\"\"\"\n return member_name in self.vol.members","function_tokens":["def","has_member","(","self",",","member_name",":","str",")","->","bool",":","return","member_name","in","self",".","vol",".","members"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L641-L644"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"AggregateType.member","parameters":"(self, attr: str = 'member')","argument_list":"","return_statement":"return self.__getattr__(attr)","docstring":"Specifically named method for retrieving members.","docstring_summary":"Specifically named method for retrieving members.","docstring_tokens":["Specifically","named","method","for","retrieving","members","."],"function":"def member(self, attr: str = 'member') -> object:\n \"\"\"Specifically named method for retrieving members.\"\"\"\n return self.__getattr__(attr)","function_tokens":["def","member","(","self",",","attr",":","str","=","'member'",")","->","object",":","return","self",".","__getattr__","(","attr",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L707-L709"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"AggregateType.__getattr__","parameters":"(self, attr: str)","argument_list":"","return_statement":"","docstring":"Method for accessing members of the type.","docstring_summary":"Method for accessing members of the type.","docstring_tokens":["Method","for","accessing","members","of","the","type","."],"function":"def __getattr__(self, attr: str) -> Any:\n \"\"\"Method for accessing members of the type.\"\"\"\n if attr in ['_concrete_members', 'vol']:\n raise AttributeError(\"Object has not been properly initialized\")\n if attr in self._concrete_members:\n return self._concrete_members[attr]\n elif attr in self.vol.members:\n mask = self._context.layers[self.vol.layer_name].address_mask\n relative_offset, template = self.vol.members[attr]\n if isinstance(template, templates.ReferenceTemplate):\n template = self._context.symbol_space.get_type(template.vol.type_name)\n object_info = interfaces.objects.ObjectInformation(layer_name = self.vol.layer_name,\n offset = mask & (self.vol.offset + relative_offset),\n member_name = attr,\n parent = self,\n native_layer_name = self.vol.native_layer_name,\n size = template.size)\n member = template(context = self._context, object_info = object_info)\n self._concrete_members[attr] = member\n return member\n # We duplicate this code to avoid polluting the methodspace\n agg_name = 'AggregateType'\n for agg_type in AggregateTypes:\n if isinstance(self, agg_type):\n agg_name = agg_type.__name__\n raise AttributeError(\"{} has no attribute: {}.{}\".format(agg_name, self.vol.type_name, attr))","function_tokens":["def","__getattr__","(","self",",","attr",":","str",")","->","Any",":","if","attr","in","[","'_concrete_members'",",","'vol'","]",":","raise","AttributeError","(","\"Object has not been properly initialized\"",")","if","attr","in","self",".","_concrete_members",":","return","self",".","_concrete_members","[","attr","]","elif","attr","in","self",".","vol",".","members",":","mask","=","self",".","_context",".","layers","[","self",".","vol",".","layer_name","]",".","address_mask","relative_offset",",","template","=","self",".","vol",".","members","[","attr","]","if","isinstance","(","template",",","templates",".","ReferenceTemplate",")",":","template","=","self",".","_context",".","symbol_space",".","get_type","(","template",".","vol",".","type_name",")","object_info","=","interfaces",".","objects",".","ObjectInformation","(","layer_name","=","self",".","vol",".","layer_name",",","offset","=","mask","&","(","self",".","vol",".","offset","+","relative_offset",")",",","member_name","=","attr",",","parent","=","self",",","native_layer_name","=","self",".","vol",".","native_layer_name",",","size","=","template",".","size",")","member","=","template","(","context","=","self",".","_context",",","object_info","=","object_info",")","self",".","_concrete_members","[","attr","]","=","member","return","member","# We duplicate this code to avoid polluting the methodspace","agg_name","=","'AggregateType'","for","agg_type","in","AggregateTypes",":","if","isinstance","(","self",",","agg_type",")",":","agg_name","=","agg_type",".","__name__","raise","AttributeError","(","\"{} has no attribute: {}.{}\"",".","format","(","agg_name",",","self",".","vol",".","type_name",",","attr",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L711-L736"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py","language":"python","identifier":"AggregateType.__dir__","parameters":"(self)","argument_list":"","return_statement":"return list(super().__dir__()) + list(self.vol.members)","docstring":"Returns a complete list of members when dir is called.","docstring_summary":"Returns a complete list of members when dir is called.","docstring_tokens":["Returns","a","complete","list","of","members","when","dir","is","called","."],"function":"def __dir__(self) -> Iterable[str]:\n \"\"\"Returns a complete list of members when dir is called.\"\"\"\n return list(super().__dir__()) + list(self.vol.members)","function_tokens":["def","__dir__","(","self",")","->","Iterable","[","str","]",":","return","list","(","super","(",")",".","__dir__","(",")",")","+","list","(","self",".","vol",".","members",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/__init__.py#L738-L740"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/utility.py","language":"python","identifier":"array_to_string","parameters":"(array: 'objects.Array',\n count: Optional[int] = None,\n errors: str = 'replace')","argument_list":"","return_statement":"return array.cast(\"string\", max_length = count, errors = errors)","docstring":"Takes a volatility Array of characters and returns a string.","docstring_summary":"Takes a volatility Array of characters and returns a string.","docstring_tokens":["Takes","a","volatility","Array","of","characters","and","returns","a","string","."],"function":"def array_to_string(array: 'objects.Array',\n count: Optional[int] = None,\n errors: str = 'replace') -> interfaces.objects.ObjectInterface:\n \"\"\"Takes a volatility Array of characters and returns a string.\"\"\"\n # TODO: Consider checking the Array's target is a native char\n if count is None:\n count = array.vol.count\n if not isinstance(array, objects.Array):\n raise TypeError(\"Array_to_string takes an Array of char\")\n\n return array.cast(\"string\", max_length = count, errors = errors)","function_tokens":["def","array_to_string","(","array",":","'objects.Array'",",","count",":","Optional","[","int","]","=","None",",","errors",":","str","=","'replace'",")","->","interfaces",".","objects",".","ObjectInterface",":","# TODO: Consider checking the Array's target is a native char","if","count","is","None",":","count","=","array",".","vol",".","count","if","not","isinstance","(","array",",","objects",".","Array",")",":","raise","TypeError","(","\"Array_to_string takes an Array of char\"",")","return","array",".","cast","(","\"string\"",",","max_length","=","count",",","errors","=","errors",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/utility.py#L10-L20"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/utility.py","language":"python","identifier":"pointer_to_string","parameters":"(pointer: 'objects.Pointer', count: int, errors: str = 'replace')","argument_list":"","return_statement":"return char.cast(\"string\", max_length = count, errors = errors)","docstring":"Takes a volatility Pointer to characters and returns a string.","docstring_summary":"Takes a volatility Pointer to characters and returns a string.","docstring_tokens":["Takes","a","volatility","Pointer","to","characters","and","returns","a","string","."],"function":"def pointer_to_string(pointer: 'objects.Pointer', count: int, errors: str = 'replace'):\n \"\"\"Takes a volatility Pointer to characters and returns a string.\"\"\"\n if not isinstance(pointer, objects.Pointer):\n raise TypeError(\"pointer_to_string takes a Pointer\")\n if count < 1:\n raise ValueError(\"pointer_to_string requires a positive count\")\n char = pointer.dereference()\n return char.cast(\"string\", max_length = count, errors = errors)","function_tokens":["def","pointer_to_string","(","pointer",":","'objects.Pointer'",",","count",":","int",",","errors",":","str","=","'replace'",")",":","if","not","isinstance","(","pointer",",","objects",".","Pointer",")",":","raise","TypeError","(","\"pointer_to_string takes a Pointer\"",")","if","count","<","1",":","raise","ValueError","(","\"pointer_to_string requires a positive count\"",")","char","=","pointer",".","dereference","(",")","return","char",".","cast","(","\"string\"",",","max_length","=","count",",","errors","=","errors",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/utility.py#L23-L30"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/utility.py","language":"python","identifier":"array_of_pointers","parameters":"(array: interfaces.objects.ObjectInterface, count: int,\n subtype: Union[str, interfaces.objects.Template],\n context: interfaces.context.ContextInterface)","argument_list":"","return_statement":"return array.cast(\"array\", count = count, subtype = subtype_pointer)","docstring":"Takes an object, and recasts it as an array of pointers to subtype.","docstring_summary":"Takes an object, and recasts it as an array of pointers to subtype.","docstring_tokens":["Takes","an","object","and","recasts","it","as","an","array","of","pointers","to","subtype","."],"function":"def array_of_pointers(array: interfaces.objects.ObjectInterface, count: int,\n subtype: Union[str, interfaces.objects.Template],\n context: interfaces.context.ContextInterface) -> interfaces.objects.ObjectInterface:\n \"\"\"Takes an object, and recasts it as an array of pointers to subtype.\"\"\"\n symbol_table = array.vol.type_name.split(constants.BANG)[0]\n if isinstance(subtype, str) and context is not None:\n subtype = context.symbol_space.get_type(subtype)\n if not isinstance(subtype, interfaces.objects.Template) or subtype is None:\n raise TypeError(\"Subtype must be a valid template (or string name of an object template)\")\n subtype_pointer = context.symbol_space.get_type(symbol_table + constants.BANG + \"pointer\")\n subtype_pointer.update_vol(subtype = subtype)\n return array.cast(\"array\", count = count, subtype = subtype_pointer)","function_tokens":["def","array_of_pointers","(","array",":","interfaces",".","objects",".","ObjectInterface",",","count",":","int",",","subtype",":","Union","[","str",",","interfaces",".","objects",".","Template","]",",","context",":","interfaces",".","context",".","ContextInterface",")","->","interfaces",".","objects",".","ObjectInterface",":","symbol_table","=","array",".","vol",".","type_name",".","split","(","constants",".","BANG",")","[","0","]","if","isinstance","(","subtype",",","str",")","and","context","is","not","None",":","subtype","=","context",".","symbol_space",".","get_type","(","subtype",")","if","not","isinstance","(","subtype",",","interfaces",".","objects",".","Template",")","or","subtype","is","None",":","raise","TypeError","(","\"Subtype must be a valid template (or string name of an object template)\"",")","subtype_pointer","=","context",".","symbol_space",".","get_type","(","symbol_table","+","constants",".","BANG","+","\"pointer\"",")","subtype_pointer",".","update_vol","(","subtype","=","subtype",")","return","array",".","cast","(","\"array\"",",","count","=","count",",","subtype","=","subtype_pointer",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/utility.py#L33-L44"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py","language":"python","identifier":"ObjectTemplate.size","parameters":"(self)","argument_list":"","return_statement":"return self.vol.object_class.VolTemplateProxy.size(self)","docstring":"Returns the children of the templated object (see :class:`~volatilit\n y.framework.interfaces.objects.ObjectInterface.VolTemplateProxy`)","docstring_summary":"Returns the children of the templated object (see :class:`~volatilit\n y.framework.interfaces.objects.ObjectInterface.VolTemplateProxy`)","docstring_tokens":["Returns","the","children","of","the","templated","object","(","see",":","class",":","~volatilit","y",".","framework",".","interfaces",".","objects",".","ObjectInterface",".","VolTemplateProxy",")"],"function":"def size(self) -> int:\n \"\"\"Returns the children of the templated object (see :class:`~volatilit\n y.framework.interfaces.objects.ObjectInterface.VolTemplateProxy`)\"\"\"\n return self.vol.object_class.VolTemplateProxy.size(self)","function_tokens":["def","size","(","self",")","->","int",":","return","self",".","vol",".","object_class",".","VolTemplateProxy",".","size","(","self",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py#L34-L37"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py","language":"python","identifier":"ObjectTemplate.children","parameters":"(self)","argument_list":"","return_statement":"return self.vol.object_class.VolTemplateProxy.children(self)","docstring":"Returns the children of the templated object (see :class:`~volatilit\n y.framework.interfaces.objects.ObjectInterface.VolTemplateProxy`)","docstring_summary":"Returns the children of the templated object (see :class:`~volatilit\n y.framework.interfaces.objects.ObjectInterface.VolTemplateProxy`)","docstring_tokens":["Returns","the","children","of","the","templated","object","(","see",":","class",":","~volatilit","y",".","framework",".","interfaces",".","objects",".","ObjectInterface",".","VolTemplateProxy",")"],"function":"def children(self) -> List[interfaces.objects.Template]:\n \"\"\"Returns the children of the templated object (see :class:`~volatilit\n y.framework.interfaces.objects.ObjectInterface.VolTemplateProxy`)\"\"\"\n return self.vol.object_class.VolTemplateProxy.children(self)","function_tokens":["def","children","(","self",")","->","List","[","interfaces",".","objects",".","Template","]",":","return","self",".","vol",".","object_class",".","VolTemplateProxy",".","children","(","self",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py#L40-L43"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py","language":"python","identifier":"ObjectTemplate.relative_child_offset","parameters":"(self, child: str)","argument_list":"","return_statement":"return self.vol.object_class.VolTemplateProxy.relative_child_offset(self, child)","docstring":"Returns the relative offset of a child of the templated object (see\n :class:`~volatility.framework.interfaces.objects.ObjectInterface.VolTem\n plateProxy`)","docstring_summary":"Returns the relative offset of a child of the templated object (see\n :class:`~volatility.framework.interfaces.objects.ObjectInterface.VolTem\n plateProxy`)","docstring_tokens":["Returns","the","relative","offset","of","a","child","of","the","templated","object","(","see",":","class",":","~volatility",".","framework",".","interfaces",".","objects",".","ObjectInterface",".","VolTem","plateProxy",")"],"function":"def relative_child_offset(self, child: str) -> int:\n \"\"\"Returns the relative offset of a child of the templated object (see\n :class:`~volatility.framework.interfaces.objects.ObjectInterface.VolTem\n plateProxy`)\"\"\"\n return self.vol.object_class.VolTemplateProxy.relative_child_offset(self, child)","function_tokens":["def","relative_child_offset","(","self",",","child",":","str",")","->","int",":","return","self",".","vol",".","object_class",".","VolTemplateProxy",".","relative_child_offset","(","self",",","child",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py#L45-L49"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py","language":"python","identifier":"ObjectTemplate.replace_child","parameters":"(self, old_child: interfaces.objects.Template, new_child: interfaces.objects.Template)","argument_list":"","return_statement":"return self.vol.object_class.VolTemplateProxy.replace_child(self, old_child, new_child)","docstring":"Replaces `old_child` for `new_child` in the templated object's child\n list (see :class:`~volatility.framework.interfaces.objects.ObjectInterf\n ace.VolTemplateProxy`)","docstring_summary":"Replaces `old_child` for `new_child` in the templated object's child\n list (see :class:`~volatility.framework.interfaces.objects.ObjectInterf\n ace.VolTemplateProxy`)","docstring_tokens":["Replaces","old_child","for","new_child","in","the","templated","object","s","child","list","(","see",":","class",":","~volatility",".","framework",".","interfaces",".","objects",".","ObjectInterf","ace",".","VolTemplateProxy",")"],"function":"def replace_child(self, old_child: interfaces.objects.Template, new_child: interfaces.objects.Template) -> None:\n \"\"\"Replaces `old_child` for `new_child` in the templated object's child\n list (see :class:`~volatility.framework.interfaces.objects.ObjectInterf\n ace.VolTemplateProxy`)\"\"\"\n return self.vol.object_class.VolTemplateProxy.replace_child(self, old_child, new_child)","function_tokens":["def","replace_child","(","self",",","old_child",":","interfaces",".","objects",".","Template",",","new_child",":","interfaces",".","objects",".","Template",")","->","None",":","return","self",".","vol",".","object_class",".","VolTemplateProxy",".","replace_child","(","self",",","old_child",",","new_child",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py#L51-L55"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py","language":"python","identifier":"ObjectTemplate.has_member","parameters":"(self, member_name: str)","argument_list":"","return_statement":"return self.vol.object_class.VolTemplateProxy.has_member(self, member_name)","docstring":"Returns whether the object would contain a member called\n member_name.","docstring_summary":"Returns whether the object would contain a member called\n member_name.","docstring_tokens":["Returns","whether","the","object","would","contain","a","member","called","member_name","."],"function":"def has_member(self, member_name: str) -> bool:\n \"\"\"Returns whether the object would contain a member called\n member_name.\"\"\"\n return self.vol.object_class.VolTemplateProxy.has_member(self, member_name)","function_tokens":["def","has_member","(","self",",","member_name",":","str",")","->","bool",":","return","self",".","vol",".","object_class",".","VolTemplateProxy",".","has_member","(","self",",","member_name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py#L57-L60"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py","language":"python","identifier":"ObjectTemplate.__call__","parameters":"(self, context: interfaces.context.ContextInterface,\n object_info: interfaces.objects.ObjectInformation)","argument_list":"","return_statement":"return self.vol.object_class(context = context, object_info = object_info, **arguments)","docstring":"Constructs the object.\n\n Returns: an object adhereing to the :class:`~volatility.framework.interfaces.objects.ObjectInterface`","docstring_summary":"Constructs the object.","docstring_tokens":["Constructs","the","object","."],"function":"def __call__(self, context: interfaces.context.ContextInterface,\n object_info: interfaces.objects.ObjectInformation) -> interfaces.objects.ObjectInterface:\n \"\"\"Constructs the object.\n\n Returns: an object adhereing to the :class:`~volatility.framework.interfaces.objects.ObjectInterface`\n \"\"\"\n arguments = {} # type: Dict[str, Any]\n for arg in self.vol:\n if arg != 'object_class':\n arguments[arg] = self.vol[arg]\n return self.vol.object_class(context = context, object_info = object_info, **arguments)","function_tokens":["def","__call__","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","object_info",":","interfaces",".","objects",".","ObjectInformation",")","->","interfaces",".","objects",".","ObjectInterface",":","arguments","=","{","}","# type: Dict[str, Any]","for","arg","in","self",".","vol",":","if","arg","!=","'object_class'",":","arguments","[","arg","]","=","self",".","vol","[","arg","]","return","self",".","vol",".","object_class","(","context","=","context",",","object_info","=","object_info",",","*","*","arguments",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py#L62-L72"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py","language":"python","identifier":"ReferenceTemplate._unresolved","parameters":"(self, *args, **kwargs)","argument_list":"","return_statement":"","docstring":"Referenced symbols must be appropriately resolved before they can\n provide information such as size This is because the size request has\n no context within which to determine the actual symbol structure.","docstring_summary":"Referenced symbols must be appropriately resolved before they can\n provide information such as size This is because the size request has\n no context within which to determine the actual symbol structure.","docstring_tokens":["Referenced","symbols","must","be","appropriately","resolved","before","they","can","provide","information","such","as","size","This","is","because","the","size","request","has","no","context","within","which","to","determine","the","actual","symbol","structure","."],"function":"def _unresolved(self, *args, **kwargs) -> Any:\n \"\"\"Referenced symbols must be appropriately resolved before they can\n provide information such as size This is because the size request has\n no context within which to determine the actual symbol structure.\"\"\"\n type_name = self.vol.type_name.split(constants.BANG)\n table_name = None\n if len(type_name) == 2:\n table_name = type_name[0]\n symbol_name = type_name[-1]\n raise exceptions.SymbolError(\n symbol_name, table_name,\n \"Template contains no information about its structure: {}\".format(self.vol.type_name))","function_tokens":["def","_unresolved","(","self",",","*","args",",","*","*","kwargs",")","->","Any",":","type_name","=","self",".","vol",".","type_name",".","split","(","constants",".","BANG",")","table_name","=","None","if","len","(","type_name",")","==","2",":","table_name","=","type_name","[","0","]","symbol_name","=","type_name","[","-","1","]","raise","exceptions",".","SymbolError","(","symbol_name",",","table_name",",","\"Template contains no information about its structure: {}\"",".","format","(","self",".","vol",".","type_name",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/objects\/templates.py#L86-L97"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/__init__.py","language":"python","identifier":"available","parameters":"(context: interfaces.context.ContextInterface)","argument_list":"","return_statement":"return sorted([\n clazz(context, interfaces.configuration.path_join(config_path, clazz.__name__))\n for clazz in class_subclasses(interfaces.automagic.AutomagicInterface)\n ],\n key = lambda x: x.priority)","docstring":"Returns an ordered list of all subclasses of\n :class:`~volatility.framework.interfaces.automagic.AutomagicInterface`.\n\n The order is based on the priority attributes of the subclasses, in order to ensure the automagics are listed in\n an appropriate order.\n\n Args:\n context: The context that will contain any automagic configuration values.","docstring_summary":"Returns an ordered list of all subclasses of\n :class:`~volatility.framework.interfaces.automagic.AutomagicInterface`.","docstring_tokens":["Returns","an","ordered","list","of","all","subclasses","of",":","class",":","~volatility",".","framework",".","interfaces",".","automagic",".","AutomagicInterface","."],"function":"def available(context: interfaces.context.ContextInterface) -> List[interfaces.automagic.AutomagicInterface]:\n \"\"\"Returns an ordered list of all subclasses of\n :class:`~volatility.framework.interfaces.automagic.AutomagicInterface`.\n\n The order is based on the priority attributes of the subclasses, in order to ensure the automagics are listed in\n an appropriate order.\n\n Args:\n context: The context that will contain any automagic configuration values.\n \"\"\"\n import_files(sys.modules[__name__])\n config_path = constants.AUTOMAGIC_CONFIG_PATH\n return sorted([\n clazz(context, interfaces.configuration.path_join(config_path, clazz.__name__))\n for clazz in class_subclasses(interfaces.automagic.AutomagicInterface)\n ],\n key = lambda x: x.priority)","function_tokens":["def","available","(","context",":","interfaces",".","context",".","ContextInterface",")","->","List","[","interfaces",".","automagic",".","AutomagicInterface","]",":","import_files","(","sys",".","modules","[","__name__","]",")","config_path","=","constants",".","AUTOMAGIC_CONFIG_PATH","return","sorted","(","[","clazz","(","context",",","interfaces",".","configuration",".","path_join","(","config_path",",","clazz",".","__name__",")",")","for","clazz","in","class_subclasses","(","interfaces",".","automagic",".","AutomagicInterface",")","]",",","key","=","lambda","x",":","x",".","priority",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/__init__.py#L31-L47"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/__init__.py","language":"python","identifier":"choose_automagic","parameters":"(\n automagics: List[interfaces.automagic.AutomagicInterface],\n plugin: Type[interfaces.plugins.PluginInterface])","argument_list":"","return_statement":"return output","docstring":"Chooses which automagics to run, maintaining the order they were handed\n in.","docstring_summary":"Chooses which automagics to run, maintaining the order they were handed\n in.","docstring_tokens":["Chooses","which","automagics","to","run","maintaining","the","order","they","were","handed","in","."],"function":"def choose_automagic(\n automagics: List[interfaces.automagic.AutomagicInterface],\n plugin: Type[interfaces.plugins.PluginInterface]) -> List[Type[interfaces.automagic.AutomagicInterface]]:\n \"\"\"Chooses which automagics to run, maintaining the order they were handed\n in.\"\"\"\n\n plugin_category = \"None\"\n plugin_categories = plugin.__module__.split('.')\n lowest_index = len(plugin_categories)\n\n automagic_categories = {'windows': windows_automagic, 'linux': linux_automagic, 'mac': mac_automagic}\n\n for os in automagic_categories:\n try:\n if plugin_categories.index(os) < lowest_index:\n lowest_index = plugin_categories.index(os)\n plugin_category = os\n except ValueError:\n # The value wasn't found, try the next one\n pass\n\n if plugin_category not in automagic_categories:\n vollog.info(\"No plugin category detected\")\n return automagics\n\n vollog.info(\"Detected a {} category plugin\".format(plugin_category))\n output = []\n for amagic in automagics:\n if amagic.__class__.__name__ in automagic_categories[plugin_category]:\n output += [amagic]\n return output","function_tokens":["def","choose_automagic","(","automagics",":","List","[","interfaces",".","automagic",".","AutomagicInterface","]",",","plugin",":","Type","[","interfaces",".","plugins",".","PluginInterface","]",")","->","List","[","Type","[","interfaces",".","automagic",".","AutomagicInterface","]","]",":","plugin_category","=","\"None\"","plugin_categories","=","plugin",".","__module__",".","split","(","'.'",")","lowest_index","=","len","(","plugin_categories",")","automagic_categories","=","{","'windows'",":","windows_automagic",",","'linux'",":","linux_automagic",",","'mac'",":","mac_automagic","}","for","os","in","automagic_categories",":","try",":","if","plugin_categories",".","index","(","os",")","<","lowest_index",":","lowest_index","=","plugin_categories",".","index","(","os",")","plugin_category","=","os","except","ValueError",":","# The value wasn't found, try the next one","pass","if","plugin_category","not","in","automagic_categories",":","vollog",".","info","(","\"No plugin category detected\"",")","return","automagics","vollog",".","info","(","\"Detected a {} category plugin\"",".","format","(","plugin_category",")",")","output","=","[","]","for","amagic","in","automagics",":","if","amagic",".","__class__",".","__name__","in","automagic_categories","[","plugin_category","]",":","output","+=","[","amagic","]","return","output"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/__init__.py#L50-L80"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/__init__.py","language":"python","identifier":"run","parameters":"(automagics: List[interfaces.automagic.AutomagicInterface],\n context: interfaces.context.ContextInterface,\n configurable: Union[interfaces.configuration.ConfigurableInterface,\n Type[interfaces.configuration.ConfigurableInterface]],\n config_path: str,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return exceptions","docstring":"Runs through the list of `automagics` in order, allowing them to make\n changes to the context.\n\n Args:\n automagics: A list of :class:`~volatility.framework.interfaces.automagic.AutomagicInterface` objects\n context: The context (that inherits from :class:`~volatility.framework.interfaces.context.ContextInterface`) for modification\n configurable: An object that inherits from :class:`~volatility.framework.interfaces.configuration.ConfigurableInterface`\n config_path: The path within the `context.config` for options required by the `configurable`\n progress_callback: A function that takes a percentage (and an optional description) that will be called periodically\n\n This is where any automagic is allowed to run, and alter the context in order to satisfy\/improve all requirements\n\n Returns a list of traceback objects that occurred during the autorun procedure\n\n Note:\n The order of the `automagics` list is important. An `automagic` that populates configurations may be necessary\n for an `automagic` that populates the context based on the configuration information.","docstring_summary":"Runs through the list of `automagics` in order, allowing them to make\n changes to the context.","docstring_tokens":["Runs","through","the","list","of","automagics","in","order","allowing","them","to","make","changes","to","the","context","."],"function":"def run(automagics: List[interfaces.automagic.AutomagicInterface],\n context: interfaces.context.ContextInterface,\n configurable: Union[interfaces.configuration.ConfigurableInterface,\n Type[interfaces.configuration.ConfigurableInterface]],\n config_path: str,\n progress_callback: constants.ProgressCallback = None) -> List[traceback.TracebackException]:\n \"\"\"Runs through the list of `automagics` in order, allowing them to make\n changes to the context.\n\n Args:\n automagics: A list of :class:`~volatility.framework.interfaces.automagic.AutomagicInterface` objects\n context: The context (that inherits from :class:`~volatility.framework.interfaces.context.ContextInterface`) for modification\n configurable: An object that inherits from :class:`~volatility.framework.interfaces.configuration.ConfigurableInterface`\n config_path: The path within the `context.config` for options required by the `configurable`\n progress_callback: A function that takes a percentage (and an optional description) that will be called periodically\n\n This is where any automagic is allowed to run, and alter the context in order to satisfy\/improve all requirements\n\n Returns a list of traceback objects that occurred during the autorun procedure\n\n Note:\n The order of the `automagics` list is important. An `automagic` that populates configurations may be necessary\n for an `automagic` that populates the context based on the configuration information.\n \"\"\"\n for automagic in automagics:\n if not isinstance(automagic, interfaces.automagic.AutomagicInterface):\n raise TypeError(\"Automagics must only contain AutomagicInterface subclasses\")\n\n if (not isinstance(configurable, interfaces.configuration.ConfigurableInterface)\n and not issubclass(configurable, interfaces.configuration.ConfigurableInterface)):\n raise TypeError(\"Automagic operates on configurables only\")\n\n # TODO: Fix need for top level config element just because we're using a MultiRequirement to group the\n # configurable's config requirements\n # configurable_class: Type[interfaces.configuration.ConfigurableInterface]\n if isinstance(configurable, interfaces.configuration.ConfigurableInterface):\n configurable_class = configurable.__class__\n else:\n configurable_class = configurable\n requirement = requirements.MultiRequirement(name = configurable_class.__name__)\n for req in configurable.get_requirements():\n requirement.add_requirement(req)\n\n exceptions = []\n\n for automagic in automagics:\n try:\n vollog.info(\"Running automagic: {}\".format(automagic.__class__.__name__))\n automagic(context, config_path, requirement, progress_callback)\n except Exception as excp:\n exceptions.append(traceback.TracebackException.from_exception(excp))\n return exceptions","function_tokens":["def","run","(","automagics",":","List","[","interfaces",".","automagic",".","AutomagicInterface","]",",","context",":","interfaces",".","context",".","ContextInterface",",","configurable",":","Union","[","interfaces",".","configuration",".","ConfigurableInterface",",","Type","[","interfaces",".","configuration",".","ConfigurableInterface","]","]",",","config_path",":","str",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","List","[","traceback",".","TracebackException","]",":","for","automagic","in","automagics",":","if","not","isinstance","(","automagic",",","interfaces",".","automagic",".","AutomagicInterface",")",":","raise","TypeError","(","\"Automagics must only contain AutomagicInterface subclasses\"",")","if","(","not","isinstance","(","configurable",",","interfaces",".","configuration",".","ConfigurableInterface",")","and","not","issubclass","(","configurable",",","interfaces",".","configuration",".","ConfigurableInterface",")",")",":","raise","TypeError","(","\"Automagic operates on configurables only\"",")","# TODO: Fix need for top level config element just because we're using a MultiRequirement to group the","# configurable's config requirements","# configurable_class: Type[interfaces.configuration.ConfigurableInterface]","if","isinstance","(","configurable",",","interfaces",".","configuration",".","ConfigurableInterface",")",":","configurable_class","=","configurable",".","__class__","else",":","configurable_class","=","configurable","requirement","=","requirements",".","MultiRequirement","(","name","=","configurable_class",".","__name__",")","for","req","in","configurable",".","get_requirements","(",")",":","requirement",".","add_requirement","(","req",")","exceptions","=","[","]","for","automagic","in","automagics",":","try",":","vollog",".","info","(","\"Running automagic: {}\"",".","format","(","automagic",".","__class__",".","__name__",")",")","automagic","(","context",",","config_path",",","requirement",",","progress_callback",")","except","Exception","as","excp",":","exceptions",".","append","(","traceback",".","TracebackException",".","from_exception","(","excp",")",")","return","exceptions"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/__init__.py#L83-L134"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py","language":"python","identifier":"KernelPDBScanner.find_virtual_layers_from_req","parameters":"(self, context: interfaces.context.ContextInterface, config_path: str,\n requirement: interfaces.configuration.RequirementInterface)","argument_list":"","return_statement":"return results","docstring":"Traverses the requirement tree, rooted at `requirement` looking for\n virtual layers that might contain a windows PDB.\n\n Returns a list of possible layers\n\n Args:\n context: The context in which the `requirement` lives\n config_path: The path within the `context` for the `requirement`'s configuration variables\n requirement: The root of the requirement tree to search for :class:~`volatility.framework.interfaces.layers.TranslationLayerRequirement` objects to scan\n progress_callback: Means of providing the user with feedback during long processes\n\n Returns:\n A list of (layer_name, scan_results)","docstring_summary":"Traverses the requirement tree, rooted at `requirement` looking for\n virtual layers that might contain a windows PDB.","docstring_tokens":["Traverses","the","requirement","tree","rooted","at","requirement","looking","for","virtual","layers","that","might","contain","a","windows","PDB","."],"function":"def find_virtual_layers_from_req(self, context: interfaces.context.ContextInterface, config_path: str,\n requirement: interfaces.configuration.RequirementInterface) -> List[str]:\n \"\"\"Traverses the requirement tree, rooted at `requirement` looking for\n virtual layers that might contain a windows PDB.\n\n Returns a list of possible layers\n\n Args:\n context: The context in which the `requirement` lives\n config_path: The path within the `context` for the `requirement`'s configuration variables\n requirement: The root of the requirement tree to search for :class:~`volatility.framework.interfaces.layers.TranslationLayerRequirement` objects to scan\n progress_callback: Means of providing the user with feedback during long processes\n\n Returns:\n A list of (layer_name, scan_results)\n \"\"\"\n sub_config_path = interfaces.configuration.path_join(config_path, requirement.name)\n results = [] # type: List[str]\n if isinstance(requirement, requirements.TranslationLayerRequirement):\n # Check for symbols in this layer\n # FIXME: optionally allow a full (slow) scan\n # FIXME: Determine the physical layer no matter the virtual layer\n virtual_layer_name = context.config.get(sub_config_path, None)\n layer_name = context.config.get(interfaces.configuration.path_join(sub_config_path, \"memory_layer\"), None)\n if layer_name and virtual_layer_name:\n memlayer = context.layers[virtual_layer_name]\n if isinstance(memlayer, intel.Intel):\n results = [virtual_layer_name]\n else:\n for subreq in requirement.requirements.values():\n results += self.find_virtual_layers_from_req(context, sub_config_path, subreq)\n return results","function_tokens":["def","find_virtual_layers_from_req","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","requirement",":","interfaces",".","configuration",".","RequirementInterface",")","->","List","[","str","]",":","sub_config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","requirement",".","name",")","results","=","[","]","# type: List[str]","if","isinstance","(","requirement",",","requirements",".","TranslationLayerRequirement",")",":","# Check for symbols in this layer","# FIXME: optionally allow a full (slow) scan","# FIXME: Determine the physical layer no matter the virtual layer","virtual_layer_name","=","context",".","config",".","get","(","sub_config_path",",","None",")","layer_name","=","context",".","config",".","get","(","interfaces",".","configuration",".","path_join","(","sub_config_path",",","\"memory_layer\"",")",",","None",")","if","layer_name","and","virtual_layer_name",":","memlayer","=","context",".","layers","[","virtual_layer_name","]","if","isinstance","(","memlayer",",","intel",".","Intel",")",":","results","=","[","virtual_layer_name","]","else",":","for","subreq","in","requirement",".","requirements",".","values","(",")",":","results","+=","self",".","find_virtual_layers_from_req","(","context",",","sub_config_path",",","subreq",")","return","results"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py#L48-L79"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py","language":"python","identifier":"KernelPDBScanner.recurse_symbol_fulfiller","parameters":"(self,\n context: interfaces.context.ContextInterface,\n valid_kernel: ValidKernelType,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"","docstring":"Fulfills the SymbolTableRequirements in `self._symbol_requirements`\n found by the `recurse_symbol_requirements`.\n\n This pass will construct any requirements that may need it in the context it was passed\n\n Args:\n context: Context on which to operate\n valid_kernel: A list of offsets where valid kernels have been found","docstring_summary":"Fulfills the SymbolTableRequirements in `self._symbol_requirements`\n found by the `recurse_symbol_requirements`.","docstring_tokens":["Fulfills","the","SymbolTableRequirements","in","self",".","_symbol_requirements","found","by","the","recurse_symbol_requirements","."],"function":"def recurse_symbol_fulfiller(self,\n context: interfaces.context.ContextInterface,\n valid_kernel: ValidKernelType,\n progress_callback: constants.ProgressCallback = None) -> None:\n \"\"\"Fulfills the SymbolTableRequirements in `self._symbol_requirements`\n found by the `recurse_symbol_requirements`.\n\n This pass will construct any requirements that may need it in the context it was passed\n\n Args:\n context: Context on which to operate\n valid_kernel: A list of offsets where valid kernels have been found\n \"\"\"\n for sub_config_path, requirement in self._symbol_requirements:\n # TODO: Potentially think about multiple symbol requirements in both the same and different levels of the requirement tree\n # TODO: Consider whether a single found kernel can fulfill multiple requirements\n if valid_kernel:\n # TODO: Check that the symbols for this kernel will fulfill the requirement\n virtual_layer, _kvo, kernel = valid_kernel\n if not isinstance(kernel['pdb_name'], str) or not isinstance(kernel['GUID'], str):\n raise TypeError(\"PDB name or GUID not a string value\")\n\n PDBUtility.load_windows_symbol_table(\n context = context,\n guid = kernel['GUID'],\n age = kernel['age'],\n pdb_name = kernel['pdb_name'],\n symbol_table_class = \"volatility.framework.symbols.windows.WindowsKernelIntermedSymbols\",\n config_path = sub_config_path,\n progress_callback = progress_callback)\n else:\n vollog.debug(\"No suitable kernel pdb signature found\")","function_tokens":["def","recurse_symbol_fulfiller","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","valid_kernel",":","ValidKernelType",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","None",":","for","sub_config_path",",","requirement","in","self",".","_symbol_requirements",":","# TODO: Potentially think about multiple symbol requirements in both the same and different levels of the requirement tree","# TODO: Consider whether a single found kernel can fulfill multiple requirements","if","valid_kernel",":","# TODO: Check that the symbols for this kernel will fulfill the requirement","virtual_layer",",","_kvo",",","kernel","=","valid_kernel","if","not","isinstance","(","kernel","[","'pdb_name'","]",",","str",")","or","not","isinstance","(","kernel","[","'GUID'","]",",","str",")",":","raise","TypeError","(","\"PDB name or GUID not a string value\"",")","PDBUtility",".","load_windows_symbol_table","(","context","=","context",",","guid","=","kernel","[","'GUID'","]",",","age","=","kernel","[","'age'","]",",","pdb_name","=","kernel","[","'pdb_name'","]",",","symbol_table_class","=","\"volatility.framework.symbols.windows.WindowsKernelIntermedSymbols\"",",","config_path","=","sub_config_path",",","progress_callback","=","progress_callback",")","else",":","vollog",".","debug","(","\"No suitable kernel pdb signature found\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py#L81-L112"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py","language":"python","identifier":"KernelPDBScanner.set_kernel_virtual_offset","parameters":"(self, context: interfaces.context.ContextInterface,\n valid_kernel: ValidKernelType)","argument_list":"","return_statement":"","docstring":"Traverses the requirement tree, looking for kernel_virtual_offset\n values that may need setting and sets it based on the previously\n identified `valid_kernel`.\n\n Args:\n context: Context on which to operate and provide the kernel virtual offset\n valid_kernel: List of valid kernels and offsets","docstring_summary":"Traverses the requirement tree, looking for kernel_virtual_offset\n values that may need setting and sets it based on the previously\n identified `valid_kernel`.","docstring_tokens":["Traverses","the","requirement","tree","looking","for","kernel_virtual_offset","values","that","may","need","setting","and","sets","it","based","on","the","previously","identified","valid_kernel","."],"function":"def set_kernel_virtual_offset(self, context: interfaces.context.ContextInterface,\n valid_kernel: ValidKernelType) -> None:\n \"\"\"Traverses the requirement tree, looking for kernel_virtual_offset\n values that may need setting and sets it based on the previously\n identified `valid_kernel`.\n\n Args:\n context: Context on which to operate and provide the kernel virtual offset\n valid_kernel: List of valid kernels and offsets\n \"\"\"\n if valid_kernel:\n # Set the virtual offset under the TranslationLayer it applies to\n virtual_layer, kvo, kernel = valid_kernel\n kvo_path = interfaces.configuration.path_join(context.layers[virtual_layer].config_path,\n 'kernel_virtual_offset')\n context.config[kvo_path] = kvo\n vollog.debug(\"Setting kernel_virtual_offset to {}\".format(hex(kvo)))","function_tokens":["def","set_kernel_virtual_offset","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","valid_kernel",":","ValidKernelType",")","->","None",":","if","valid_kernel",":","# Set the virtual offset under the TranslationLayer it applies to","virtual_layer",",","kvo",",","kernel","=","valid_kernel","kvo_path","=","interfaces",".","configuration",".","path_join","(","context",".","layers","[","virtual_layer","]",".","config_path",",","'kernel_virtual_offset'",")","context",".","config","[","kvo_path","]","=","kvo","vollog",".","debug","(","\"Setting kernel_virtual_offset to {}\"",".","format","(","hex","(","kvo",")",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py#L114-L130"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py","language":"python","identifier":"KernelPDBScanner._method_offset","parameters":"(self,\n context: interfaces.context.ContextInterface,\n vlayer: layers.intel.Intel,\n pattern: bytes,\n result_offset: int,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return valid_kernel","docstring":"Method for finding a suitable kernel offset based on a module\n table.","docstring_summary":"Method for finding a suitable kernel offset based on a module\n table.","docstring_tokens":["Method","for","finding","a","suitable","kernel","offset","based","on","a","module","table","."],"function":"def _method_offset(self,\n context: interfaces.context.ContextInterface,\n vlayer: layers.intel.Intel,\n pattern: bytes,\n result_offset: int,\n progress_callback: constants.ProgressCallback = None) -> Optional[ValidKernelType]:\n \"\"\"Method for finding a suitable kernel offset based on a module\n table.\"\"\"\n vollog.debug(\"Kernel base determination - searching layer module list structure\")\n valid_kernel = None # type: Optional[ValidKernelType]\n # If we're here, chances are high we're in a Win10 x64 image with kernel base randomization\n physical_layer_name = self.get_physical_layer_name(context, vlayer)\n physical_layer = context.layers[physical_layer_name]\n # TODO: On older windows, this might be \\WINDOWS\\system32\\nt rather than \\SystemRoot\\system32\\nt\n results = physical_layer.scan(context, scanners.BytesScanner(pattern), progress_callback = progress_callback)\n seen = set() # type: Set[int]\n # Because this will launch a scan of the virtual layer, we want to be careful\n for result in results:\n # TODO: Identify the specific structure we're finding and document this a bit better\n pointer = context.object(\"pdbscan!unsigned long long\",\n offset = (result + result_offset),\n layer_name = physical_layer_name)\n address = pointer & vlayer.address_mask\n if address in seen:\n continue\n seen.add(address)\n\n valid_kernel = self.check_kernel_offset(context, vlayer, address, progress_callback)\n\n if valid_kernel:\n break\n return valid_kernel","function_tokens":["def","_method_offset","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","vlayer",":","layers",".","intel",".","Intel",",","pattern",":","bytes",",","result_offset",":","int",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","Optional","[","ValidKernelType","]",":","vollog",".","debug","(","\"Kernel base determination - searching layer module list structure\"",")","valid_kernel","=","None","# type: Optional[ValidKernelType]","# If we're here, chances are high we're in a Win10 x64 image with kernel base randomization","physical_layer_name","=","self",".","get_physical_layer_name","(","context",",","vlayer",")","physical_layer","=","context",".","layers","[","physical_layer_name","]","# TODO: On older windows, this might be \\WINDOWS\\system32\\nt rather than \\SystemRoot\\system32\\nt","results","=","physical_layer",".","scan","(","context",",","scanners",".","BytesScanner","(","pattern",")",",","progress_callback","=","progress_callback",")","seen","=","set","(",")","# type: Set[int]","# Because this will launch a scan of the virtual layer, we want to be careful","for","result","in","results",":","# TODO: Identify the specific structure we're finding and document this a bit better","pointer","=","context",".","object","(","\"pdbscan!unsigned long long\"",",","offset","=","(","result","+","result_offset",")",",","layer_name","=","physical_layer_name",")","address","=","pointer","&","vlayer",".","address_mask","if","address","in","seen",":","continue","seen",".","add","(","address",")","valid_kernel","=","self",".","check_kernel_offset","(","context",",","vlayer",",","address",",","progress_callback",")","if","valid_kernel",":","break","return","valid_kernel"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py#L173-L204"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py","language":"python","identifier":"KernelPDBScanner.check_kernel_offset","parameters":"(self,\n context: interfaces.context.ContextInterface,\n vlayer: layers.intel.Intel,\n address: int,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return valid_kernel","docstring":"Scans a virtual address.","docstring_summary":"Scans a virtual address.","docstring_tokens":["Scans","a","virtual","address","."],"function":"def check_kernel_offset(self,\n context: interfaces.context.ContextInterface,\n vlayer: layers.intel.Intel,\n address: int,\n progress_callback: constants.ProgressCallback = None) -> Optional[ValidKernelType]:\n \"\"\"Scans a virtual address.\"\"\"\n # Scan a few megs of the virtual space at the location to see if they're potential kernels\n\n valid_kernel = None # type: Optional[ValidKernelType]\n kernel_pdb_names = [bytes(name + \".pdb\", \"utf-8\") for name in constants.windows.KERNEL_MODULE_NAMES]\n\n virtual_layer_name = vlayer.name\n try:\n if vlayer.read(address, 0x2) == b'MZ':\n res = list(\n PDBUtility.pdbname_scan(ctx = context,\n layer_name = vlayer.name,\n page_size = vlayer.page_size,\n pdb_names = kernel_pdb_names,\n progress_callback = progress_callback,\n start = address,\n end = address + self.max_pdb_size))\n if res:\n valid_kernel = (virtual_layer_name, address, res[0])\n except exceptions.InvalidAddressException:\n pass\n return valid_kernel","function_tokens":["def","check_kernel_offset","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","vlayer",":","layers",".","intel",".","Intel",",","address",":","int",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","Optional","[","ValidKernelType","]",":","# Scan a few megs of the virtual space at the location to see if they're potential kernels","valid_kernel","=","None","# type: Optional[ValidKernelType]","kernel_pdb_names","=","[","bytes","(","name","+","\".pdb\"",",","\"utf-8\"",")","for","name","in","constants",".","windows",".","KERNEL_MODULE_NAMES","]","virtual_layer_name","=","vlayer",".","name","try",":","if","vlayer",".","read","(","address",",","0x2",")","==","b'MZ'",":","res","=","list","(","PDBUtility",".","pdbname_scan","(","ctx","=","context",",","layer_name","=","vlayer",".","name",",","page_size","=","vlayer",".","page_size",",","pdb_names","=","kernel_pdb_names",",","progress_callback","=","progress_callback",",","start","=","address",",","end","=","address","+","self",".","max_pdb_size",")",")","if","res",":","valid_kernel","=","(","virtual_layer_name",",","address",",","res","[","0","]",")","except","exceptions",".","InvalidAddressException",":","pass","return","valid_kernel"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py#L219-L245"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py","language":"python","identifier":"KernelPDBScanner.determine_valid_kernel","parameters":"(self,\n context: interfaces.context.ContextInterface,\n potential_layers: List[str],\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return valid_kernel","docstring":"Runs through the identified potential kernels and verifies their\n suitability.\n\n This carries out a scan using the pdb_signature scanner on a physical layer. It uses the\n results of the scan to determine the virtual offset of the kernel. On early windows implementations\n there is a fixed mapping between the physical and virtual addresses of the kernel. On more recent versions\n a search is conducted for a structure that will identify the kernel's virtual offset.\n\n Args:\n context: Context on which to operate\n potential_kernels: Dictionary containing `GUID`, `age`, `pdb_name` and `mz_offset` keys\n progress_callback: Function taking a percentage and optional description to be called during expensive computations to indicate progress\n\n Returns:\n A dictionary of valid kernels","docstring_summary":"Runs through the identified potential kernels and verifies their\n suitability.","docstring_tokens":["Runs","through","the","identified","potential","kernels","and","verifies","their","suitability","."],"function":"def determine_valid_kernel(self,\n context: interfaces.context.ContextInterface,\n potential_layers: List[str],\n progress_callback: constants.ProgressCallback = None) -> Optional[ValidKernelType]:\n \"\"\"Runs through the identified potential kernels and verifies their\n suitability.\n\n This carries out a scan using the pdb_signature scanner on a physical layer. It uses the\n results of the scan to determine the virtual offset of the kernel. On early windows implementations\n there is a fixed mapping between the physical and virtual addresses of the kernel. On more recent versions\n a search is conducted for a structure that will identify the kernel's virtual offset.\n\n Args:\n context: Context on which to operate\n potential_kernels: Dictionary containing `GUID`, `age`, `pdb_name` and `mz_offset` keys\n progress_callback: Function taking a percentage and optional description to be called during expensive computations to indicate progress\n\n Returns:\n A dictionary of valid kernels\n \"\"\"\n valid_kernel = None # type: Optional[ValidKernelType]\n for virtual_layer_name in potential_layers:\n vlayer = context.layers.get(virtual_layer_name, None)\n if isinstance(vlayer, layers.intel.Intel):\n for method in self.methods:\n valid_kernel = method(self, context, vlayer, progress_callback)\n if valid_kernel:\n break\n if not valid_kernel:\n vollog.info(\"No suitable kernels found during pdbscan\")\n return valid_kernel","function_tokens":["def","determine_valid_kernel","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","potential_layers",":","List","[","str","]",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","Optional","[","ValidKernelType","]",":","valid_kernel","=","None","# type: Optional[ValidKernelType]","for","virtual_layer_name","in","potential_layers",":","vlayer","=","context",".","layers",".","get","(","virtual_layer_name",",","None",")","if","isinstance","(","vlayer",",","layers",".","intel",".","Intel",")",":","for","method","in","self",".","methods",":","valid_kernel","=","method","(","self",",","context",",","vlayer",",","progress_callback",")","if","valid_kernel",":","break","if","not","valid_kernel",":","vollog",".","info","(","\"No suitable kernels found during pdbscan\"",")","return","valid_kernel"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/pdbscan.py#L250-L280"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py","language":"python","identifier":"DtbTest.__call__","parameters":"(self, data: bytes, data_offset: int, page_offset: int)","argument_list":"","return_statement":"return None","docstring":"Tests a specific page in a chunk of data to see if it contains a\n self-referential pointer.\n\n Args:\n data: The chunk of data that contains the page to be scanned\n data_offset: Where, within the layer, the chunk of data lives\n page_offset: Where, within the data, the page to be scanned starts\n\n Returns:\n A valid DTB within this page (and an additional parameter for data)","docstring_summary":"Tests a specific page in a chunk of data to see if it contains a\n self-referential pointer.","docstring_tokens":["Tests","a","specific","page","in","a","chunk","of","data","to","see","if","it","contains","a","self","-","referential","pointer","."],"function":"def __call__(self, data: bytes, data_offset: int, page_offset: int) -> Optional[Tuple[int, Any]]:\n \"\"\"Tests a specific page in a chunk of data to see if it contains a\n self-referential pointer.\n\n Args:\n data: The chunk of data that contains the page to be scanned\n data_offset: Where, within the layer, the chunk of data lives\n page_offset: Where, within the data, the page to be scanned starts\n\n Returns:\n A valid DTB within this page (and an additional parameter for data)\n \"\"\"\n value = data[page_offset + (self.ptr_reference * self.ptr_size):page_offset +\n ((self.ptr_reference + 1) * self.ptr_size)]\n try:\n ptr = self._unpack(value)\n except struct.error:\n return None\n # The value *must* be present (bit 0) since it's a mapped page\n # It's almost always writable (bit 1)\n # It's occasionally Super, but not reliably so, haven't checked when\/why not\n # The top 3-bits are usually ignore (which in practice means 0\n # Need to find out why the middle 3-bits are usually 6 (0110)\n if ptr != 0 and (ptr & self.mask == data_offset + page_offset) & (ptr & 0xFF1 == 0x61):\n dtb = (ptr & self.mask)\n return self.second_pass(dtb, data, data_offset)\n return None","function_tokens":["def","__call__","(","self",",","data",":","bytes",",","data_offset",":","int",",","page_offset",":","int",")","->","Optional","[","Tuple","[","int",",","Any","]","]",":","value","=","data","[","page_offset","+","(","self",".","ptr_reference","*","self",".","ptr_size",")",":","page_offset","+","(","(","self",".","ptr_reference","+","1",")","*","self",".","ptr_size",")","]","try",":","ptr","=","self",".","_unpack","(","value",")","except","struct",".","error",":","return","None","# The value *must* be present (bit 0) since it's a mapped page","# It's almost always writable (bit 1)","# It's occasionally Super, but not reliably so, haven't checked when\/why not","# The top 3-bits are usually ignore (which in practice means 0","# Need to find out why the middle 3-bits are usually 6 (0110)","if","ptr","!=","0","and","(","ptr","&","self",".","mask","==","data_offset","+","page_offset",")","&","(","ptr","&","0xFF1","==","0x61",")",":","dtb","=","(","ptr","&","self",".","mask",")","return","self",".","second_pass","(","dtb",",","data",",","data_offset",")","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py#L60-L86"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py","language":"python","identifier":"DtbTest.second_pass","parameters":"(self, dtb: int, data: bytes, data_offset: int)","argument_list":"","return_statement":"return None","docstring":"Re-reads over the whole page to validate other records based on the\n number of pages marked user vs super.\n\n Args:\n dtb: The identified dtb that needs validating\n data: The chunk of data that contains the dtb to be validated\n data_offset: Where, within the layer, the chunk of data lives\n\n Returns:\n A valid DTB within this page","docstring_summary":"Re-reads over the whole page to validate other records based on the\n number of pages marked user vs super.","docstring_tokens":["Re","-","reads","over","the","whole","page","to","validate","other","records","based","on","the","number","of","pages","marked","user","vs","super","."],"function":"def second_pass(self, dtb: int, data: bytes, data_offset: int) -> Optional[Tuple[int, Any]]:\n \"\"\"Re-reads over the whole page to validate other records based on the\n number of pages marked user vs super.\n\n Args:\n dtb: The identified dtb that needs validating\n data: The chunk of data that contains the dtb to be validated\n data_offset: Where, within the layer, the chunk of data lives\n\n Returns:\n A valid DTB within this page\n \"\"\"\n page = data[dtb - data_offset:dtb - data_offset + self.page_size]\n usr_count, sup_count = 0, 0\n for i in range(0, self.page_size, self.ptr_size):\n val = self._unpack(page[i:i + self.ptr_size])\n if val & 0x1:\n sup_count += 0 if (val & 0x4) else 1\n usr_count += 1 if (val & 0x4) else 0\n # print(hex(dtb), usr_count, sup_count, usr_count + sup_count)\n # We sometimes find bogus DTBs at 0x16000 with a very low sup_count and 0 usr_count\n # I have a winxpsp2-x64 image with identical usr\/sup counts at 0x16000 and 0x24c00 as well as the actual 0x3c3000\n if usr_count or sup_count > 5:\n return dtb, None\n return None","function_tokens":["def","second_pass","(","self",",","dtb",":","int",",","data",":","bytes",",","data_offset",":","int",")","->","Optional","[","Tuple","[","int",",","Any","]","]",":","page","=","data","[","dtb","-","data_offset",":","dtb","-","data_offset","+","self",".","page_size","]","usr_count",",","sup_count","=","0",",","0","for","i","in","range","(","0",",","self",".","page_size",",","self",".","ptr_size",")",":","val","=","self",".","_unpack","(","page","[","i",":","i","+","self",".","ptr_size","]",")","if","val","&","0x1",":","sup_count","+=","0","if","(","val","&","0x4",")","else","1","usr_count","+=","1","if","(","val","&","0x4",")","else","0","# print(hex(dtb), usr_count, sup_count, usr_count + sup_count)","# We sometimes find bogus DTBs at 0x16000 with a very low sup_count and 0 usr_count","# I have a winxpsp2-x64 image with identical usr\/sup counts at 0x16000 and 0x24c00 as well as the actual 0x3c3000","if","usr_count","or","sup_count",">","5",":","return","dtb",",","None","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py#L88-L112"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py","language":"python","identifier":"DtbTestPae.second_pass","parameters":"(self, dtb: int, data: bytes, data_offset: int)","argument_list":"","return_statement":"return None","docstring":"PAE top level directory tables contains four entries and the self-\n referential pointer occurs in the second level of tables (so as not to\n use up a full quarter of the space). This is very high in the space,\n and occurs in the fourht (last quarter) second-level table. The\n second-level tables appear always to come sequentially directly after\n the real dtb. The value for the real DTB is therefore four page\n earlier (and the fourth entry should point back to the `dtb` parameter\n this function was originally passed.\n\n Args:\n dtb: The identified self-referential pointer that needs validating\n data: The chunk of data that contains the dtb to be validated\n data_offset: Where, within the layer, the chunk of data lives\n\n Returns:\n Returns the actual DTB of the PAE space","docstring_summary":"PAE top level directory tables contains four entries and the self-\n referential pointer occurs in the second level of tables (so as not to\n use up a full quarter of the space). This is very high in the space,\n and occurs in the fourht (last quarter) second-level table. The\n second-level tables appear always to come sequentially directly after\n the real dtb. The value for the real DTB is therefore four page\n earlier (and the fourth entry should point back to the `dtb` parameter\n this function was originally passed.","docstring_tokens":["PAE","top","level","directory","tables","contains","four","entries","and","the","self","-","referential","pointer","occurs","in","the","second","level","of","tables","(","so","as","not","to","use","up","a","full","quarter","of","the","space",")",".","This","is","very","high","in","the","space","and","occurs","in","the","fourht","(","last","quarter",")","second","-","level","table",".","The","second","-","level","tables","appear","always","to","come","sequentially","directly","after","the","real","dtb",".","The","value","for","the","real","DTB","is","therefore","four","page","earlier","(","and","the","fourth","entry","should","point","back","to","the","dtb","parameter","this","function","was","originally","passed","."],"function":"def second_pass(self, dtb: int, data: bytes, data_offset: int) -> Optional[Tuple[int, Any]]:\n \"\"\"PAE top level directory tables contains four entries and the self-\n referential pointer occurs in the second level of tables (so as not to\n use up a full quarter of the space). This is very high in the space,\n and occurs in the fourht (last quarter) second-level table. The\n second-level tables appear always to come sequentially directly after\n the real dtb. The value for the real DTB is therefore four page\n earlier (and the fourth entry should point back to the `dtb` parameter\n this function was originally passed.\n\n Args:\n dtb: The identified self-referential pointer that needs validating\n data: The chunk of data that contains the dtb to be validated\n data_offset: Where, within the layer, the chunk of data lives\n\n Returns:\n Returns the actual DTB of the PAE space\n \"\"\"\n dtb -= 0x4000\n # If we're not in something that the overlap would pick up\n if dtb - data_offset >= 0:\n pointers = data[dtb - data_offset + (3 * self.ptr_size):dtb - data_offset + (4 * self.ptr_size)]\n val = self._unpack(pointers)\n if (val & self.mask == dtb + 0x4000) and (val & 0xFFF == 0x001):\n return dtb, None\n return None","function_tokens":["def","second_pass","(","self",",","dtb",":","int",",","data",":","bytes",",","data_offset",":","int",")","->","Optional","[","Tuple","[","int",",","Any","]","]",":","dtb","-=","0x4000","# If we're not in something that the overlap would pick up","if","dtb","-","data_offset",">=","0",":","pointers","=","data","[","dtb","-","data_offset","+","(","3","*","self",".","ptr_size",")",":","dtb","-","data_offset","+","(","4","*","self",".","ptr_size",")","]","val","=","self",".","_unpack","(","pointers",")","if","(","val","&","self",".","mask","==","dtb","+","0x4000",")","and","(","val","&","0xFFF","==","0x001",")",":","return","dtb",",","None","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py#L141-L166"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py","language":"python","identifier":"WindowsIntelStacker.stack","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return layer","docstring":"Attempts to determine and stack an intel layer on a physical layer\n where possible.\n\n Where the DTB scan fails, it attempts a heuristic of checking\n for the DTB within a specific range. New versions of windows,\n with randomized self-referential pointers, appear to always load\n their dtb within a small specific range (`0x1a0000` and\n `0x1b0000`), so instead we scan for all self-referential\n pointers in that range, and ignore any that contain multiple\n self-references (since the DTB is very unlikely to point to\n itself more than once).","docstring_summary":"Attempts to determine and stack an intel layer on a physical layer\n where possible.","docstring_tokens":["Attempts","to","determine","and","stack","an","intel","layer","on","a","physical","layer","where","possible","."],"function":"def stack(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None) -> Optional[interfaces.layers.DataLayerInterface]:\n \"\"\"Attempts to determine and stack an intel layer on a physical layer\n where possible.\n\n Where the DTB scan fails, it attempts a heuristic of checking\n for the DTB within a specific range. New versions of windows,\n with randomized self-referential pointers, appear to always load\n their dtb within a small specific range (`0x1a0000` and\n `0x1b0000`), so instead we scan for all self-referential\n pointers in that range, and ignore any that contain multiple\n self-references (since the DTB is very unlikely to point to\n itself more than once).\n \"\"\"\n base_layer = context.layers[layer_name]\n if isinstance(base_layer, intel.Intel):\n return None\n if base_layer.metadata.get('os', None) not in ['Windows', 'Unknown']:\n return None\n layer = config_path = None\n\n # Check the metadata\n if (base_layer.metadata.get('os', None) == 'Windows' and base_layer.metadata.get('page_map_offset')):\n arch = base_layer.metadata.get('architecture', None)\n if arch not in ['Intel32', 'Intel64']:\n return None\n # Set the layer type\n layer_type = intel.WindowsIntel # type: Type\n if arch == 'Intel64':\n layer_type = intel.WindowsIntel32e\n elif base_layer.metadata.get('pae', False):\n layer_type = intel.WindowsIntelPAE\n # Construct the layer\n new_layer_name = context.layers.free_layer_name(\"IntelLayer\")\n config_path = interfaces.configuration.path_join(\"IntelHelper\", new_layer_name)\n context.config[interfaces.configuration.path_join(config_path, \"memory_layer\")] = layer_name\n context.config[interfaces.configuration.path_join(\n config_path, \"page_map_offset\")] = base_layer.metadata['page_map_offset']\n layer = layer_type(context, config_path = config_path, name = new_layer_name, metadata = {'os': 'Windows'})\n\n # Check for the self-referential pointer\n if layer is None:\n hits = base_layer.scan(context, PageMapScanner(WintelHelper.tests))\n layer = None\n config_path = None\n for test, dtb in hits:\n new_layer_name = context.layers.free_layer_name(\"IntelLayer\")\n config_path = interfaces.configuration.path_join(\"IntelHelper\", new_layer_name)\n context.config[interfaces.configuration.path_join(config_path, \"memory_layer\")] = layer_name\n context.config[interfaces.configuration.path_join(config_path, \"page_map_offset\")] = dtb\n layer = test.layer_type(context,\n config_path = config_path,\n name = new_layer_name,\n metadata = {'os': 'Windows'})\n break\n\n # Fall back to a heuristic for finding the Windows DTB\n if layer is None:\n vollog.debug(\"Self-referential pointer not in well-known location, moving to recent windows heuristic\")\n # There is a very high chance that the DTB will live in this narrow segment, assuming we couldn't find it previously\n hits = context.layers[layer_name].scan(context,\n PageMapScanner([DtbSelfRef64bit()]),\n sections = [(0x1a0000, 0x50000)],\n progress_callback = progress_callback)\n # Flatten the generator\n hits = list(hits)\n if hits:\n # TODO: Decide which to use if there are multiple options\n test, page_map_offset = hits[0]\n new_layer_name = context.layers.free_layer_name(\"IntelLayer\")\n config_path = interfaces.configuration.path_join(\"IntelHelper\", new_layer_name)\n context.config[interfaces.configuration.path_join(config_path, \"memory_layer\")] = layer_name\n context.config[interfaces.configuration.path_join(config_path, \"page_map_offset\")] = page_map_offset\n # TODO: Need to determine the layer type (chances are high it's x64, hence this default)\n layer = layers.intel.WindowsIntel32e(context,\n config_path = config_path,\n name = new_layer_name,\n metadata = {'os': 'Windows'})\n if layer is not None and config_path:\n vollog.debug(\"DTB was found at: 0x{:0x}\".format(context.config[interfaces.configuration.path_join(\n config_path, \"page_map_offset\")]))\n return layer","function_tokens":["def","stack","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","Optional","[","interfaces",".","layers",".","DataLayerInterface","]",":","base_layer","=","context",".","layers","[","layer_name","]","if","isinstance","(","base_layer",",","intel",".","Intel",")",":","return","None","if","base_layer",".","metadata",".","get","(","'os'",",","None",")","not","in","[","'Windows'",",","'Unknown'","]",":","return","None","layer","=","config_path","=","None","# Check the metadata","if","(","base_layer",".","metadata",".","get","(","'os'",",","None",")","==","'Windows'","and","base_layer",".","metadata",".","get","(","'page_map_offset'",")",")",":","arch","=","base_layer",".","metadata",".","get","(","'architecture'",",","None",")","if","arch","not","in","[","'Intel32'",",","'Intel64'","]",":","return","None","# Set the layer type","layer_type","=","intel",".","WindowsIntel","# type: Type","if","arch","==","'Intel64'",":","layer_type","=","intel",".","WindowsIntel32e","elif","base_layer",".","metadata",".","get","(","'pae'",",","False",")",":","layer_type","=","intel",".","WindowsIntelPAE","# Construct the layer","new_layer_name","=","context",".","layers",".","free_layer_name","(","\"IntelLayer\"",")","config_path","=","interfaces",".","configuration",".","path_join","(","\"IntelHelper\"",",","new_layer_name",")","context",".","config","[","interfaces",".","configuration",".","path_join","(","config_path",",","\"memory_layer\"",")","]","=","layer_name","context",".","config","[","interfaces",".","configuration",".","path_join","(","config_path",",","\"page_map_offset\"",")","]","=","base_layer",".","metadata","[","'page_map_offset'","]","layer","=","layer_type","(","context",",","config_path","=","config_path",",","name","=","new_layer_name",",","metadata","=","{","'os'",":","'Windows'","}",")","# Check for the self-referential pointer","if","layer","is","None",":","hits","=","base_layer",".","scan","(","context",",","PageMapScanner","(","WintelHelper",".","tests",")",")","layer","=","None","config_path","=","None","for","test",",","dtb","in","hits",":","new_layer_name","=","context",".","layers",".","free_layer_name","(","\"IntelLayer\"",")","config_path","=","interfaces",".","configuration",".","path_join","(","\"IntelHelper\"",",","new_layer_name",")","context",".","config","[","interfaces",".","configuration",".","path_join","(","config_path",",","\"memory_layer\"",")","]","=","layer_name","context",".","config","[","interfaces",".","configuration",".","path_join","(","config_path",",","\"page_map_offset\"",")","]","=","dtb","layer","=","test",".","layer_type","(","context",",","config_path","=","config_path",",","name","=","new_layer_name",",","metadata","=","{","'os'",":","'Windows'","}",")","break","# Fall back to a heuristic for finding the Windows DTB","if","layer","is","None",":","vollog",".","debug","(","\"Self-referential pointer not in well-known location, moving to recent windows heuristic\"",")","# There is a very high chance that the DTB will live in this narrow segment, assuming we couldn't find it previously","hits","=","context",".","layers","[","layer_name","]",".","scan","(","context",",","PageMapScanner","(","[","DtbSelfRef64bit","(",")","]",")",",","sections","=","[","(","0x1a0000",",","0x50000",")","]",",","progress_callback","=","progress_callback",")","# Flatten the generator","hits","=","list","(","hits",")","if","hits",":","# TODO: Decide which to use if there are multiple options","test",",","page_map_offset","=","hits","[","0","]","new_layer_name","=","context",".","layers",".","free_layer_name","(","\"IntelLayer\"",")","config_path","=","interfaces",".","configuration",".","path_join","(","\"IntelHelper\"",",","new_layer_name",")","context",".","config","[","interfaces",".","configuration",".","path_join","(","config_path",",","\"memory_layer\"",")","]","=","layer_name","context",".","config","[","interfaces",".","configuration",".","path_join","(","config_path",",","\"page_map_offset\"",")","]","=","page_map_offset","# TODO: Need to determine the layer type (chances are high it's x64, hence this default)","layer","=","layers",".","intel",".","WindowsIntel32e","(","context",",","config_path","=","config_path",",","name","=","new_layer_name",",","metadata","=","{","'os'",":","'Windows'","}",")","if","layer","is","not","None","and","config_path",":","vollog",".","debug","(","\"DTB was found at: 0x{:0x}\"",".","format","(","context",".","config","[","interfaces",".","configuration",".","path_join","(","config_path",",","\"page_map_offset\"",")","]",")",")","return","layer"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py#L295-L378"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py","language":"python","identifier":"WinSwapLayers.__call__","parameters":"(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"","docstring":"Finds translation layers that can have swap layers added.","docstring_summary":"Finds translation layers that can have swap layers added.","docstring_tokens":["Finds","translation","layers","that","can","have","swap","layers","added","."],"function":"def __call__(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n progress_callback: constants.ProgressCallback = None) -> None:\n \"\"\"Finds translation layers that can have swap layers added.\"\"\"\n path_join = interfaces.configuration.path_join\n self._translation_requirement = self.find_requirements(context,\n config_path,\n requirement,\n requirements.TranslationLayerRequirement,\n shortcut = False)\n for trans_sub_config, trans_req in self._translation_requirement:\n if not isinstance(trans_req, requirements.TranslationLayerRequirement):\n # We need this so the type-checker knows we're a TranslationLayerRequirement\n continue\n swap_sub_config, swap_req = self.find_swap_requirement(trans_sub_config, trans_req)\n counter = 0\n swap_config = interfaces.configuration.parent_path(swap_sub_config)\n\n if swap_req and swap_req.unsatisfied(context, swap_config):\n # See if any of them need constructing\n for swap_location in self.config.get('single_swap_locations', []):\n # Setup config locations\/paths\n current_layer_name = swap_req.name + str(counter)\n current_layer_path = path_join(swap_sub_config, current_layer_name)\n layer_loc_path = path_join(current_layer_path, \"location\")\n layer_class_path = path_join(current_layer_path, \"class\")\n counter += 1\n\n # Fill in the config\n if swap_location:\n context.config[current_layer_path] = current_layer_name\n context.config[layer_loc_path] = swap_location\n context.config[layer_class_path] = 'volatility.framework.layers.physical.FileLayer'\n\n # Add the requirement\n new_req = requirements.TranslationLayerRequirement(name = current_layer_name,\n description = \"Swap Layer\",\n optional = False)\n swap_req.add_requirement(new_req)\n\n context.config[path_join(swap_sub_config, 'number_of_elements')] = counter\n context.config[swap_sub_config] = True\n\n swap_req.construct(context, swap_config)","function_tokens":["def","__call__","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","requirement",":","interfaces",".","configuration",".","RequirementInterface",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","None",":","path_join","=","interfaces",".","configuration",".","path_join","self",".","_translation_requirement","=","self",".","find_requirements","(","context",",","config_path",",","requirement",",","requirements",".","TranslationLayerRequirement",",","shortcut","=","False",")","for","trans_sub_config",",","trans_req","in","self",".","_translation_requirement",":","if","not","isinstance","(","trans_req",",","requirements",".","TranslationLayerRequirement",")",":","# We need this so the type-checker knows we're a TranslationLayerRequirement","continue","swap_sub_config",",","swap_req","=","self",".","find_swap_requirement","(","trans_sub_config",",","trans_req",")","counter","=","0","swap_config","=","interfaces",".","configuration",".","parent_path","(","swap_sub_config",")","if","swap_req","and","swap_req",".","unsatisfied","(","context",",","swap_config",")",":","# See if any of them need constructing","for","swap_location","in","self",".","config",".","get","(","'single_swap_locations'",",","[","]",")",":","# Setup config locations\/paths","current_layer_name","=","swap_req",".","name","+","str","(","counter",")","current_layer_path","=","path_join","(","swap_sub_config",",","current_layer_name",")","layer_loc_path","=","path_join","(","current_layer_path",",","\"location\"",")","layer_class_path","=","path_join","(","current_layer_path",",","\"class\"",")","counter","+=","1","# Fill in the config","if","swap_location",":","context",".","config","[","current_layer_path","]","=","current_layer_name","context",".","config","[","layer_loc_path","]","=","swap_location","context",".","config","[","layer_class_path","]","=","'volatility.framework.layers.physical.FileLayer'","# Add the requirement","new_req","=","requirements",".","TranslationLayerRequirement","(","name","=","current_layer_name",",","description","=","\"Swap Layer\"",",","optional","=","False",")","swap_req",".","add_requirement","(","new_req",")","context",".","config","[","path_join","(","swap_sub_config",",","'number_of_elements'",")","]","=","counter","context",".","config","[","swap_sub_config","]","=","True","swap_req",".","construct","(","context",",","swap_config",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py#L385-L430"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py","language":"python","identifier":"WinSwapLayers.find_swap_requirement","parameters":"(config: str,\n requirement: requirements.TranslationLayerRequirement)","argument_list":"","return_statement":"return swap_config, swap_req","docstring":"Takes a Translation layer and returns its swap_layer requirement.","docstring_summary":"Takes a Translation layer and returns its swap_layer requirement.","docstring_tokens":["Takes","a","Translation","layer","and","returns","its","swap_layer","requirement","."],"function":"def find_swap_requirement(config: str,\n requirement: requirements.TranslationLayerRequirement) \\\n -> Tuple[str, Optional[requirements.LayerListRequirement]]:\n \"\"\"Takes a Translation layer and returns its swap_layer requirement.\"\"\"\n swap_req = None\n for req_name in requirement.requirements:\n req = requirement.requirements[req_name]\n if isinstance(req, requirements.LayerListRequirement) and req.name == 'swap_layers':\n swap_req = req\n continue\n\n swap_config = interfaces.configuration.path_join(config, 'swap_layers')\n return swap_config, swap_req","function_tokens":["def","find_swap_requirement","(","config",":","str",",","requirement",":","requirements",".","TranslationLayerRequirement",")","->","Tuple","[","str",",","Optional","[","requirements",".","LayerListRequirement","]","]",":","swap_req","=","None","for","req_name","in","requirement",".","requirements",":","req","=","requirement",".","requirements","[","req_name","]","if","isinstance","(","req",",","requirements",".","LayerListRequirement",")","and","req",".","name","==","'swap_layers'",":","swap_req","=","req","continue","swap_config","=","interfaces",".","configuration",".","path_join","(","config",",","'swap_layers'",")","return","swap_config",",","swap_req"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py#L433-L445"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py","language":"python","identifier":"WinSwapLayers.get_requirements","parameters":"(cls)","argument_list":"","return_statement":"return [\n requirements.ListRequirement(\n name = \"single_swap_locations\",\n element_type = str,\n min_elements = 0,\n max_elements = 16,\n description = \"Specifies a list of swap layer URIs for use with single-location\",\n optional = True)\n ]","docstring":"Returns the requirements of this plugin.","docstring_summary":"Returns the requirements of this plugin.","docstring_tokens":["Returns","the","requirements","of","this","plugin","."],"function":"def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]:\n \"\"\"Returns the requirements of this plugin.\"\"\"\n return [\n requirements.ListRequirement(\n name = \"single_swap_locations\",\n element_type = str,\n min_elements = 0,\n max_elements = 16,\n description = \"Specifies a list of swap layer URIs for use with single-location\",\n optional = True)\n ]","function_tokens":["def","get_requirements","(","cls",")","->","List","[","interfaces",".","configuration",".","RequirementInterface","]",":","return","[","requirements",".","ListRequirement","(","name","=","\"single_swap_locations\"",",","element_type","=","str",",","min_elements","=","0",",","max_elements","=","16",",","description","=","\"Specifies a list of swap layer URIs for use with single-location\"",",","optional","=","True",")","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/windows.py#L448-L458"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/linux.py","language":"python","identifier":"LinuxIntelStacker.stack","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return None","docstring":"Attempts to identify linux within this layer.","docstring_summary":"Attempts to identify linux within this layer.","docstring_tokens":["Attempts","to","identify","linux","within","this","layer","."],"function":"def stack(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None) -> Optional[interfaces.layers.DataLayerInterface]:\n \"\"\"Attempts to identify linux within this layer.\"\"\"\n # Bail out by default unless we can stack properly\n layer = context.layers[layer_name]\n join = interfaces.configuration.path_join\n\n # Never stack on top of an intel layer\n # FIXME: Find a way to improve this check\n if isinstance(layer, intel.Intel):\n return None\n\n linux_banners = LinuxBannerCache.load_banners()\n # If we have no banners, don't bother scanning\n if not linux_banners:\n vollog.info(\"No Linux banners found - if this is a linux plugin, please check your symbol files location\")\n return None\n\n mss = scanners.MultiStringScanner([x for x in linux_banners if x is not None])\n for _, banner in layer.scan(context = context, scanner = mss, progress_callback = progress_callback):\n dtb = None\n vollog.debug(\"Identified banner: {}\".format(repr(banner)))\n\n symbol_files = linux_banners.get(banner, None)\n if symbol_files:\n isf_path = symbol_files[0]\n table_name = context.symbol_space.free_table_name('LintelStacker')\n table = linux.LinuxKernelIntermedSymbols(context,\n 'temporary.' + table_name,\n name = table_name,\n isf_url = isf_path)\n context.symbol_space.append(table)\n kaslr_shift, aslr_shift = cls.find_aslr(context,\n table_name,\n layer_name,\n progress_callback = progress_callback)\n\n layer_class = intel.Intel # type: Type\n if 'init_top_pgt' in table.symbols:\n layer_class = intel.Intel32e\n dtb_symbol_name = 'init_top_pgt'\n elif 'init_level4_pgt' in table.symbols:\n layer_class = intel.Intel32e\n dtb_symbol_name = 'init_level4_pgt'\n else:\n dtb_symbol_name = 'swapper_pg_dir'\n\n dtb = cls.virtual_to_physical_address(table.get_symbol(dtb_symbol_name).address + kaslr_shift)\n\n # Build the new layer\n new_layer_name = context.layers.free_layer_name(\"IntelLayer\")\n config_path = join(\"IntelHelper\", new_layer_name)\n context.config[join(config_path, \"memory_layer\")] = layer_name\n context.config[join(config_path, \"page_map_offset\")] = dtb\n context.config[join(config_path, LinuxSymbolFinder.banner_config_key)] = str(banner, 'latin-1')\n\n layer = layer_class(context,\n config_path = config_path,\n name = new_layer_name,\n metadata = {'kaslr_value': aslr_shift})\n\n if layer and dtb:\n vollog.debug(\"DTB was found at: 0x{:0x}\".format(dtb))\n return layer\n return None","function_tokens":["def","stack","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","Optional","[","interfaces",".","layers",".","DataLayerInterface","]",":","# Bail out by default unless we can stack properly","layer","=","context",".","layers","[","layer_name","]","join","=","interfaces",".","configuration",".","path_join","# Never stack on top of an intel layer","# FIXME: Find a way to improve this check","if","isinstance","(","layer",",","intel",".","Intel",")",":","return","None","linux_banners","=","LinuxBannerCache",".","load_banners","(",")","# If we have no banners, don't bother scanning","if","not","linux_banners",":","vollog",".","info","(","\"No Linux banners found - if this is a linux plugin, please check your symbol files location\"",")","return","None","mss","=","scanners",".","MultiStringScanner","(","[","x","for","x","in","linux_banners","if","x","is","not","None","]",")","for","_",",","banner","in","layer",".","scan","(","context","=","context",",","scanner","=","mss",",","progress_callback","=","progress_callback",")",":","dtb","=","None","vollog",".","debug","(","\"Identified banner: {}\"",".","format","(","repr","(","banner",")",")",")","symbol_files","=","linux_banners",".","get","(","banner",",","None",")","if","symbol_files",":","isf_path","=","symbol_files","[","0","]","table_name","=","context",".","symbol_space",".","free_table_name","(","'LintelStacker'",")","table","=","linux",".","LinuxKernelIntermedSymbols","(","context",",","'temporary.'","+","table_name",",","name","=","table_name",",","isf_url","=","isf_path",")","context",".","symbol_space",".","append","(","table",")","kaslr_shift",",","aslr_shift","=","cls",".","find_aslr","(","context",",","table_name",",","layer_name",",","progress_callback","=","progress_callback",")","layer_class","=","intel",".","Intel","# type: Type","if","'init_top_pgt'","in","table",".","symbols",":","layer_class","=","intel",".","Intel32e","dtb_symbol_name","=","'init_top_pgt'","elif","'init_level4_pgt'","in","table",".","symbols",":","layer_class","=","intel",".","Intel32e","dtb_symbol_name","=","'init_level4_pgt'","else",":","dtb_symbol_name","=","'swapper_pg_dir'","dtb","=","cls",".","virtual_to_physical_address","(","table",".","get_symbol","(","dtb_symbol_name",")",".","address","+","kaslr_shift",")","# Build the new layer","new_layer_name","=","context",".","layers",".","free_layer_name","(","\"IntelLayer\"",")","config_path","=","join","(","\"IntelHelper\"",",","new_layer_name",")","context",".","config","[","join","(","config_path",",","\"memory_layer\"",")","]","=","layer_name","context",".","config","[","join","(","config_path",",","\"page_map_offset\"",")","]","=","dtb","context",".","config","[","join","(","config_path",",","LinuxSymbolFinder",".","banner_config_key",")","]","=","str","(","banner",",","'latin-1'",")","layer","=","layer_class","(","context",",","config_path","=","config_path",",","name","=","new_layer_name",",","metadata","=","{","'kaslr_value'",":","aslr_shift","}",")","if","layer","and","dtb",":","vollog",".","debug","(","\"DTB was found at: 0x{:0x}\"",".","format","(","dtb",")",")","return","layer","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/linux.py#L21-L87"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/linux.py","language":"python","identifier":"LinuxIntelStacker.find_aslr","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n symbol_table: str,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return 0, 0","docstring":"Determines the offset of the actual DTB in physical space and its\n symbol offset.","docstring_summary":"Determines the offset of the actual DTB in physical space and its\n symbol offset.","docstring_tokens":["Determines","the","offset","of","the","actual","DTB","in","physical","space","and","its","symbol","offset","."],"function":"def find_aslr(cls,\n context: interfaces.context.ContextInterface,\n symbol_table: str,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None) \\\n -> Tuple[int, int]:\n \"\"\"Determines the offset of the actual DTB in physical space and its\n symbol offset.\"\"\"\n init_task_symbol = symbol_table + constants.BANG + 'init_task'\n init_task_json_address = context.symbol_space.get_symbol(init_task_symbol).address\n swapper_signature = rb\"swapper(\\\/0|\\x00\\x00)\\x00\\x00\\x00\\x00\\x00\\x00\"\n module = context.module(symbol_table, layer_name, 0)\n address_mask = context.symbol_space[symbol_table].config.get('symbol_mask', None)\n\n task_symbol = module.get_type('task_struct')\n comm_child_offset = task_symbol.relative_child_offset('comm')\n\n for offset in context.layers[layer_name].scan(scanner = scanners.RegExScanner(swapper_signature),\n context = context,\n progress_callback = progress_callback):\n init_task_address = offset - comm_child_offset\n init_task = module.object(object_type = 'task_struct', offset = init_task_address, absolute = True)\n if init_task.pid != 0:\n continue\n elif init_task.has_member('state') and init_task.state.cast('unsigned int') != 0:\n continue\n\n # This we get for free\n aslr_shift = init_task.files.cast('long unsigned int') - module.get_symbol('init_files').address\n kaslr_shift = init_task_address - cls.virtual_to_physical_address(init_task_json_address)\n if address_mask:\n aslr_shift = aslr_shift & address_mask\n\n if aslr_shift & 0xfff != 0 or kaslr_shift & 0xfff != 0:\n continue\n vollog.debug(\"Linux ASLR shift values determined: physical {:0x} virtual {:0x}\".format(\n kaslr_shift, aslr_shift))\n return kaslr_shift, aslr_shift\n\n # We don't throw an exception, because we may legitimately not have an ASLR shift, but we report it\n vollog.debug(\"Scanners could not determine any ASLR shifts, using 0 for both\")\n return 0, 0","function_tokens":["def","find_aslr","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","symbol_table",":","str",",","layer_name",":","str",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","Tuple","[","int",",","int","]",":","init_task_symbol","=","symbol_table","+","constants",".","BANG","+","'init_task'","init_task_json_address","=","context",".","symbol_space",".","get_symbol","(","init_task_symbol",")",".","address","swapper_signature","=","rb\"swapper(\\\/0|\\x00\\x00)\\x00\\x00\\x00\\x00\\x00\\x00\"","module","=","context",".","module","(","symbol_table",",","layer_name",",","0",")","address_mask","=","context",".","symbol_space","[","symbol_table","]",".","config",".","get","(","'symbol_mask'",",","None",")","task_symbol","=","module",".","get_type","(","'task_struct'",")","comm_child_offset","=","task_symbol",".","relative_child_offset","(","'comm'",")","for","offset","in","context",".","layers","[","layer_name","]",".","scan","(","scanner","=","scanners",".","RegExScanner","(","swapper_signature",")",",","context","=","context",",","progress_callback","=","progress_callback",")",":","init_task_address","=","offset","-","comm_child_offset","init_task","=","module",".","object","(","object_type","=","'task_struct'",",","offset","=","init_task_address",",","absolute","=","True",")","if","init_task",".","pid","!=","0",":","continue","elif","init_task",".","has_member","(","'state'",")","and","init_task",".","state",".","cast","(","'unsigned int'",")","!=","0",":","continue","# This we get for free","aslr_shift","=","init_task",".","files",".","cast","(","'long unsigned int'",")","-","module",".","get_symbol","(","'init_files'",")",".","address","kaslr_shift","=","init_task_address","-","cls",".","virtual_to_physical_address","(","init_task_json_address",")","if","address_mask",":","aslr_shift","=","aslr_shift","&","address_mask","if","aslr_shift","&","0xfff","!=","0","or","kaslr_shift","&","0xfff","!=","0",":","continue","vollog",".","debug","(","\"Linux ASLR shift values determined: physical {:0x} virtual {:0x}\"",".","format","(","kaslr_shift",",","aslr_shift",")",")","return","kaslr_shift",",","aslr_shift","# We don't throw an exception, because we may legitimately not have an ASLR shift, but we report it","vollog",".","debug","(","\"Scanners could not determine any ASLR shifts, using 0 for both\"",")","return","0",",","0"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/linux.py#L90-L131"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/linux.py","language":"python","identifier":"LinuxIntelStacker.virtual_to_physical_address","parameters":"(cls, addr: int)","argument_list":"","return_statement":"return addr - 0xc0000000","docstring":"Converts a virtual linux address to a physical one (does not account\n of ASLR)","docstring_summary":"Converts a virtual linux address to a physical one (does not account\n of ASLR)","docstring_tokens":["Converts","a","virtual","linux","address","to","a","physical","one","(","does","not","account","of","ASLR",")"],"function":"def virtual_to_physical_address(cls, addr: int) -> int:\n \"\"\"Converts a virtual linux address to a physical one (does not account\n of ASLR)\"\"\"\n if addr > 0xffffffff80000000:\n return addr - 0xffffffff80000000\n return addr - 0xc0000000","function_tokens":["def","virtual_to_physical_address","(","cls",",","addr",":","int",")","->","int",":","if","addr",">","0xffffffff80000000",":","return","addr","-","0xffffffff80000000","return","addr","-","0xc0000000"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/linux.py#L134-L139"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/symbol_cache.py","language":"python","identifier":"SymbolBannerCache.__call__","parameters":"(self, context, config_path, configurable, progress_callback = None)","argument_list":"","return_statement":"","docstring":"Runs the automagic over the configurable.","docstring_summary":"Runs the automagic over the configurable.","docstring_tokens":["Runs","the","automagic","over","the","configurable","."],"function":"def __call__(self, context, config_path, configurable, progress_callback = None):\n \"\"\"Runs the automagic over the configurable.\"\"\"\n\n # Bomb out if we're just the generic interface\n if self.os is None:\n return\n\n # We only need to be called once, so no recursion necessary\n banners = self.load_banners()\n\n cacheables = list(intermed.IntermediateSymbolTable.file_symbol_url(self.os))\n\n for banner in banners:\n for json_file in banners[banner]:\n if json_file in cacheables:\n cacheables.remove(json_file)\n\n total = len(cacheables)\n if total > 0:\n vollog.info(\"Building {} caches...\".format(self.os))\n for current in range(total):\n if progress_callback is not None:\n progress_callback(current * 100 \/ total, \"Building {} caches\".format(self.os))\n isf_url = cacheables[current]\n\n isf = None\n try:\n # Loading the symbol table will be very slow until it's been validated\n isf = intermed.IntermediateSymbolTable(context, config_path, \"temp\", isf_url, validate = False)\n\n # We should store the banner against the filename\n # We don't bother with the hash (it'll likely take too long to validate)\n # but we should check at least that the banner matches on load.\n banner = isf.get_symbol(self.symbol_name).constant_data\n vollog.log(constants.LOGLEVEL_VV, \"Caching banner {} for file {}\".format(banner, isf_url))\n\n bannerlist = banners.get(banner, [])\n bannerlist.append(isf_url)\n banners[banner] = bannerlist\n except exceptions.SymbolError:\n pass\n except json.JSONDecodeError:\n vollog.log(constants.LOGLEVEL_VV, \"Caching file {} failed due to JSON error\".format(isf_url))\n finally:\n # Get rid of the loaded file, in case it sits in memory\n if isf:\n del isf\n gc.collect()\n\n # Rewrite the cached banners each run, since writing is faster than the banner_cache validation portion\n self.save_banners(banners)\n\n if progress_callback is not None:\n progress_callback(100, \"Built {} caches\".format(self.os))","function_tokens":["def","__call__","(","self",",","context",",","config_path",",","configurable",",","progress_callback","=","None",")",":","# Bomb out if we're just the generic interface","if","self",".","os","is","None",":","return","# We only need to be called once, so no recursion necessary","banners","=","self",".","load_banners","(",")","cacheables","=","list","(","intermed",".","IntermediateSymbolTable",".","file_symbol_url","(","self",".","os",")",")","for","banner","in","banners",":","for","json_file","in","banners","[","banner","]",":","if","json_file","in","cacheables",":","cacheables",".","remove","(","json_file",")","total","=","len","(","cacheables",")","if","total",">","0",":","vollog",".","info","(","\"Building {} caches...\"",".","format","(","self",".","os",")",")","for","current","in","range","(","total",")",":","if","progress_callback","is","not","None",":","progress_callback","(","current","*","100","\/","total",",","\"Building {} caches\"",".","format","(","self",".","os",")",")","isf_url","=","cacheables","[","current","]","isf","=","None","try",":","# Loading the symbol table will be very slow until it's been validated","isf","=","intermed",".","IntermediateSymbolTable","(","context",",","config_path",",","\"temp\"",",","isf_url",",","validate","=","False",")","# We should store the banner against the filename","# We don't bother with the hash (it'll likely take too long to validate)","# but we should check at least that the banner matches on load.","banner","=","isf",".","get_symbol","(","self",".","symbol_name",")",".","constant_data","vollog",".","log","(","constants",".","LOGLEVEL_VV",",","\"Caching banner {} for file {}\"",".","format","(","banner",",","isf_url",")",")","bannerlist","=","banners",".","get","(","banner",",","[","]",")","bannerlist",".","append","(","isf_url",")","banners","[","banner","]","=","bannerlist","except","exceptions",".","SymbolError",":","pass","except","json",".","JSONDecodeError",":","vollog",".","log","(","constants",".","LOGLEVEL_VV",",","\"Caching file {} failed due to JSON error\"",".","format","(","isf_url",")",")","finally",":","# Get rid of the loaded file, in case it sits in memory","if","isf",":","del","isf","gc",".","collect","(",")","# Rewrite the cached banners each run, since writing is faster than the banner_cache validation portion","self",".","save_banners","(","banners",")","if","progress_callback","is","not","None",":","progress_callback","(","100",",","\"Built {} caches\"",".","format","(","self",".","os",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/symbol_cache.py#L74-L127"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/mac.py","language":"python","identifier":"MacIntelStacker.stack","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return None","docstring":"Attempts to identify mac within this layer.","docstring_summary":"Attempts to identify mac within this layer.","docstring_tokens":["Attempts","to","identify","mac","within","this","layer","."],"function":"def stack(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None) -> Optional[interfaces.layers.DataLayerInterface]:\n \"\"\"Attempts to identify mac within this layer.\"\"\"\n # Bail out by default unless we can stack properly\n layer = context.layers[layer_name]\n new_layer = None\n join = interfaces.configuration.path_join\n\n # Never stack on top of an intel layer\n # FIXME: Find a way to improve this check\n if isinstance(layer, intel.Intel):\n return None\n\n mac_banners = MacBannerCache.load_banners()\n # If we have no banners, don't bother scanning\n if not mac_banners:\n vollog.info(\"No Mac banners found - if this is a mac plugin, please check your symbol files location\")\n return None\n\n mss = scanners.MultiStringScanner([x for x in mac_banners if x])\n for banner_offset, banner in layer.scan(context = context, scanner = mss,\n progress_callback = progress_callback):\n dtb = None\n\n symbol_files = mac_banners.get(banner, None)\n if symbol_files:\n isf_path = symbol_files[0]\n table_name = context.symbol_space.free_table_name('MacintelStacker')\n table = mac.MacKernelIntermedSymbols(context = context,\n config_path = join('temporary', table_name),\n name = table_name,\n isf_url = isf_path)\n context.symbol_space.append(table)\n kaslr_shift = cls.find_aslr(context = context,\n symbol_table = table_name,\n layer_name = layer_name,\n compare_banner = banner,\n compare_banner_offset = banner_offset,\n progress_callback = progress_callback)\n\n if kaslr_shift == 0:\n vollog.log(constants.LOGLEVEL_VVV, \"Invalid kalsr_shift found at offset: {}\".format(banner_offset))\n continue\n\n bootpml4_addr = cls.virtual_to_physical_address(table.get_symbol(\"BootPML4\").address + kaslr_shift)\n\n new_layer_name = context.layers.free_layer_name(\"MacDTBTempLayer\")\n config_path = join(\"automagic\", \"MacIntelHelper\", new_layer_name)\n context.config[join(config_path, \"memory_layer\")] = layer_name\n context.config[join(config_path, \"page_map_offset\")] = bootpml4_addr\n\n layer = layers.intel.Intel32e(context,\n config_path = config_path,\n name = new_layer_name,\n metadata = {'os': 'Mac'})\n\n idlepml4_ptr = table.get_symbol(\"IdlePML4\").address + kaslr_shift\n idlepml4_str = layer.read(idlepml4_ptr, 4)\n idlepml4_addr = struct.unpack(\"","Optional","[","interfaces",".","layers",".","DataLayerInterface","]",":","# Bail out by default unless we can stack properly","layer","=","context",".","layers","[","layer_name","]","new_layer","=","None","join","=","interfaces",".","configuration",".","path_join","# Never stack on top of an intel layer","# FIXME: Find a way to improve this check","if","isinstance","(","layer",",","intel",".","Intel",")",":","return","None","mac_banners","=","MacBannerCache",".","load_banners","(",")","# If we have no banners, don't bother scanning","if","not","mac_banners",":","vollog",".","info","(","\"No Mac banners found - if this is a mac plugin, please check your symbol files location\"",")","return","None","mss","=","scanners",".","MultiStringScanner","(","[","x","for","x","in","mac_banners","if","x","]",")","for","banner_offset",",","banner","in","layer",".","scan","(","context","=","context",",","scanner","=","mss",",","progress_callback","=","progress_callback",")",":","dtb","=","None","symbol_files","=","mac_banners",".","get","(","banner",",","None",")","if","symbol_files",":","isf_path","=","symbol_files","[","0","]","table_name","=","context",".","symbol_space",".","free_table_name","(","'MacintelStacker'",")","table","=","mac",".","MacKernelIntermedSymbols","(","context","=","context",",","config_path","=","join","(","'temporary'",",","table_name",")",",","name","=","table_name",",","isf_url","=","isf_path",")","context",".","symbol_space",".","append","(","table",")","kaslr_shift","=","cls",".","find_aslr","(","context","=","context",",","symbol_table","=","table_name",",","layer_name","=","layer_name",",","compare_banner","=","banner",",","compare_banner_offset","=","banner_offset",",","progress_callback","=","progress_callback",")","if","kaslr_shift","==","0",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Invalid kalsr_shift found at offset: {}\"",".","format","(","banner_offset",")",")","continue","bootpml4_addr","=","cls",".","virtual_to_physical_address","(","table",".","get_symbol","(","\"BootPML4\"",")",".","address","+","kaslr_shift",")","new_layer_name","=","context",".","layers",".","free_layer_name","(","\"MacDTBTempLayer\"",")","config_path","=","join","(","\"automagic\"",",","\"MacIntelHelper\"",",","new_layer_name",")","context",".","config","[","join","(","config_path",",","\"memory_layer\"",")","]","=","layer_name","context",".","config","[","join","(","config_path",",","\"page_map_offset\"",")","]","=","bootpml4_addr","layer","=","layers",".","intel",".","Intel32e","(","context",",","config_path","=","config_path",",","name","=","new_layer_name",",","metadata","=","{","'os'",":","'Mac'","}",")","idlepml4_ptr","=","table",".","get_symbol","(","\"IdlePML4\"",")",".","address","+","kaslr_shift","idlepml4_str","=","layer",".","read","(","idlepml4_ptr",",","4",")","idlepml4_addr","=","struct",".","unpack","(","\" int:\n \"\"\"Determines the offset of the actual DTB in physical space and its\n symbol offset.\"\"\"\n version_symbol = symbol_table + constants.BANG + 'version'\n version_json_address = context.symbol_space.get_symbol(version_symbol).address\n\n version_major_symbol = symbol_table + constants.BANG + 'version_major'\n version_major_json_address = context.symbol_space.get_symbol(version_major_symbol).address\n version_major_phys_offset = cls.virtual_to_physical_address(version_major_json_address)\n\n version_minor_symbol = symbol_table + constants.BANG + 'version_minor'\n version_minor_json_address = context.symbol_space.get_symbol(version_minor_symbol).address\n version_minor_phys_offset = cls.virtual_to_physical_address(version_minor_json_address)\n\n if not compare_banner_offset or not compare_banner:\n offset_generator = cls._scan_generator(context, layer_name, progress_callback)\n else:\n offset_generator = [(compare_banner_offset, compare_banner)]\n\n aslr_shift = 0\n\n for offset, banner in offset_generator:\n banner_major, banner_minor = [int(x) for x in banner[22:].split(b\".\")[0:2]]\n\n tmp_aslr_shift = offset - cls.virtual_to_physical_address(version_json_address)\n\n major_string = context.layers[layer_name].read(version_major_phys_offset + tmp_aslr_shift, 4)\n major = struct.unpack(\"","int",":","version_symbol","=","symbol_table","+","constants",".","BANG","+","'version'","version_json_address","=","context",".","symbol_space",".","get_symbol","(","version_symbol",")",".","address","version_major_symbol","=","symbol_table","+","constants",".","BANG","+","'version_major'","version_major_json_address","=","context",".","symbol_space",".","get_symbol","(","version_major_symbol",")",".","address","version_major_phys_offset","=","cls",".","virtual_to_physical_address","(","version_major_json_address",")","version_minor_symbol","=","symbol_table","+","constants",".","BANG","+","'version_minor'","version_minor_json_address","=","context",".","symbol_space",".","get_symbol","(","version_minor_symbol",")",".","address","version_minor_phys_offset","=","cls",".","virtual_to_physical_address","(","version_minor_json_address",")","if","not","compare_banner_offset","or","not","compare_banner",":","offset_generator","=","cls",".","_scan_generator","(","context",",","layer_name",",","progress_callback",")","else",":","offset_generator","=","[","(","compare_banner_offset",",","compare_banner",")","]","aslr_shift","=","0","for","offset",",","banner","in","offset_generator",":","banner_major",",","banner_minor","=","[","int","(","x",")","for","x","in","banner","[","22",":","]",".","split","(","b\".\"",")","[","0",":","2","]","]","tmp_aslr_shift","=","offset","-","cls",".","virtual_to_physical_address","(","version_json_address",")","major_string","=","context",".","layers","[","layer_name","]",".","read","(","version_major_phys_offset","+","tmp_aslr_shift",",","4",")","major","=","struct",".","unpack","(","\" int:\n \"\"\"Converts a virtual mac address to a physical one (does not account\n of ASLR)\"\"\"\n if addr > 0xffffff8000000000:\n addr = addr - 0xffffff8000000000\n else:\n addr = addr - 0xff8000000000\n\n return addr","function_tokens":["def","virtual_to_physical_address","(","cls",",","addr",":","int",")","->","int",":","if","addr",">","0xffffff8000000000",":","addr","=","addr","-","0xffffff8000000000","else",":","addr","=","addr","-","0xff8000000000","return","addr"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/mac.py#L166-L174"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/symbol_finder.py","language":"python","identifier":"SymbolFinder.banners","parameters":"(self)","argument_list":"","return_statement":"return self._banners","docstring":"Creates a cached copy of the results, but only it's been\n requested.","docstring_summary":"Creates a cached copy of the results, but only it's been\n requested.","docstring_tokens":["Creates","a","cached","copy","of","the","results","but","only","it","s","been","requested","."],"function":"def banners(self) -> symbol_cache.BannersType:\n \"\"\"Creates a cached copy of the results, but only it's been\n requested.\"\"\"\n if not self._banners:\n if not self.banner_cache:\n raise RuntimeError(\"Cache has not been properly defined for {}\".format(self.__class__.__name__))\n self._banners = self.banner_cache.load_banners()\n return self._banners","function_tokens":["def","banners","(","self",")","->","symbol_cache",".","BannersType",":","if","not","self",".","_banners",":","if","not","self",".","banner_cache",":","raise","RuntimeError","(","\"Cache has not been properly defined for {}\"",".","format","(","self",".","__class__",".","__name__",")",")","self",".","_banners","=","self",".","banner_cache",".","load_banners","(",")","return","self",".","_banners"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/symbol_finder.py#L31-L38"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/symbol_finder.py","language":"python","identifier":"SymbolFinder.__call__","parameters":"(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"","docstring":"Searches for SymbolTableRequirements and attempt to populate\n them.","docstring_summary":"Searches for SymbolTableRequirements and attempt to populate\n them.","docstring_tokens":["Searches","for","SymbolTableRequirements","and","attempt","to","populate","them","."],"function":"def __call__(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n progress_callback: constants.ProgressCallback = None) -> None:\n \"\"\"Searches for SymbolTableRequirements and attempt to populate\n them.\"\"\"\n\n # Bomb out early if our details haven't been configured\n if self.symbol_class is None:\n return\n\n self._requirements = self.find_requirements(\n context,\n config_path,\n requirement, (requirements.TranslationLayerRequirement, requirements.SymbolTableRequirement),\n shortcut = False)\n\n for (sub_path, requirement) in self._requirements:\n parent_path = interfaces.configuration.parent_path(sub_path)\n\n if (isinstance(requirement, requirements.SymbolTableRequirement)\n and requirement.unsatisfied(context, parent_path)):\n for (tl_sub_path, tl_requirement) in self._requirements:\n tl_parent_path = interfaces.configuration.parent_path(tl_sub_path)\n # Find the TranslationLayer sibling to the SymbolTableRequirement\n if (isinstance(tl_requirement, requirements.TranslationLayerRequirement)\n and tl_parent_path == parent_path):\n if context.config.get(tl_sub_path, None):\n self._banner_scan(context, parent_path, requirement, context.config[tl_sub_path],\n progress_callback)\n break","function_tokens":["def","__call__","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","requirement",":","interfaces",".","configuration",".","RequirementInterface",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","None",":","# Bomb out early if our details haven't been configured","if","self",".","symbol_class","is","None",":","return","self",".","_requirements","=","self",".","find_requirements","(","context",",","config_path",",","requirement",",","(","requirements",".","TranslationLayerRequirement",",","requirements",".","SymbolTableRequirement",")",",","shortcut","=","False",")","for","(","sub_path",",","requirement",")","in","self",".","_requirements",":","parent_path","=","interfaces",".","configuration",".","parent_path","(","sub_path",")","if","(","isinstance","(","requirement",",","requirements",".","SymbolTableRequirement",")","and","requirement",".","unsatisfied","(","context",",","parent_path",")",")",":","for","(","tl_sub_path",",","tl_requirement",")","in","self",".","_requirements",":","tl_parent_path","=","interfaces",".","configuration",".","parent_path","(","tl_sub_path",")","# Find the TranslationLayer sibling to the SymbolTableRequirement","if","(","isinstance","(","tl_requirement",",","requirements",".","TranslationLayerRequirement",")","and","tl_parent_path","==","parent_path",")",":","if","context",".","config",".","get","(","tl_sub_path",",","None",")",":","self",".","_banner_scan","(","context",",","parent_path",",","requirement",",","context",".","config","[","tl_sub_path","]",",","progress_callback",")","break"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/symbol_finder.py#L40-L71"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/symbol_finder.py","language":"python","identifier":"SymbolFinder._banner_scan","parameters":"(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement: interfaces.configuration.ConstructableRequirementInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"","docstring":"Accepts a context, config_path and SymbolTableRequirement, with a\n constructed layer_name and scans the layer for banners.","docstring_summary":"Accepts a context, config_path and SymbolTableRequirement, with a\n constructed layer_name and scans the layer for banners.","docstring_tokens":["Accepts","a","context","config_path","and","SymbolTableRequirement","with","a","constructed","layer_name","and","scans","the","layer","for","banners","."],"function":"def _banner_scan(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement: interfaces.configuration.ConstructableRequirementInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None) -> None:\n \"\"\"Accepts a context, config_path and SymbolTableRequirement, with a\n constructed layer_name and scans the layer for banners.\"\"\"\n\n # Bomb out early if there's no banners\n if not self.banners:\n return\n\n mss = scanners.MultiStringScanner([x for x in self.banners if x is not None])\n\n layer = context.layers[layer_name]\n\n # Check if the Stacker has already found what we're looking for\n if layer.config.get(self.banner_config_key, None):\n banner_list = [(0, bytes(layer.config[self.banner_config_key],\n 'raw_unicode_escape'))] # type: Iterable[Any]\n else:\n # Swap to the physical layer for scanning\n # TODO: Fix this so it works for layers other than just Intel\n layer = context.layers[layer.config['memory_layer']]\n banner_list = layer.scan(context = context, scanner = mss, progress_callback = progress_callback)\n\n for _, banner in banner_list:\n vollog.debug(\"Identified banner: {}\".format(repr(banner)))\n symbol_files = self.banners.get(banner, None)\n if symbol_files:\n isf_path = symbol_files[0]\n vollog.debug(\"Using symbol library: {}\".format(symbol_files[0]))\n clazz = self.symbol_class\n # Set the discovered options\n path_join = interfaces.configuration.path_join\n context.config[path_join(config_path, requirement.name, \"class\")] = clazz\n context.config[path_join(config_path, requirement.name, \"isf_url\")] = isf_path\n context.config[path_join(config_path, requirement.name, \"symbol_mask\")] = layer.address_mask\n\n # Set a default symbol_shift when attempt to determine it,\n # so we can create the symbols which are used in finding the aslr_shift anyway\n if not context.config.get(path_join(config_path, requirement.name, \"symbol_shift\"), None):\n # Don't overwrite it if it's already been set, it will be manually refound if not present\n prefound_kaslr_value = context.layers[layer_name].metadata.get('kaslr_value', 0)\n context.config[path_join(config_path, requirement.name, \"symbol_shift\")] = prefound_kaslr_value\n # Construct the appropriate symbol table\n requirement.construct(context, config_path)\n\n # Apply the ASLR masking (only if we're not already shifted)\n if self.find_aslr and not context.config.get(path_join(config_path, requirement.name, \"symbol_shift\"),\n None):\n unmasked_symbol_table_name = context.config.get(path_join(config_path, requirement.name), None)\n if not unmasked_symbol_table_name:\n raise exceptions.SymbolSpaceError(\"Symbol table could not be constructed\")\n if not isinstance(layer, layers.intel.Intel):\n raise TypeError(\"Layer name {} is not an intel space\")\n aslr_shift = self.find_aslr(context, unmasked_symbol_table_name, layer.config['memory_layer'])\n context.config[path_join(config_path, requirement.name, \"symbol_shift\")] = aslr_shift\n context.symbol_space.clear_symbol_cache(unmasked_symbol_table_name)\n\n break\n else:\n if symbol_files:\n vollog.debug(\"Symbol library path not found: {}\".format(symbol_files[0]))\n # print(\"Kernel\", banner, hex(banner_offset))\n else:\n vollog.debug(\"No existing banners found\")","function_tokens":["def","_banner_scan","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","requirement",":","interfaces",".","configuration",".","ConstructableRequirementInterface",",","layer_name",":","str",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","None",":","# Bomb out early if there's no banners","if","not","self",".","banners",":","return","mss","=","scanners",".","MultiStringScanner","(","[","x","for","x","in","self",".","banners","if","x","is","not","None","]",")","layer","=","context",".","layers","[","layer_name","]","# Check if the Stacker has already found what we're looking for","if","layer",".","config",".","get","(","self",".","banner_config_key",",","None",")",":","banner_list","=","[","(","0",",","bytes","(","layer",".","config","[","self",".","banner_config_key","]",",","'raw_unicode_escape'",")",")","]","# type: Iterable[Any]","else",":","# Swap to the physical layer for scanning","# TODO: Fix this so it works for layers other than just Intel","layer","=","context",".","layers","[","layer",".","config","[","'memory_layer'","]","]","banner_list","=","layer",".","scan","(","context","=","context",",","scanner","=","mss",",","progress_callback","=","progress_callback",")","for","_",",","banner","in","banner_list",":","vollog",".","debug","(","\"Identified banner: {}\"",".","format","(","repr","(","banner",")",")",")","symbol_files","=","self",".","banners",".","get","(","banner",",","None",")","if","symbol_files",":","isf_path","=","symbol_files","[","0","]","vollog",".","debug","(","\"Using symbol library: {}\"",".","format","(","symbol_files","[","0","]",")",")","clazz","=","self",".","symbol_class","# Set the discovered options","path_join","=","interfaces",".","configuration",".","path_join","context",".","config","[","path_join","(","config_path",",","requirement",".","name",",","\"class\"",")","]","=","clazz","context",".","config","[","path_join","(","config_path",",","requirement",".","name",",","\"isf_url\"",")","]","=","isf_path","context",".","config","[","path_join","(","config_path",",","requirement",".","name",",","\"symbol_mask\"",")","]","=","layer",".","address_mask","# Set a default symbol_shift when attempt to determine it,","# so we can create the symbols which are used in finding the aslr_shift anyway","if","not","context",".","config",".","get","(","path_join","(","config_path",",","requirement",".","name",",","\"symbol_shift\"",")",",","None",")",":","# Don't overwrite it if it's already been set, it will be manually refound if not present","prefound_kaslr_value","=","context",".","layers","[","layer_name","]",".","metadata",".","get","(","'kaslr_value'",",","0",")","context",".","config","[","path_join","(","config_path",",","requirement",".","name",",","\"symbol_shift\"",")","]","=","prefound_kaslr_value","# Construct the appropriate symbol table","requirement",".","construct","(","context",",","config_path",")","# Apply the ASLR masking (only if we're not already shifted)","if","self",".","find_aslr","and","not","context",".","config",".","get","(","path_join","(","config_path",",","requirement",".","name",",","\"symbol_shift\"",")",",","None",")",":","unmasked_symbol_table_name","=","context",".","config",".","get","(","path_join","(","config_path",",","requirement",".","name",")",",","None",")","if","not","unmasked_symbol_table_name",":","raise","exceptions",".","SymbolSpaceError","(","\"Symbol table could not be constructed\"",")","if","not","isinstance","(","layer",",","layers",".","intel",".","Intel",")",":","raise","TypeError","(","\"Layer name {} is not an intel space\"",")","aslr_shift","=","self",".","find_aslr","(","context",",","unmasked_symbol_table_name",",","layer",".","config","[","'memory_layer'","]",")","context",".","config","[","path_join","(","config_path",",","requirement",".","name",",","\"symbol_shift\"",")","]","=","aslr_shift","context",".","symbol_space",".","clear_symbol_cache","(","unmasked_symbol_table_name",")","break","else",":","if","symbol_files",":","vollog",".","debug","(","\"Symbol library path not found: {}\"",".","format","(","symbol_files","[","0","]",")",")","# print(\"Kernel\", banner, hex(banner_offset))","else",":","vollog",".","debug","(","\"No existing banners found\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/symbol_finder.py#L73-L140"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py","language":"python","identifier":"choose_os_stackers","parameters":"(plugin)","argument_list":"","return_statement":"return result","docstring":"Identifies the stackers that should be run, based on the plugin (and thus os) provided","docstring_summary":"Identifies the stackers that should be run, based on the plugin (and thus os) provided","docstring_tokens":["Identifies","the","stackers","that","should","be","run","based","on","the","plugin","(","and","thus","os",")","provided"],"function":"def choose_os_stackers(plugin):\n \"\"\"Identifies the stackers that should be run, based on the plugin (and thus os) provided\"\"\"\n plugin_first_level = plugin.__module__.split('.')[2]\n\n # Ensure all stackers are loaded\n framework.import_files(sys.modules['volatility.framework.layers'])\n\n result = []\n for stacker in sorted(framework.class_subclasses(interfaces.automagic.StackerLayerInterface),\n key = lambda x: x.stack_order):\n if plugin_first_level in stacker.exclusion_list:\n continue\n result.append(stacker.__name__)\n return result","function_tokens":["def","choose_os_stackers","(","plugin",")",":","plugin_first_level","=","plugin",".","__module__",".","split","(","'.'",")","[","2","]","# Ensure all stackers are loaded","framework",".","import_files","(","sys",".","modules","[","'volatility.framework.layers'","]",")","result","=","[","]","for","stacker","in","sorted","(","framework",".","class_subclasses","(","interfaces",".","automagic",".","StackerLayerInterface",")",",","key","=","lambda","x",":","x",".","stack_order",")",":","if","plugin_first_level","in","stacker",".","exclusion_list",":","continue","result",".","append","(","stacker",".","__name__",")","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py#L248-L261"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py","language":"python","identifier":"LayerStacker.__call__","parameters":"(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return None","docstring":"Runs the automagic over the configurable.","docstring_summary":"Runs the automagic over the configurable.","docstring_tokens":["Runs","the","automagic","over","the","configurable","."],"function":"def __call__(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n progress_callback: constants.ProgressCallback = None) -> Optional[List[str]]:\n \"\"\"Runs the automagic over the configurable.\"\"\"\n\n framework.import_files(sys.modules['volatility.framework.layers'])\n\n # Quick exit if we're not needed\n if not requirement.unsatisfied(context, config_path):\n return None\n\n # Bow out quickly if the UI hasn't provided a single_location\n unsatisfied = self.unsatisfied(self.context, self.config_path)\n if unsatisfied:\n vollog.info(\"Unable to run LayerStacker, unsatisfied requirement: {}\".format(unsatisfied))\n return list(unsatisfied)\n if not self.config or not self.config.get('single_location', None):\n raise ValueError(\"Unable to run LayerStacker, single_location parameter not provided\")\n\n # Search for suitable requirements\n self.stack(context, config_path, requirement, progress_callback)\n\n if progress_callback is not None:\n progress_callback(100, \"Stacking attempts finished\")\n return None","function_tokens":["def","__call__","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","requirement",":","interfaces",".","configuration",".","RequirementInterface",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","Optional","[","List","[","str","]","]",":","framework",".","import_files","(","sys",".","modules","[","'volatility.framework.layers'","]",")","# Quick exit if we're not needed","if","not","requirement",".","unsatisfied","(","context",",","config_path",")",":","return","None","# Bow out quickly if the UI hasn't provided a single_location","unsatisfied","=","self",".","unsatisfied","(","self",".","context",",","self",".","config_path",")","if","unsatisfied",":","vollog",".","info","(","\"Unable to run LayerStacker, unsatisfied requirement: {}\"",".","format","(","unsatisfied",")",")","return","list","(","unsatisfied",")","if","not","self",".","config","or","not","self",".","config",".","get","(","'single_location'",",","None",")",":","raise","ValueError","(","\"Unable to run LayerStacker, single_location parameter not provided\"",")","# Search for suitable requirements","self",".","stack","(","context",",","config_path",",","requirement",",","progress_callback",")","if","progress_callback","is","not","None",":","progress_callback","(","100",",","\"Stacking attempts finished\"",")","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py#L45-L71"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py","language":"python","identifier":"LayerStacker.stack","parameters":"(self, context: interfaces.context.ContextInterface, config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n progress_callback: constants.ProgressCallback)","argument_list":"","return_statement":"","docstring":"Stacks the various layers and attaches these to a specific\n requirement.\n\n Args:\n context: Context on which to operate\n config_path: Configuration path under which to store stacking data\n requirement: Requirement that should have layers stacked on it\n progress_callback: Function to provide callback progress","docstring_summary":"Stacks the various layers and attaches these to a specific\n requirement.","docstring_tokens":["Stacks","the","various","layers","and","attaches","these","to","a","specific","requirement","."],"function":"def stack(self, context: interfaces.context.ContextInterface, config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n progress_callback: constants.ProgressCallback) -> None:\n \"\"\"Stacks the various layers and attaches these to a specific\n requirement.\n\n Args:\n context: Context on which to operate\n config_path: Configuration path under which to store stacking data\n requirement: Requirement that should have layers stacked on it\n progress_callback: Function to provide callback progress\n \"\"\"\n # If we're cached, find Now we need to find where to apply the stack configuration\n if self._cached:\n top_layer_name, subconfig = self._cached\n result = self.find_suitable_requirements(context, config_path, requirement, [top_layer_name])\n if result:\n appropriate_config_path, layer_name = result\n context.config.merge(appropriate_config_path, subconfig)\n context.config[appropriate_config_path] = top_layer_name\n return\n self._cached = None\n\n new_context = context.clone()\n location = self.config.get('single_location', None)\n\n # Setup the local copy of the resource\n current_layer_name = context.layers.free_layer_name(\"FileLayer\")\n current_config_path = interfaces.configuration.path_join(config_path, \"stack\", current_layer_name)\n\n # This must be specific to get us started, setup the config and run\n new_context.config[interfaces.configuration.path_join(current_config_path, \"location\")] = location\n physical_layer = physical.FileLayer(new_context, current_config_path, current_layer_name)\n new_context.add_layer(physical_layer)\n\n stacked_layers = self.stack_layer(new_context, current_layer_name, self.create_stackers_list(),\n progress_callback)\n\n if stacked_layers is not None:\n # Applies the stacked_layers to each requirement in the requirements list\n result = self.find_suitable_requirements(new_context, config_path, requirement, stacked_layers)\n if result:\n path, layer = result\n # splice in the new configuration into the original context\n context.config.merge(path, new_context.layers[layer].build_configuration())\n\n # Call the construction magic now we may have new things to construct\n constructor = construct_layers.ConstructionMagic(\n context, interfaces.configuration.path_join(self.config_path, \"ConstructionMagic\"))\n constructor(context, config_path, requirement)\n\n # Stash the changed config items\n self._cached = context.config.get(path, None), context.config.branch(path)\n vollog.debug(\"Stacked layers: {}\".format(stacked_layers))","function_tokens":["def","stack","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","requirement",":","interfaces",".","configuration",".","RequirementInterface",",","progress_callback",":","constants",".","ProgressCallback",")","->","None",":","# If we're cached, find Now we need to find where to apply the stack configuration","if","self",".","_cached",":","top_layer_name",",","subconfig","=","self",".","_cached","result","=","self",".","find_suitable_requirements","(","context",",","config_path",",","requirement",",","[","top_layer_name","]",")","if","result",":","appropriate_config_path",",","layer_name","=","result","context",".","config",".","merge","(","appropriate_config_path",",","subconfig",")","context",".","config","[","appropriate_config_path","]","=","top_layer_name","return","self",".","_cached","=","None","new_context","=","context",".","clone","(",")","location","=","self",".","config",".","get","(","'single_location'",",","None",")","# Setup the local copy of the resource","current_layer_name","=","context",".","layers",".","free_layer_name","(","\"FileLayer\"",")","current_config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","\"stack\"",",","current_layer_name",")","# This must be specific to get us started, setup the config and run","new_context",".","config","[","interfaces",".","configuration",".","path_join","(","current_config_path",",","\"location\"",")","]","=","location","physical_layer","=","physical",".","FileLayer","(","new_context",",","current_config_path",",","current_layer_name",")","new_context",".","add_layer","(","physical_layer",")","stacked_layers","=","self",".","stack_layer","(","new_context",",","current_layer_name",",","self",".","create_stackers_list","(",")",",","progress_callback",")","if","stacked_layers","is","not","None",":","# Applies the stacked_layers to each requirement in the requirements list","result","=","self",".","find_suitable_requirements","(","new_context",",","config_path",",","requirement",",","stacked_layers",")","if","result",":","path",",","layer","=","result","# splice in the new configuration into the original context","context",".","config",".","merge","(","path",",","new_context",".","layers","[","layer","]",".","build_configuration","(",")",")","# Call the construction magic now we may have new things to construct","constructor","=","construct_layers",".","ConstructionMagic","(","context",",","interfaces",".","configuration",".","path_join","(","self",".","config_path",",","\"ConstructionMagic\"",")",")","constructor","(","context",",","config_path",",","requirement",")","# Stash the changed config items","self",".","_cached","=","context",".","config",".","get","(","path",",","None",")",",","context",".","config",".","branch","(","path",")","vollog",".","debug","(","\"Stacked layers: {}\"",".","format","(","stacked_layers",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py#L73-L126"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py","language":"python","identifier":"LayerStacker.stack_layer","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n initial_layer: str,\n stack_set: List[Type[interfaces.automagic.StackerLayerInterface]] = None,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return stacked_layers","docstring":"Stacks as many possible layers on top of the initial layer as can be done.\n\n WARNING: This modifies the context provided and may pollute it with unnecessary layers\n Recommended use is to:\n 1. Pass in context.clone() instead of context\n 2. When provided the layer list, choose the desired layer\n 3. Build the configuration using layer.build_configuration()\n 4. Merge the configuration into the original context with context.config.merge()\n 5. Call Construction magic to reconstruct the layers from just the configuration\n\n Args:\n context: The context on which to operate\n initial_layer: The name of the initial layer within the context\n stack_set: A list of StackerLayerInterface objects in the order they should be stacked\n progress_callback: A function to report progress during the process\n\n Returns:\n A list of layer names that exist in the provided context, stacked in order (highest to lowest)","docstring_summary":"Stacks as many possible layers on top of the initial layer as can be done.","docstring_tokens":["Stacks","as","many","possible","layers","on","top","of","the","initial","layer","as","can","be","done","."],"function":"def stack_layer(cls,\n context: interfaces.context.ContextInterface,\n initial_layer: str,\n stack_set: List[Type[interfaces.automagic.StackerLayerInterface]] = None,\n progress_callback: constants.ProgressCallback = None):\n \"\"\"Stacks as many possible layers on top of the initial layer as can be done.\n\n WARNING: This modifies the context provided and may pollute it with unnecessary layers\n Recommended use is to:\n 1. Pass in context.clone() instead of context\n 2. When provided the layer list, choose the desired layer\n 3. Build the configuration using layer.build_configuration()\n 4. Merge the configuration into the original context with context.config.merge()\n 5. Call Construction magic to reconstruct the layers from just the configuration\n\n Args:\n context: The context on which to operate\n initial_layer: The name of the initial layer within the context\n stack_set: A list of StackerLayerInterface objects in the order they should be stacked\n progress_callback: A function to report progress during the process\n\n Returns:\n A list of layer names that exist in the provided context, stacked in order (highest to lowest)\n \"\"\"\n # Repeatedly apply \"determine what this is\" code and build as much up as possible\n stacked = True\n stacked_layers = [initial_layer]\n if stack_set is None:\n stack_set = list(framework.class_subclasses(interfaces.automagic.StackerLayerInterface))\n\n for stacker_item in stack_set:\n if not issubclass(stacker_item, interfaces.automagic.StackerLayerInterface):\n raise TypeError(\"Stacker {} is not a descendent of StackerLayerInterface\".format(stacker_item.__name__))\n\n while stacked:\n stacked = False\n new_layer = None\n stacker_cls = None\n for stacker_cls in stack_set:\n stacker = stacker_cls()\n try:\n vollog.log(constants.LOGLEVEL_VV, \"Attempting to stack using {}\".format(stacker_cls.__name__))\n new_layer = stacker.stack(context, initial_layer, progress_callback)\n if new_layer:\n context.layers.add_layer(new_layer)\n vollog.log(constants.LOGLEVEL_VV,\n \"Stacked {} using {}\".format(new_layer.name, stacker_cls.__name__))\n break\n except Exception as excp:\n # Stacking exceptions are likely only of interest to developers, so the lowest level of logging\n fulltrace = traceback.TracebackException.from_exception(excp).format(chain = True)\n vollog.log(constants.LOGLEVEL_VVV, \"Exception during stacking: {}\".format(str(excp)))\n vollog.log(constants.LOGLEVEL_VVVV, \"\\n\".join(fulltrace))\n else:\n stacked = False\n if new_layer and stacker_cls:\n stacked_layers = [new_layer.name] + stacked_layers\n initial_layer = new_layer.name\n stacked = True\n stack_set.remove(stacker_cls)\n return stacked_layers","function_tokens":["def","stack_layer","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","initial_layer",":","str",",","stack_set",":","List","[","Type","[","interfaces",".","automagic",".","StackerLayerInterface","]","]","=","None",",","progress_callback",":","constants",".","ProgressCallback","=","None",")",":","# Repeatedly apply \"determine what this is\" code and build as much up as possible","stacked","=","True","stacked_layers","=","[","initial_layer","]","if","stack_set","is","None",":","stack_set","=","list","(","framework",".","class_subclasses","(","interfaces",".","automagic",".","StackerLayerInterface",")",")","for","stacker_item","in","stack_set",":","if","not","issubclass","(","stacker_item",",","interfaces",".","automagic",".","StackerLayerInterface",")",":","raise","TypeError","(","\"Stacker {} is not a descendent of StackerLayerInterface\"",".","format","(","stacker_item",".","__name__",")",")","while","stacked",":","stacked","=","False","new_layer","=","None","stacker_cls","=","None","for","stacker_cls","in","stack_set",":","stacker","=","stacker_cls","(",")","try",":","vollog",".","log","(","constants",".","LOGLEVEL_VV",",","\"Attempting to stack using {}\"",".","format","(","stacker_cls",".","__name__",")",")","new_layer","=","stacker",".","stack","(","context",",","initial_layer",",","progress_callback",")","if","new_layer",":","context",".","layers",".","add_layer","(","new_layer",")","vollog",".","log","(","constants",".","LOGLEVEL_VV",",","\"Stacked {} using {}\"",".","format","(","new_layer",".","name",",","stacker_cls",".","__name__",")",")","break","except","Exception","as","excp",":","# Stacking exceptions are likely only of interest to developers, so the lowest level of logging","fulltrace","=","traceback",".","TracebackException",".","from_exception","(","excp",")",".","format","(","chain","=","True",")","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Exception during stacking: {}\"",".","format","(","str","(","excp",")",")",")","vollog",".","log","(","constants",".","LOGLEVEL_VVVV",",","\"\\n\"",".","join","(","fulltrace",")",")","else",":","stacked","=","False","if","new_layer","and","stacker_cls",":","stacked_layers","=","[","new_layer",".","name","]","+","stacked_layers","initial_layer","=","new_layer",".","name","stacked","=","True","stack_set",".","remove","(","stacker_cls",")","return","stacked_layers"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py#L129-L189"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py","language":"python","identifier":"LayerStacker.create_stackers_list","parameters":"(self)","argument_list":"","return_statement":"return stack_set","docstring":"Creates the list of stackers to use based on the config option","docstring_summary":"Creates the list of stackers to use based on the config option","docstring_tokens":["Creates","the","list","of","stackers","to","use","based","on","the","config","option"],"function":"def create_stackers_list(self) -> List[Type[interfaces.automagic.StackerLayerInterface]]:\n \"\"\"Creates the list of stackers to use based on the config option\"\"\"\n stack_set = sorted(framework.class_subclasses(interfaces.automagic.StackerLayerInterface),\n key = lambda x: x.stack_order)\n stacker_list = self.config.get('stackers', [])\n if len(stacker_list):\n result = []\n for stacker in stack_set:\n if stacker.__name__ in stacker_list:\n result.append(stacker)\n stack_set = result\n return stack_set","function_tokens":["def","create_stackers_list","(","self",")","->","List","[","Type","[","interfaces",".","automagic",".","StackerLayerInterface","]","]",":","stack_set","=","sorted","(","framework",".","class_subclasses","(","interfaces",".","automagic",".","StackerLayerInterface",")",",","key","=","lambda","x",":","x",".","stack_order",")","stacker_list","=","self",".","config",".","get","(","'stackers'",",","[","]",")","if","len","(","stacker_list",")",":","result","=","[","]","for","stacker","in","stack_set",":","if","stacker",".","__name__","in","stacker_list",":","result",".","append","(","stacker",")","stack_set","=","result","return","stack_set"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py#L191-L202"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py","language":"python","identifier":"LayerStacker.find_suitable_requirements","parameters":"(cls, context: interfaces.context.ContextInterface, config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n stacked_layers: List[str])","argument_list":"","return_statement":"return None","docstring":"Looks for translation layer requirements and attempts to apply the\n stacked layers to it. If it succeeds it returns the configuration path\n and layer name where the stacked nodes were spliced into the tree.\n\n Returns:\n A tuple of a configuration path and layer name for the top of the stacked layers\n or None if suitable requirements are not found","docstring_summary":"Looks for translation layer requirements and attempts to apply the\n stacked layers to it. If it succeeds it returns the configuration path\n and layer name where the stacked nodes were spliced into the tree.","docstring_tokens":["Looks","for","translation","layer","requirements","and","attempts","to","apply","the","stacked","layers","to","it",".","If","it","succeeds","it","returns","the","configuration","path","and","layer","name","where","the","stacked","nodes","were","spliced","into","the","tree","."],"function":"def find_suitable_requirements(cls, context: interfaces.context.ContextInterface, config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n stacked_layers: List[str]) -> Optional[Tuple[str, str]]:\n \"\"\"Looks for translation layer requirements and attempts to apply the\n stacked layers to it. If it succeeds it returns the configuration path\n and layer name where the stacked nodes were spliced into the tree.\n\n Returns:\n A tuple of a configuration path and layer name for the top of the stacked layers\n or None if suitable requirements are not found\n \"\"\"\n child_config_path = interfaces.configuration.path_join(config_path, requirement.name)\n if isinstance(requirement, requirements.TranslationLayerRequirement):\n if requirement.unsatisfied(context, config_path):\n original_setting = context.config.get(child_config_path, None)\n for layer_name in stacked_layers:\n context.config[child_config_path] = layer_name\n if not requirement.unsatisfied(context, config_path):\n return child_config_path, layer_name\n # Clean-up to restore the config\n if original_setting:\n context.config[child_config_path] = original_setting\n else:\n del context.config[child_config_path]\n else:\n return child_config_path, context.config.get(child_config_path, None)\n for req_name, req in requirement.requirements.items():\n result = cls.find_suitable_requirements(context, child_config_path, req, stacked_layers)\n if result:\n return result\n return None","function_tokens":["def","find_suitable_requirements","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","requirement",":","interfaces",".","configuration",".","RequirementInterface",",","stacked_layers",":","List","[","str","]",")","->","Optional","[","Tuple","[","str",",","str","]","]",":","child_config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","requirement",".","name",")","if","isinstance","(","requirement",",","requirements",".","TranslationLayerRequirement",")",":","if","requirement",".","unsatisfied","(","context",",","config_path",")",":","original_setting","=","context",".","config",".","get","(","child_config_path",",","None",")","for","layer_name","in","stacked_layers",":","context",".","config","[","child_config_path","]","=","layer_name","if","not","requirement",".","unsatisfied","(","context",",","config_path",")",":","return","child_config_path",",","layer_name","# Clean-up to restore the config","if","original_setting",":","context",".","config","[","child_config_path","]","=","original_setting","else",":","del","context",".","config","[","child_config_path","]","else",":","return","child_config_path",",","context",".","config",".","get","(","child_config_path",",","None",")","for","req_name",",","req","in","requirement",".","requirements",".","items","(",")",":","result","=","cls",".","find_suitable_requirements","(","context",",","child_config_path",",","req",",","stacked_layers",")","if","result",":","return","result","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/automagic\/stacker.py#L205-L235"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"get_module_wrapper","parameters":"(method: str)","argument_list":"","return_statement":"return wrapper","docstring":"Returns a symbol using the symbol_table_name of the Module.","docstring_summary":"Returns a symbol using the symbol_table_name of the Module.","docstring_tokens":["Returns","a","symbol","using","the","symbol_table_name","of","the","Module","."],"function":"def get_module_wrapper(method: str) -> Callable:\n \"\"\"Returns a symbol using the symbol_table_name of the Module.\"\"\"\n\n def wrapper(self, name: str) -> Callable:\n if constants.BANG not in name:\n name = self._module_name + constants.BANG + name\n else:\n raise ValueError(\"Cannot reference another module when calling {}\".format(method))\n return getattr(self._context.symbol_space, method)(name)\n\n for entry in ['__annotations__', '__doc__', '__module__', '__name__', '__qualname__']:\n proxy_interface = getattr(interfaces.context.ModuleInterface, method)\n if hasattr(proxy_interface, entry):\n setattr(wrapper, entry, getattr(proxy_interface, entry))\n\n return wrapper","function_tokens":["def","get_module_wrapper","(","method",":","str",")","->","Callable",":","def","wrapper","(","self",",","name",":","str",")","->","Callable",":","if","constants",".","BANG","not","in","name",":","name","=","self",".","_module_name","+","constants",".","BANG","+","name","else",":","raise","ValueError","(","\"Cannot reference another module when calling {}\"",".","format","(","method",")",")","return","getattr","(","self",".","_context",".","symbol_space",",","method",")","(","name",")","for","entry","in","[","'__annotations__'",",","'__doc__'",",","'__module__'",",","'__name__'",",","'__qualname__'","]",":","proxy_interface","=","getattr","(","interfaces",".","context",".","ModuleInterface",",","method",")","if","hasattr","(","proxy_interface",",","entry",")",":","setattr","(","wrapper",",","entry",",","getattr","(","proxy_interface",",","entry",")",")","return","wrapper"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L151-L166"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"Context.__init__","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Initializes the context.","docstring_summary":"Initializes the context.","docstring_tokens":["Initializes","the","context","."],"function":"def __init__(self) -> None:\n \"\"\"Initializes the context.\"\"\"\n super().__init__()\n self._symbol_space = symbols.SymbolSpace()\n self._memory = interfaces.layers.LayerContainer()\n self._config = interfaces.configuration.HierarchicalDict()","function_tokens":["def","__init__","(","self",")","->","None",":","super","(",")",".","__init__","(",")","self",".","_symbol_space","=","symbols",".","SymbolSpace","(",")","self",".","_memory","=","interfaces",".","layers",".","LayerContainer","(",")","self",".","_config","=","interfaces",".","configuration",".","HierarchicalDict","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L32-L37"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"Context.config","parameters":"(self)","argument_list":"","return_statement":"return self._config","docstring":"Returns a mutable copy of the configuration, but does not allow the\n whole configuration to be altered.","docstring_summary":"Returns a mutable copy of the configuration, but does not allow the\n whole configuration to be altered.","docstring_tokens":["Returns","a","mutable","copy","of","the","configuration","but","does","not","allow","the","whole","configuration","to","be","altered","."],"function":"def config(self) -> interfaces.configuration.HierarchicalDict:\n \"\"\"Returns a mutable copy of the configuration, but does not allow the\n whole configuration to be altered.\"\"\"\n return self._config","function_tokens":["def","config","(","self",")","->","interfaces",".","configuration",".","HierarchicalDict",":","return","self",".","_config"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L42-L45"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"Context.symbol_space","parameters":"(self)","argument_list":"","return_statement":"return self._symbol_space","docstring":"The space of all symbols that can be accessed within this\n context.","docstring_summary":"The space of all symbols that can be accessed within this\n context.","docstring_tokens":["The","space","of","all","symbols","that","can","be","accessed","within","this","context","."],"function":"def symbol_space(self) -> interfaces.symbols.SymbolSpaceInterface:\n \"\"\"The space of all symbols that can be accessed within this\n context.\"\"\"\n return self._symbol_space","function_tokens":["def","symbol_space","(","self",")","->","interfaces",".","symbols",".","SymbolSpaceInterface",":","return","self",".","_symbol_space"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L54-L57"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"Context.layers","parameters":"(self)","argument_list":"","return_statement":"return self._memory","docstring":"A LayerContainer object, allowing access to all data and translation\n layers currently available within the context.","docstring_summary":"A LayerContainer object, allowing access to all data and translation\n layers currently available within the context.","docstring_tokens":["A","LayerContainer","object","allowing","access","to","all","data","and","translation","layers","currently","available","within","the","context","."],"function":"def layers(self) -> interfaces.layers.LayerContainer:\n \"\"\"A LayerContainer object, allowing access to all data and translation\n layers currently available within the context.\"\"\"\n return self._memory","function_tokens":["def","layers","(","self",")","->","interfaces",".","layers",".","LayerContainer",":","return","self",".","_memory"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L60-L63"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"Context.add_layer","parameters":"(self, layer: interfaces.layers.DataLayerInterface)","argument_list":"","return_statement":"","docstring":"Adds a named translation layer to the context.\n\n Args:\n layer: The layer to be added to the memory\n\n Raises:\n volatility.framework.exceptions.LayerException: if the layer is already present, or has\n unmet dependencies","docstring_summary":"Adds a named translation layer to the context.","docstring_tokens":["Adds","a","named","translation","layer","to","the","context","."],"function":"def add_layer(self, layer: interfaces.layers.DataLayerInterface) -> None:\n \"\"\"Adds a named translation layer to the context.\n\n Args:\n layer: The layer to be added to the memory\n\n Raises:\n volatility.framework.exceptions.LayerException: if the layer is already present, or has\n unmet dependencies\n \"\"\"\n self._memory.add_layer(layer)","function_tokens":["def","add_layer","(","self",",","layer",":","interfaces",".","layers",".","DataLayerInterface",")","->","None",":","self",".","_memory",".","add_layer","(","layer",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L67-L77"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"Context.object","parameters":"(self,\n object_type: Union[str, interfaces.objects.Template],\n layer_name: str,\n offset: int,\n native_layer_name: Optional[str] = None,\n **arguments)","argument_list":"","return_statement":"return object_template(context = self,\n object_info = interfaces.objects.ObjectInformation(layer_name = layer_name,\n offset = offset,\n native_layer_name = native_layer_name,\n size = object_template.size))","docstring":"Object factory, takes a context, symbol, offset and optional\n layername.\n\n Looks up the layername in the context, finds the object template based on the symbol,\n and constructs an object using the object template on the layer at the offset.\n\n Args:\n object_type: The name (or template) of the symbol type on which to construct the object. If this is a name, it should contain an explicit table name.\n layer_name: The name of the layer on which to construct the object\n offset: The offset within the layer at which the data used to create the object lives\n native_layer_name: The name of the layer the object references (for pointers) if different to layer_name\n\n Returns:\n A fully constructed object","docstring_summary":"Object factory, takes a context, symbol, offset and optional\n layername.","docstring_tokens":["Object","factory","takes","a","context","symbol","offset","and","optional","layername","."],"function":"def object(self,\n object_type: Union[str, interfaces.objects.Template],\n layer_name: str,\n offset: int,\n native_layer_name: Optional[str] = None,\n **arguments) -> interfaces.objects.ObjectInterface:\n \"\"\"Object factory, takes a context, symbol, offset and optional\n layername.\n\n Looks up the layername in the context, finds the object template based on the symbol,\n and constructs an object using the object template on the layer at the offset.\n\n Args:\n object_type: The name (or template) of the symbol type on which to construct the object. If this is a name, it should contain an explicit table name.\n layer_name: The name of the layer on which to construct the object\n offset: The offset within the layer at which the data used to create the object lives\n native_layer_name: The name of the layer the object references (for pointers) if different to layer_name\n\n Returns:\n A fully constructed object\n \"\"\"\n if not isinstance(object_type, interfaces.objects.Template):\n try:\n object_template = self._symbol_space.get_type(object_type)\n except exceptions.SymbolError:\n object_template = self._symbol_space.get_enumeration(object_type)\n else:\n if isinstance(object_type, templates.ReferenceTemplate):\n object_type = self._symbol_space.get_type(object_type.vol.type_name)\n object_template = object_type\n # Ensure that if a pre-constructed type is provided we just instantiate it\n arguments.update(object_template.vol)\n\n object_template = object_template.clone()\n object_template.update_vol(**arguments)\n return object_template(context = self,\n object_info = interfaces.objects.ObjectInformation(layer_name = layer_name,\n offset = offset,\n native_layer_name = native_layer_name,\n size = object_template.size))","function_tokens":["def","object","(","self",",","object_type",":","Union","[","str",",","interfaces",".","objects",".","Template","]",",","layer_name",":","str",",","offset",":","int",",","native_layer_name",":","Optional","[","str","]","=","None",",","*","*","arguments",")","->","interfaces",".","objects",".","ObjectInterface",":","if","not","isinstance","(","object_type",",","interfaces",".","objects",".","Template",")",":","try",":","object_template","=","self",".","_symbol_space",".","get_type","(","object_type",")","except","exceptions",".","SymbolError",":","object_template","=","self",".","_symbol_space",".","get_enumeration","(","object_type",")","else",":","if","isinstance","(","object_type",",","templates",".","ReferenceTemplate",")",":","object_type","=","self",".","_symbol_space",".","get_type","(","object_type",".","vol",".","type_name",")","object_template","=","object_type","# Ensure that if a pre-constructed type is provided we just instantiate it","arguments",".","update","(","object_template",".","vol",")","object_template","=","object_template",".","clone","(",")","object_template",".","update_vol","(","*","*","arguments",")","return","object_template","(","context","=","self",",","object_info","=","interfaces",".","objects",".","ObjectInformation","(","layer_name","=","layer_name",",","offset","=","offset",",","native_layer_name","=","native_layer_name",",","size","=","object_template",".","size",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L81-L120"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"Context.module","parameters":"(self,\n module_name: str,\n layer_name: str,\n offset: int,\n native_layer_name: Optional[str] = None,\n size: Optional[int] = None)","argument_list":"","return_statement":"return Module(self,\n module_name = module_name,\n layer_name = layer_name,\n offset = offset,\n native_layer_name = native_layer_name)","docstring":"Constructs a new os-independent module.\n\n Args:\n module_name: The name of the module\n layer_name: The layer within the context in which the module exists\n offset: The offset at which the module exists in the layer\n native_layer_name: The default native layer for objects constructed by the module\n size: The size, in bytes, that the module occupys from offset location within the layer named layer_name","docstring_summary":"Constructs a new os-independent module.","docstring_tokens":["Constructs","a","new","os","-","independent","module","."],"function":"def module(self,\n module_name: str,\n layer_name: str,\n offset: int,\n native_layer_name: Optional[str] = None,\n size: Optional[int] = None) -> interfaces.context.ModuleInterface:\n \"\"\"Constructs a new os-independent module.\n\n Args:\n module_name: The name of the module\n layer_name: The layer within the context in which the module exists\n offset: The offset at which the module exists in the layer\n native_layer_name: The default native layer for objects constructed by the module\n size: The size, in bytes, that the module occupys from offset location within the layer named layer_name\n \"\"\"\n if size:\n return SizedModule(self,\n module_name = module_name,\n layer_name = layer_name,\n offset = offset,\n size = size,\n native_layer_name = native_layer_name)\n return Module(self,\n module_name = module_name,\n layer_name = layer_name,\n offset = offset,\n native_layer_name = native_layer_name)","function_tokens":["def","module","(","self",",","module_name",":","str",",","layer_name",":","str",",","offset",":","int",",","native_layer_name",":","Optional","[","str","]","=","None",",","size",":","Optional","[","int","]","=","None",")","->","interfaces",".","context",".","ModuleInterface",":","if","size",":","return","SizedModule","(","self",",","module_name","=","module_name",",","layer_name","=","layer_name",",","offset","=","offset",",","size","=","size",",","native_layer_name","=","native_layer_name",")","return","Module","(","self",",","module_name","=","module_name",",","layer_name","=","layer_name",",","offset","=","offset",",","native_layer_name","=","native_layer_name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L122-L148"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"Module.object","parameters":"(self,\n object_type: str,\n offset: int = None,\n native_layer_name: Optional[str] = None,\n absolute: bool = False,\n **kwargs)","argument_list":"","return_statement":"return self._context.object(object_type = object_type,\n layer_name = self._layer_name,\n offset = offset,\n native_layer_name = native_layer_name or self._native_layer_name,\n **kwargs)","docstring":"Returns an object created using the symbol_table_name and layer_name\n of the Module.\n\n Args:\n object_type: Name of the type\/enumeration (within the module) to construct\n offset: The location of the object, ignored when symbol_type is SYMBOL\n native_layer_name: Name of the layer in which constructed objects are made (for pointers)\n absolute: whether the type's offset is absolute within memory or relative to the module","docstring_summary":"Returns an object created using the symbol_table_name and layer_name\n of the Module.","docstring_tokens":["Returns","an","object","created","using","the","symbol_table_name","and","layer_name","of","the","Module","."],"function":"def object(self,\n object_type: str,\n offset: int = None,\n native_layer_name: Optional[str] = None,\n absolute: bool = False,\n **kwargs) -> 'interfaces.objects.ObjectInterface':\n \"\"\"Returns an object created using the symbol_table_name and layer_name\n of the Module.\n\n Args:\n object_type: Name of the type\/enumeration (within the module) to construct\n offset: The location of the object, ignored when symbol_type is SYMBOL\n native_layer_name: Name of the layer in which constructed objects are made (for pointers)\n absolute: whether the type's offset is absolute within memory or relative to the module\n \"\"\"\n if constants.BANG not in object_type:\n object_type = self.symbol_table_name + constants.BANG + object_type\n else:\n raise ValueError(\"Cannot reference another module when constructing an object\")\n\n if offset is None:\n raise TypeError(\"Offset must not be None for non-symbol objects\")\n\n if not absolute:\n offset += self._offset\n\n # Ensure we don't use a layer_name other than the module's, why would anyone do that?\n if 'layer_name' in kwargs:\n del kwargs['layer_name']\n return self._context.object(object_type = object_type,\n layer_name = self._layer_name,\n offset = offset,\n native_layer_name = native_layer_name or self._native_layer_name,\n **kwargs)","function_tokens":["def","object","(","self",",","object_type",":","str",",","offset",":","int","=","None",",","native_layer_name",":","Optional","[","str","]","=","None",",","absolute",":","bool","=","False",",","*","*","kwargs",")","->","'interfaces.objects.ObjectInterface'",":","if","constants",".","BANG","not","in","object_type",":","object_type","=","self",".","symbol_table_name","+","constants",".","BANG","+","object_type","else",":","raise","ValueError","(","\"Cannot reference another module when constructing an object\"",")","if","offset","is","None",":","raise","TypeError","(","\"Offset must not be None for non-symbol objects\"",")","if","not","absolute",":","offset","+=","self",".","_offset","# Ensure we don't use a layer_name other than the module's, why would anyone do that?","if","'layer_name'","in","kwargs",":","del","kwargs","[","'layer_name'","]","return","self",".","_context",".","object","(","object_type","=","object_type",",","layer_name","=","self",".","_layer_name",",","offset","=","offset",",","native_layer_name","=","native_layer_name","or","self",".","_native_layer_name",",","*","*","kwargs",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L171-L204"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"Module.object_from_symbol","parameters":"(self,\n symbol_name: str,\n native_layer_name: Optional[str] = None,\n absolute: bool = False,\n **kwargs)","argument_list":"","return_statement":"return self._context.object(object_type = symbol_val.type,\n layer_name = self._layer_name,\n offset = offset,\n native_layer_name = native_layer_name or self._native_layer_name,\n **kwargs)","docstring":"Returns an object based on a specific symbol (containing type and\n offset information) and the layer_name of the Module. This will throw\n a ValueError if the symbol does not contain an associated type, or if\n the symbol name is invalid. It will throw a SymbolError if the symbol\n cannot be found.\n\n Args:\n symbol_name: Name of the symbol (within the module) to construct\n native_layer_name: Name of the layer in which constructed objects are made (for pointers)\n absolute: whether the symbol's address is absolute or relative to the module","docstring_summary":"Returns an object based on a specific symbol (containing type and\n offset information) and the layer_name of the Module. This will throw\n a ValueError if the symbol does not contain an associated type, or if\n the symbol name is invalid. It will throw a SymbolError if the symbol\n cannot be found.","docstring_tokens":["Returns","an","object","based","on","a","specific","symbol","(","containing","type","and","offset","information",")","and","the","layer_name","of","the","Module",".","This","will","throw","a","ValueError","if","the","symbol","does","not","contain","an","associated","type","or","if","the","symbol","name","is","invalid",".","It","will","throw","a","SymbolError","if","the","symbol","cannot","be","found","."],"function":"def object_from_symbol(self,\n symbol_name: str,\n native_layer_name: Optional[str] = None,\n absolute: bool = False,\n **kwargs) -> 'interfaces.objects.ObjectInterface':\n \"\"\"Returns an object based on a specific symbol (containing type and\n offset information) and the layer_name of the Module. This will throw\n a ValueError if the symbol does not contain an associated type, or if\n the symbol name is invalid. It will throw a SymbolError if the symbol\n cannot be found.\n\n Args:\n symbol_name: Name of the symbol (within the module) to construct\n native_layer_name: Name of the layer in which constructed objects are made (for pointers)\n absolute: whether the symbol's address is absolute or relative to the module\n \"\"\"\n if constants.BANG not in symbol_name:\n symbol_name = self.symbol_table_name + constants.BANG + symbol_name\n else:\n raise ValueError(\"Cannot reference another module when constructing an object\")\n\n # Only set the offset if type is Symbol and we were given a name, not a template\n symbol_val = self._context.symbol_space.get_symbol(symbol_name)\n offset = symbol_val.address\n\n if not absolute:\n offset += self._offset\n\n if symbol_val.type is None:\n raise TypeError(\"Symbol {} has no associated type\".format(symbol_val.name))\n\n # Ensure we don't use a layer_name other than the module's, why would anyone do that?\n if 'layer_name' in kwargs:\n del kwargs['layer_name']\n\n # Since type may be a template, we don't just call our own module method\n return self._context.object(object_type = symbol_val.type,\n layer_name = self._layer_name,\n offset = offset,\n native_layer_name = native_layer_name or self._native_layer_name,\n **kwargs)","function_tokens":["def","object_from_symbol","(","self",",","symbol_name",":","str",",","native_layer_name",":","Optional","[","str","]","=","None",",","absolute",":","bool","=","False",",","*","*","kwargs",")","->","'interfaces.objects.ObjectInterface'",":","if","constants",".","BANG","not","in","symbol_name",":","symbol_name","=","self",".","symbol_table_name","+","constants",".","BANG","+","symbol_name","else",":","raise","ValueError","(","\"Cannot reference another module when constructing an object\"",")","# Only set the offset if type is Symbol and we were given a name, not a template","symbol_val","=","self",".","_context",".","symbol_space",".","get_symbol","(","symbol_name",")","offset","=","symbol_val",".","address","if","not","absolute",":","offset","+=","self",".","_offset","if","symbol_val",".","type","is","None",":","raise","TypeError","(","\"Symbol {} has no associated type\"",".","format","(","symbol_val",".","name",")",")","# Ensure we don't use a layer_name other than the module's, why would anyone do that?","if","'layer_name'","in","kwargs",":","del","kwargs","[","'layer_name'","]","# Since type may be a template, we don't just call our own module method","return","self",".","_context",".","object","(","object_type","=","symbol_val",".","type",",","layer_name","=","self",".","_layer_name",",","offset","=","offset",",","native_layer_name","=","native_layer_name","or","self",".","_native_layer_name",",","*","*","kwargs",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L206-L246"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"SizedModule.size","parameters":"(self)","argument_list":"","return_statement":"return self._size","docstring":"Returns the size of the module (0 for unknown size)","docstring_summary":"Returns the size of the module (0 for unknown size)","docstring_tokens":["Returns","the","size","of","the","module","(","0","for","unknown","size",")"],"function":"def size(self) -> int:\n \"\"\"Returns the size of the module (0 for unknown size)\"\"\"\n return self._size","function_tokens":["def","size","(","self",")","->","int",":","return","self",".","_size"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L275-L277"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"SizedModule.hash","parameters":"(self)","argument_list":"","return_statement":"return hashlib.md5(bytes(str(list(layer.mapping(self.offset, self.size, ignore_errors = True))),\n 'utf-8')).hexdigest()","docstring":"Hashes the module for equality checks.\n\n The mapping should be sorted and should be quicker than reading\n the data We turn it into JSON to make a common string and use a\n quick hash, because collissions are unlikely","docstring_summary":"Hashes the module for equality checks.","docstring_tokens":["Hashes","the","module","for","equality","checks","."],"function":"def hash(self) -> str:\n \"\"\"Hashes the module for equality checks.\n\n The mapping should be sorted and should be quicker than reading\n the data We turn it into JSON to make a common string and use a\n quick hash, because collissions are unlikely\n \"\"\"\n layer = self._context.layers[self.layer_name]\n if not isinstance(layer, interfaces.layers.TranslationLayerInterface):\n raise TypeError(\"Hashing modules on non-TranslationLayers is not allowed\")\n return hashlib.md5(bytes(str(list(layer.mapping(self.offset, self.size, ignore_errors = True))),\n 'utf-8')).hexdigest()","function_tokens":["def","hash","(","self",")","->","str",":","layer","=","self",".","_context",".","layers","[","self",".","layer_name","]","if","not","isinstance","(","layer",",","interfaces",".","layers",".","TranslationLayerInterface",")",":","raise","TypeError","(","\"Hashing modules on non-TranslationLayers is not allowed\"",")","return","hashlib",".","md5","(","bytes","(","str","(","list","(","layer",".","mapping","(","self",".","offset",",","self",".","size",",","ignore_errors","=","True",")",")",")",",","'utf-8'",")",")",".","hexdigest","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L281-L292"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"SizedModule.get_symbols_by_absolute_location","parameters":"(self, offset: int, size: int = 0)","argument_list":"","return_statement":"return list(\n self._context.symbol_space.get_symbols_by_location(offset = offset - self._offset,\n size = size,\n table_name = self.symbol_table_name))","docstring":"Returns the symbols within this module that live at the specified\n absolute offset provided.","docstring_summary":"Returns the symbols within this module that live at the specified\n absolute offset provided.","docstring_tokens":["Returns","the","symbols","within","this","module","that","live","at","the","specified","absolute","offset","provided","."],"function":"def get_symbols_by_absolute_location(self, offset: int, size: int = 0) -> List[str]:\n \"\"\"Returns the symbols within this module that live at the specified\n absolute offset provided.\"\"\"\n if size < 0:\n raise ValueError(\"Size must be strictly non-negative\")\n if offset > self._offset + self.size:\n return []\n return list(\n self._context.symbol_space.get_symbols_by_location(offset = offset - self._offset,\n size = size,\n table_name = self.symbol_table_name))","function_tokens":["def","get_symbols_by_absolute_location","(","self",",","offset",":","int",",","size",":","int","=","0",")","->","List","[","str","]",":","if","size","<","0",":","raise","ValueError","(","\"Size must be strictly non-negative\"",")","if","offset",">","self",".","_offset","+","self",".","size",":","return","[","]","return","list","(","self",".","_context",".","symbol_space",".","get_symbols_by_location","(","offset","=","offset","-","self",".","_offset",",","size","=","size",",","table_name","=","self",".","symbol_table_name",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L294-L304"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"ModuleCollection.deduplicate","parameters":"(self)","argument_list":"","return_statement":"return ModuleCollection(new_modules)","docstring":"Returns a new deduplicated ModuleCollection featuring no repeated\n modules (based on data hash)\n\n All 0 sized modules will have identical hashes and are therefore\n included in the deduplicated version","docstring_summary":"Returns a new deduplicated ModuleCollection featuring no repeated\n modules (based on data hash)","docstring_tokens":["Returns","a","new","deduplicated","ModuleCollection","featuring","no","repeated","modules","(","based","on","data","hash",")"],"function":"def deduplicate(self) -> 'ModuleCollection':\n \"\"\"Returns a new deduplicated ModuleCollection featuring no repeated\n modules (based on data hash)\n\n All 0 sized modules will have identical hashes and are therefore\n included in the deduplicated version\n \"\"\"\n new_modules = []\n seen = set() # type: Set[str]\n for mod in self._modules:\n if mod.hash not in seen or mod.size == 0:\n new_modules.append(mod)\n seen.add(mod.hash) # type: ignore # FIXME: mypy #5107\n return ModuleCollection(new_modules)","function_tokens":["def","deduplicate","(","self",")","->","'ModuleCollection'",":","new_modules","=","[","]","seen","=","set","(",")","# type: Set[str]","for","mod","in","self",".","_modules",":","if","mod",".","hash","not","in","seen","or","mod",".","size","==","0",":","new_modules",".","append","(","mod",")","seen",".","add","(","mod",".","hash",")","# type: ignore # FIXME: mypy #5107","return","ModuleCollection","(","new_modules",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L314-L327"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"ModuleCollection.modules","parameters":"(self)","argument_list":"","return_statement":"return self._generate_module_dict(self._modules)","docstring":"A name indexed dictionary of modules using that name in this\n collection.","docstring_summary":"A name indexed dictionary of modules using that name in this\n collection.","docstring_tokens":["A","name","indexed","dictionary","of","modules","using","that","name","in","this","collection","."],"function":"def modules(self) -> Dict[str, List[SizedModule]]:\n \"\"\"A name indexed dictionary of modules using that name in this\n collection.\"\"\"\n return self._generate_module_dict(self._modules)","function_tokens":["def","modules","(","self",")","->","Dict","[","str",",","List","[","SizedModule","]","]",":","return","self",".","_generate_module_dict","(","self",".","_modules",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L330-L333"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py","language":"python","identifier":"ModuleCollection.get_module_symbols_by_absolute_location","parameters":"(self, offset: int, size: int = 0)","argument_list":"","return_statement":"","docstring":"Returns a tuple of (module_name, list_of_symbol_names) for each\n module, where symbols live at the absolute offset in memory\n provided.","docstring_summary":"Returns a tuple of (module_name, list_of_symbol_names) for each\n module, where symbols live at the absolute offset in memory\n provided.","docstring_tokens":["Returns","a","tuple","of","(","module_name","list_of_symbol_names",")","for","each","module","where","symbols","live","at","the","absolute","offset","in","memory","provided","."],"function":"def get_module_symbols_by_absolute_location(self, offset: int, size: int = 0) -> Iterable[Tuple[str, List[str]]]:\n \"\"\"Returns a tuple of (module_name, list_of_symbol_names) for each\n module, where symbols live at the absolute offset in memory\n provided.\"\"\"\n if size < 0:\n raise ValueError(\"Size must be strictly non-negative\")\n for module in self._modules:\n if (offset <= module.offset + module.size) and (offset + size >= module.offset):\n yield (module.name, module.get_symbols_by_absolute_location(offset, size))","function_tokens":["def","get_module_symbols_by_absolute_location","(","self",",","offset",":","int",",","size",":","int","=","0",")","->","Iterable","[","Tuple","[","str",",","List","[","str","]","]","]",":","if","size","<","0",":","raise","ValueError","(","\"Size must be strictly non-negative\"",")","for","module","in","self",".","_modules",":","if","(","offset","<=","module",".","offset","+","module",".","size",")","and","(","offset","+","size",">=","module",".","offset",")",":","yield","(","module",".","name",",","module",".","get_symbols_by_absolute_location","(","offset",",","size",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/contexts\/__init__.py#L344-L352"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ReadOnlyMapping.__getattr__","parameters":"(self, attr: str)","argument_list":"","return_statement":"","docstring":"Returns the item as an attribute.","docstring_summary":"Returns the item as an attribute.","docstring_tokens":["Returns","the","item","as","an","attribute","."],"function":"def __getattr__(self, attr: str) -> Any:\n \"\"\"Returns the item as an attribute.\"\"\"\n if attr == '_dict':\n return super().__getattribute__(attr)\n if attr in self._dict:\n return self._dict[attr]\n raise AttributeError(\"Object has no attribute: {}.{}\".format(self.__class__.__name__, attr))","function_tokens":["def","__getattr__","(","self",",","attr",":","str",")","->","Any",":","if","attr","==","'_dict'",":","return","super","(",")",".","__getattribute__","(","attr",")","if","attr","in","self",".","_dict",":","return","self",".","_dict","[","attr","]","raise","AttributeError","(","\"Object has no attribute: {}.{}\"",".","format","(","self",".","__class__",".","__name__",",","attr",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L28-L34"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ReadOnlyMapping.__getitem__","parameters":"(self, name: str)","argument_list":"","return_statement":"return self._dict[name]","docstring":"Returns the item requested.","docstring_summary":"Returns the item requested.","docstring_tokens":["Returns","the","item","requested","."],"function":"def __getitem__(self, name: str) -> Any:\n \"\"\"Returns the item requested.\"\"\"\n return self._dict[name]","function_tokens":["def","__getitem__","(","self",",","name",":","str",")","->","Any",":","return","self",".","_dict","[","name","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L36-L38"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ReadOnlyMapping.__iter__","parameters":"(self)","argument_list":"","return_statement":"return self._dict.__iter__()","docstring":"Returns an iterator of the dictionary items.","docstring_summary":"Returns an iterator of the dictionary items.","docstring_tokens":["Returns","an","iterator","of","the","dictionary","items","."],"function":"def __iter__(self):\n \"\"\"Returns an iterator of the dictionary items.\"\"\"\n return self._dict.__iter__()","function_tokens":["def","__iter__","(","self",")",":","return","self",".","_dict",".","__iter__","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L40-L42"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ReadOnlyMapping.__len__","parameters":"(self)","argument_list":"","return_statement":"return len(self._dict)","docstring":"Returns the length of the internal dictionary.","docstring_summary":"Returns the length of the internal dictionary.","docstring_tokens":["Returns","the","length","of","the","internal","dictionary","."],"function":"def __len__(self) -> int:\n \"\"\"Returns the length of the internal dictionary.\"\"\"\n return len(self._dict)","function_tokens":["def","__len__","(","self",")","->","int",":","return","len","(","self",".","_dict",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L44-L46"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ObjectInformation.__init__","parameters":"(self,\n layer_name: str,\n offset: int,\n member_name: Optional[str] = None,\n parent: Optional['ObjectInterface'] = None,\n native_layer_name: Optional[str] = None,\n size: Optional[int] = None)","argument_list":"","return_statement":"","docstring":"Constructs a container for basic information about an object.\n\n Args:\n layer_name: Layer from which the data for the object will be read\n offset: Offset within the layer at which the data for the object will be read\n member_name: If the object was accessed as a member of a parent object, this was the name used to access it\n parent: If the object was accessed as a member of a parent object, this is the parent object\n native_layer_name: If this object references other objects (such as a pointer), what layer those objects live in\n size: The size that the whole structure consumes in bytes","docstring_summary":"Constructs a container for basic information about an object.","docstring_tokens":["Constructs","a","container","for","basic","information","about","an","object","."],"function":"def __init__(self,\n layer_name: str,\n offset: int,\n member_name: Optional[str] = None,\n parent: Optional['ObjectInterface'] = None,\n native_layer_name: Optional[str] = None,\n size: Optional[int] = None):\n \"\"\"Constructs a container for basic information about an object.\n\n Args:\n layer_name: Layer from which the data for the object will be read\n offset: Offset within the layer at which the data for the object will be read\n member_name: If the object was accessed as a member of a parent object, this was the name used to access it\n parent: If the object was accessed as a member of a parent object, this is the parent object\n native_layer_name: If this object references other objects (such as a pointer), what layer those objects live in\n size: The size that the whole structure consumes in bytes\n \"\"\"\n super().__init__({\n 'layer_name': layer_name,\n 'offset': offset,\n 'member_name': member_name,\n 'parent': parent,\n 'native_layer_name': native_layer_name or layer_name,\n 'size': size\n })","function_tokens":["def","__init__","(","self",",","layer_name",":","str",",","offset",":","int",",","member_name",":","Optional","[","str","]","=","None",",","parent",":","Optional","[","'ObjectInterface'","]","=","None",",","native_layer_name",":","Optional","[","str","]","=","None",",","size",":","Optional","[","int","]","=","None",")",":","super","(",")",".","__init__","(","{","'layer_name'",":","layer_name",",","'offset'",":","offset",",","'member_name'",":","member_name",",","'parent'",":","parent",",","'native_layer_name'",":","native_layer_name","or","layer_name",",","'size'",":","size","}",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L63-L87"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ObjectInterface.__init__","parameters":"(self, context: 'interfaces.context.ContextInterface', type_name: str, object_info: 'ObjectInformation',\n **kwargs)","argument_list":"","return_statement":"","docstring":"Constructs an Object adhering to the ObjectInterface.\n\n Args:\n context: The context associated with the object\n type_name: The name of the type structure for the object\n object_info: Basic information relevant to the object (layer, offset, member_name, parent, etc)","docstring_summary":"Constructs an Object adhering to the ObjectInterface.","docstring_tokens":["Constructs","an","Object","adhering","to","the","ObjectInterface","."],"function":"def __init__(self, context: 'interfaces.context.ContextInterface', type_name: str, object_info: 'ObjectInformation',\n **kwargs) -> None:\n \"\"\"Constructs an Object adhering to the ObjectInterface.\n\n Args:\n context: The context associated with the object\n type_name: The name of the type structure for the object\n object_info: Basic information relevant to the object (layer, offset, member_name, parent, etc)\n \"\"\"\n # Since objects are likely to be instantiated often,\n # we're reliant on type_checking to ensure correctness of context, offset and parent\n # Everything else may be wrong, but that will get caught later on\n\n # Add an empty dictionary at the start to allow objects to add their own data to the vol object\n #\n # NOTE:\n # This allows objects to MASSIVELY MESS with their own internal representation!!!\n # Changes to offset, type_name, etc should NEVER be done\n #\n\n # Normalize offsets\n mask = context.layers[object_info.layer_name].address_mask\n normalized_offset = object_info.offset & mask\n\n self._vol = collections.ChainMap({}, object_info, {'type_name': type_name, 'offset': normalized_offset}, kwargs)\n self._context = context","function_tokens":["def","__init__","(","self",",","context",":","'interfaces.context.ContextInterface'",",","type_name",":","str",",","object_info",":","'ObjectInformation'",",","*","*","kwargs",")","->","None",":","# Since objects are likely to be instantiated often,","# we're reliant on type_checking to ensure correctness of context, offset and parent","# Everything else may be wrong, but that will get caught later on","# Add an empty dictionary at the start to allow objects to add their own data to the vol object","#","# NOTE:","# This allows objects to MASSIVELY MESS with their own internal representation!!!","# Changes to offset, type_name, etc should NEVER be done","#","# Normalize offsets","mask","=","context",".","layers","[","object_info",".","layer_name","]",".","address_mask","normalized_offset","=","object_info",".","offset","&","mask","self",".","_vol","=","collections",".","ChainMap","(","{","}",",","object_info",",","{","'type_name'",":","type_name",",","'offset'",":","normalized_offset","}",",","kwargs",")","self",".","_context","=","context"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L94-L119"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ObjectInterface.__getattr__","parameters":"(self, attr: str)","argument_list":"","return_statement":"","docstring":"Method for ensuring volatility members can be returned.","docstring_summary":"Method for ensuring volatility members can be returned.","docstring_tokens":["Method","for","ensuring","volatility","members","can","be","returned","."],"function":"def __getattr__(self, attr: str) -> Any:\n \"\"\"Method for ensuring volatility members can be returned.\"\"\"\n raise AttributeError","function_tokens":["def","__getattr__","(","self",",","attr",":","str",")","->","Any",":","raise","AttributeError"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L121-L123"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ObjectInterface.vol","parameters":"(self)","argument_list":"","return_statement":"return ReadOnlyMapping(self._vol)","docstring":"Returns the volatility specific object information.","docstring_summary":"Returns the volatility specific object information.","docstring_tokens":["Returns","the","volatility","specific","object","information","."],"function":"def vol(self) -> ReadOnlyMapping:\n \"\"\"Returns the volatility specific object information.\"\"\"\n # Wrap the outgoing vol in a read-only proxy\n return ReadOnlyMapping(self._vol)","function_tokens":["def","vol","(","self",")","->","ReadOnlyMapping",":","# Wrap the outgoing vol in a read-only proxy","return","ReadOnlyMapping","(","self",".","_vol",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L126-L129"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ObjectInterface.write","parameters":"(self, value: Any)","argument_list":"","return_statement":"","docstring":"Writes the new value into the format at the offset the object\n currently resides at.","docstring_summary":"Writes the new value into the format at the offset the object\n currently resides at.","docstring_tokens":["Writes","the","new","value","into","the","format","at","the","offset","the","object","currently","resides","at","."],"function":"def write(self, value: Any):\n \"\"\"Writes the new value into the format at the offset the object\n currently resides at.\"\"\"","function_tokens":["def","write","(","self",",","value",":","Any",")",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L132-L134"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ObjectInterface.get_symbol_table_name","parameters":"(self)","argument_list":"","return_statement":"return table_name","docstring":"Returns the symbol table name for this particular object.\n\n Raises:\n ValueError: If the object's symbol does not contain an explicit table\n KeyError: If the table_name is not valid within the object's context","docstring_summary":"Returns the symbol table name for this particular object.","docstring_tokens":["Returns","the","symbol","table","name","for","this","particular","object","."],"function":"def get_symbol_table_name(self) -> str:\n \"\"\"Returns the symbol table name for this particular object.\n\n Raises:\n ValueError: If the object's symbol does not contain an explicit table\n KeyError: If the table_name is not valid within the object's context\n \"\"\"\n if constants.BANG not in self.vol.type_name:\n raise ValueError(\"Unable to determine table for symbol: {}\".format(self.vol.type_name))\n table_name = self.vol.type_name[:self.vol.type_name.index(constants.BANG)]\n if table_name not in self._context.symbol_space:\n raise KeyError(\"Symbol table not found in context's symbol_space for symbol: {}\".format(self.vol.type_name))\n return table_name","function_tokens":["def","get_symbol_table_name","(","self",")","->","str",":","if","constants",".","BANG","not","in","self",".","vol",".","type_name",":","raise","ValueError","(","\"Unable to determine table for symbol: {}\"",".","format","(","self",".","vol",".","type_name",")",")","table_name","=","self",".","vol",".","type_name","[",":","self",".","vol",".","type_name",".","index","(","constants",".","BANG",")","]","if","table_name","not","in","self",".","_context",".","symbol_space",":","raise","KeyError","(","\"Symbol table not found in context's symbol_space for symbol: {}\"",".","format","(","self",".","vol",".","type_name",")",")","return","table_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L136-L148"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ObjectInterface.cast","parameters":"(self, new_type_name: str, **additional)","argument_list":"","return_statement":"return object_template(context = self._context, object_info = object_info)","docstring":"Returns a new object at the offset and from the layer that the\n current object inhabits.\n\n .. note:: If new type name does not include a symbol table, the\n symbol table for the current object is used","docstring_summary":"Returns a new object at the offset and from the layer that the\n current object inhabits.","docstring_tokens":["Returns","a","new","object","at","the","offset","and","from","the","layer","that","the","current","object","inhabits","."],"function":"def cast(self, new_type_name: str, **additional) -> 'ObjectInterface':\n \"\"\"Returns a new object at the offset and from the layer that the\n current object inhabits.\n\n .. note:: If new type name does not include a symbol table, the\n symbol table for the current object is used\n \"\"\"\n # TODO: Carefully consider the implications of casting and how it should work\n if constants.BANG not in new_type_name:\n symbol_table = self.vol['type_name'].split(constants.BANG)[0]\n new_type_name = symbol_table + constants.BANG + new_type_name\n object_template = self._context.symbol_space.get_type(new_type_name)\n object_template = object_template.clone()\n object_template.update_vol(**additional)\n object_info = ObjectInformation(layer_name = self.vol.layer_name,\n offset = self.vol.offset,\n member_name = self.vol.member_name,\n parent = self.vol.parent,\n native_layer_name = self.vol.native_layer_name,\n size = object_template.size)\n return object_template(context = self._context, object_info = object_info)","function_tokens":["def","cast","(","self",",","new_type_name",":","str",",","*","*","additional",")","->","'ObjectInterface'",":","# TODO: Carefully consider the implications of casting and how it should work","if","constants",".","BANG","not","in","new_type_name",":","symbol_table","=","self",".","vol","[","'type_name'","]",".","split","(","constants",".","BANG",")","[","0","]","new_type_name","=","symbol_table","+","constants",".","BANG","+","new_type_name","object_template","=","self",".","_context",".","symbol_space",".","get_type","(","new_type_name",")","object_template","=","object_template",".","clone","(",")","object_template",".","update_vol","(","*","*","additional",")","object_info","=","ObjectInformation","(","layer_name","=","self",".","vol",".","layer_name",",","offset","=","self",".","vol",".","offset",",","member_name","=","self",".","vol",".","member_name",",","parent","=","self",".","vol",".","parent",",","native_layer_name","=","self",".","vol",".","native_layer_name",",","size","=","object_template",".","size",")","return","object_template","(","context","=","self",".","_context",",","object_info","=","object_info",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L150-L170"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ObjectInterface.has_member","parameters":"(self, member_name: str)","argument_list":"","return_statement":"return False","docstring":"Returns whether the object would contain a member called\n member_name.\n\n Args:\n member_name: Name to test whether a member exists within the type structure","docstring_summary":"Returns whether the object would contain a member called\n member_name.","docstring_tokens":["Returns","whether","the","object","would","contain","a","member","called","member_name","."],"function":"def has_member(self, member_name: str) -> bool:\n \"\"\"Returns whether the object would contain a member called\n member_name.\n\n Args:\n member_name: Name to test whether a member exists within the type structure\n \"\"\"\n return False","function_tokens":["def","has_member","(","self",",","member_name",":","str",")","->","bool",":","return","False"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L172-L179"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ObjectInterface.has_valid_member","parameters":"(self, member_name: str)","argument_list":"","return_statement":"return False","docstring":"Returns whether the dereferenced type has a valid member.\n\n Args:\n member_name: Name of the member to test access to determine if the member is valid or not","docstring_summary":"Returns whether the dereferenced type has a valid member.","docstring_tokens":["Returns","whether","the","dereferenced","type","has","a","valid","member","."],"function":"def has_valid_member(self, member_name: str) -> bool:\n \"\"\"Returns whether the dereferenced type has a valid member.\n\n Args:\n member_name: Name of the member to test access to determine if the member is valid or not\n \"\"\"\n if self.has_member(member_name):\n # noinspection PyBroadException\n try:\n _ = getattr(self, member_name)\n return True\n except Exception:\n pass\n return False","function_tokens":["def","has_valid_member","(","self",",","member_name",":","str",")","->","bool",":","if","self",".","has_member","(","member_name",")",":","# noinspection PyBroadException","try",":","_","=","getattr","(","self",",","member_name",")","return","True","except","Exception",":","pass","return","False"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L181-L194"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"ObjectInterface.has_valid_members","parameters":"(self, member_names: List[str])","argument_list":"","return_statement":"return all([self.has_valid_member(member_name) for member_name in member_names])","docstring":"Returns whether the object has all of the members listed in member_names\n\n Args:\n member_names: List of names to test as to members with those names validity","docstring_summary":"Returns whether the object has all of the members listed in member_names","docstring_tokens":["Returns","whether","the","object","has","all","of","the","members","listed","in","member_names"],"function":"def has_valid_members(self, member_names: List[str]) -> bool:\n \"\"\"Returns whether the object has all of the members listed in member_names\n\n Args:\n member_names: List of names to test as to members with those names validity\n \"\"\"\n return all([self.has_valid_member(member_name) for member_name in member_names])","function_tokens":["def","has_valid_members","(","self",",","member_names",":","List","[","str","]",")","->","bool",":","return","all","(","[","self",".","has_valid_member","(","member_name",")","for","member_name","in","member_names","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L196-L202"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"Template.__init__","parameters":"(self, type_name: str, **arguments)","argument_list":"","return_statement":"","docstring":"Stores the keyword arguments for later object creation.","docstring_summary":"Stores the keyword arguments for later object creation.","docstring_tokens":["Stores","the","keyword","arguments","for","later","object","creation","."],"function":"def __init__(self, type_name: str, **arguments) -> None:\n \"\"\"Stores the keyword arguments for later object creation.\"\"\"\n # Allow the updating of template arguments whilst still in template form\n super().__init__()\n empty_dict = {} # type: Dict[str, Any]\n self._vol = collections.ChainMap(empty_dict, arguments, {'type_name': type_name})","function_tokens":["def","__init__","(","self",",","type_name",":","str",",","*","*","arguments",")","->","None",":","# Allow the updating of template arguments whilst still in template form","super","(",")",".","__init__","(",")","empty_dict","=","{","}","# type: Dict[str, Any]","self",".","_vol","=","collections",".","ChainMap","(","empty_dict",",","arguments",",","{","'type_name'",":","type_name","}",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L274-L279"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"Template.vol","parameters":"(self)","argument_list":"","return_statement":"return ReadOnlyMapping(self._vol)","docstring":"Returns a volatility information object, much like the\n :class:`~volatility.framework.interfaces.objects.ObjectInformation`\n provides.","docstring_summary":"Returns a volatility information object, much like the\n :class:`~volatility.framework.interfaces.objects.ObjectInformation`\n provides.","docstring_tokens":["Returns","a","volatility","information","object","much","like","the",":","class",":","~volatility",".","framework",".","interfaces",".","objects",".","ObjectInformation","provides","."],"function":"def vol(self) -> ReadOnlyMapping:\n \"\"\"Returns a volatility information object, much like the\n :class:`~volatility.framework.interfaces.objects.ObjectInformation`\n provides.\"\"\"\n return ReadOnlyMapping(self._vol)","function_tokens":["def","vol","(","self",")","->","ReadOnlyMapping",":","return","ReadOnlyMapping","(","self",".","_vol",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L282-L286"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"Template.children","parameters":"(self)","argument_list":"","return_statement":"return []","docstring":"The children of this template (such as member types, sub-types and\n base-types where they are relevant).\n\n Used to traverse the template tree.","docstring_summary":"The children of this template (such as member types, sub-types and\n base-types where they are relevant).","docstring_tokens":["The","children","of","this","template","(","such","as","member","types","sub","-","types","and","base","-","types","where","they","are","relevant",")","."],"function":"def children(self) -> List['Template']:\n \"\"\"The children of this template (such as member types, sub-types and\n base-types where they are relevant).\n\n Used to traverse the template tree.\n \"\"\"\n return []","function_tokens":["def","children","(","self",")","->","List","[","'Template'","]",":","return","[","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L289-L295"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"Template.size","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the size of the template.","docstring_summary":"Returns the size of the template.","docstring_tokens":["Returns","the","size","of","the","template","."],"function":"def size(self) -> int:\n \"\"\"Returns the size of the template.\"\"\"","function_tokens":["def","size","(","self",")","->","int",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L299-L300"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"Template.relative_child_offset","parameters":"(self, child: str)","argument_list":"","return_statement":"","docstring":"Returns the relative offset of the `child` member from its parent\n offset.","docstring_summary":"Returns the relative offset of the `child` member from its parent\n offset.","docstring_tokens":["Returns","the","relative","offset","of","the","child","member","from","its","parent","offset","."],"function":"def relative_child_offset(self, child: str) -> int:\n \"\"\"Returns the relative offset of the `child` member from its parent\n offset.\"\"\"","function_tokens":["def","relative_child_offset","(","self",",","child",":","str",")","->","int",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L303-L305"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"Template.replace_child","parameters":"(self, old_child: 'Template', new_child: 'Template')","argument_list":"","return_statement":"","docstring":"Replaces `old_child` with `new_child` in the list of children.","docstring_summary":"Replaces `old_child` with `new_child` in the list of children.","docstring_tokens":["Replaces","old_child","with","new_child","in","the","list","of","children","."],"function":"def replace_child(self, old_child: 'Template', new_child: 'Template') -> None:\n \"\"\"Replaces `old_child` with `new_child` in the list of children.\"\"\"","function_tokens":["def","replace_child","(","self",",","old_child",":","'Template'",",","new_child",":","'Template'",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L308-L309"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"Template.has_member","parameters":"(self, member_name: str)","argument_list":"","return_statement":"","docstring":"Returns whether the object would contain a member called\n `member_name`","docstring_summary":"Returns whether the object would contain a member called\n `member_name`","docstring_tokens":["Returns","whether","the","object","would","contain","a","member","called","member_name"],"function":"def has_member(self, member_name: str) -> bool:\n \"\"\"Returns whether the object would contain a member called\n `member_name`\"\"\"","function_tokens":["def","has_member","(","self",",","member_name",":","str",")","->","bool",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L312-L314"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"Template.clone","parameters":"(self)","argument_list":"","return_statement":"return clone","docstring":"Returns a copy of the original Template as constructed (without\n `update_vol` additions having been made)","docstring_summary":"Returns a copy of the original Template as constructed (without\n `update_vol` additions having been made)","docstring_tokens":["Returns","a","copy","of","the","original","Template","as","constructed","(","without","update_vol","additions","having","been","made",")"],"function":"def clone(self) -> 'Template':\n \"\"\"Returns a copy of the original Template as constructed (without\n `update_vol` additions having been made)\"\"\"\n clone = self.__class__(**self._vol.parents.new_child())\n return clone","function_tokens":["def","clone","(","self",")","->","'Template'",":","clone","=","self",".","__class__","(","*","*","self",".","_vol",".","parents",".","new_child","(",")",")","return","clone"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L316-L320"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"Template.update_vol","parameters":"(self, **new_arguments)","argument_list":"","return_statement":"","docstring":"Updates the keyword arguments with values that will **not** be\n carried across to clones.","docstring_summary":"Updates the keyword arguments with values that will **not** be\n carried across to clones.","docstring_tokens":["Updates","the","keyword","arguments","with","values","that","will","**","not","**","be","carried","across","to","clones","."],"function":"def update_vol(self, **new_arguments) -> None:\n \"\"\"Updates the keyword arguments with values that will **not** be\n carried across to clones.\"\"\"\n self._vol.update(new_arguments)","function_tokens":["def","update_vol","(","self",",","*","*","new_arguments",")","->","None",":","self",".","_vol",".","update","(","new_arguments",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L322-L325"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"Template.__getattr__","parameters":"(self, attr: str)","argument_list":"","return_statement":"","docstring":"Exposes any other values stored in ._vol as attributes (for example,\n enumeration choices)","docstring_summary":"Exposes any other values stored in ._vol as attributes (for example,\n enumeration choices)","docstring_tokens":["Exposes","any","other","values","stored","in",".","_vol","as","attributes","(","for","example","enumeration","choices",")"],"function":"def __getattr__(self, attr: str) -> Any:\n \"\"\"Exposes any other values stored in ._vol as attributes (for example,\n enumeration choices)\"\"\"\n if attr != '_vol':\n if attr in self._vol:\n return self._vol[attr]\n raise AttributeError(\"{} object has no attribute {}\".format(self.__class__.__name__, attr))","function_tokens":["def","__getattr__","(","self",",","attr",":","str",")","->","Any",":","if","attr","!=","'_vol'",":","if","attr","in","self",".","_vol",":","return","self",".","_vol","[","attr","]","raise","AttributeError","(","\"{} object has no attribute {}\"",".","format","(","self",".","__class__",".","__name__",",","attr",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L327-L333"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py","language":"python","identifier":"Template.__call__","parameters":"(self, context: 'interfaces.context.ContextInterface',\n object_info: ObjectInformation)","argument_list":"","return_statement":"","docstring":"Constructs the object.","docstring_summary":"Constructs the object.","docstring_tokens":["Constructs","the","object","."],"function":"def __call__(self, context: 'interfaces.context.ContextInterface',\n object_info: ObjectInformation) -> ObjectInterface:\n \"\"\"Constructs the object.\"\"\"","function_tokens":["def","__call__","(","self",",","context",":","'interfaces.context.ContextInterface'",",","object_info",":","ObjectInformation",")","->","ObjectInterface",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/objects.py#L335-L337"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"path_join","parameters":"(*args)","argument_list":"","return_statement":"return CONFIG_SEPARATOR.join(args)","docstring":"Joins configuration paths together.","docstring_summary":"Joins configuration paths together.","docstring_tokens":["Joins","configuration","paths","together","."],"function":"def path_join(*args) -> str:\n \"\"\"Joins configuration paths together.\"\"\"\n # If a path element (particularly the first) is empty, then remove it from the list\n args = tuple([arg for arg in args if arg])\n return CONFIG_SEPARATOR.join(args)","function_tokens":["def","path_join","(","*","args",")","->","str",":","# If a path element (particularly the first) is empty, then remove it from the list","args","=","tuple","(","[","arg","for","arg","in","args","if","arg","]",")","return","CONFIG_SEPARATOR",".","join","(","args",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L41-L45"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"parent_path","parameters":"(value: str)","argument_list":"","return_statement":"return CONFIG_SEPARATOR.join(value.split(CONFIG_SEPARATOR)[:-1])","docstring":"Returns the parent configuration path from a configuration path.","docstring_summary":"Returns the parent configuration path from a configuration path.","docstring_tokens":["Returns","the","parent","configuration","path","from","a","configuration","path","."],"function":"def parent_path(value: str) -> str:\n \"\"\"Returns the parent configuration path from a configuration path.\"\"\"\n return CONFIG_SEPARATOR.join(value.split(CONFIG_SEPARATOR)[:-1])","function_tokens":["def","parent_path","(","value",":","str",")","->","str",":","return","CONFIG_SEPARATOR",".","join","(","value",".","split","(","CONFIG_SEPARATOR",")","[",":","-","1","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L48-L50"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"path_head","parameters":"(value: str)","argument_list":"","return_statement":"return value.split(CONFIG_SEPARATOR)[-1]","docstring":"Return the top of the configuration path","docstring_summary":"Return the top of the configuration path","docstring_tokens":["Return","the","top","of","the","configuration","path"],"function":"def path_head(value: str) -> str:\n \"\"\"Return the top of the configuration path\"\"\"\n return value.split(CONFIG_SEPARATOR)[-1]","function_tokens":["def","path_head","(","value",":","str",")","->","str",":","return","value",".","split","(","CONFIG_SEPARATOR",")","[","-","1","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L53-L55"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"path_depth","parameters":"(path: str, depth: int = 1)","argument_list":"","return_statement":"return path_join(path.split(CONFIG_SEPARATOR)[:depth])","docstring":"Returns the `path` up to a certain depth.\n\n Note that `depth` can be negative (such as `-x`) and will return all\n elements except for the last `x` components","docstring_summary":"Returns the `path` up to a certain depth.","docstring_tokens":["Returns","the","path","up","to","a","certain","depth","."],"function":"def path_depth(path: str, depth: int = 1) -> str:\n \"\"\"Returns the `path` up to a certain depth.\n\n Note that `depth` can be negative (such as `-x`) and will return all\n elements except for the last `x` components\n \"\"\"\n return path_join(path.split(CONFIG_SEPARATOR)[:depth])","function_tokens":["def","path_depth","(","path",":","str",",","depth",":","int","=","1",")","->","str",":","return","path_join","(","path",".","split","(","CONFIG_SEPARATOR",")","[",":","depth","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L58-L64"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.__init__","parameters":"(self,\n initial_dict: Dict[str, 'SimpleTypeRequirement'] = None,\n separator: str = CONFIG_SEPARATOR)","argument_list":"","return_statement":"","docstring":"Args:\n initial_dict: A dictionary to populate the HierachicalDict with initially\n separator: A custom hierarchy separator (defaults to CONFIG_SEPARATOR)","docstring_summary":"Args:\n initial_dict: A dictionary to populate the HierachicalDict with initially\n separator: A custom hierarchy separator (defaults to CONFIG_SEPARATOR)","docstring_tokens":["Args",":","initial_dict",":","A","dictionary","to","populate","the","HierachicalDict","with","initially","separator",":","A","custom","hierarchy","separator","(","defaults","to","CONFIG_SEPARATOR",")"],"function":"def __init__(self,\n initial_dict: Dict[str, 'SimpleTypeRequirement'] = None,\n separator: str = CONFIG_SEPARATOR) -> None:\n \"\"\"\n Args:\n initial_dict: A dictionary to populate the HierachicalDict with initially\n separator: A custom hierarchy separator (defaults to CONFIG_SEPARATOR)\n \"\"\"\n if not (isinstance(separator, str) and len(separator) == 1):\n raise TypeError(\"Separator must be a one character string: {}\".format(separator))\n self._separator = separator\n self._data = {} # type: Dict[str, ConfigSimpleType]\n self._subdict = {} # type: Dict[str, 'HierarchicalDict']\n if isinstance(initial_dict, str):\n initial_dict = json.loads(initial_dict)\n if isinstance(initial_dict, dict):\n for k, v in initial_dict.items():\n self[k] = v\n elif initial_dict is not None:\n raise TypeError(\n \"Initial_dict must be a dictionary or JSON string containing a dictionary: {}\".format(initial_dict))","function_tokens":["def","__init__","(","self",",","initial_dict",":","Dict","[","str",",","'SimpleTypeRequirement'","]","=","None",",","separator",":","str","=","CONFIG_SEPARATOR",")","->","None",":","if","not","(","isinstance","(","separator",",","str",")","and","len","(","separator",")","==","1",")",":","raise","TypeError","(","\"Separator must be a one character string: {}\"",".","format","(","separator",")",")","self",".","_separator","=","separator","self",".","_data","=","{","}","# type: Dict[str, ConfigSimpleType]","self",".","_subdict","=","{","}","# type: Dict[str, 'HierarchicalDict']","if","isinstance","(","initial_dict",",","str",")",":","initial_dict","=","json",".","loads","(","initial_dict",")","if","isinstance","(","initial_dict",",","dict",")",":","for","k",",","v","in","initial_dict",".","items","(",")",":","self","[","k","]","=","v","elif","initial_dict","is","not","None",":","raise","TypeError","(","\"Initial_dict must be a dictionary or JSON string containing a dictionary: {}\"",".","format","(","initial_dict",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L71-L91"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.__eq__","parameters":"(self, other)","argument_list":"","return_statement":"return dict(self) == dict(other)","docstring":"Define equality between HierarchicalDicts","docstring_summary":"Define equality between HierarchicalDicts","docstring_tokens":["Define","equality","between","HierarchicalDicts"],"function":"def __eq__(self, other):\n \"\"\"Define equality between HierarchicalDicts\"\"\"\n return dict(self) == dict(other)","function_tokens":["def","__eq__","(","self",",","other",")",":","return","dict","(","self",")","==","dict","(","other",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L93-L95"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.separator","parameters":"(self)","argument_list":"","return_statement":"return self._separator","docstring":"Specifies the hierarchy separator in use in this HierarchyDict.","docstring_summary":"Specifies the hierarchy separator in use in this HierarchyDict.","docstring_tokens":["Specifies","the","hierarchy","separator","in","use","in","this","HierarchyDict","."],"function":"def separator(self) -> str:\n \"\"\"Specifies the hierarchy separator in use in this HierarchyDict.\"\"\"\n return self._separator","function_tokens":["def","separator","(","self",")","->","str",":","return","self",".","_separator"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L98-L100"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.data","parameters":"(self)","argument_list":"","return_statement":"return self._data.copy()","docstring":"Returns just the data-containing mappings on this level of the\n Hierarchy.","docstring_summary":"Returns just the data-containing mappings on this level of the\n Hierarchy.","docstring_tokens":["Returns","just","the","data","-","containing","mappings","on","this","level","of","the","Hierarchy","."],"function":"def data(self) -> Dict:\n \"\"\"Returns just the data-containing mappings on this level of the\n Hierarchy.\"\"\"\n return self._data.copy()","function_tokens":["def","data","(","self",")","->","Dict",":","return","self",".","_data",".","copy","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L103-L106"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict._key_head","parameters":"(self, key: str)","argument_list":"","return_statement":"","docstring":"Returns the first division of a key based on the dict separator, or\n the full key if the separator is not present.","docstring_summary":"Returns the first division of a key based on the dict separator, or\n the full key if the separator is not present.","docstring_tokens":["Returns","the","first","division","of","a","key","based","on","the","dict","separator","or","the","full","key","if","the","separator","is","not","present","."],"function":"def _key_head(self, key: str) -> str:\n \"\"\"Returns the first division of a key based on the dict separator, or\n the full key if the separator is not present.\"\"\"\n if self.separator in key:\n return key[:key.index(self.separator)]\n else:\n return key","function_tokens":["def","_key_head","(","self",",","key",":","str",")","->","str",":","if","self",".","separator","in","key",":","return","key","[",":","key",".","index","(","self",".","separator",")","]","else",":","return","key"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L108-L114"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict._key_tail","parameters":"(self, key: str)","argument_list":"","return_statement":"return ''","docstring":"Returns all but the first division of a key based on the dict\n separator, or None if the separator is not in the key.","docstring_summary":"Returns all but the first division of a key based on the dict\n separator, or None if the separator is not in the key.","docstring_tokens":["Returns","all","but","the","first","division","of","a","key","based","on","the","dict","separator","or","None","if","the","separator","is","not","in","the","key","."],"function":"def _key_tail(self, key: str) -> str:\n \"\"\"Returns all but the first division of a key based on the dict\n separator, or None if the separator is not in the key.\"\"\"\n if self.separator in key:\n return key[key.index(self.separator) + 1:]\n return ''","function_tokens":["def","_key_tail","(","self",",","key",":","str",")","->","str",":","if","self",".","separator","in","key",":","return","key","[","key",".","index","(","self",".","separator",")","+","1",":","]","return","''"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L116-L121"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.__iter__","parameters":"(self)","argument_list":"","return_statement":"return self.generator()","docstring":"Returns an iterator object that supports the iterator protocol.","docstring_summary":"Returns an iterator object that supports the iterator protocol.","docstring_tokens":["Returns","an","iterator","object","that","supports","the","iterator","protocol","."],"function":"def __iter__(self):\n \"\"\"Returns an iterator object that supports the iterator protocol.\"\"\"\n return self.generator()","function_tokens":["def","__iter__","(","self",")",":","return","self",".","generator","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L123-L125"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.generator","parameters":"(self)","argument_list":"","return_statement":"","docstring":"A generator for the data in this level and lower levels of this\n mapping.\n\n Returns:\n Returns each item in the top level data, and then all subkeys in a depth first order","docstring_summary":"A generator for the data in this level and lower levels of this\n mapping.","docstring_tokens":["A","generator","for","the","data","in","this","level","and","lower","levels","of","this","mapping","."],"function":"def generator(self) -> Generator[str, None, None]:\n \"\"\"A generator for the data in this level and lower levels of this\n mapping.\n\n Returns:\n Returns each item in the top level data, and then all subkeys in a depth first order\n \"\"\"\n for key in self._data:\n yield key\n for subdict_key in self._subdict:\n for key in self._subdict[subdict_key]:\n yield subdict_key + self.separator + key","function_tokens":["def","generator","(","self",")","->","Generator","[","str",",","None",",","None","]",":","for","key","in","self",".","_data",":","yield","key","for","subdict_key","in","self",".","_subdict",":","for","key","in","self",".","_subdict","[","subdict_key","]",":","yield","subdict_key","+","self",".","separator","+","key"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L127-L138"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.__getitem__","parameters":"(self, key)","argument_list":"","return_statement":"","docstring":"Gets an item, traversing down the trees to get to the final\n value.","docstring_summary":"Gets an item, traversing down the trees to get to the final\n value.","docstring_tokens":["Gets","an","item","traversing","down","the","trees","to","get","to","the","final","value","."],"function":"def __getitem__(self, key):\n \"\"\"Gets an item, traversing down the trees to get to the final\n value.\"\"\"\n try:\n if self.separator in key:\n subdict = self._subdict[self._key_head(key)]\n return subdict[self._key_tail(key)]\n else:\n return self._data[key]\n except KeyError:\n raise KeyError(key)","function_tokens":["def","__getitem__","(","self",",","key",")",":","try",":","if","self",".","separator","in","key",":","subdict","=","self",".","_subdict","[","self",".","_key_head","(","key",")","]","return","subdict","[","self",".","_key_tail","(","key",")","]","else",":","return","self",".","_data","[","key","]","except","KeyError",":","raise","KeyError","(","key",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L140-L150"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.__setitem__","parameters":"(self, key: str, value: Any)","argument_list":"","return_statement":"","docstring":"Sets an item or creates a subdict and sets the item within that.","docstring_summary":"Sets an item or creates a subdict and sets the item within that.","docstring_tokens":["Sets","an","item","or","creates","a","subdict","and","sets","the","item","within","that","."],"function":"def __setitem__(self, key: str, value: Any) -> None:\n \"\"\"Sets an item or creates a subdict and sets the item within that.\"\"\"\n self._setitem(key, value)","function_tokens":["def","__setitem__","(","self",",","key",":","str",",","value",":","Any",")","->","None",":","self",".","_setitem","(","key",",","value",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L152-L154"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict._setitem","parameters":"(self, key: str, value: Any, is_data: bool = True)","argument_list":"","return_statement":"","docstring":"Set an item or appends a whole subtree at a key location.","docstring_summary":"Set an item or appends a whole subtree at a key location.","docstring_tokens":["Set","an","item","or","appends","a","whole","subtree","at","a","key","location","."],"function":"def _setitem(self, key: str, value: Any, is_data: bool = True) -> None:\n \"\"\"Set an item or appends a whole subtree at a key location.\"\"\"\n if self.separator in key:\n subdict = self._subdict.get(self._key_head(key), HierarchicalDict(separator = self.separator))\n subdict._setitem(self._key_tail(key), value, is_data)\n self._subdict[self._key_head(key)] = subdict\n else:\n if is_data:\n self._data[key] = self._sanitize_value(value)\n else:\n if not isinstance(value, HierarchicalDict):\n raise TypeError(\n \"HierarchicalDicts can only store HierarchicalDicts within their structure: {}\".format(\n type(value)))\n self._subdict[key] = value","function_tokens":["def","_setitem","(","self",",","key",":","str",",","value",":","Any",",","is_data",":","bool","=","True",")","->","None",":","if","self",".","separator","in","key",":","subdict","=","self",".","_subdict",".","get","(","self",".","_key_head","(","key",")",",","HierarchicalDict","(","separator","=","self",".","separator",")",")","subdict",".","_setitem","(","self",".","_key_tail","(","key",")",",","value",",","is_data",")","self",".","_subdict","[","self",".","_key_head","(","key",")","]","=","subdict","else",":","if","is_data",":","self",".","_data","[","key","]","=","self",".","_sanitize_value","(","value",")","else",":","if","not","isinstance","(","value",",","HierarchicalDict",")",":","raise","TypeError","(","\"HierarchicalDicts can only store HierarchicalDicts within their structure: {}\"",".","format","(","type","(","value",")",")",")","self",".","_subdict","[","key","]","=","value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L156-L170"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict._sanitize_value","parameters":"(self, value: Any)","argument_list":"","return_statement":"","docstring":"Method to ensure all values are standard values and not volatility\n objects containing contexts.","docstring_summary":"Method to ensure all values are standard values and not volatility\n objects containing contexts.","docstring_tokens":["Method","to","ensure","all","values","are","standard","values","and","not","volatility","objects","containing","contexts","."],"function":"def _sanitize_value(self, value: Any) -> ConfigSimpleType:\n \"\"\"Method to ensure all values are standard values and not volatility\n objects containing contexts.\"\"\"\n if isinstance(value, bool):\n return bool(value)\n elif isinstance(value, int):\n return int(value)\n elif isinstance(value, str):\n return str(value)\n elif isinstance(value, bytes):\n return bytes(value)\n elif isinstance(value, list):\n new_list = []\n for element in value:\n element_value = self._sanitize_value(element)\n if isinstance(element_value, list):\n raise TypeError(\"Configuration list types cannot contain list types\")\n new_list.append(element_value)\n return new_list\n elif value is None:\n return None\n else:\n raise TypeError(\"Invalid type stored in configuration\")","function_tokens":["def","_sanitize_value","(","self",",","value",":","Any",")","->","ConfigSimpleType",":","if","isinstance","(","value",",","bool",")",":","return","bool","(","value",")","elif","isinstance","(","value",",","int",")",":","return","int","(","value",")","elif","isinstance","(","value",",","str",")",":","return","str","(","value",")","elif","isinstance","(","value",",","bytes",")",":","return","bytes","(","value",")","elif","isinstance","(","value",",","list",")",":","new_list","=","[","]","for","element","in","value",":","element_value","=","self",".","_sanitize_value","(","element",")","if","isinstance","(","element_value",",","list",")",":","raise","TypeError","(","\"Configuration list types cannot contain list types\"",")","new_list",".","append","(","element_value",")","return","new_list","elif","value","is","None",":","return","None","else",":","raise","TypeError","(","\"Invalid type stored in configuration\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L172-L194"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.__delitem__","parameters":"(self, key: str)","argument_list":"","return_statement":"","docstring":"Deletes an item from the hierarchical dict.","docstring_summary":"Deletes an item from the hierarchical dict.","docstring_tokens":["Deletes","an","item","from","the","hierarchical","dict","."],"function":"def __delitem__(self, key: str) -> None:\n \"\"\"Deletes an item from the hierarchical dict.\"\"\"\n try:\n if self.separator in key:\n subdict = self._subdict[self._key_head(key)]\n del subdict[self._key_tail(key)]\n else:\n del self._data[self._key_head(key)]\n except KeyError:\n raise KeyError(key)","function_tokens":["def","__delitem__","(","self",",","key",":","str",")","->","None",":","try",":","if","self",".","separator","in","key",":","subdict","=","self",".","_subdict","[","self",".","_key_head","(","key",")","]","del","subdict","[","self",".","_key_tail","(","key",")","]","else",":","del","self",".","_data","[","self",".","_key_head","(","key",")","]","except","KeyError",":","raise","KeyError","(","key",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L196-L205"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.__contains__","parameters":"(self, key: Any)","argument_list":"","return_statement":"","docstring":"Determines whether the key is present in the hierarchy.","docstring_summary":"Determines whether the key is present in the hierarchy.","docstring_tokens":["Determines","whether","the","key","is","present","in","the","hierarchy","."],"function":"def __contains__(self, key: Any) -> bool:\n \"\"\"Determines whether the key is present in the hierarchy.\"\"\"\n if self.separator in key:\n try:\n subdict = self._subdict[self._key_head(key)]\n return self._key_tail(key) in subdict\n except KeyError:\n return False\n else:\n return key in self._data","function_tokens":["def","__contains__","(","self",",","key",":","Any",")","->","bool",":","if","self",".","separator","in","key",":","try",":","subdict","=","self",".","_subdict","[","self",".","_key_head","(","key",")","]","return","self",".","_key_tail","(","key",")","in","subdict","except","KeyError",":","return","False","else",":","return","key","in","self",".","_data"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L207-L216"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.__len__","parameters":"(self)","argument_list":"","return_statement":"return len(self._data) + sum([len(subdict) for subdict in self._subdict])","docstring":"Returns the length of all items.","docstring_summary":"Returns the length of all items.","docstring_tokens":["Returns","the","length","of","all","items","."],"function":"def __len__(self) -> int:\n \"\"\"Returns the length of all items.\"\"\"\n return len(self._data) + sum([len(subdict) for subdict in self._subdict])","function_tokens":["def","__len__","(","self",")","->","int",":","return","len","(","self",".","_data",")","+","sum","(","[","len","(","subdict",")","for","subdict","in","self",".","_subdict","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L218-L220"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.branch","parameters":"(self, key: str)","argument_list":"","return_statement":"return HierarchicalDict()","docstring":"Returns the HierarchicalDict housed under the key.\n\n This differs from the data property, in that it is directed by the `key`, and all layers under that key are\n returned, not just those in that level.\n\n Higher layers are not prefixed with the location of earlier layers, so branching a hierarchy containing `a.b.c.d`\n on `a.b` would return a hierarchy containing `c.d`, not `a.b.c.d`.\n\n Args:\n key: The location within the hierarchy to return higher layers.\n\n Returns:\n The HierarchicalDict underneath the specified key (not just the data at that key location in the tree)","docstring_summary":"Returns the HierarchicalDict housed under the key.","docstring_tokens":["Returns","the","HierarchicalDict","housed","under","the","key","."],"function":"def branch(self, key: str) -> 'HierarchicalDict':\n \"\"\"Returns the HierarchicalDict housed under the key.\n\n This differs from the data property, in that it is directed by the `key`, and all layers under that key are\n returned, not just those in that level.\n\n Higher layers are not prefixed with the location of earlier layers, so branching a hierarchy containing `a.b.c.d`\n on `a.b` would return a hierarchy containing `c.d`, not `a.b.c.d`.\n\n Args:\n key: The location within the hierarchy to return higher layers.\n\n Returns:\n The HierarchicalDict underneath the specified key (not just the data at that key location in the tree)\n \"\"\"\n try:\n if self.separator in key:\n return self._subdict[self._key_head(key)].branch(self._key_tail(key))\n else:\n return self._subdict[key]\n except KeyError:\n self._setitem(key = key, value = HierarchicalDict(separator = self.separator), is_data = False)\n return HierarchicalDict()","function_tokens":["def","branch","(","self",",","key",":","str",")","->","'HierarchicalDict'",":","try",":","if","self",".","separator","in","key",":","return","self",".","_subdict","[","self",".","_key_head","(","key",")","]",".","branch","(","self",".","_key_tail","(","key",")",")","else",":","return","self",".","_subdict","[","key","]","except","KeyError",":","self",".","_setitem","(","key","=","key",",","value","=","HierarchicalDict","(","separator","=","self",".","separator",")",",","is_data","=","False",")","return","HierarchicalDict","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L222-L244"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.splice","parameters":"(self, key: str, value: 'HierarchicalDict')","argument_list":"","return_statement":"","docstring":"Splices an existing HierarchicalDictionary under a specific key.\n\n This can be thought of as an inverse of :func:`branch`, although\n `branch` does not remove the requested hierarchy, it simply\n returns it.","docstring_summary":"Splices an existing HierarchicalDictionary under a specific key.","docstring_tokens":["Splices","an","existing","HierarchicalDictionary","under","a","specific","key","."],"function":"def splice(self, key: str, value: 'HierarchicalDict') -> None:\n \"\"\"Splices an existing HierarchicalDictionary under a specific key.\n\n This can be thought of as an inverse of :func:`branch`, although\n `branch` does not remove the requested hierarchy, it simply\n returns it.\n \"\"\"\n if not isinstance(key, str) or not isinstance(value, HierarchicalDict):\n raise TypeError(\"Splice requires a string key and HierarchicalDict value\")\n self._setitem(key, value, False)","function_tokens":["def","splice","(","self",",","key",":","str",",","value",":","'HierarchicalDict'",")","->","None",":","if","not","isinstance","(","key",",","str",")","or","not","isinstance","(","value",",","HierarchicalDict",")",":","raise","TypeError","(","\"Splice requires a string key and HierarchicalDict value\"",")","self",".","_setitem","(","key",",","value",",","False",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L246-L255"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.merge","parameters":"(self, key: str, value: 'HierarchicalDict', overwrite: bool = False)","argument_list":"","return_statement":"","docstring":"Acts similarly to splice, but maintains previous values.\n\n If overwrite is true, then entries in the new value are used over those that exist within key already\n\n Args:\n key: The location within the hierarchy at which to merge the `value`\n value: HierarchicalDict to be merged under the key node\n overwrite: A boolean defining whether the value will be overwritten if it already exists","docstring_summary":"Acts similarly to splice, but maintains previous values.","docstring_tokens":["Acts","similarly","to","splice","but","maintains","previous","values","."],"function":"def merge(self, key: str, value: 'HierarchicalDict', overwrite: bool = False) -> None:\n \"\"\"Acts similarly to splice, but maintains previous values.\n\n If overwrite is true, then entries in the new value are used over those that exist within key already\n\n Args:\n key: The location within the hierarchy at which to merge the `value`\n value: HierarchicalDict to be merged under the key node\n overwrite: A boolean defining whether the value will be overwritten if it already exists\n \"\"\"\n if not isinstance(key, str) or not isinstance(value, HierarchicalDict):\n raise TypeError(\"Splice requires a string key and HierarchicalDict value\")\n for item in dict(value):\n if self.get(key + self._separator + item, None) is not None:\n if overwrite:\n self[key + self._separator + item] = value[item]\n else:\n self[key + self._separator + item] = value[item]","function_tokens":["def","merge","(","self",",","key",":","str",",","value",":","'HierarchicalDict'",",","overwrite",":","bool","=","False",")","->","None",":","if","not","isinstance","(","key",",","str",")","or","not","isinstance","(","value",",","HierarchicalDict",")",":","raise","TypeError","(","\"Splice requires a string key and HierarchicalDict value\"",")","for","item","in","dict","(","value",")",":","if","self",".","get","(","key","+","self",".","_separator","+","item",",","None",")","is","not","None",":","if","overwrite",":","self","[","key","+","self",".","_separator","+","item","]","=","value","[","item","]","else",":","self","[","key","+","self",".","_separator","+","item","]","=","value","[","item","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L257-L274"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.clone","parameters":"(self)","argument_list":"","return_statement":"return copy.deepcopy(self)","docstring":"Duplicates the configuration, allowing changes without affecting the\n original.\n\n Returns:\n A duplicate HierarchicalDict of this object","docstring_summary":"Duplicates the configuration, allowing changes without affecting the\n original.","docstring_tokens":["Duplicates","the","configuration","allowing","changes","without","affecting","the","original","."],"function":"def clone(self) -> 'HierarchicalDict':\n \"\"\"Duplicates the configuration, allowing changes without affecting the\n original.\n\n Returns:\n A duplicate HierarchicalDict of this object\n \"\"\"\n return copy.deepcopy(self)","function_tokens":["def","clone","(","self",")","->","'HierarchicalDict'",":","return","copy",".","deepcopy","(","self",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L276-L283"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"HierarchicalDict.__str__","parameters":"(self)","argument_list":"","return_statement":"return json.dumps(dict([(key, self[key]) for key in sorted(self.generator())]), indent = 2)","docstring":"Turns the Hierarchical dict into a string representation.","docstring_summary":"Turns the Hierarchical dict into a string representation.","docstring_tokens":["Turns","the","Hierarchical","dict","into","a","string","representation","."],"function":"def __str__(self) -> str:\n \"\"\"Turns the Hierarchical dict into a string representation.\"\"\"\n return json.dumps(dict([(key, self[key]) for key in sorted(self.generator())]), indent = 2)","function_tokens":["def","__str__","(","self",")","->","str",":","return","json",".","dumps","(","dict","(","[","(","key",",","self","[","key","]",")","for","key","in","sorted","(","self",".","generator","(",")",")","]",")",",","indent","=","2",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L285-L287"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.__init__","parameters":"(self,\n name: str,\n description: str = None,\n default: ConfigSimpleType = None,\n optional: bool = False)","argument_list":"","return_statement":"","docstring":"Args:\n name: The name of the requirement\n description: A short textual description of the requirement\n default: The default value for the requirement if no value is provided\n optional: Whether the requirement must be satisfied or not","docstring_summary":"","docstring_tokens":[],"function":"def __init__(self,\n name: str,\n description: str = None,\n default: ConfigSimpleType = None,\n optional: bool = False) -> None:\n \"\"\"\n\n Args:\n name: The name of the requirement\n description: A short textual description of the requirement\n default: The default value for the requirement if no value is provided\n optional: Whether the requirement must be satisfied or not\n \"\"\"\n super().__init__()\n if CONFIG_SEPARATOR in name:\n raise ValueError(\"Name cannot contain the config-hierarchy divider ({})\".format(CONFIG_SEPARATOR))\n self._name = name\n self._description = description or \"\"\n self._default = default\n self._optional = optional\n self._requirements = {}","function_tokens":["def","__init__","(","self",",","name",":","str",",","description",":","str","=","None",",","default",":","ConfigSimpleType","=","None",",","optional",":","bool","=","False",")","->","None",":","super","(",")",".","__init__","(",")","if","CONFIG_SEPARATOR","in","name",":","raise","ValueError","(","\"Name cannot contain the config-hierarchy divider ({})\"",".","format","(","CONFIG_SEPARATOR",")",")","self",".","_name","=","name","self",".","_description","=","description","or","\"\"","self",".","_default","=","default","self",".","_optional","=","optional","self",".","_requirements","=","{","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L302-L322"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.name","parameters":"(self)","argument_list":"","return_statement":"return self._name","docstring":"The name of the Requirement.\n\n Names cannot contain CONFIG_SEPARATOR ('.' by default) since\n this is used within the configuration hierarchy.","docstring_summary":"The name of the Requirement.","docstring_tokens":["The","name","of","the","Requirement","."],"function":"def name(self) -> str:\n \"\"\"The name of the Requirement.\n\n Names cannot contain CONFIG_SEPARATOR ('.' by default) since\n this is used within the configuration hierarchy.\n \"\"\"\n return self._name","function_tokens":["def","name","(","self",")","->","str",":","return","self",".","_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L328-L334"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.description","parameters":"(self)","argument_list":"","return_statement":"return self._description","docstring":"A short description of what the Requirement is designed to affect or\n achieve.","docstring_summary":"A short description of what the Requirement is designed to affect or\n achieve.","docstring_tokens":["A","short","description","of","what","the","Requirement","is","designed","to","affect","or","achieve","."],"function":"def description(self) -> str:\n \"\"\"A short description of what the Requirement is designed to affect or\n achieve.\"\"\"\n return self._description","function_tokens":["def","description","(","self",")","->","str",":","return","self",".","_description"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L337-L340"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.default","parameters":"(self)","argument_list":"","return_statement":"return self._default","docstring":"Returns the default value if one is set.","docstring_summary":"Returns the default value if one is set.","docstring_tokens":["Returns","the","default","value","if","one","is","set","."],"function":"def default(self) -> ConfigSimpleType:\n \"\"\"Returns the default value if one is set.\"\"\"\n return self._default","function_tokens":["def","default","(","self",")","->","ConfigSimpleType",":","return","self",".","_default"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L343-L345"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.optional","parameters":"(self)","argument_list":"","return_statement":"return self._optional","docstring":"Whether the Requirement is optional or not.","docstring_summary":"Whether the Requirement is optional or not.","docstring_tokens":["Whether","the","Requirement","is","optional","or","not","."],"function":"def optional(self) -> bool:\n \"\"\"Whether the Requirement is optional or not.\"\"\"\n return self._optional","function_tokens":["def","optional","(","self",")","->","bool",":","return","self",".","_optional"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L348-L350"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.optional","parameters":"(self, value)","argument_list":"","return_statement":"","docstring":"Sets the optional value for a requirement.","docstring_summary":"Sets the optional value for a requirement.","docstring_tokens":["Sets","the","optional","value","for","a","requirement","."],"function":"def optional(self, value) -> None:\n \"\"\"Sets the optional value for a requirement.\"\"\"\n self._optional = bool(value)","function_tokens":["def","optional","(","self",",","value",")","->","None",":","self",".","_optional","=","bool","(","value",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L353-L355"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.config_value","parameters":"(self,\n context: 'interfaces.context.ContextInterface',\n config_path: str,\n default: ConfigSimpleType = None)","argument_list":"","return_statement":"return context.config.get(config_path, default)","docstring":"Returns the value for this Requirement from its config path.\n\n Args:\n context: the configuration store to find the value for this requirement\n config_path: the configuration path of the instance of the requirement to be recovered\n default: a default value to provide if the requirement's configuration value is not found","docstring_summary":"Returns the value for this Requirement from its config path.","docstring_tokens":["Returns","the","value","for","this","Requirement","from","its","config","path","."],"function":"def config_value(self,\n context: 'interfaces.context.ContextInterface',\n config_path: str,\n default: ConfigSimpleType = None) -> ConfigSimpleType:\n \"\"\"Returns the value for this Requirement from its config path.\n\n Args:\n context: the configuration store to find the value for this requirement\n config_path: the configuration path of the instance of the requirement to be recovered\n default: a default value to provide if the requirement's configuration value is not found\n \"\"\"\n return context.config.get(config_path, default)","function_tokens":["def","config_value","(","self",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",",","default",":","ConfigSimpleType","=","None",")","->","ConfigSimpleType",":","return","context",".","config",".","get","(","config_path",",","default",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L357-L368"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.requirements","parameters":"(self)","argument_list":"","return_statement":"return self._requirements.copy()","docstring":"Returns a dictionary of all the child requirements, indexed by\n name.","docstring_summary":"Returns a dictionary of all the child requirements, indexed by\n name.","docstring_tokens":["Returns","a","dictionary","of","all","the","child","requirements","indexed","by","name","."],"function":"def requirements(self) -> Dict[str, 'RequirementInterface']:\n \"\"\"Returns a dictionary of all the child requirements, indexed by\n name.\"\"\"\n return self._requirements.copy()","function_tokens":["def","requirements","(","self",")","->","Dict","[","str",",","'RequirementInterface'","]",":","return","self",".","_requirements",".","copy","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L372-L375"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.add_requirement","parameters":"(self, requirement: 'RequirementInterface')","argument_list":"","return_statement":"","docstring":"Adds a child to the list of requirements.\n\n Args:\n requirement: The requirement to add as a child-requirement","docstring_summary":"Adds a child to the list of requirements.","docstring_tokens":["Adds","a","child","to","the","list","of","requirements","."],"function":"def add_requirement(self, requirement: 'RequirementInterface') -> None:\n \"\"\"Adds a child to the list of requirements.\n\n Args:\n requirement: The requirement to add as a child-requirement\n \"\"\"\n self._requirements[requirement.name] = requirement","function_tokens":["def","add_requirement","(","self",",","requirement",":","'RequirementInterface'",")","->","None",":","self",".","_requirements","[","requirement",".","name","]","=","requirement"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L377-L383"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.remove_requirement","parameters":"(self, requirement: 'RequirementInterface')","argument_list":"","return_statement":"","docstring":"Removes a child from the list of requirements.\n\n Args:\n requirement: The requirement to remove as a child-requirement","docstring_summary":"Removes a child from the list of requirements.","docstring_tokens":["Removes","a","child","from","the","list","of","requirements","."],"function":"def remove_requirement(self, requirement: 'RequirementInterface') -> None:\n \"\"\"Removes a child from the list of requirements.\n\n Args:\n requirement: The requirement to remove as a child-requirement\n \"\"\"\n del self._requirements[requirement.name]","function_tokens":["def","remove_requirement","(","self",",","requirement",":","'RequirementInterface'",")","->","None",":","del","self",".","_requirements","[","requirement",".","name","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L385-L391"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.unsatisfied_children","parameters":"(self, context: 'interfaces.context.ContextInterface',\n config_path: str)","argument_list":"","return_statement":"return result","docstring":"Method that will validate all child requirements.\n\n Args:\n context: the context containing the configuration data for this requirement\n config_path: the configuration path of this instance of the requirement\n\n Returns:\n A dictionary of full configuration paths for each unsatisfied child-requirement","docstring_summary":"Method that will validate all child requirements.","docstring_tokens":["Method","that","will","validate","all","child","requirements","."],"function":"def unsatisfied_children(self, context: 'interfaces.context.ContextInterface',\n config_path: str) -> Dict[str, 'RequirementInterface']:\n \"\"\"Method that will validate all child requirements.\n\n Args:\n context: the context containing the configuration data for this requirement\n config_path: the configuration path of this instance of the requirement\n\n Returns:\n A dictionary of full configuration paths for each unsatisfied child-requirement\n \"\"\"\n result = {}\n for requirement in self.requirements.values():\n if not requirement.optional:\n subresult = requirement.unsatisfied(context, path_join(config_path, self._name))\n result.update(subresult)\n return result","function_tokens":["def","unsatisfied_children","(","self",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",")","->","Dict","[","str",",","'RequirementInterface'","]",":","result","=","{","}","for","requirement","in","self",".","requirements",".","values","(",")",":","if","not","requirement",".","optional",":","subresult","=","requirement",".","unsatisfied","(","context",",","path_join","(","config_path",",","self",".","_name",")",")","result",".","update","(","subresult",")","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L393-L409"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"RequirementInterface.unsatisfied","parameters":"(self, context: 'interfaces.context.ContextInterface',\n config_path: str)","argument_list":"","return_statement":"","docstring":"Method to validate the value stored at config_path for the\n configuration object against a context.\n\n Returns a list containing its own name (or multiple unsatisfied requirement names) when invalid\n\n Args:\n context: The context object containing the configuration for this requirement\n config_path: The configuration path for this requirement to test satisfaction\n\n Returns:\n A dictionary of configuration-paths to requirements that could not be satisfied","docstring_summary":"Method to validate the value stored at config_path for the\n configuration object against a context.","docstring_tokens":["Method","to","validate","the","value","stored","at","config_path","for","the","configuration","object","against","a","context","."],"function":"def unsatisfied(self, context: 'interfaces.context.ContextInterface',\n config_path: str) -> Dict[str, 'RequirementInterface']:\n \"\"\"Method to validate the value stored at config_path for the\n configuration object against a context.\n\n Returns a list containing its own name (or multiple unsatisfied requirement names) when invalid\n\n Args:\n context: The context object containing the configuration for this requirement\n config_path: The configuration path for this requirement to test satisfaction\n\n Returns:\n A dictionary of configuration-paths to requirements that could not be satisfied\n \"\"\"","function_tokens":["def","unsatisfied","(","self",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",")","->","Dict","[","str",",","'RequirementInterface'","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L413-L426"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"SimpleTypeRequirement.add_requirement","parameters":"(self, requirement: RequirementInterface)","argument_list":"","return_statement":"","docstring":"Always raises a TypeError as instance requirements cannot have\n children.","docstring_summary":"Always raises a TypeError as instance requirements cannot have\n children.","docstring_tokens":["Always","raises","a","TypeError","as","instance","requirements","cannot","have","children","."],"function":"def add_requirement(self, requirement: RequirementInterface):\n \"\"\"Always raises a TypeError as instance requirements cannot have\n children.\"\"\"\n raise TypeError(\"Instance Requirements cannot have subrequirements\")","function_tokens":["def","add_requirement","(","self",",","requirement",":","RequirementInterface",")",":","raise","TypeError","(","\"Instance Requirements cannot have subrequirements\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L434-L437"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"SimpleTypeRequirement.remove_requirement","parameters":"(self, requirement: RequirementInterface)","argument_list":"","return_statement":"","docstring":"Always raises a TypeError as instance requirements cannot have\n children.","docstring_summary":"Always raises a TypeError as instance requirements cannot have\n children.","docstring_tokens":["Always","raises","a","TypeError","as","instance","requirements","cannot","have","children","."],"function":"def remove_requirement(self, requirement: RequirementInterface):\n \"\"\"Always raises a TypeError as instance requirements cannot have\n children.\"\"\"\n raise TypeError(\"Instance Requirements cannot have subrequirements\")","function_tokens":["def","remove_requirement","(","self",",","requirement",":","RequirementInterface",")",":","raise","TypeError","(","\"Instance Requirements cannot have subrequirements\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L439-L442"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"SimpleTypeRequirement.unsatisfied","parameters":"(self, context: 'interfaces.context.ContextInterface',\n config_path: str)","argument_list":"","return_statement":"return {}","docstring":"Validates the instance requirement based upon its\n `instance_type`.","docstring_summary":"Validates the instance requirement based upon its\n `instance_type`.","docstring_tokens":["Validates","the","instance","requirement","based","upon","its","instance_type","."],"function":"def unsatisfied(self, context: 'interfaces.context.ContextInterface',\n config_path: str) -> Dict[str, RequirementInterface]:\n \"\"\"Validates the instance requirement based upon its\n `instance_type`.\"\"\"\n config_path = path_join(config_path, self.name)\n\n value = self.config_value(context, config_path, None)\n if not isinstance(value, self.instance_type):\n vollog.log(\n constants.LOGLEVEL_V,\n \"TypeError - {} requirements only accept {} type: {}\".format(self.name, self.instance_type.__name__,\n repr(value)))\n return {config_path: self}\n return {}","function_tokens":["def","unsatisfied","(","self",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",")","->","Dict","[","str",",","RequirementInterface","]",":","config_path","=","path_join","(","config_path",",","self",".","name",")","value","=","self",".","config_value","(","context",",","config_path",",","None",")","if","not","isinstance","(","value",",","self",".","instance_type",")",":","vollog",".","log","(","constants",".","LOGLEVEL_V",",","\"TypeError - {} requirements only accept {} type: {}\"",".","format","(","self",".","name",",","self",".","instance_type",".","__name__",",","repr","(","value",")",")",")","return","{","config_path",":","self","}","return","{","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L444-L457"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ClassRequirement.cls","parameters":"(self)","argument_list":"","return_statement":"return self._cls","docstring":"Contains the actual chosen class based on the configuration value's\n class name.","docstring_summary":"Contains the actual chosen class based on the configuration value's\n class name.","docstring_tokens":["Contains","the","actual","chosen","class","based","on","the","configuration","value","s","class","name","."],"function":"def cls(self) -> Type:\n \"\"\"Contains the actual chosen class based on the configuration value's\n class name.\"\"\"\n return self._cls","function_tokens":["def","cls","(","self",")","->","Type",":","return","self",".","_cls"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L473-L476"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ClassRequirement.unsatisfied","parameters":"(self, context: 'interfaces.context.ContextInterface',\n config_path: str)","argument_list":"","return_statement":"return {}","docstring":"Checks to see if a class can be recovered.","docstring_summary":"Checks to see if a class can be recovered.","docstring_tokens":["Checks","to","see","if","a","class","can","be","recovered","."],"function":"def unsatisfied(self, context: 'interfaces.context.ContextInterface',\n config_path: str) -> Dict[str, RequirementInterface]:\n \"\"\"Checks to see if a class can be recovered.\"\"\"\n config_path = path_join(config_path, self.name)\n\n value = self.config_value(context, config_path, None)\n self._cls = None\n if value is not None and isinstance(value, str):\n if \".\" in value:\n # TODO: consider importing the prefix\n module = sys.modules.get(value[:value.rindex(\".\")], None)\n class_name = value[value.rindex(\".\") + 1:]\n if hasattr(module, class_name):\n self._cls = getattr(module, class_name)\n else:\n if value in globals():\n self._cls = globals()[value]\n if self._cls is None:\n return {config_path: self}\n return {}","function_tokens":["def","unsatisfied","(","self",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",")","->","Dict","[","str",",","RequirementInterface","]",":","config_path","=","path_join","(","config_path",",","self",".","name",")","value","=","self",".","config_value","(","context",",","config_path",",","None",")","self",".","_cls","=","None","if","value","is","not","None","and","isinstance","(","value",",","str",")",":","if","\".\"","in","value",":","# TODO: consider importing the prefix","module","=","sys",".","modules",".","get","(","value","[",":","value",".","rindex","(","\".\"",")","]",",","None",")","class_name","=","value","[","value",".","rindex","(","\".\"",")","+","1",":","]","if","hasattr","(","module",",","class_name",")",":","self",".","_cls","=","getattr","(","module",",","class_name",")","else",":","if","value","in","globals","(",")",":","self",".","_cls","=","globals","(",")","[","value","]","if","self",".","_cls","is","None",":","return","{","config_path",":","self","}","return","{","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L478-L497"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConstructableRequirementInterface.construct","parameters":"(self, context: 'interfaces.context.ContextInterface', config_path: str)","argument_list":"","return_statement":"","docstring":"Method for constructing within the context any required elements\n from subrequirements.\n\n Args:\n context: The context object containing the configuration data for the constructable\n config_path: The configuration path for the specific instance of this constructable","docstring_summary":"Method for constructing within the context any required elements\n from subrequirements.","docstring_tokens":["Method","for","constructing","within","the","context","any","required","elements","from","subrequirements","."],"function":"def construct(self, context: 'interfaces.context.ContextInterface', config_path: str) -> None:\n \"\"\"Method for constructing within the context any required elements\n from subrequirements.\n\n Args:\n context: The context object containing the configuration data for the constructable\n config_path: The configuration path for the specific instance of this constructable\n \"\"\"","function_tokens":["def","construct","(","self",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L521-L528"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConstructableRequirementInterface._validate_class","parameters":"(self, context: 'interfaces.context.ContextInterface', config_path: str)","argument_list":"","return_statement":"","docstring":"Method to check if the class Requirement is valid and if so populate\n the other requirements (but no need to validate, since we're invalid\n already)\n\n Args:\n context: The context object containing the configuration data for the constructable\n config_path: The configuration path for the specific instance of this constructable","docstring_summary":"Method to check if the class Requirement is valid and if so populate\n the other requirements (but no need to validate, since we're invalid\n already)","docstring_tokens":["Method","to","check","if","the","class","Requirement","is","valid","and","if","so","populate","the","other","requirements","(","but","no","need","to","validate","since","we","re","invalid","already",")"],"function":"def _validate_class(self, context: 'interfaces.context.ContextInterface', config_path: str) -> None:\n \"\"\"Method to check if the class Requirement is valid and if so populate\n the other requirements (but no need to validate, since we're invalid\n already)\n\n Args:\n context: The context object containing the configuration data for the constructable\n config_path: The configuration path for the specific instance of this constructable\n \"\"\"\n class_req = self.requirements['class']\n subreq_config_path = path_join(config_path, self.name)\n if not class_req.unsatisfied(context, subreq_config_path) and isinstance(class_req, ClassRequirement):\n # We have a class, and since it's validated we can construct our requirements from it\n if issubclass(class_req.cls, ConfigurableInterface):\n # In case the class has changed, clear out the old requirements\n for old_req in self._current_class_requirements.copy():\n del self._requirements[old_req]\n self._current_class_requirements.remove(old_req)\n # And add the new ones\n for requirement in class_req.cls.get_requirements():\n self._current_class_requirements.add(requirement.name)\n self.add_requirement(requirement)","function_tokens":["def","_validate_class","(","self",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",")","->","None",":","class_req","=","self",".","requirements","[","'class'","]","subreq_config_path","=","path_join","(","config_path",",","self",".","name",")","if","not","class_req",".","unsatisfied","(","context",",","subreq_config_path",")","and","isinstance","(","class_req",",","ClassRequirement",")",":","# We have a class, and since it's validated we can construct our requirements from it","if","issubclass","(","class_req",".","cls",",","ConfigurableInterface",")",":","# In case the class has changed, clear out the old requirements","for","old_req","in","self",".","_current_class_requirements",".","copy","(",")",":","del","self",".","_requirements","[","old_req","]","self",".","_current_class_requirements",".","remove","(","old_req",")","# And add the new ones","for","requirement","in","class_req",".","cls",".","get_requirements","(",")",":","self",".","_current_class_requirements",".","add","(","requirement",".","name",")","self",".","add_requirement","(","requirement",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L530-L551"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConstructableRequirementInterface._construct_class","parameters":"(self,\n context: 'interfaces.context.ContextInterface',\n config_path: str,\n requirement_dict: Dict[str, object] = None)","argument_list":"","return_statement":"return obj","docstring":"Constructs the class, handing args and the subrequirements as\n parameters to __init__","docstring_summary":"Constructs the class, handing args and the subrequirements as\n parameters to __init__","docstring_tokens":["Constructs","the","class","handing","args","and","the","subrequirements","as","parameters","to","__init__"],"function":"def _construct_class(self,\n context: 'interfaces.context.ContextInterface',\n config_path: str,\n requirement_dict: Dict[str, object] = None) -> Optional['interfaces.objects.ObjectInterface']:\n \"\"\"Constructs the class, handing args and the subrequirements as\n parameters to __init__\"\"\"\n if self.requirements[\"class\"].unsatisfied(context, config_path):\n return None\n\n if not isinstance(self.requirements[\"class\"], ClassRequirement):\n return None\n cls = self.requirements[\"class\"].cls\n\n # These classes all have a name property\n # We could subclass this out as a NameableInterface, but it seems a little excessive\n # FIXME: We can't test this, because importing the other interfaces causes all kinds of import loops\n # if not issubclass(cls, [interfaces.layers.TranslationLayerInterface,\n # interfaces.symbols.SymbolTableInterface]):\n # return None\n\n if requirement_dict is None:\n requirement_dict = {}\n\n # Fulfillment must happen, exceptions happening here mean the requirements aren't correct\n # and these need to be raised and fixed, rather than caught and ignored\n obj = cls(**requirement_dict)\n context.config[config_path] = obj.name\n return obj","function_tokens":["def","_construct_class","(","self",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",",","requirement_dict",":","Dict","[","str",",","object","]","=","None",")","->","Optional","[","'interfaces.objects.ObjectInterface'","]",":","if","self",".","requirements","[","\"class\"","]",".","unsatisfied","(","context",",","config_path",")",":","return","None","if","not","isinstance","(","self",".","requirements","[","\"class\"","]",",","ClassRequirement",")",":","return","None","cls","=","self",".","requirements","[","\"class\"","]",".","cls","# These classes all have a name property","# We could subclass this out as a NameableInterface, but it seems a little excessive","# FIXME: We can't test this, because importing the other interfaces causes all kinds of import loops","# if not issubclass(cls, [interfaces.layers.TranslationLayerInterface,","# interfaces.symbols.SymbolTableInterface]):","# return None","if","requirement_dict","is","None",":","requirement_dict","=","{","}","# Fulfillment must happen, exceptions happening here mean the requirements aren't correct","# and these need to be raised and fixed, rather than caught and ignored","obj","=","cls","(","*","*","requirement_dict",")","context",".","config","[","config_path","]","=","obj",".","name","return","obj"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L553-L580"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConfigurableRequirementInterface.build_configuration","parameters":"(self, context: 'interfaces.context.ContextInterface', config_path: str,\n value: Any)","argument_list":"","return_statement":"","docstring":"Proxies to a ConfigurableInterface if necessary.","docstring_summary":"Proxies to a ConfigurableInterface if necessary.","docstring_tokens":["Proxies","to","a","ConfigurableInterface","if","necessary","."],"function":"def build_configuration(self, context: 'interfaces.context.ContextInterface', config_path: str,\n value: Any) -> HierarchicalDict:\n \"\"\"Proxies to a ConfigurableInterface if necessary.\"\"\"","function_tokens":["def","build_configuration","(","self",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",",","value",":","Any",")","->","HierarchicalDict",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L586-L588"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConfigurableInterface.__init__","parameters":"(self, context: 'interfaces.context.ContextInterface', config_path: str)","argument_list":"","return_statement":"","docstring":"Basic initializer that allows configurables to access their own\n config settings.","docstring_summary":"Basic initializer that allows configurables to access their own\n config settings.","docstring_tokens":["Basic","initializer","that","allows","configurables","to","access","their","own","config","settings","."],"function":"def __init__(self, context: 'interfaces.context.ContextInterface', config_path: str) -> None:\n \"\"\"Basic initializer that allows configurables to access their own\n config settings.\"\"\"\n super().__init__()\n self._context = context\n self._config_path = config_path\n self._config_cache = None","function_tokens":["def","__init__","(","self",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",")","->","None",":","super","(",")",".","__init__","(",")","self",".","_context","=","context","self",".","_config_path","=","config_path","self",".","_config_cache","=","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L595-L601"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConfigurableInterface.context","parameters":"(self)","argument_list":"","return_statement":"return self._context","docstring":"The context object that this configurable belongs to\/configuration\n is stored in.","docstring_summary":"The context object that this configurable belongs to\/configuration\n is stored in.","docstring_tokens":["The","context","object","that","this","configurable","belongs","to","\/","configuration","is","stored","in","."],"function":"def context(self) -> 'interfaces.context.ContextInterface':\n \"\"\"The context object that this configurable belongs to\/configuration\n is stored in.\"\"\"\n return self._context","function_tokens":["def","context","(","self",")","->","'interfaces.context.ContextInterface'",":","return","self",".","_context"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L604-L607"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConfigurableInterface.config_path","parameters":"(self)","argument_list":"","return_statement":"return self._config_path","docstring":"The configuration path on which this configurable lives.","docstring_summary":"The configuration path on which this configurable lives.","docstring_tokens":["The","configuration","path","on","which","this","configurable","lives","."],"function":"def config_path(self) -> str:\n \"\"\"The configuration path on which this configurable lives.\"\"\"\n return self._config_path","function_tokens":["def","config_path","(","self",")","->","str",":","return","self",".","_config_path"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L610-L612"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConfigurableInterface.config_path","parameters":"(self, value: str)","argument_list":"","return_statement":"","docstring":"The configuration path on which this configurable lives.","docstring_summary":"The configuration path on which this configurable lives.","docstring_tokens":["The","configuration","path","on","which","this","configurable","lives","."],"function":"def config_path(self, value: str) -> None:\n \"\"\"The configuration path on which this configurable lives.\"\"\"\n self._config_path = value\n self._config_cache = None","function_tokens":["def","config_path","(","self",",","value",":","str",")","->","None",":","self",".","_config_path","=","value","self",".","_config_cache","=","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L615-L618"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConfigurableInterface.config","parameters":"(self)","argument_list":"","return_statement":"return self._config_cache","docstring":"The Hierarchical configuration Dictionary for this Configurable\n object.","docstring_summary":"The Hierarchical configuration Dictionary for this Configurable\n object.","docstring_tokens":["The","Hierarchical","configuration","Dictionary","for","this","Configurable","object","."],"function":"def config(self) -> HierarchicalDict:\n \"\"\"The Hierarchical configuration Dictionary for this Configurable\n object.\"\"\"\n if not hasattr(self, \"_config_cache\") or self._config_cache is None:\n self._config_cache = self._context.config.branch(self._config_path)\n return self._config_cache","function_tokens":["def","config","(","self",")","->","HierarchicalDict",":","if","not","hasattr","(","self",",","\"_config_cache\"",")","or","self",".","_config_cache","is","None",":","self",".","_config_cache","=","self",".","_context",".","config",".","branch","(","self",".","_config_path",")","return","self",".","_config_cache"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L621-L626"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConfigurableInterface.build_configuration","parameters":"(self)","argument_list":"","return_statement":"return result","docstring":"Constructs a HierarchicalDictionary of all the options required to\n build this component in the current context.\n\n Ensures that if the class has been created, it can be recreated\n using the configuration built Inheriting classes must override\n this to ensure any dependent classes update their configurations\n too","docstring_summary":"Constructs a HierarchicalDictionary of all the options required to\n build this component in the current context.","docstring_tokens":["Constructs","a","HierarchicalDictionary","of","all","the","options","required","to","build","this","component","in","the","current","context","."],"function":"def build_configuration(self) -> HierarchicalDict:\n \"\"\"Constructs a HierarchicalDictionary of all the options required to\n build this component in the current context.\n\n Ensures that if the class has been created, it can be recreated\n using the configuration built Inheriting classes must override\n this to ensure any dependent classes update their configurations\n too\n \"\"\"\n result = HierarchicalDict()\n for req in self.get_requirements():\n value = self.config.get(req.name, None)\n # Do not include the name of constructed classes\n if value is not None and not isinstance(req, ConstructableRequirementInterface):\n result[req.name] = value\n if isinstance(req, ConfigurableRequirementInterface):\n if value is not None:\n result.splice(req.name, req.build_configuration(self.context, self.config_path, value))\n return result","function_tokens":["def","build_configuration","(","self",")","->","HierarchicalDict",":","result","=","HierarchicalDict","(",")","for","req","in","self",".","get_requirements","(",")",":","value","=","self",".","config",".","get","(","req",".","name",",","None",")","# Do not include the name of constructed classes","if","value","is","not","None","and","not","isinstance","(","req",",","ConstructableRequirementInterface",")",":","result","[","req",".","name","]","=","value","if","isinstance","(","req",",","ConfigurableRequirementInterface",")",":","if","value","is","not","None",":","result",".","splice","(","req",".","name",",","req",".","build_configuration","(","self",".","context",",","self",".","config_path",",","value",")",")","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L628-L646"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConfigurableInterface.get_requirements","parameters":"(cls)","argument_list":"","return_statement":"return []","docstring":"Returns a list of RequirementInterface objects required by this\n object.","docstring_summary":"Returns a list of RequirementInterface objects required by this\n object.","docstring_tokens":["Returns","a","list","of","RequirementInterface","objects","required","by","this","object","."],"function":"def get_requirements(cls) -> List[RequirementInterface]:\n \"\"\"Returns a list of RequirementInterface objects required by this\n object.\"\"\"\n return []","function_tokens":["def","get_requirements","(","cls",")","->","List","[","RequirementInterface","]",":","return","[","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L649-L652"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConfigurableInterface.unsatisfied","parameters":"(cls, context: 'interfaces.context.ContextInterface',\n config_path: str)","argument_list":"","return_statement":"return result","docstring":"Returns a list of the names of all unsatisfied requirements.\n\n Since a satisfied set of requirements will return [], it can be used in tests as follows:\n\n .. code-block:: python\n\n unmet = configurable.unsatisfied(context, config_path)\n if unmet:\n raise RuntimeError(\"Unsatisfied requirements: {}\".format(unmet)","docstring_summary":"Returns a list of the names of all unsatisfied requirements.","docstring_tokens":["Returns","a","list","of","the","names","of","all","unsatisfied","requirements","."],"function":"def unsatisfied(cls, context: 'interfaces.context.ContextInterface',\n config_path: str) -> Dict[str, RequirementInterface]:\n \"\"\"Returns a list of the names of all unsatisfied requirements.\n\n Since a satisfied set of requirements will return [], it can be used in tests as follows:\n\n .. code-block:: python\n\n unmet = configurable.unsatisfied(context, config_path)\n if unmet:\n raise RuntimeError(\"Unsatisfied requirements: {}\".format(unmet)\n \"\"\"\n result = {}\n for requirement in cls.get_requirements():\n if not requirement.optional:\n subresult = requirement.unsatisfied(context, config_path)\n result.update(subresult)\n return result","function_tokens":["def","unsatisfied","(","cls",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",")","->","Dict","[","str",",","RequirementInterface","]",":","result","=","{","}","for","requirement","in","cls",".","get_requirements","(",")",":","if","not","requirement",".","optional",":","subresult","=","requirement",".","unsatisfied","(","context",",","config_path",")","result",".","update","(","subresult",")","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L655-L672"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"ConfigurableInterface.make_subconfig","parameters":"(cls, context: 'interfaces.context.ContextInterface', base_config_path: str, **kwargs)","argument_list":"","return_statement":"return new_config_path","docstring":"Convenience function to allow constructing a new randomly generated\n sub-configuration path, containing each element from kwargs.\n\n Args:\n context: The context in which to store the new configuration\n base_config_path: The base configuration path on which to build the new configuration\n kwargs: Keyword arguments that are used to populate the new configuration path\n\n Returns:\n str: The newly generated full configuration path","docstring_summary":"Convenience function to allow constructing a new randomly generated\n sub-configuration path, containing each element from kwargs.","docstring_tokens":["Convenience","function","to","allow","constructing","a","new","randomly","generated","sub","-","configuration","path","containing","each","element","from","kwargs","."],"function":"def make_subconfig(cls, context: 'interfaces.context.ContextInterface', base_config_path: str, **kwargs) -> str:\n \"\"\"Convenience function to allow constructing a new randomly generated\n sub-configuration path, containing each element from kwargs.\n\n Args:\n context: The context in which to store the new configuration\n base_config_path: The base configuration path on which to build the new configuration\n kwargs: Keyword arguments that are used to populate the new configuration path\n\n Returns:\n str: The newly generated full configuration path\n \"\"\"\n random_config_dict = ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits)\n for _ in range(8))\n new_config_path = path_join(base_config_path, random_config_dict)\n # TODO: Check that the new_config_path is empty, although it's not critical if it's not since the values are merged in\n\n # This should check that each k corresponds to a requirement and each v is of the appropriate type\n # This would require knowledge of the new configurable itself to verify, and they should do validation in the\n # constructor anyway, however, to prevent bad types getting into the config tree we just verify that v is a simple type\n for k, v in kwargs.items():\n if not isinstance(v, (int, str, bool, float, bytes)):\n raise TypeError(\"Config values passed to make_subconfig can only be simple types\")\n context.config[path_join(new_config_path, k)] = v\n\n return new_config_path","function_tokens":["def","make_subconfig","(","cls",",","context",":","'interfaces.context.ContextInterface'",",","base_config_path",":","str",",","*","*","kwargs",")","->","str",":","random_config_dict","=","''",".","join","(","random",".","SystemRandom","(",")",".","choice","(","string",".","ascii_uppercase","+","string",".","digits",")","for","_","in","range","(","8",")",")","new_config_path","=","path_join","(","base_config_path",",","random_config_dict",")","# TODO: Check that the new_config_path is empty, although it's not critical if it's not since the values are merged in","# This should check that each k corresponds to a requirement and each v is of the appropriate type","# This would require knowledge of the new configurable itself to verify, and they should do validation in the","# constructor anyway, however, to prevent bad types getting into the config tree we just verify that v is a simple type","for","k",",","v","in","kwargs",".","items","(",")",":","if","not","isinstance","(","v",",","(","int",",","str",",","bool",",","float",",","bytes",")",")",":","raise","TypeError","(","\"Config values passed to make_subconfig can only be simple types\"",")","context",".","config","[","path_join","(","new_config_path",",","k",")","]","=","v","return","new_config_path"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L675-L700"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py","language":"python","identifier":"VersionableInterface.version","parameters":"(cls)","argument_list":"","return_statement":"return cls._version","docstring":"The version of the current interface (classmethods available on the component).\n\n It is strongly recommended that Semantic Versioning be used (and the default version verification is defined that way):\n\n MAJOR version when you make incompatible API changes.\n MINOR version when you add functionality in a backwards compatible manner.\n PATCH version when you make backwards compatible bug fixes.","docstring_summary":"The version of the current interface (classmethods available on the component).","docstring_tokens":["The","version","of","the","current","interface","(","classmethods","available","on","the","component",")","."],"function":"def version(cls) -> Tuple[int, int, int]:\n \"\"\"The version of the current interface (classmethods available on the component).\n\n It is strongly recommended that Semantic Versioning be used (and the default version verification is defined that way):\n\n MAJOR version when you make incompatible API changes.\n MINOR version when you add functionality in a backwards compatible manner.\n PATCH version when you make backwards compatible bug fixes.\n \"\"\"\n return cls._version","function_tokens":["def","version","(","cls",")","->","Tuple","[","int",",","int",",","int","]",":","return","cls",".","_version"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/configuration.py#L713-L722"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/automagic.py","language":"python","identifier":"AutomagicInterface.__call__","parameters":"(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return []","docstring":"Runs the automagic over the configurable.","docstring_summary":"Runs the automagic over the configurable.","docstring_tokens":["Runs","the","automagic","over","the","configurable","."],"function":"def __call__(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement: interfaces.configuration.RequirementInterface,\n progress_callback: constants.ProgressCallback = None) -> Optional[List[Any]]:\n \"\"\"Runs the automagic over the configurable.\"\"\"\n return []","function_tokens":["def","__call__","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","requirement",":","interfaces",".","configuration",".","RequirementInterface",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","Optional","[","List","[","Any","]","]",":","return","[","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/automagic.py#L51-L57"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/automagic.py","language":"python","identifier":"AutomagicInterface.find_requirements","parameters":"(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement_root: interfaces.configuration.RequirementInterface,\n requirement_type: Union[Tuple[Type[interfaces.configuration.RequirementInterface], ...],\n Type[interfaces.configuration.RequirementInterface]],\n shortcut: bool = True)","argument_list":"","return_statement":"return results","docstring":"Determines if there is actually an unfulfilled `Requirement`\n waiting.\n\n This ensures we do not carry out an expensive search when there is no need for a particular `Requirement`\n\n Args:\n context: Context on which to operate\n config_path: Configuration path of the top-level requirement\n requirement_root: Top-level requirement whose subrequirements will all be searched\n requirement_type: Type of requirement to find\n shortcut: Only returns requirements that live under unsatisfied requirements\n\n Returns:\n A list of tuples containing the config_path, sub_config_path and requirement identifying the unsatisfied `Requirements`","docstring_summary":"Determines if there is actually an unfulfilled `Requirement`\n waiting.","docstring_tokens":["Determines","if","there","is","actually","an","unfulfilled","Requirement","waiting","."],"function":"def find_requirements(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n requirement_root: interfaces.configuration.RequirementInterface,\n requirement_type: Union[Tuple[Type[interfaces.configuration.RequirementInterface], ...],\n Type[interfaces.configuration.RequirementInterface]],\n shortcut: bool = True) -> List[Tuple[str, interfaces.configuration.RequirementInterface]]:\n \"\"\"Determines if there is actually an unfulfilled `Requirement`\n waiting.\n\n This ensures we do not carry out an expensive search when there is no need for a particular `Requirement`\n\n Args:\n context: Context on which to operate\n config_path: Configuration path of the top-level requirement\n requirement_root: Top-level requirement whose subrequirements will all be searched\n requirement_type: Type of requirement to find\n shortcut: Only returns requirements that live under unsatisfied requirements\n\n Returns:\n A list of tuples containing the config_path, sub_config_path and requirement identifying the unsatisfied `Requirements`\n \"\"\"\n sub_config_path = interfaces.configuration.path_join(config_path, requirement_root.name)\n results = [] # type: List[Tuple[str, interfaces.configuration.RequirementInterface]]\n recurse = not shortcut\n if isinstance(requirement_root, requirement_type):\n if recurse or requirement_root.unsatisfied(context, config_path):\n results.append((sub_config_path, requirement_root))\n else:\n recurse = True\n if recurse:\n for subreq in requirement_root.requirements.values():\n results += self.find_requirements(context, sub_config_path, subreq, requirement_type, shortcut)\n return results","function_tokens":["def","find_requirements","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","requirement_root",":","interfaces",".","configuration",".","RequirementInterface",",","requirement_type",":","Union","[","Tuple","[","Type","[","interfaces",".","configuration",".","RequirementInterface","]",",","...","]",",","Type","[","interfaces",".","configuration",".","RequirementInterface","]","]",",","shortcut",":","bool","=","True",")","->","List","[","Tuple","[","str",",","interfaces",".","configuration",".","RequirementInterface","]","]",":","sub_config_path","=","interfaces",".","configuration",".","path_join","(","config_path",",","requirement_root",".","name",")","results","=","[","]","# type: List[Tuple[str, interfaces.configuration.RequirementInterface]]","recurse","=","not","shortcut","if","isinstance","(","requirement_root",",","requirement_type",")",":","if","recurse","or","requirement_root",".","unsatisfied","(","context",",","config_path",")",":","results",".","append","(","(","sub_config_path",",","requirement_root",")",")","else",":","recurse","=","True","if","recurse",":","for","subreq","in","requirement_root",".","requirements",".","values","(",")",":","results","+=","self",".","find_requirements","(","context",",","sub_config_path",",","subreq",",","requirement_type",",","shortcut",")","return","results"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/automagic.py#L62-L95"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/automagic.py","language":"python","identifier":"StackerLayerInterface.stack","parameters":"(self,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"","docstring":"Method to determine whether this builder can operate on the named\n layer. If so, modify the context appropriately.\n\n Returns the name of any new layer stacked on top of this layer or None. The stacking is therefore strictly\n linear rather than tree driven.\n\n Configuration options provided by the context are ignored, and defaults are to be used by this method\n to build a space where possible.\n\n Args:\n context: Context in which to construct the higher layer\n layer_name: Name of the layer to stack on top of\n progress_callback: A callback function to indicate progress through a scan (if one is necessary)","docstring_summary":"Method to determine whether this builder can operate on the named\n layer. If so, modify the context appropriately.","docstring_tokens":["Method","to","determine","whether","this","builder","can","operate","on","the","named","layer",".","If","so","modify","the","context","appropriately","."],"function":"def stack(self,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n progress_callback: constants.ProgressCallback = None) -> Optional[interfaces.layers.DataLayerInterface]:\n \"\"\"Method to determine whether this builder can operate on the named\n layer. If so, modify the context appropriately.\n\n Returns the name of any new layer stacked on top of this layer or None. The stacking is therefore strictly\n linear rather than tree driven.\n\n Configuration options provided by the context are ignored, and defaults are to be used by this method\n to build a space where possible.\n\n Args:\n context: Context in which to construct the higher layer\n layer_name: Name of the layer to stack on top of\n progress_callback: A callback function to indicate progress through a scan (if one is necessary)\n \"\"\"","function_tokens":["def","stack","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","Optional","[","interfaces",".","layers",".","DataLayerInterface","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/automagic.py#L112-L129"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"ScannerInterface.context","parameters":"(self, ctx: 'interfaces.context.ContextInterface')","argument_list":"","return_statement":"","docstring":"Stores the context locally in case the scanner needs to access the\n layer.","docstring_summary":"Stores the context locally in case the scanner needs to access the\n layer.","docstring_tokens":["Stores","the","context","locally","in","case","the","scanner","needs","to","access","the","layer","."],"function":"def context(self, ctx: 'interfaces.context.ContextInterface') -> None:\n \"\"\"Stores the context locally in case the scanner needs to access the\n layer.\"\"\"\n self._context = ctx","function_tokens":["def","context","(","self",",","ctx",":","'interfaces.context.ContextInterface'",")","->","None",":","self",".","_context","=","ctx"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L69-L72"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"ScannerInterface.layer_name","parameters":"(self, layer_name: str)","argument_list":"","return_statement":"","docstring":"Stores the layer_name being scanned locally in case the scanner\n needs to access the layer.","docstring_summary":"Stores the layer_name being scanned locally in case the scanner\n needs to access the layer.","docstring_tokens":["Stores","the","layer_name","being","scanned","locally","in","case","the","scanner","needs","to","access","the","layer","."],"function":"def layer_name(self, layer_name: str) -> None:\n \"\"\"Stores the layer_name being scanned locally in case the scanner\n needs to access the layer.\"\"\"\n self._layer_name = layer_name","function_tokens":["def","layer_name","(","self",",","layer_name",":","str",")","->","None",":","self",".","_layer_name","=","layer_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L79-L82"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"ScannerInterface.__call__","parameters":"(self, data: bytes, data_offset: int)","argument_list":"","return_statement":"","docstring":"Searches through a chunk of data for a particular value\/pattern\/etc\n Always returns an iterator of the same type of object (need not be a\n volatility object)\n\n data is the chunk of data to search through data_offset is the\n offset within the layer that the data being searched starts at","docstring_summary":"Searches through a chunk of data for a particular value\/pattern\/etc\n Always returns an iterator of the same type of object (need not be a\n volatility object)","docstring_tokens":["Searches","through","a","chunk","of","data","for","a","particular","value","\/","pattern","\/","etc","Always","returns","an","iterator","of","the","same","type","of","object","(","need","not","be","a","volatility","object",")"],"function":"def __call__(self, data: bytes, data_offset: int) -> Iterable[Any]:\n \"\"\"Searches through a chunk of data for a particular value\/pattern\/etc\n Always returns an iterator of the same type of object (need not be a\n volatility object)\n\n data is the chunk of data to search through data_offset is the\n offset within the layer that the data being searched starts at\n \"\"\"","function_tokens":["def","__call__","(","self",",","data",":","bytes",",","data_offset",":","int",")","->","Iterable","[","Any","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L85-L92"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.name","parameters":"(self)","argument_list":"","return_statement":"return self._name","docstring":"Returns the layer name.","docstring_summary":"Returns the layer name.","docstring_tokens":["Returns","the","layer","name","."],"function":"def name(self) -> str:\n \"\"\"Returns the layer name.\"\"\"\n return self._name","function_tokens":["def","name","(","self",")","->","str",":","return","self",".","_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L120-L122"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.maximum_address","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the maximum valid address of the space.","docstring_summary":"Returns the maximum valid address of the space.","docstring_tokens":["Returns","the","maximum","valid","address","of","the","space","."],"function":"def maximum_address(self) -> int:\n \"\"\"Returns the maximum valid address of the space.\"\"\"","function_tokens":["def","maximum_address","(","self",")","->","int",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L126-L127"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.minimum_address","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the minimum valid address of the space.","docstring_summary":"Returns the minimum valid address of the space.","docstring_tokens":["Returns","the","minimum","valid","address","of","the","space","."],"function":"def minimum_address(self) -> int:\n \"\"\"Returns the minimum valid address of the space.\"\"\"","function_tokens":["def","minimum_address","(","self",")","->","int",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L131-L132"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.address_mask","parameters":"(self)","argument_list":"","return_statement":"return (1 << int(math.ceil(math.log2(self.maximum_address)))) - 1","docstring":"Returns a mask which encapsulates all the active bits of an address\n for this layer.","docstring_summary":"Returns a mask which encapsulates all the active bits of an address\n for this layer.","docstring_tokens":["Returns","a","mask","which","encapsulates","all","the","active","bits","of","an","address","for","this","layer","."],"function":"def address_mask(self) -> int:\n \"\"\"Returns a mask which encapsulates all the active bits of an address\n for this layer.\"\"\"\n return (1 << int(math.ceil(math.log2(self.maximum_address)))) - 1","function_tokens":["def","address_mask","(","self",")","->","int",":","return","(","1","<<","int","(","math",".","ceil","(","math",".","log2","(","self",".","maximum_address",")",")",")",")","-","1"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L135-L138"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.is_valid","parameters":"(self, offset: int, length: int = 1)","argument_list":"","return_statement":"","docstring":"Returns a boolean based on whether the entire chunk of data (from\n offset to length) is valid or not.\n\n Args:\n offset: The address to start determining whether bytes are readable\/valid\n length: The number of bytes from offset of which to test the validity\n\n Returns:\n Whether the bytes are valid and accessible","docstring_summary":"Returns a boolean based on whether the entire chunk of data (from\n offset to length) is valid or not.","docstring_tokens":["Returns","a","boolean","based","on","whether","the","entire","chunk","of","data","(","from","offset","to","length",")","is","valid","or","not","."],"function":"def is_valid(self, offset: int, length: int = 1) -> bool:\n \"\"\"Returns a boolean based on whether the entire chunk of data (from\n offset to length) is valid or not.\n\n Args:\n offset: The address to start determining whether bytes are readable\/valid\n length: The number of bytes from offset of which to test the validity\n\n Returns:\n Whether the bytes are valid and accessible\n \"\"\"","function_tokens":["def","is_valid","(","self",",","offset",":","int",",","length",":","int","=","1",")","->","bool",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L141-L151"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.read","parameters":"(self, offset: int, length: int, pad: bool = False)","argument_list":"","return_statement":"","docstring":"Reads an offset for length bytes and returns 'bytes' (not 'str') of\n length size.\n\n If there is a fault of any kind (such as a page fault), an exception will be thrown\n unless pad is set, in which case the read errors will be replaced by null characters.\n\n Args:\n offset: The offset at which to being reading within the layer\n length: The number of bytes to read within the layer\n pad: A boolean indicating whether exceptions should be raised or bad bytes replaced with null characters\n\n Returns:\n The bytes read from the layer, starting at offset for length bytes","docstring_summary":"Reads an offset for length bytes and returns 'bytes' (not 'str') of\n length size.","docstring_tokens":["Reads","an","offset","for","length","bytes","and","returns","bytes","(","not","str",")","of","length","size","."],"function":"def read(self, offset: int, length: int, pad: bool = False) -> bytes:\n \"\"\"Reads an offset for length bytes and returns 'bytes' (not 'str') of\n length size.\n\n If there is a fault of any kind (such as a page fault), an exception will be thrown\n unless pad is set, in which case the read errors will be replaced by null characters.\n\n Args:\n offset: The offset at which to being reading within the layer\n length: The number of bytes to read within the layer\n pad: A boolean indicating whether exceptions should be raised or bad bytes replaced with null characters\n\n Returns:\n The bytes read from the layer, starting at offset for length bytes\n \"\"\"","function_tokens":["def","read","(","self",",","offset",":","int",",","length",":","int",",","pad",":","bool","=","False",")","->","bytes",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L154-L168"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.write","parameters":"(self, offset: int, data: bytes)","argument_list":"","return_statement":"","docstring":"Writes a chunk of data at offset.\n\n Any unavailable sections in the underlying bases will cause an exception to be thrown.\n Note: Writes are not guaranteed atomic, therefore some data may have been written, even if an exception is thrown.","docstring_summary":"Writes a chunk of data at offset.","docstring_tokens":["Writes","a","chunk","of","data","at","offset","."],"function":"def write(self, offset: int, data: bytes) -> None:\n \"\"\"Writes a chunk of data at offset.\n\n Any unavailable sections in the underlying bases will cause an exception to be thrown.\n Note: Writes are not guaranteed atomic, therefore some data may have been written, even if an exception is thrown.\n \"\"\"","function_tokens":["def","write","(","self",",","offset",":","int",",","data",":","bytes",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L171-L176"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.destroy","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Causes a DataLayer to close any open handles, etc.\n\n Systems that make use of Data Layers should call destroy when\n they are done with them. This will close all handles, and make\n the object unreadable (exceptions will be thrown using a\n DataLayer after destruction)","docstring_summary":"Causes a DataLayer to close any open handles, etc.","docstring_tokens":["Causes","a","DataLayer","to","close","any","open","handles","etc","."],"function":"def destroy(self) -> None:\n \"\"\"Causes a DataLayer to close any open handles, etc.\n\n Systems that make use of Data Layers should call destroy when\n they are done with them. This will close all handles, and make\n the object unreadable (exceptions will be thrown using a\n DataLayer after destruction)\n \"\"\"\n pass","function_tokens":["def","destroy","(","self",")","->","None",":","pass"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L178-L186"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.get_requirements","parameters":"(cls)","argument_list":"","return_statement":"return super().get_requirements()","docstring":"Returns a list of Requirement objects for this type of layer.","docstring_summary":"Returns a list of Requirement objects for this type of layer.","docstring_tokens":["Returns","a","list","of","Requirement","objects","for","this","type","of","layer","."],"function":"def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]:\n \"\"\"Returns a list of Requirement objects for this type of layer.\"\"\"\n return super().get_requirements()","function_tokens":["def","get_requirements","(","cls",")","->","List","[","interfaces",".","configuration",".","RequirementInterface","]",":","return","super","(",")",".","get_requirements","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L189-L191"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.dependencies","parameters":"(self)","argument_list":"","return_statement":"return []","docstring":"A list of other layer names required by this layer.\n\n Note:\n DataLayers must never define other layers","docstring_summary":"A list of other layer names required by this layer.","docstring_tokens":["A","list","of","other","layer","names","required","by","this","layer","."],"function":"def dependencies(self) -> List[str]:\n \"\"\"A list of other layer names required by this layer.\n\n Note:\n DataLayers must never define other layers\n \"\"\"\n return []","function_tokens":["def","dependencies","(","self",")","->","List","[","str","]",":","return","[","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L194-L200"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.scan","parameters":"(self,\n context: interfaces.context.ContextInterface,\n scanner: ScannerInterface,\n progress_callback: constants.ProgressCallback = None,\n sections: Iterable[Tuple[int, int]] = None)","argument_list":"","return_statement":"","docstring":"Scans a Translation layer by chunk.\n\n Note: this will skip missing\/unmappable chunks of memory\n\n Args:\n context: The context containing the data layer\n scanner: The constructed Scanner object to be applied\n progress_callback: Method that is called periodically during scanning to update progress\n sections: A list of (start, size) tuples defining the portions of the layer to scan\n\n Returns:\n The output iterable from the scanner object having been run against the layer","docstring_summary":"Scans a Translation layer by chunk.","docstring_tokens":["Scans","a","Translation","layer","by","chunk","."],"function":"def scan(self,\n context: interfaces.context.ContextInterface,\n scanner: ScannerInterface,\n progress_callback: constants.ProgressCallback = None,\n sections: Iterable[Tuple[int, int]] = None) -> Iterable[Any]:\n \"\"\"Scans a Translation layer by chunk.\n\n Note: this will skip missing\/unmappable chunks of memory\n\n Args:\n context: The context containing the data layer\n scanner: The constructed Scanner object to be applied\n progress_callback: Method that is called periodically during scanning to update progress\n sections: A list of (start, size) tuples defining the portions of the layer to scan\n\n Returns:\n The output iterable from the scanner object having been run against the layer\n \"\"\"\n if progress_callback is not None and not callable(progress_callback):\n raise TypeError(\"Progress_callback is not callable\")\n\n scanner.context = context\n scanner.layer_name = self.name\n\n if sections is None:\n sections = [(self.minimum_address, self.maximum_address - self.minimum_address)]\n\n sections = list(self._coalesce_sections(sections))\n\n try:\n progress = DummyProgress() # type: ProgressValue\n scan_iterator = functools.partial(self._scan_iterator, scanner, sections)\n scan_metric = self._scan_metric(scanner, sections)\n if not scanner.thread_safe or constants.PARALLELISM == constants.Parallelism.Off:\n progress = DummyProgress()\n scan_chunk = functools.partial(self._scan_chunk, scanner, progress)\n for value in scan_iterator():\n if progress_callback:\n progress_callback(scan_metric(progress.value),\n \"Scanning {} using {}\".format(self.name, scanner.__class__.__name__))\n yield from scan_chunk(value)\n else:\n progress = multiprocessing.Manager().Value(\"Q\", 0)\n parallel_module = multiprocessing # type: types.ModuleType\n if constants.PARALLELISM == constants.Parallelism.Threading:\n progress = DummyProgress()\n parallel_module = threading\n scan_chunk = functools.partial(self._scan_chunk, scanner, progress)\n with parallel_module.Pool() as pool:\n result = pool.map_async(scan_chunk, scan_iterator())\n while not result.ready():\n if progress_callback:\n # Run the progress_callback\n progress_callback(scan_metric(progress.value),\n \"Scanning {} using {}\".format(self.name, scanner.__class__.__name__))\n # Ensures we don't burn CPU cycles going round in a ready waiting loop\n # without delaying the user too long between progress updates\/results\n result.wait(0.1)\n for result_value in result.get():\n yield from result_value\n except Exception as e:\n # We don't care the kind of exception, so catch and report on everything, yielding nothing further\n vollog.debug(\"Scan Failure: {}\".format(str(e)))\n vollog.log(constants.LOGLEVEL_VVV,\n \"\\n\".join(traceback.TracebackException.from_exception(e).format(chain = True)))","function_tokens":["def","scan","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","scanner",":","ScannerInterface",",","progress_callback",":","constants",".","ProgressCallback","=","None",",","sections",":","Iterable","[","Tuple","[","int",",","int","]","]","=","None",")","->","Iterable","[","Any","]",":","if","progress_callback","is","not","None","and","not","callable","(","progress_callback",")",":","raise","TypeError","(","\"Progress_callback is not callable\"",")","scanner",".","context","=","context","scanner",".","layer_name","=","self",".","name","if","sections","is","None",":","sections","=","[","(","self",".","minimum_address",",","self",".","maximum_address","-","self",".","minimum_address",")","]","sections","=","list","(","self",".","_coalesce_sections","(","sections",")",")","try",":","progress","=","DummyProgress","(",")","# type: ProgressValue","scan_iterator","=","functools",".","partial","(","self",".","_scan_iterator",",","scanner",",","sections",")","scan_metric","=","self",".","_scan_metric","(","scanner",",","sections",")","if","not","scanner",".","thread_safe","or","constants",".","PARALLELISM","==","constants",".","Parallelism",".","Off",":","progress","=","DummyProgress","(",")","scan_chunk","=","functools",".","partial","(","self",".","_scan_chunk",",","scanner",",","progress",")","for","value","in","scan_iterator","(",")",":","if","progress_callback",":","progress_callback","(","scan_metric","(","progress",".","value",")",",","\"Scanning {} using {}\"",".","format","(","self",".","name",",","scanner",".","__class__",".","__name__",")",")","yield","from","scan_chunk","(","value",")","else",":","progress","=","multiprocessing",".","Manager","(",")",".","Value","(","\"Q\"",",","0",")","parallel_module","=","multiprocessing","# type: types.ModuleType","if","constants",".","PARALLELISM","==","constants",".","Parallelism",".","Threading",":","progress","=","DummyProgress","(",")","parallel_module","=","threading","scan_chunk","=","functools",".","partial","(","self",".","_scan_chunk",",","scanner",",","progress",")","with","parallel_module",".","Pool","(",")","as","pool",":","result","=","pool",".","map_async","(","scan_chunk",",","scan_iterator","(",")",")","while","not","result",".","ready","(",")",":","if","progress_callback",":","# Run the progress_callback","progress_callback","(","scan_metric","(","progress",".","value",")",",","\"Scanning {} using {}\"",".","format","(","self",".","name",",","scanner",".","__class__",".","__name__",")",")","# Ensures we don't burn CPU cycles going round in a ready waiting loop","# without delaying the user too long between progress updates\/results","result",".","wait","(","0.1",")","for","result_value","in","result",".","get","(",")",":","yield","from","result_value","except","Exception","as","e",":","# We don't care the kind of exception, so catch and report on everything, yielding nothing further","vollog",".","debug","(","\"Scan Failure: {}\"",".","format","(","str","(","e",")",")",")","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"\\n\"",".","join","(","traceback",".","TracebackException",".","from_exception","(","e",")",".","format","(","chain","=","True",")",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L204-L268"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface._coalesce_sections","parameters":"(self, sections: Iterable[Tuple[int, int]])","argument_list":"","return_statement":"return result","docstring":"Take a list of (start, length) sections and coalesce any adjacent\n sections.","docstring_summary":"Take a list of (start, length) sections and coalesce any adjacent\n sections.","docstring_tokens":["Take","a","list","of","(","start","length",")","sections","and","coalesce","any","adjacent","sections","."],"function":"def _coalesce_sections(self, sections: Iterable[Tuple[int, int]]) -> Iterable[Tuple[int, int]]:\n \"\"\"Take a list of (start, length) sections and coalesce any adjacent\n sections.\"\"\"\n result = [] # type: List[Tuple[int, int]]\n position = 0\n for (start, length) in sorted(sections):\n if result and start <= position:\n initial_start, _ = result.pop()\n result.append((initial_start, (start + length) - initial_start))\n else:\n result.append((start, length))\n position = start + length\n\n while result and result[0] < (self.minimum_address, 0):\n first_start, first_length = result[0]\n if first_start + first_length < self.minimum_address:\n result = result[1:]\n elif first_start < self.minimum_address:\n result[0] = (self.minimum_address, (first_start + first_length) - self.minimum_address)\n while result and result[-1] > (self.maximum_address, 0):\n last_start, last_length = result[-1]\n if last_start > self.maximum_address:\n result.pop()\n elif last_start + last_length > self.maximum_address:\n result[1] = (last_start, self.maximum_address - last_start)\n return result","function_tokens":["def","_coalesce_sections","(","self",",","sections",":","Iterable","[","Tuple","[","int",",","int","]","]",")","->","Iterable","[","Tuple","[","int",",","int","]","]",":","result","=","[","]","# type: List[Tuple[int, int]]","position","=","0","for","(","start",",","length",")","in","sorted","(","sections",")",":","if","result","and","start","<=","position",":","initial_start",",","_","=","result",".","pop","(",")","result",".","append","(","(","initial_start",",","(","start","+","length",")","-","initial_start",")",")","else",":","result",".","append","(","(","start",",","length",")",")","position","=","start","+","length","while","result","and","result","[","0","]","<","(","self",".","minimum_address",",","0",")",":","first_start",",","first_length","=","result","[","0","]","if","first_start","+","first_length","<","self",".","minimum_address",":","result","=","result","[","1",":","]","elif","first_start","<","self",".","minimum_address",":","result","[","0","]","=","(","self",".","minimum_address",",","(","first_start","+","first_length",")","-","self",".","minimum_address",")","while","result","and","result","[","-","1","]",">","(","self",".","maximum_address",",","0",")",":","last_start",",","last_length","=","result","[","-","1","]","if","last_start",">","self",".","maximum_address",":","result",".","pop","(",")","elif","last_start","+","last_length",">","self",".","maximum_address",":","result","[","1","]","=","(","last_start",",","self",".","maximum_address","-","last_start",")","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L270-L295"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface._scan_iterator","parameters":"(self, scanner: 'ScannerInterface', sections: Iterable[Tuple[int,\n int]])","argument_list":"","return_statement":"","docstring":"Iterator that indicates which blocks in the layer are to be read by\n for the scanning.\n\n Returns a list of blocks (potentially in lower layers) that make\n up this chunk contiguously. Chunks can be no bigger than\n scanner.chunk_size + scanner.overlap DataLayers by default are\n assumed to have no holes","docstring_summary":"Iterator that indicates which blocks in the layer are to be read by\n for the scanning.","docstring_tokens":["Iterator","that","indicates","which","blocks","in","the","layer","are","to","be","read","by","for","the","scanning","."],"function":"def _scan_iterator(self, scanner: 'ScannerInterface', sections: Iterable[Tuple[int,\n int]]) -> Iterable[IteratorValue]:\n \"\"\"Iterator that indicates which blocks in the layer are to be read by\n for the scanning.\n\n Returns a list of blocks (potentially in lower layers) that make\n up this chunk contiguously. Chunks can be no bigger than\n scanner.chunk_size + scanner.overlap DataLayers by default are\n assumed to have no holes\n \"\"\"\n for section_start, section_length in sections:\n offset, mapped_offset, length, layer_name = section_start, section_start, section_length, self.name\n while length > 0:\n chunk_size = min(length, scanner.chunk_size + scanner.overlap)\n yield [(layer_name, mapped_offset, chunk_size)], offset + chunk_size\n # It we've got more than the scanner's chunk_size, only move up by the chunk_size\n if chunk_size > scanner.chunk_size:\n chunk_size -= scanner.overlap\n length -= chunk_size\n mapped_offset += chunk_size\n offset += chunk_size","function_tokens":["def","_scan_iterator","(","self",",","scanner",":","'ScannerInterface'",",","sections",":","Iterable","[","Tuple","[","int",",","int","]","]",")","->","Iterable","[","IteratorValue","]",":","for","section_start",",","section_length","in","sections",":","offset",",","mapped_offset",",","length",",","layer_name","=","section_start",",","section_start",",","section_length",",","self",".","name","while","length",">","0",":","chunk_size","=","min","(","length",",","scanner",".","chunk_size","+","scanner",".","overlap",")","yield","[","(","layer_name",",","mapped_offset",",","chunk_size",")","]",",","offset","+","chunk_size","# It we've got more than the scanner's chunk_size, only move up by the chunk_size","if","chunk_size",">","scanner",".","chunk_size",":","chunk_size","-=","scanner",".","overlap","length","-=","chunk_size","mapped_offset","+=","chunk_size","offset","+=","chunk_size"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L297-L317"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"DataLayerInterface.metadata","parameters":"(self)","argument_list":"","return_statement":"return interfaces.objects.ReadOnlyMapping(collections.ChainMap({}, self._direct_metadata, *maps))","docstring":"Returns a ReadOnly copy of the metadata published by this layer.","docstring_summary":"Returns a ReadOnly copy of the metadata published by this layer.","docstring_tokens":["Returns","a","ReadOnly","copy","of","the","metadata","published","by","this","layer","."],"function":"def metadata(self) -> Mapping:\n \"\"\"Returns a ReadOnly copy of the metadata published by this layer.\"\"\"\n maps = [self.context.layers[layer_name].metadata for layer_name in self.dependencies]\n return interfaces.objects.ReadOnlyMapping(collections.ChainMap({}, self._direct_metadata, *maps))","function_tokens":["def","metadata","(","self",")","->","Mapping",":","maps","=","[","self",".","context",".","layers","[","layer_name","]",".","metadata","for","layer_name","in","self",".","dependencies","]","return","interfaces",".","objects",".","ReadOnlyMapping","(","collections",".","ChainMap","(","{","}",",","self",".","_direct_metadata",",","*","maps",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L357-L360"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"TranslationLayerInterface.mapping","parameters":"(self,\n offset: int,\n length: int,\n ignore_errors: bool = False)","argument_list":"","return_statement":"return []","docstring":"Returns a sorted iterable of (offset, sublength, mapped_offset, mapped_length, layer)\n mappings.\n\n ignore_errors will provide all available maps with gaps, but\n their total length may not add up to the requested length This\n allows translation layers to provide maps of contiguous regions\n in one layer","docstring_summary":"Returns a sorted iterable of (offset, sublength, mapped_offset, mapped_length, layer)\n mappings.","docstring_tokens":["Returns","a","sorted","iterable","of","(","offset","sublength","mapped_offset","mapped_length","layer",")","mappings","."],"function":"def mapping(self,\n offset: int,\n length: int,\n ignore_errors: bool = False) -> Iterable[Tuple[int, int, int, int, str]]:\n \"\"\"Returns a sorted iterable of (offset, sublength, mapped_offset, mapped_length, layer)\n mappings.\n\n ignore_errors will provide all available maps with gaps, but\n their total length may not add up to the requested length This\n allows translation layers to provide maps of contiguous regions\n in one layer\n \"\"\"\n return []","function_tokens":["def","mapping","(","self",",","offset",":","int",",","length",":","int",",","ignore_errors",":","bool","=","False",")","->","Iterable","[","Tuple","[","int",",","int",",","int",",","int",",","str","]","]",":","return","[","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L372-L384"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"TranslationLayerInterface.dependencies","parameters":"(self)","argument_list":"","return_statement":"return []","docstring":"Returns a list of layer names that this layer translates onto.","docstring_summary":"Returns a list of layer names that this layer translates onto.","docstring_tokens":["Returns","a","list","of","layer","names","that","this","layer","translates","onto","."],"function":"def dependencies(self) -> List[str]:\n \"\"\"Returns a list of layer names that this layer translates onto.\"\"\"\n return []","function_tokens":["def","dependencies","(","self",")","->","List","[","str","]",":","return","[","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L388-L390"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"TranslationLayerInterface._decode_data","parameters":"(self, data: bytes, mapped_offset: int, offset: int, output_length: int)","argument_list":"","return_statement":"return data","docstring":"Decodes any necessary data. Note, additional data may need to be read from the lower layer, such as lookup\n tables or similar. The data provided to this layer is purely that data which encompasses the requested data\n range.\n\n Args:\n data: The bytes of data necessary for decoding\n mapped_offset: The offset in the underlying layer where the data would begin\n offset: The offset in the higher-layer where the data would begin\n output_length: The expected length of the returned data\n\n Returns:\n The data to be read from the underlying layer.","docstring_summary":"Decodes any necessary data. Note, additional data may need to be read from the lower layer, such as lookup\n tables or similar. The data provided to this layer is purely that data which encompasses the requested data\n range.","docstring_tokens":["Decodes","any","necessary","data",".","Note","additional","data","may","need","to","be","read","from","the","lower","layer","such","as","lookup","tables","or","similar",".","The","data","provided","to","this","layer","is","purely","that","data","which","encompasses","the","requested","data","range","."],"function":"def _decode_data(self, data: bytes, mapped_offset: int, offset: int, output_length: int) -> bytes:\n \"\"\"Decodes any necessary data. Note, additional data may need to be read from the lower layer, such as lookup\n tables or similar. The data provided to this layer is purely that data which encompasses the requested data\n range.\n\n Args:\n data: The bytes of data necessary for decoding\n mapped_offset: The offset in the underlying layer where the data would begin\n offset: The offset in the higher-layer where the data would begin\n output_length: The expected length of the returned data\n\n Returns:\n The data to be read from the underlying layer.\"\"\"\n return data","function_tokens":["def","_decode_data","(","self",",","data",":","bytes",",","mapped_offset",":","int",",","offset",":","int",",","output_length",":","int",")","->","bytes",":","return","data"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L392-L405"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"TranslationLayerInterface._encode_data","parameters":"(self, layer_name: str, mapped_offset: int, offset: int, value: bytes)","argument_list":"","return_statement":"return value","docstring":"Encodes any necessary data.\n\n Args:\n layer_name: The layer to write data back to\n mapped_offset: The offset in the underlying layer where the data would begin\n offset: The offset in the higher-layer where the data would begin\n value: The new value to encode\n\n Returns:\n The data to be rewritten at mapped_offset.","docstring_summary":"Encodes any necessary data.","docstring_tokens":["Encodes","any","necessary","data","."],"function":"def _encode_data(self, layer_name: str, mapped_offset: int, offset: int, value: bytes) -> bytes:\n \"\"\"Encodes any necessary data.\n\n Args:\n layer_name: The layer to write data back to\n mapped_offset: The offset in the underlying layer where the data would begin\n offset: The offset in the higher-layer where the data would begin\n value: The new value to encode\n\n Returns:\n The data to be rewritten at mapped_offset.\"\"\"\n return value","function_tokens":["def","_encode_data","(","self",",","layer_name",":","str",",","mapped_offset",":","int",",","offset",":","int",",","value",":","bytes",")","->","bytes",":","return","value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L407-L418"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"TranslationLayerInterface.read","parameters":"(self, offset: int, length: int, pad: bool = False)","argument_list":"","return_statement":"return output + (b\"\\x00\" * (length - len(output)))","docstring":"Reads an offset for length bytes and returns 'bytes' (not 'str') of\n length size.","docstring_summary":"Reads an offset for length bytes and returns 'bytes' (not 'str') of\n length size.","docstring_tokens":["Reads","an","offset","for","length","bytes","and","returns","bytes","(","not","str",")","of","length","size","."],"function":"def read(self, offset: int, length: int, pad: bool = False) -> bytes:\n \"\"\"Reads an offset for length bytes and returns 'bytes' (not 'str') of\n length size.\"\"\"\n current_offset = offset\n output = b'' # type: bytes\n for (layer_offset, sublength, mapped_offset, mapped_length, layer) in self.mapping(offset,\n length,\n ignore_errors = pad):\n if not pad and layer_offset > current_offset:\n raise exceptions.InvalidAddressException(\n self.name, current_offset, \"Layer {} cannot map offset: {}\".format(self.name, current_offset))\n elif layer_offset > current_offset:\n output += b\"\\x00\" * (layer_offset - current_offset)\n current_offset = layer_offset\n # The layer_offset can be less than the current_offset in non-linearly mapped layers\n # it does not suggest an overlap, but that the data is in an encoded block\n if mapped_length > 0:\n unprocessed_data = self._context.layers.read(layer, mapped_offset, mapped_length, pad)\n processed_data = self._decode_data(unprocessed_data, mapped_offset, layer_offset, sublength)\n if len(processed_data) != sublength:\n raise ValueError(\"ProcessedData length does not match expected length of chunk\")\n output += processed_data\n current_offset += sublength\n return output + (b\"\\x00\" * (length - len(output)))","function_tokens":["def","read","(","self",",","offset",":","int",",","length",":","int",",","pad",":","bool","=","False",")","->","bytes",":","current_offset","=","offset","output","=","b''","# type: bytes","for","(","layer_offset",",","sublength",",","mapped_offset",",","mapped_length",",","layer",")","in","self",".","mapping","(","offset",",","length",",","ignore_errors","=","pad",")",":","if","not","pad","and","layer_offset",">","current_offset",":","raise","exceptions",".","InvalidAddressException","(","self",".","name",",","current_offset",",","\"Layer {} cannot map offset: {}\"",".","format","(","self",".","name",",","current_offset",")",")","elif","layer_offset",">","current_offset",":","output","+=","b\"\\x00\"","*","(","layer_offset","-","current_offset",")","current_offset","=","layer_offset","# The layer_offset can be less than the current_offset in non-linearly mapped layers","# it does not suggest an overlap, but that the data is in an encoded block","if","mapped_length",">","0",":","unprocessed_data","=","self",".","_context",".","layers",".","read","(","layer",",","mapped_offset",",","mapped_length",",","pad",")","processed_data","=","self",".","_decode_data","(","unprocessed_data",",","mapped_offset",",","layer_offset",",","sublength",")","if","len","(","processed_data",")","!=","sublength",":","raise","ValueError","(","\"ProcessedData length does not match expected length of chunk\"",")","output","+=","processed_data","current_offset","+=","sublength","return","output","+","(","b\"\\x00\"","*","(","length","-","len","(","output",")",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L423-L446"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"TranslationLayerInterface.write","parameters":"(self, offset: int, value: bytes)","argument_list":"","return_statement":"","docstring":"Writes a value at offset, distributing the writing across any\n underlying mapping.","docstring_summary":"Writes a value at offset, distributing the writing across any\n underlying mapping.","docstring_tokens":["Writes","a","value","at","offset","distributing","the","writing","across","any","underlying","mapping","."],"function":"def write(self, offset: int, value: bytes) -> None:\n \"\"\"Writes a value at offset, distributing the writing across any\n underlying mapping.\"\"\"\n current_offset = offset\n length = len(value)\n for (layer_offset, sublength, mapped_offset, mapped_length, layer) in self.mapping(offset, length):\n if layer_offset > current_offset:\n raise exceptions.InvalidAddressException(\n self.name, current_offset, \"Layer {} cannot map offset: {}\".format(self.name, current_offset))\n\n value_chunk = value[layer_offset - offset:layer_offset - offset + sublength]\n new_data = self._encode_data(layer, mapped_offset, layer_offset, value_chunk)\n self._context.layers.write(layer, mapped_offset, new_data)\n\n current_offset += len(new_data)","function_tokens":["def","write","(","self",",","offset",":","int",",","value",":","bytes",")","->","None",":","current_offset","=","offset","length","=","len","(","value",")","for","(","layer_offset",",","sublength",",","mapped_offset",",","mapped_length",",","layer",")","in","self",".","mapping","(","offset",",","length",")",":","if","layer_offset",">","current_offset",":","raise","exceptions",".","InvalidAddressException","(","self",".","name",",","current_offset",",","\"Layer {} cannot map offset: {}\"",".","format","(","self",".","name",",","current_offset",")",")","value_chunk","=","value","[","layer_offset","-","offset",":","layer_offset","-","offset","+","sublength","]","new_data","=","self",".","_encode_data","(","layer",",","mapped_offset",",","layer_offset",",","value_chunk",")","self",".","_context",".","layers",".","write","(","layer",",","mapped_offset",",","new_data",")","current_offset","+=","len","(","new_data",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L448-L462"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"TranslationLayerInterface._scan_iterator","parameters":"(self,\n scanner: 'ScannerInterface',\n sections: Iterable[Tuple[int, int]],\n linear: bool = False)","argument_list":"","return_statement":"","docstring":"Iterator that indicates which blocks in the layer are to be read by\n for the scanning.\n\n Returns a list of blocks (potentially in lower layers) that make\n up this chunk contiguously. Chunks can be no bigger than\n scanner.chunk_size + scanner.overlap DataLayers by default are\n assumed to have no holes","docstring_summary":"Iterator that indicates which blocks in the layer are to be read by\n for the scanning.","docstring_tokens":["Iterator","that","indicates","which","blocks","in","the","layer","are","to","be","read","by","for","the","scanning","."],"function":"def _scan_iterator(self,\n scanner: 'ScannerInterface',\n sections: Iterable[Tuple[int, int]],\n linear: bool = False) -> Iterable[IteratorValue]:\n \"\"\"Iterator that indicates which blocks in the layer are to be read by\n for the scanning.\n\n Returns a list of blocks (potentially in lower layers) that make\n up this chunk contiguously. Chunks can be no bigger than\n scanner.chunk_size + scanner.overlap DataLayers by default are\n assumed to have no holes\n \"\"\"\n for (section_start, section_length) in sections:\n # For each section, split it into scan size chunks\n for chunk_start in range(section_start, section_start + section_length, scanner.chunk_size):\n # Shorten it, if we're at the end of the section\n chunk_length = min(section_start + section_length - chunk_start, scanner.chunk_size + scanner.overlap)\n\n # Prev offset keeps track of the end of the previous subchunk\n prev_offset = chunk_start\n output = [] # type: List[Tuple[str, int, int]]\n\n # We populate the response based on subchunks that may be mapped all over the place\n for mapped in self.mapping(chunk_start, chunk_length, ignore_errors = True):\n # We don't bother with the other data in case the data's been processed by a lower layer\n offset, sublength, mapped_offset, mapped_length, layer_name = mapped\n\n # We need to check if the offset is next to the end of the last one (contiguous)\n if offset != prev_offset:\n # Only yield if we've accumulated output\n if len(output):\n # Yield all the (joined) items so far\n # and the ending point of that subchunk (where we'd gotten to previously)\n yield output, prev_offset\n output = []\n\n # Shift the marker up to the end of what we just received and add it to the output\n prev_offset = offset + sublength\n\n if not linear:\n output += [(self.name, offset, sublength)]\n else:\n output += [(layer_name, mapped_offset, mapped_length)]\n # If there's still output left, output it\n if len(output):\n yield output, prev_offset","function_tokens":["def","_scan_iterator","(","self",",","scanner",":","'ScannerInterface'",",","sections",":","Iterable","[","Tuple","[","int",",","int","]","]",",","linear",":","bool","=","False",")","->","Iterable","[","IteratorValue","]",":","for","(","section_start",",","section_length",")","in","sections",":","# For each section, split it into scan size chunks","for","chunk_start","in","range","(","section_start",",","section_start","+","section_length",",","scanner",".","chunk_size",")",":","# Shorten it, if we're at the end of the section","chunk_length","=","min","(","section_start","+","section_length","-","chunk_start",",","scanner",".","chunk_size","+","scanner",".","overlap",")","# Prev offset keeps track of the end of the previous subchunk","prev_offset","=","chunk_start","output","=","[","]","# type: List[Tuple[str, int, int]]","# We populate the response based on subchunks that may be mapped all over the place","for","mapped","in","self",".","mapping","(","chunk_start",",","chunk_length",",","ignore_errors","=","True",")",":","# We don't bother with the other data in case the data's been processed by a lower layer","offset",",","sublength",",","mapped_offset",",","mapped_length",",","layer_name","=","mapped","# We need to check if the offset is next to the end of the last one (contiguous)","if","offset","!=","prev_offset",":","# Only yield if we've accumulated output","if","len","(","output",")",":","# Yield all the (joined) items so far","# and the ending point of that subchunk (where we'd gotten to previously)","yield","output",",","prev_offset","output","=","[","]","# Shift the marker up to the end of what we just received and add it to the output","prev_offset","=","offset","+","sublength","if","not","linear",":","output","+=","[","(","self",".","name",",","offset",",","sublength",")","]","else",":","output","+=","[","(","layer_name",",","mapped_offset",",","mapped_length",")","]","# If there's still output left, output it","if","len","(","output",")",":","yield","output",",","prev_offset"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L464-L509"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"LayerContainer.read","parameters":"(self, layer: str, offset: int, length: int, pad: bool = False)","argument_list":"","return_statement":"return self[layer].read(offset, length, pad)","docstring":"Reads from a particular layer at offset for length bytes.\n\n Returns 'bytes' not 'str'\n\n Args:\n layer: The name of the layer to read from\n offset: Where to begin reading within the layer\n length: How many bytes to read from the layer\n pad: Whether to raise exceptions or return null bytes when errors occur\n\n Returns:\n The result of reading from the requested layer","docstring_summary":"Reads from a particular layer at offset for length bytes.","docstring_tokens":["Reads","from","a","particular","layer","at","offset","for","length","bytes","."],"function":"def read(self, layer: str, offset: int, length: int, pad: bool = False) -> bytes:\n \"\"\"Reads from a particular layer at offset for length bytes.\n\n Returns 'bytes' not 'str'\n\n Args:\n layer: The name of the layer to read from\n offset: Where to begin reading within the layer\n length: How many bytes to read from the layer\n pad: Whether to raise exceptions or return null bytes when errors occur\n\n Returns:\n The result of reading from the requested layer\n \"\"\"\n return self[layer].read(offset, length, pad)","function_tokens":["def","read","(","self",",","layer",":","str",",","offset",":","int",",","length",":","int",",","pad",":","bool","=","False",")","->","bytes",":","return","self","[","layer","]",".","read","(","offset",",","length",",","pad",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L518-L532"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"LayerContainer.write","parameters":"(self, layer: str, offset: int, data: bytes)","argument_list":"","return_statement":"","docstring":"Writes to a particular layer at offset for length bytes.","docstring_summary":"Writes to a particular layer at offset for length bytes.","docstring_tokens":["Writes","to","a","particular","layer","at","offset","for","length","bytes","."],"function":"def write(self, layer: str, offset: int, data: bytes) -> None:\n \"\"\"Writes to a particular layer at offset for length bytes.\"\"\"\n self[layer].write(offset, data)","function_tokens":["def","write","(","self",",","layer",":","str",",","offset",":","int",",","data",":","bytes",")","->","None",":","self","[","layer","]",".","write","(","offset",",","data",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L537-L539"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"LayerContainer.add_layer","parameters":"(self, layer: DataLayerInterface)","argument_list":"","return_statement":"","docstring":"Adds a layer to memory model.\n\n This will throw an exception if the required dependencies are not met\n\n Args:\n layer: the layer to add to the list of layers (based on layer.name)","docstring_summary":"Adds a layer to memory model.","docstring_tokens":["Adds","a","layer","to","memory","model","."],"function":"def add_layer(self, layer: DataLayerInterface) -> None:\n \"\"\"Adds a layer to memory model.\n\n This will throw an exception if the required dependencies are not met\n\n Args:\n layer: the layer to add to the list of layers (based on layer.name)\n \"\"\"\n if layer.name in self._layers:\n raise exceptions.LayerException(layer.name, \"Layer already exists: {}\".format(layer.name))\n if isinstance(layer, TranslationLayerInterface):\n missing_list = [sublayer for sublayer in layer.dependencies if sublayer not in self._layers]\n if missing_list:\n raise exceptions.LayerException(\n layer.name, \"Layer {} has unmet dependencies: {}\".format(layer.name, \", \".join(missing_list)))\n self._layers[layer.name] = layer","function_tokens":["def","add_layer","(","self",",","layer",":","DataLayerInterface",")","->","None",":","if","layer",".","name","in","self",".","_layers",":","raise","exceptions",".","LayerException","(","layer",".","name",",","\"Layer already exists: {}\"",".","format","(","layer",".","name",")",")","if","isinstance","(","layer",",","TranslationLayerInterface",")",":","missing_list","=","[","sublayer","for","sublayer","in","layer",".","dependencies","if","sublayer","not","in","self",".","_layers","]","if","missing_list",":","raise","exceptions",".","LayerException","(","layer",".","name",",","\"Layer {} has unmet dependencies: {}\"",".","format","(","layer",".","name",",","\", \"",".","join","(","missing_list",")",")",")","self",".","_layers","[","layer",".","name","]","=","layer"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L541-L556"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"LayerContainer.del_layer","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Removes the layer called name.\n\n This will throw an exception if other layers depend upon this layer\n\n Args:\n name: The name of the layer to delete","docstring_summary":"Removes the layer called name.","docstring_tokens":["Removes","the","layer","called","name","."],"function":"def del_layer(self, name: str) -> None:\n \"\"\"Removes the layer called name.\n\n This will throw an exception if other layers depend upon this layer\n\n Args:\n name: The name of the layer to delete\n \"\"\"\n for layer in self._layers:\n depend_list = [superlayer for superlayer in self._layers if name in self._layers[layer].dependencies]\n if depend_list:\n raise exceptions.LayerException(\n self._layers[layer].name,\n \"Layer {} is depended upon: {}\".format(self._layers[layer].name, \", \".join(depend_list)))\n self._layers[name].destroy()\n del self._layers[name]","function_tokens":["def","del_layer","(","self",",","name",":","str",")","->","None",":","for","layer","in","self",".","_layers",":","depend_list","=","[","superlayer","for","superlayer","in","self",".","_layers","if","name","in","self",".","_layers","[","layer","]",".","dependencies","]","if","depend_list",":","raise","exceptions",".","LayerException","(","self",".","_layers","[","layer","]",".","name",",","\"Layer {} is depended upon: {}\"",".","format","(","self",".","_layers","[","layer","]",".","name",",","\", \"",".","join","(","depend_list",")",")",")","self",".","_layers","[","name","]",".","destroy","(",")","del","self",".","_layers","[","name","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L558-L573"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"LayerContainer.free_layer_name","parameters":"(self, prefix: str = \"layer\")","argument_list":"","return_statement":"return \"{}_{}\".format(prefix, count)","docstring":"Returns an unused layer name to ensure no collision occurs when\n inserting a layer.\n\n Args:\n prefix: A descriptive string with which to prefix the layer name\n\n Returns:\n A string containing a name, prefixed with prefix, not currently in use within the LayerContainer","docstring_summary":"Returns an unused layer name to ensure no collision occurs when\n inserting a layer.","docstring_tokens":["Returns","an","unused","layer","name","to","ensure","no","collision","occurs","when","inserting","a","layer","."],"function":"def free_layer_name(self, prefix: str = \"layer\") -> str:\n \"\"\"Returns an unused layer name to ensure no collision occurs when\n inserting a layer.\n\n Args:\n prefix: A descriptive string with which to prefix the layer name\n\n Returns:\n A string containing a name, prefixed with prefix, not currently in use within the LayerContainer\n \"\"\"\n if prefix not in self:\n return prefix\n count = 1\n while \"{}_{}\".format(prefix, count) in self:\n count += 1\n return \"{}_{}\".format(prefix, count)","function_tokens":["def","free_layer_name","(","self",",","prefix",":","str","=","\"layer\"",")","->","str",":","if","prefix","not","in","self",":","return","prefix","count","=","1","while","\"{}_{}\"",".","format","(","prefix",",","count",")","in","self",":","count","+=","1","return","\"{}_{}\"",".","format","(","prefix",",","count",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L575-L590"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"LayerContainer.__getitem__","parameters":"(self, name: str)","argument_list":"","return_statement":"return self._layers[name]","docstring":"Returns the layer of specified name.","docstring_summary":"Returns the layer of specified name.","docstring_tokens":["Returns","the","layer","of","specified","name","."],"function":"def __getitem__(self, name: str) -> DataLayerInterface:\n \"\"\"Returns the layer of specified name.\"\"\"\n return self._layers[name]","function_tokens":["def","__getitem__","(","self",",","name",":","str",")","->","DataLayerInterface",":","return","self",".","_layers","[","name","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L592-L594"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py","language":"python","identifier":"LayerContainer.check_cycles","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Runs through the available layers and identifies if there are cycles\n in the DAG.","docstring_summary":"Runs through the available layers and identifies if there are cycles\n in the DAG.","docstring_tokens":["Runs","through","the","available","layers","and","identifies","if","there","are","cycles","in","the","DAG","."],"function":"def check_cycles(self) -> None:\n \"\"\"Runs through the available layers and identifies if there are cycles\n in the DAG.\"\"\"\n # TODO: Is having a cycle check necessary?\n raise NotImplementedError(\"Cycle checking has not yet been implemented\")","function_tokens":["def","check_cycles","(","self",")","->","None",":","# TODO: Is having a cycle check necessary?","raise","NotImplementedError","(","\"Cycle checking has not yet been implemented\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/layers.py#L602-L606"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"Renderer.__init__","parameters":"(self, options: Optional[List[RenderOption]] = None)","argument_list":"","return_statement":"","docstring":"Accepts an options object to configure the renderers.","docstring_summary":"Accepts an options object to configure the renderers.","docstring_tokens":["Accepts","an","options","object","to","configure","the","renderers","."],"function":"def __init__(self, options: Optional[List[RenderOption]] = None) -> None:\n \"\"\"Accepts an options object to configure the renderers.\"\"\"","function_tokens":["def","__init__","(","self",",","options",":","Optional","[","List","[","RenderOption","]","]","=","None",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L26-L27"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"Renderer.get_render_options","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns a list of rendering options.","docstring_summary":"Returns a list of rendering options.","docstring_tokens":["Returns","a","list","of","rendering","options","."],"function":"def get_render_options(self) -> List[RenderOption]:\n \"\"\"Returns a list of rendering options.\"\"\"","function_tokens":["def","get_render_options","(","self",")","->","List","[","RenderOption","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L31-L32"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"Renderer.render","parameters":"(self, grid: 'TreeGrid')","argument_list":"","return_statement":"","docstring":"Takes a grid object and renders it based on the object's\n preferences.","docstring_summary":"Takes a grid object and renders it based on the object's\n preferences.","docstring_tokens":["Takes","a","grid","object","and","renders","it","based","on","the","object","s","preferences","."],"function":"def render(self, grid: 'TreeGrid') -> None:\n \"\"\"Takes a grid object and renders it based on the object's\n preferences.\"\"\"","function_tokens":["def","render","(","self",",","grid",":","'TreeGrid'",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L35-L37"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"ColumnSortKey.__call__","parameters":"(self, values: List[Any])","argument_list":"","return_statement":"","docstring":"The key function passed as a sort key to the TreeGrid's visit\n function.","docstring_summary":"The key function passed as a sort key to the TreeGrid's visit\n function.","docstring_tokens":["The","key","function","passed","as","a","sort","key","to","the","TreeGrid","s","visit","function","."],"function":"def __call__(self, values: List[Any]) -> Any:\n \"\"\"The key function passed as a sort key to the TreeGrid's visit\n function.\"\"\"","function_tokens":["def","__call__","(","self",",","values",":","List","[","Any","]",")","->","Any",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L44-L46"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeNode.__init__","parameters":"(self, path, treegrid, parent, values)","argument_list":"","return_statement":"","docstring":"Initializes the TreeNode.","docstring_summary":"Initializes the TreeNode.","docstring_tokens":["Initializes","the","TreeNode","."],"function":"def __init__(self, path, treegrid, parent, values):\n \"\"\"Initializes the TreeNode.\"\"\"","function_tokens":["def","__init__","(","self",",","path",",","treegrid",",","parent",",","values",")",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L51-L52"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeNode.values","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the list of values from the particular node, based on column\n index.","docstring_summary":"Returns the list of values from the particular node, based on column\n index.","docstring_tokens":["Returns","the","list","of","values","from","the","particular","node","based","on","column","index","."],"function":"def values(self) -> List['BaseTypes']:\n \"\"\"Returns the list of values from the particular node, based on column\n index.\"\"\"","function_tokens":["def","values","(","self",")","->","List","[","'BaseTypes'","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L56-L58"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeNode.path","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns a path identifying string.\n\n This should be seen as opaque by external classes, Parsing of\n path locations based on this string are not guaranteed to remain\n stable.","docstring_summary":"Returns a path identifying string.","docstring_tokens":["Returns","a","path","identifying","string","."],"function":"def path(self) -> str:\n \"\"\"Returns a path identifying string.\n\n This should be seen as opaque by external classes, Parsing of\n path locations based on this string are not guaranteed to remain\n stable.\n \"\"\"","function_tokens":["def","path","(","self",")","->","str",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L62-L68"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeNode.parent","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the parent node of this node or None.","docstring_summary":"Returns the parent node of this node or None.","docstring_tokens":["Returns","the","parent","node","of","this","node","or","None","."],"function":"def parent(self) -> Optional['TreeNode']:\n \"\"\"Returns the parent node of this node or None.\"\"\"","function_tokens":["def","parent","(","self",")","->","Optional","[","'TreeNode'","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L72-L73"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeNode.path_depth","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Return the path depth of the current node.","docstring_summary":"Return the path depth of the current node.","docstring_tokens":["Return","the","path","depth","of","the","current","node","."],"function":"def path_depth(self) -> int:\n \"\"\"Return the path depth of the current node.\"\"\"","function_tokens":["def","path_depth","(","self",")","->","int",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L77-L78"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeNode.path_changed","parameters":"(self, path: str, added: bool = False)","argument_list":"","return_statement":"","docstring":"Updates the path based on the addition or removal of a node higher\n up in the tree.\n\n This should only be called by the containing TreeGrid and\n expects to only be called for affected nodes.","docstring_summary":"Updates the path based on the addition or removal of a node higher\n up in the tree.","docstring_tokens":["Updates","the","path","based","on","the","addition","or","removal","of","a","node","higher","up","in","the","tree","."],"function":"def path_changed(self, path: str, added: bool = False) -> None:\n \"\"\"Updates the path based on the addition or removal of a node higher\n up in the tree.\n\n This should only be called by the containing TreeGrid and\n expects to only be called for affected nodes.\n \"\"\"","function_tokens":["def","path_changed","(","self",",","path",":","str",",","added",":","bool","=","False",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L81-L87"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeGrid.__init__","parameters":"(self, columns: ColumnsType, generator: Generator)","argument_list":"","return_statement":"","docstring":"Constructs a TreeGrid object using a specific set of columns.\n\n The TreeGrid itself is a root element, that can have children but no values.\n The TreeGrid does *not* contain any information about formatting,\n these are up to the renderers and plugins.\n\n Args:\n columns: A list of column tuples made up of (name, type).\n generator: An iterable containing row for a tree grid, each row contains a indent level followed by the values for each column in order.","docstring_summary":"Constructs a TreeGrid object using a specific set of columns.","docstring_tokens":["Constructs","a","TreeGrid","object","using","a","specific","set","of","columns","."],"function":"def __init__(self, columns: ColumnsType, generator: Generator) -> None:\n \"\"\"Constructs a TreeGrid object using a specific set of columns.\n\n The TreeGrid itself is a root element, that can have children but no values.\n The TreeGrid does *not* contain any information about formatting,\n these are up to the renderers and plugins.\n\n Args:\n columns: A list of column tuples made up of (name, type).\n generator: An iterable containing row for a tree grid, each row contains a indent level followed by the values for each column in order.\n \"\"\"","function_tokens":["def","__init__","(","self",",","columns",":","ColumnsType",",","generator",":","Generator",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L134-L144"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeGrid.sanitize_name","parameters":"(text: str)","argument_list":"","return_statement":"","docstring":"Method used to sanitize column names for TreeNodes.","docstring_summary":"Method used to sanitize column names for TreeNodes.","docstring_tokens":["Method","used","to","sanitize","column","names","for","TreeNodes","."],"function":"def sanitize_name(text: str) -> str:\n \"\"\"Method used to sanitize column names for TreeNodes.\"\"\"","function_tokens":["def","sanitize_name","(","text",":","str",")","->","str",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L148-L149"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeGrid.populate","parameters":"(self,\n function: VisitorSignature = None,\n initial_accumulator: Any = None,\n fail_on_errors: bool = True)","argument_list":"","return_statement":"","docstring":"Populates the tree by consuming the TreeGrid's construction\n generator Func is called on every node, so can be used to create output\n on demand.\n\n This is equivalent to a one-time visit.","docstring_summary":"Populates the tree by consuming the TreeGrid's construction\n generator Func is called on every node, so can be used to create output\n on demand.","docstring_tokens":["Populates","the","tree","by","consuming","the","TreeGrid","s","construction","generator","Func","is","called","on","every","node","so","can","be","used","to","create","output","on","demand","."],"function":"def populate(self,\n function: VisitorSignature = None,\n initial_accumulator: Any = None,\n fail_on_errors: bool = True) -> Optional[Exception]:\n \"\"\"Populates the tree by consuming the TreeGrid's construction\n generator Func is called on every node, so can be used to create output\n on demand.\n\n This is equivalent to a one-time visit.\n \"\"\"","function_tokens":["def","populate","(","self",",","function",":","VisitorSignature","=","None",",","initial_accumulator",":","Any","=","None",",","fail_on_errors",":","bool","=","True",")","->","Optional","[","Exception","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L152-L161"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeGrid.populated","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Indicates that population has completed and the tree may now be\n manipulated separately.","docstring_summary":"Indicates that population has completed and the tree may now be\n manipulated separately.","docstring_tokens":["Indicates","that","population","has","completed","and","the","tree","may","now","be","manipulated","separately","."],"function":"def populated(self) -> bool:\n \"\"\"Indicates that population has completed and the tree may now be\n manipulated separately.\"\"\"","function_tokens":["def","populated","(","self",")","->","bool",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L165-L167"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeGrid.columns","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the available columns and their ordering and types.","docstring_summary":"Returns the available columns and their ordering and types.","docstring_tokens":["Returns","the","available","columns","and","their","ordering","and","types","."],"function":"def columns(self) -> List[Column]:\n \"\"\"Returns the available columns and their ordering and types.\"\"\"","function_tokens":["def","columns","(","self",")","->","List","[","Column","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L171-L172"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeGrid.children","parameters":"(self, node: TreeNode)","argument_list":"","return_statement":"","docstring":"Returns the subnodes of a particular node in order.","docstring_summary":"Returns the subnodes of a particular node in order.","docstring_tokens":["Returns","the","subnodes","of","a","particular","node","in","order","."],"function":"def children(self, node: TreeNode) -> List[TreeNode]:\n \"\"\"Returns the subnodes of a particular node in order.\"\"\"","function_tokens":["def","children","(","self",",","node",":","TreeNode",")","->","List","[","TreeNode","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L175-L176"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeGrid.values","parameters":"(self, node: TreeNode)","argument_list":"","return_statement":"","docstring":"Returns the values for a particular node.\n\n The values returned are mutable,","docstring_summary":"Returns the values for a particular node.","docstring_tokens":["Returns","the","values","for","a","particular","node","."],"function":"def values(self, node: TreeNode) -> Tuple[BaseTypes, ...]:\n \"\"\"Returns the values for a particular node.\n\n The values returned are mutable,\n \"\"\"","function_tokens":["def","values","(","self",",","node",":","TreeNode",")","->","Tuple","[","BaseTypes",",","...","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L179-L183"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeGrid.is_ancestor","parameters":"(self, node: TreeNode, descendant: TreeNode)","argument_list":"","return_statement":"","docstring":"Returns true if descendent is a child, grandchild, etc of node.","docstring_summary":"Returns true if descendent is a child, grandchild, etc of node.","docstring_tokens":["Returns","true","if","descendent","is","a","child","grandchild","etc","of","node","."],"function":"def is_ancestor(self, node: TreeNode, descendant: TreeNode) -> bool:\n \"\"\"Returns true if descendent is a child, grandchild, etc of node.\"\"\"","function_tokens":["def","is_ancestor","(","self",",","node",":","TreeNode",",","descendant",":","TreeNode",")","->","bool",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L186-L187"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeGrid.max_depth","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the maximum depth of the tree.","docstring_summary":"Returns the maximum depth of the tree.","docstring_tokens":["Returns","the","maximum","depth","of","the","tree","."],"function":"def max_depth(self) -> int:\n \"\"\"Returns the maximum depth of the tree.\"\"\"","function_tokens":["def","max_depth","(","self",")","->","int",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L190-L191"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeGrid.path_depth","parameters":"(node: TreeNode)","argument_list":"","return_statement":"return node.path_depth","docstring":"Returns the path depth of a particular node.","docstring_summary":"Returns the path depth of a particular node.","docstring_tokens":["Returns","the","path","depth","of","a","particular","node","."],"function":"def path_depth(node: TreeNode) -> int:\n \"\"\"Returns the path depth of a particular node.\"\"\"\n return node.path_depth","function_tokens":["def","path_depth","(","node",":","TreeNode",")","->","int",":","return","node",".","path_depth"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L194-L196"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py","language":"python","identifier":"TreeGrid.visit","parameters":"(self,\n node: Optional[TreeNode],\n function: VisitorSignature,\n initial_accumulator: _Type,\n sort_key: ColumnSortKey = None)","argument_list":"","return_statement":"","docstring":"Visits all the nodes in a tree, calling function on each one.\n\n function should have the signature function(node, accumulator) and return new_accumulator\n If accumulators are not needed, the function must still accept a second parameter.\n\n The order of that the nodes are visited is always depth first, however, the order children are traversed can\n be set based on a sort_key function which should accept a node's values and return something that can be\n sorted to receive the desired order (similar to the sort\/sorted key).\n\n If node is None, then the root node is used.\n\n Args:\n node: The initial node to be visited\n function: The visitor to apply to the nodes under the initial node\n initial_accumulator: An accumulator that allows data to be transfered between one visitor call to the next\n sort_key: Information about the sort order of columns in order to determine the ordering of results","docstring_summary":"Visits all the nodes in a tree, calling function on each one.","docstring_tokens":["Visits","all","the","nodes","in","a","tree","calling","function","on","each","one","."],"function":"def visit(self,\n node: Optional[TreeNode],\n function: VisitorSignature,\n initial_accumulator: _Type,\n sort_key: ColumnSortKey = None) -> None:\n \"\"\"Visits all the nodes in a tree, calling function on each one.\n\n function should have the signature function(node, accumulator) and return new_accumulator\n If accumulators are not needed, the function must still accept a second parameter.\n\n The order of that the nodes are visited is always depth first, however, the order children are traversed can\n be set based on a sort_key function which should accept a node's values and return something that can be\n sorted to receive the desired order (similar to the sort\/sorted key).\n\n If node is None, then the root node is used.\n\n Args:\n node: The initial node to be visited\n function: The visitor to apply to the nodes under the initial node\n initial_accumulator: An accumulator that allows data to be transfered between one visitor call to the next\n sort_key: Information about the sort order of columns in order to determine the ordering of results\n \"\"\"","function_tokens":["def","visit","(","self",",","node",":","Optional","[","TreeNode","]",",","function",":","VisitorSignature",",","initial_accumulator",":","_Type",",","sort_key",":","ColumnSortKey","=","None",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/renderers.py#L199-L220"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ContextInterface.__init__","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Initializes the context with a symbol_space.","docstring_summary":"Initializes the context with a symbol_space.","docstring_tokens":["Initializes","the","context","with","a","symbol_space","."],"function":"def __init__(self) -> None:\n \"\"\"Initializes the context with a symbol_space.\"\"\"","function_tokens":["def","__init__","(","self",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L27-L28"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ContextInterface.config","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the configuration object for this context.","docstring_summary":"Returns the configuration object for this context.","docstring_tokens":["Returns","the","configuration","object","for","this","context","."],"function":"def config(self) -> 'interfaces.configuration.HierarchicalDict':\n \"\"\"Returns the configuration object for this context.\"\"\"","function_tokens":["def","config","(","self",")","->","'interfaces.configuration.HierarchicalDict'",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L34-L35"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ContextInterface.symbol_space","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the symbol_space for the context.\n\n This object must support the :class:`~volatility.framework.interfaces.symbols.SymbolSpaceInterface`","docstring_summary":"Returns the symbol_space for the context.","docstring_tokens":["Returns","the","symbol_space","for","the","context","."],"function":"def symbol_space(self) -> 'interfaces.symbols.SymbolSpaceInterface':\n \"\"\"Returns the symbol_space for the context.\n\n This object must support the :class:`~volatility.framework.interfaces.symbols.SymbolSpaceInterface`\n \"\"\"","function_tokens":["def","symbol_space","(","self",")","->","'interfaces.symbols.SymbolSpaceInterface'",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L39-L43"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ContextInterface.layers","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the memory object for the context.","docstring_summary":"Returns the memory object for the context.","docstring_tokens":["Returns","the","memory","object","for","the","context","."],"function":"def layers(self) -> 'interfaces.layers.LayerContainer':\n \"\"\"Returns the memory object for the context.\"\"\"\n raise NotImplementedError(\"LayerContainer has not been implemented.\")","function_tokens":["def","layers","(","self",")","->","'interfaces.layers.LayerContainer'",":","raise","NotImplementedError","(","\"LayerContainer has not been implemented.\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L49-L51"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ContextInterface.add_layer","parameters":"(self, layer: 'interfaces.layers.DataLayerInterface')","argument_list":"","return_statement":"","docstring":"Adds a named translation layer to the context memory.\n\n Args:\n layer: Layer object to be added to the context memory","docstring_summary":"Adds a named translation layer to the context memory.","docstring_tokens":["Adds","a","named","translation","layer","to","the","context","memory","."],"function":"def add_layer(self, layer: 'interfaces.layers.DataLayerInterface'):\n \"\"\"Adds a named translation layer to the context memory.\n\n Args:\n layer: Layer object to be added to the context memory\n \"\"\"\n self.layers.add_layer(layer)","function_tokens":["def","add_layer","(","self",",","layer",":","'interfaces.layers.DataLayerInterface'",")",":","self",".","layers",".","add_layer","(","layer",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L53-L59"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ContextInterface.object","parameters":"(self,\n object_type: Union[str, 'interfaces.objects.Template'],\n layer_name: str,\n offset: int,\n native_layer_name: str = None,\n **arguments)","argument_list":"","return_statement":"","docstring":"Object factory, takes a context, symbol, offset and optional\n layer_name.\n\n Looks up the layer_name in the context, finds the object template based on the symbol,\n and constructs an object using the object template on the layer at the offset.\n\n Args:\n object_type: Either a string name of the type, or a Template of the type to be constructed\n layer_name: The name of the layer on which to construct the object\n offset: The address within the layer at which to construct the object\n native_layer_name: The layer this object references (should it be a pointer or similar)\n\n Returns:\n A fully constructed object","docstring_summary":"Object factory, takes a context, symbol, offset and optional\n layer_name.","docstring_tokens":["Object","factory","takes","a","context","symbol","offset","and","optional","layer_name","."],"function":"def object(self,\n object_type: Union[str, 'interfaces.objects.Template'],\n layer_name: str,\n offset: int,\n native_layer_name: str = None,\n **arguments):\n \"\"\"Object factory, takes a context, symbol, offset and optional\n layer_name.\n\n Looks up the layer_name in the context, finds the object template based on the symbol,\n and constructs an object using the object template on the layer at the offset.\n\n Args:\n object_type: Either a string name of the type, or a Template of the type to be constructed\n layer_name: The name of the layer on which to construct the object\n offset: The address within the layer at which to construct the object\n native_layer_name: The layer this object references (should it be a pointer or similar)\n\n Returns:\n A fully constructed object\n \"\"\"","function_tokens":["def","object","(","self",",","object_type",":","Union","[","str",",","'interfaces.objects.Template'","]",",","layer_name",":","str",",","offset",":","int",",","native_layer_name",":","str","=","None",",","*","*","arguments",")",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L64-L84"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ContextInterface.clone","parameters":"(self)","argument_list":"","return_statement":"return copy.deepcopy(self)","docstring":"Produce a clone of the context (and configuration), allowing\n modifications to be made without affecting any mutable objects in the\n original.\n\n Memory constraints may become an issue for this function\n depending on how much is actually stored in the context","docstring_summary":"Produce a clone of the context (and configuration), allowing\n modifications to be made without affecting any mutable objects in the\n original.","docstring_tokens":["Produce","a","clone","of","the","context","(","and","configuration",")","allowing","modifications","to","be","made","without","affecting","any","mutable","objects","in","the","original","."],"function":"def clone(self) -> 'ContextInterface':\n \"\"\"Produce a clone of the context (and configuration), allowing\n modifications to be made without affecting any mutable objects in the\n original.\n\n Memory constraints may become an issue for this function\n depending on how much is actually stored in the context\n \"\"\"\n return copy.deepcopy(self)","function_tokens":["def","clone","(","self",")","->","'ContextInterface'",":","return","copy",".","deepcopy","(","self",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L86-L94"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ContextInterface.module","parameters":"(self,\n module_name: str,\n layer_name: str,\n offset: int,\n native_layer_name: Optional[str] = None,\n size: Optional[int] = None)","argument_list":"","return_statement":"","docstring":"Create a module object.\n\n A module object is associated with a symbol table, and acts like a context, but offsets locations by a known value\n and looks up symbols, by default within the associated symbol table. It can also be sized should that information\n be available.\n\n Args:\n module_name: The name of the module\n layer_name: The layer the module is associated with (which layer the module lives within)\n offset: The initial\/base offset of the module (used as the offset for relative symbols)\n native_layer_name: The default native_layer_name to use when the module constructs objects\n size: The size, in bytes, that the module occupys from offset location within the layer named layer_name\n\n Returns:\n A module object","docstring_summary":"Create a module object.","docstring_tokens":["Create","a","module","object","."],"function":"def module(self,\n module_name: str,\n layer_name: str,\n offset: int,\n native_layer_name: Optional[str] = None,\n size: Optional[int] = None) -> 'ModuleInterface':\n \"\"\"Create a module object.\n\n A module object is associated with a symbol table, and acts like a context, but offsets locations by a known value\n and looks up symbols, by default within the associated symbol table. It can also be sized should that information\n be available.\n\n Args:\n module_name: The name of the module\n layer_name: The layer the module is associated with (which layer the module lives within)\n offset: The initial\/base offset of the module (used as the offset for relative symbols)\n native_layer_name: The default native_layer_name to use when the module constructs objects\n size: The size, in bytes, that the module occupys from offset location within the layer named layer_name\n\n Returns:\n A module object\n \"\"\"","function_tokens":["def","module","(","self",",","module_name",":","str",",","layer_name",":","str",",","offset",":","int",",","native_layer_name",":","Optional","[","str","]","=","None",",","size",":","Optional","[","int","]","=","None",")","->","'ModuleInterface'",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L96-L117"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.__init__","parameters":"(self,\n context: ContextInterface,\n module_name: str,\n layer_name: str,\n offset: int,\n symbol_table_name: Optional[str] = None,\n native_layer_name: Optional[str] = None)","argument_list":"","return_statement":"","docstring":"Constructs a new os-independent module.\n\n Args:\n context: The context within which this module will exist\n module_name: The name of the module\n layer_name: The layer within the context in which the module exists\n offset: The offset at which the module exists in the layer\n symbol_table_name: The name of an associated symbol table\n native_layer_name: The default native layer for objects constructed by the module","docstring_summary":"Constructs a new os-independent module.","docstring_tokens":["Constructs","a","new","os","-","independent","module","."],"function":"def __init__(self,\n context: ContextInterface,\n module_name: str,\n layer_name: str,\n offset: int,\n symbol_table_name: Optional[str] = None,\n native_layer_name: Optional[str] = None) -> None:\n \"\"\"Constructs a new os-independent module.\n\n Args:\n context: The context within which this module will exist\n module_name: The name of the module\n layer_name: The layer within the context in which the module exists\n offset: The offset at which the module exists in the layer\n symbol_table_name: The name of an associated symbol table\n native_layer_name: The default native layer for objects constructed by the module\n \"\"\"\n self._context = context\n self._module_name = module_name\n self._layer_name = layer_name\n self._offset = offset\n self._native_layer_name = None\n if native_layer_name:\n self._native_layer_name = native_layer_name\n self.symbol_table_name = symbol_table_name or self._module_name\n super().__init__()","function_tokens":["def","__init__","(","self",",","context",":","ContextInterface",",","module_name",":","str",",","layer_name",":","str",",","offset",":","int",",","symbol_table_name",":","Optional","[","str","]","=","None",",","native_layer_name",":","Optional","[","str","]","=","None",")","->","None",":","self",".","_context","=","context","self",".","_module_name","=","module_name","self",".","_layer_name","=","layer_name","self",".","_offset","=","offset","self",".","_native_layer_name","=","None","if","native_layer_name",":","self",".","_native_layer_name","=","native_layer_name","self",".","symbol_table_name","=","symbol_table_name","or","self",".","_module_name","super","(",")",".","__init__","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L126-L151"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.name","parameters":"(self)","argument_list":"","return_statement":"return self._module_name","docstring":"The name of the constructed module.","docstring_summary":"The name of the constructed module.","docstring_tokens":["The","name","of","the","constructed","module","."],"function":"def name(self) -> str:\n \"\"\"The name of the constructed module.\"\"\"\n return self._module_name","function_tokens":["def","name","(","self",")","->","str",":","return","self",".","_module_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L154-L156"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.offset","parameters":"(self)","argument_list":"","return_statement":"return self._offset","docstring":"Returns the offset that the module resides within the layer of\n layer_name.","docstring_summary":"Returns the offset that the module resides within the layer of\n layer_name.","docstring_tokens":["Returns","the","offset","that","the","module","resides","within","the","layer","of","layer_name","."],"function":"def offset(self) -> int:\n \"\"\"Returns the offset that the module resides within the layer of\n layer_name.\"\"\"\n return self._offset","function_tokens":["def","offset","(","self",")","->","int",":","return","self",".","_offset"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L159-L162"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.layer_name","parameters":"(self)","argument_list":"","return_statement":"return self._layer_name","docstring":"Layer name in which the Module resides.","docstring_summary":"Layer name in which the Module resides.","docstring_tokens":["Layer","name","in","which","the","Module","resides","."],"function":"def layer_name(self) -> str:\n \"\"\"Layer name in which the Module resides.\"\"\"\n return self._layer_name","function_tokens":["def","layer_name","(","self",")","->","str",":","return","self",".","_layer_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L165-L167"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.context","parameters":"(self)","argument_list":"","return_statement":"return self._context","docstring":"Context that the module uses.","docstring_summary":"Context that the module uses.","docstring_tokens":["Context","that","the","module","uses","."],"function":"def context(self) -> ContextInterface:\n \"\"\"Context that the module uses.\"\"\"\n return self._context","function_tokens":["def","context","(","self",")","->","ContextInterface",":","return","self",".","_context"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L170-L172"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.object","parameters":"(self,\n object_type: str,\n offset: int = None,\n native_layer_name: Optional[str] = None,\n absolute: bool = False,\n **kwargs)","argument_list":"","return_statement":"","docstring":"Returns an object created using the symbol_table_name and layer_name\n of the Module.\n\n Args:\n object_type: The name of object type to construct (using the module's symbol_table)\n offset: the offset (unless absolute is set) from the start of the module\n native_layer_name: The native layer for objects that reference a different layer (if not the default provided during module construction)\n absolute: A boolean specifying whether the offset is absolute within the layer, or relative to the start of the module\n\n Returns:\n The constructed object","docstring_summary":"Returns an object created using the symbol_table_name and layer_name\n of the Module.","docstring_tokens":["Returns","an","object","created","using","the","symbol_table_name","and","layer_name","of","the","Module","."],"function":"def object(self,\n object_type: str,\n offset: int = None,\n native_layer_name: Optional[str] = None,\n absolute: bool = False,\n **kwargs) -> 'interfaces.objects.ObjectInterface':\n \"\"\"Returns an object created using the symbol_table_name and layer_name\n of the Module.\n\n Args:\n object_type: The name of object type to construct (using the module's symbol_table)\n offset: the offset (unless absolute is set) from the start of the module\n native_layer_name: The native layer for objects that reference a different layer (if not the default provided during module construction)\n absolute: A boolean specifying whether the offset is absolute within the layer, or relative to the start of the module\n\n Returns:\n The constructed object\n \"\"\"","function_tokens":["def","object","(","self",",","object_type",":","str",",","offset",":","int","=","None",",","native_layer_name",":","Optional","[","str","]","=","None",",","absolute",":","bool","=","False",",","*","*","kwargs",")","->","'interfaces.objects.ObjectInterface'",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L175-L192"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.object_from_symbol","parameters":"(self,\n symbol_name: str,\n native_layer_name: Optional[str] = None,\n absolute: bool = False,\n **kwargs)","argument_list":"","return_statement":"","docstring":"Returns an object created using the symbol_table_name and layer_name\n of the Module.\n\n Args:\n symbol_name: The name of a symbol (that must be present in the module's symbol table). The symbol's associated type will be used to construct an object at the symbol's offset.\n native_layer_name: The native layer for objects that reference a different layer (if not the default provided during module construction)\n absolute: A boolean specifying whether the offset is absolute within the layer, or relative to the start of the module\n\n Returns:\n The constructed object","docstring_summary":"Returns an object created using the symbol_table_name and layer_name\n of the Module.","docstring_tokens":["Returns","an","object","created","using","the","symbol_table_name","and","layer_name","of","the","Module","."],"function":"def object_from_symbol(self,\n symbol_name: str,\n native_layer_name: Optional[str] = None,\n absolute: bool = False,\n **kwargs) -> 'interfaces.objects.ObjectInterface':\n \"\"\"Returns an object created using the symbol_table_name and layer_name\n of the Module.\n\n Args:\n symbol_name: The name of a symbol (that must be present in the module's symbol table). The symbol's associated type will be used to construct an object at the symbol's offset.\n native_layer_name: The native layer for objects that reference a different layer (if not the default provided during module construction)\n absolute: A boolean specifying whether the offset is absolute within the layer, or relative to the start of the module\n\n Returns:\n The constructed object\n \"\"\"","function_tokens":["def","object_from_symbol","(","self",",","symbol_name",":","str",",","native_layer_name",":","Optional","[","str","]","=","None",",","absolute",":","bool","=","False",",","*","*","kwargs",")","->","'interfaces.objects.ObjectInterface'",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L195-L210"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.get_type","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Returns a type from the module.","docstring_summary":"Returns a type from the module.","docstring_tokens":["Returns","a","type","from","the","module","."],"function":"def get_type(self, name: str) -> 'interfaces.objects.Template':\n \"\"\"Returns a type from the module.\"\"\"","function_tokens":["def","get_type","(","self",",","name",":","str",")","->","'interfaces.objects.Template'",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L212-L213"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.get_symbol","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Returns a symbol from the module.","docstring_summary":"Returns a symbol from the module.","docstring_tokens":["Returns","a","symbol","from","the","module","."],"function":"def get_symbol(self, name: str) -> 'interfaces.symbols.SymbolInterface':\n \"\"\"Returns a symbol from the module.\"\"\"","function_tokens":["def","get_symbol","(","self",",","name",":","str",")","->","'interfaces.symbols.SymbolInterface'",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L215-L216"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.get_enumeration","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Returns an enumeration from the module.","docstring_summary":"Returns an enumeration from the module.","docstring_tokens":["Returns","an","enumeration","from","the","module","."],"function":"def get_enumeration(self, name: str) -> 'interfaces.objects.Template':\n \"\"\"Returns an enumeration from the module.\"\"\"","function_tokens":["def","get_enumeration","(","self",",","name",":","str",")","->","'interfaces.objects.Template'",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L218-L219"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.has_type","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Determines whether a type is present in the module.","docstring_summary":"Determines whether a type is present in the module.","docstring_tokens":["Determines","whether","a","type","is","present","in","the","module","."],"function":"def has_type(self, name: str) -> bool:\n \"\"\"Determines whether a type is present in the module.\"\"\"","function_tokens":["def","has_type","(","self",",","name",":","str",")","->","bool",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L221-L222"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.has_symbol","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Determines whether a symbol is present in the module.","docstring_summary":"Determines whether a symbol is present in the module.","docstring_tokens":["Determines","whether","a","symbol","is","present","in","the","module","."],"function":"def has_symbol(self, name: str) -> bool:\n \"\"\"Determines whether a symbol is present in the module.\"\"\"","function_tokens":["def","has_symbol","(","self",",","name",":","str",")","->","bool",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L224-L225"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py","language":"python","identifier":"ModuleInterface.has_enumeration","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Determines whether an enumeration is present in the module.","docstring_summary":"Determines whether an enumeration is present in the module.","docstring_tokens":["Determines","whether","an","enumeration","is","present","in","the","module","."],"function":"def has_enumeration(self, name: str) -> bool:\n \"\"\"Determines whether an enumeration is present in the module.\"\"\"","function_tokens":["def","has_enumeration","(","self",",","name",":","str",")","->","bool",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/context.py#L227-L228"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolInterface.__init__","parameters":"(self,\n name: str,\n address: int,\n type: Optional[objects.Template] = None,\n constant_data: Optional[bytes] = None)","argument_list":"","return_statement":"","docstring":"Args:\n name: Name of the symbol\n address: Numeric address value of the symbol\n type: Optional type structure information associated with the symbol\n constant_data: Potential constant data the symbol points at","docstring_summary":"","docstring_tokens":[],"function":"def __init__(self,\n name: str,\n address: int,\n type: Optional[objects.Template] = None,\n constant_data: Optional[bytes] = None) -> None:\n \"\"\"\n\n Args:\n name: Name of the symbol\n address: Numeric address value of the symbol\n type: Optional type structure information associated with the symbol\n constant_data: Potential constant data the symbol points at\n \"\"\"\n self._name = name\n if constants.BANG in self._name:\n raise ValueError(\"Symbol names cannot contain the symbol differentiator ({})\".format(constants.BANG))\n\n # Scope can be added at a later date\n self._location = None\n self._address = address\n self._type = type\n self._constant_data = constant_data","function_tokens":["def","__init__","(","self",",","name",":","str",",","address",":","int",",","type",":","Optional","[","objects",".","Template","]","=","None",",","constant_data",":","Optional","[","bytes","]","=","None",")","->","None",":","self",".","_name","=","name","if","constants",".","BANG","in","self",".","_name",":","raise","ValueError","(","\"Symbol names cannot contain the symbol differentiator ({})\"",".","format","(","constants",".","BANG",")",")","# Scope can be added at a later date","self",".","_location","=","None","self",".","_address","=","address","self",".","_type","=","type","self",".","_constant_data","=","constant_data"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L19-L40"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolInterface.name","parameters":"(self)","argument_list":"","return_statement":"return self._name","docstring":"Returns the name of the symbol.","docstring_summary":"Returns the name of the symbol.","docstring_tokens":["Returns","the","name","of","the","symbol","."],"function":"def name(self) -> str:\n \"\"\"Returns the name of the symbol.\"\"\"\n return self._name","function_tokens":["def","name","(","self",")","->","str",":","return","self",".","_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L43-L45"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolInterface.type_name","parameters":"(self)","argument_list":"","return_statement":"return self.type.vol['type_name']","docstring":"Returns the name of the type that the symbol represents.","docstring_summary":"Returns the name of the type that the symbol represents.","docstring_tokens":["Returns","the","name","of","the","type","that","the","symbol","represents","."],"function":"def type_name(self) -> Optional[str]:\n \"\"\"Returns the name of the type that the symbol represents.\"\"\"\n # Objects and ObjectTemplates should *always* get a type_name when they're constructed, so allow the IndexError\n if self.type is None:\n return None\n return self.type.vol['type_name']","function_tokens":["def","type_name","(","self",")","->","Optional","[","str","]",":","# Objects and ObjectTemplates should *always* get a type_name when they're constructed, so allow the IndexError","if","self",".","type","is","None",":","return","None","return","self",".","type",".","vol","[","'type_name'","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L48-L53"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolInterface.type","parameters":"(self)","argument_list":"","return_statement":"return self._type","docstring":"Returns the type that the symbol represents.","docstring_summary":"Returns the type that the symbol represents.","docstring_tokens":["Returns","the","type","that","the","symbol","represents","."],"function":"def type(self) -> Optional[objects.Template]:\n \"\"\"Returns the type that the symbol represents.\"\"\"\n return self._type","function_tokens":["def","type","(","self",")","->","Optional","[","objects",".","Template","]",":","return","self",".","_type"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L56-L58"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolInterface.address","parameters":"(self)","argument_list":"","return_statement":"return self._address","docstring":"Returns the relative address of the symbol within the compilation\n unit.","docstring_summary":"Returns the relative address of the symbol within the compilation\n unit.","docstring_tokens":["Returns","the","relative","address","of","the","symbol","within","the","compilation","unit","."],"function":"def address(self) -> int:\n \"\"\"Returns the relative address of the symbol within the compilation\n unit.\"\"\"\n return self._address","function_tokens":["def","address","(","self",")","->","int",":","return","self",".","_address"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L61-L64"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolInterface.constant_data","parameters":"(self)","argument_list":"","return_statement":"return self._constant_data","docstring":"Returns any constant data associated with the symbol.","docstring_summary":"Returns any constant data associated with the symbol.","docstring_tokens":["Returns","any","constant","data","associated","with","the","symbol","."],"function":"def constant_data(self) -> Optional[bytes]:\n \"\"\"Returns any constant data associated with the symbol.\"\"\"\n return self._constant_data","function_tokens":["def","constant_data","(","self",")","->","Optional","[","bytes","]",":","return","self",".","_constant_data"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L67-L69"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.__init__","parameters":"(self,\n name: str,\n native_types: 'NativeTableInterface',\n table_mapping: Optional[Dict[str, str]] = None,\n class_types: Optional[Mapping[str, Type[objects.ObjectInterface]]] = None)","argument_list":"","return_statement":"","docstring":"Args:\n name: Name of the symbol table\n native_types: The native symbol table used to resolve any base\/native types\n table_mapping: A dictionary mapping names of tables (which when present within the table will be changed to the mapped table)\n class_types: A dictionary of types and classes that should be instantiated instead of Struct to construct them","docstring_summary":"","docstring_tokens":[],"function":"def __init__(self,\n name: str,\n native_types: 'NativeTableInterface',\n table_mapping: Optional[Dict[str, str]] = None,\n class_types: Optional[Mapping[str, Type[objects.ObjectInterface]]] = None) -> None:\n \"\"\"\n\n Args:\n name: Name of the symbol table\n native_types: The native symbol table used to resolve any base\/native types\n table_mapping: A dictionary mapping names of tables (which when present within the table will be changed to the mapped table)\n class_types: A dictionary of types and classes that should be instantiated instead of Struct to construct them\n \"\"\"\n self.name = name\n if table_mapping is None:\n table_mapping = {}\n self.table_mapping = table_mapping\n self._native_types = native_types\n self._sort_symbols = [] # type: List[Tuple[int, str]]\n\n # Set any provisioned class_types\n if class_types:\n for class_type in class_types:\n self.set_type_class(class_type, class_types[class_type])","function_tokens":["def","__init__","(","self",",","name",":","str",",","native_types",":","'NativeTableInterface'",",","table_mapping",":","Optional","[","Dict","[","str",",","str","]","]","=","None",",","class_types",":","Optional","[","Mapping","[","str",",","Type","[","objects",".","ObjectInterface","]","]","]","=","None",")","->","None",":","self",".","name","=","name","if","table_mapping","is","None",":","table_mapping","=","{","}","self",".","table_mapping","=","table_mapping","self",".","_native_types","=","native_types","self",".","_sort_symbols","=","[","]","# type: List[Tuple[int, str]]","# Set any provisioned class_types","if","class_types",":","for","class_type","in","class_types",":","self",".","set_type_class","(","class_type",",","class_types","[","class_type","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L81-L104"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.get_symbol","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Resolves a symbol name into a symbol object.\n\n If the symbol isn't found, it raises a SymbolError exception","docstring_summary":"Resolves a symbol name into a symbol object.","docstring_tokens":["Resolves","a","symbol","name","into","a","symbol","object","."],"function":"def get_symbol(self, name: str) -> SymbolInterface:\n \"\"\"Resolves a symbol name into a symbol object.\n\n If the symbol isn't found, it raises a SymbolError exception\n \"\"\"\n raise NotImplementedError(\"Abstract property get_symbol not implemented by subclass.\")","function_tokens":["def","get_symbol","(","self",",","name",":","str",")","->","SymbolInterface",":","raise","NotImplementedError","(","\"Abstract property get_symbol not implemented by subclass.\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L108-L113"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.symbols","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns an iterator of the Symbol names.","docstring_summary":"Returns an iterator of the Symbol names.","docstring_tokens":["Returns","an","iterator","of","the","Symbol","names","."],"function":"def symbols(self) -> Iterable[str]:\n \"\"\"Returns an iterator of the Symbol names.\"\"\"\n raise NotImplementedError(\"Abstract property symbols not implemented by subclass.\")","function_tokens":["def","symbols","(","self",")","->","Iterable","[","str","]",":","raise","NotImplementedError","(","\"Abstract property symbols not implemented by subclass.\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L116-L118"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.types","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns an iterator of the Symbol type names.","docstring_summary":"Returns an iterator of the Symbol type names.","docstring_tokens":["Returns","an","iterator","of","the","Symbol","type","names","."],"function":"def types(self) -> Iterable[str]:\n \"\"\"Returns an iterator of the Symbol type names.\"\"\"\n raise NotImplementedError(\"Abstract property types not implemented by subclass.\")","function_tokens":["def","types","(","self",")","->","Iterable","[","str","]",":","raise","NotImplementedError","(","\"Abstract property types not implemented by subclass.\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L123-L125"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.get_type","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Resolves a symbol name into an object template.\n\n If the symbol isn't found it raises a SymbolError exception","docstring_summary":"Resolves a symbol name into an object template.","docstring_tokens":["Resolves","a","symbol","name","into","an","object","template","."],"function":"def get_type(self, name: str) -> objects.Template:\n \"\"\"Resolves a symbol name into an object template.\n\n If the symbol isn't found it raises a SymbolError exception\n \"\"\"\n raise NotImplementedError(\"Abstract method get_type not implemented by subclass.\")","function_tokens":["def","get_type","(","self",",","name",":","str",")","->","objects",".","Template",":","raise","NotImplementedError","(","\"Abstract method get_type not implemented by subclass.\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L127-L132"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.enumerations","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns an iterator of the Enumeration names.","docstring_summary":"Returns an iterator of the Enumeration names.","docstring_tokens":["Returns","an","iterator","of","the","Enumeration","names","."],"function":"def enumerations(self) -> Iterable[Any]:\n \"\"\"Returns an iterator of the Enumeration names.\"\"\"\n raise NotImplementedError(\"Abstract property enumerations not implemented by subclass.\")","function_tokens":["def","enumerations","(","self",")","->","Iterable","[","Any","]",":","raise","NotImplementedError","(","\"Abstract property enumerations not implemented by subclass.\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L137-L139"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.natives","parameters":"(self)","argument_list":"","return_statement":"return self._native_types","docstring":"Returns None or a NativeTable for handling space specific native\n types.","docstring_summary":"Returns None or a NativeTable for handling space specific native\n types.","docstring_tokens":["Returns","None","or","a","NativeTable","for","handling","space","specific","native","types","."],"function":"def natives(self) -> 'NativeTableInterface':\n \"\"\"Returns None or a NativeTable for handling space specific native\n types.\"\"\"\n return self._native_types","function_tokens":["def","natives","(","self",")","->","'NativeTableInterface'",":","return","self",".","_native_types"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L144-L147"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.natives","parameters":"(self, value: 'NativeTableInterface')","argument_list":"","return_statement":"","docstring":"Checks the natives value and then applies it internally.\n\n WARNING: This allows changing the underlying size of all the other types referenced in the SymbolTable","docstring_summary":"Checks the natives value and then applies it internally.","docstring_tokens":["Checks","the","natives","value","and","then","applies","it","internally","."],"function":"def natives(self, value: 'NativeTableInterface') -> None:\n \"\"\"Checks the natives value and then applies it internally.\n\n WARNING: This allows changing the underlying size of all the other types referenced in the SymbolTable\n \"\"\"\n self._native_types = value","function_tokens":["def","natives","(","self",",","value",":","'NativeTableInterface'",")","->","None",":","self",".","_native_types","=","value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L150-L155"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.set_type_class","parameters":"(self, name: str, clazz: Type[objects.ObjectInterface])","argument_list":"","return_statement":"","docstring":"Overrides the object class for a specific Symbol type.\n\n Name *must* be present in self.types\n\n Args:\n name: The name of the type to override the class for\n clazz: The actual class to override for the provided type name","docstring_summary":"Overrides the object class for a specific Symbol type.","docstring_tokens":["Overrides","the","object","class","for","a","specific","Symbol","type","."],"function":"def set_type_class(self, name: str, clazz: Type[objects.ObjectInterface]) -> None:\n \"\"\"Overrides the object class for a specific Symbol type.\n\n Name *must* be present in self.types\n\n Args:\n name: The name of the type to override the class for\n clazz: The actual class to override for the provided type name\n \"\"\"\n raise NotImplementedError(\"Abstract method set_type_class not implemented yet.\")","function_tokens":["def","set_type_class","(","self",",","name",":","str",",","clazz",":","Type","[","objects",".","ObjectInterface","]",")","->","None",":","raise","NotImplementedError","(","\"Abstract method set_type_class not implemented yet.\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L159-L168"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.get_type_class","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Returns the class associated with a Symbol type.","docstring_summary":"Returns the class associated with a Symbol type.","docstring_tokens":["Returns","the","class","associated","with","a","Symbol","type","."],"function":"def get_type_class(self, name: str) -> Type[objects.ObjectInterface]:\n \"\"\"Returns the class associated with a Symbol type.\"\"\"\n raise NotImplementedError(\"Abstract method get_type_class not implemented yet.\")","function_tokens":["def","get_type_class","(","self",",","name",":","str",")","->","Type","[","objects",".","ObjectInterface","]",":","raise","NotImplementedError","(","\"Abstract method get_type_class not implemented yet.\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L170-L172"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.del_type_class","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Removes the associated class override for a specific Symbol type.","docstring_summary":"Removes the associated class override for a specific Symbol type.","docstring_tokens":["Removes","the","associated","class","override","for","a","specific","Symbol","type","."],"function":"def del_type_class(self, name: str) -> None:\n \"\"\"Removes the associated class override for a specific Symbol type.\"\"\"\n raise NotImplementedError(\"Abstract method del_type_class not implemented yet.\")","function_tokens":["def","del_type_class","(","self",",","name",":","str",")","->","None",":","raise","NotImplementedError","(","\"Abstract method del_type_class not implemented yet.\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L174-L176"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.get_symbol_type","parameters":"(self, name: str)","argument_list":"","return_statement":"return self.get_type(type_name)","docstring":"Resolves a symbol name into a symbol and then resolves the symbol's\n type.","docstring_summary":"Resolves a symbol name into a symbol and then resolves the symbol's\n type.","docstring_tokens":["Resolves","a","symbol","name","into","a","symbol","and","then","resolves","the","symbol","s","type","."],"function":"def get_symbol_type(self, name: str) -> Optional[objects.Template]:\n \"\"\"Resolves a symbol name into a symbol and then resolves the symbol's\n type.\"\"\"\n type_name = self.get_symbol(name).type_name\n if type_name is None:\n return None\n return self.get_type(type_name)","function_tokens":["def","get_symbol_type","(","self",",","name",":","str",")","->","Optional","[","objects",".","Template","]",":","type_name","=","self",".","get_symbol","(","name",")",".","type_name","if","type_name","is","None",":","return","None","return","self",".","get_type","(","type_name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L180-L186"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.get_symbols_by_type","parameters":"(self, type_name: str)","argument_list":"","return_statement":"","docstring":"Returns the name of all symbols in this table that have type\n matching type_name.","docstring_summary":"Returns the name of all symbols in this table that have type\n matching type_name.","docstring_tokens":["Returns","the","name","of","all","symbols","in","this","table","that","have","type","matching","type_name","."],"function":"def get_symbols_by_type(self, type_name: str) -> Iterable[str]:\n \"\"\"Returns the name of all symbols in this table that have type\n matching type_name.\"\"\"\n for symbol_name in self.symbols:\n # This allows for searching with and without the table name (in case multiple tables contain\n # the same symbol name and we've not specifically been told which one)\n symbol = self.get_symbol(symbol_name)\n if symbol.type_name is not None and (symbol.type_name == type_name or\n (symbol.type_name.endswith(constants.BANG + type_name))):\n yield symbol.name","function_tokens":["def","get_symbols_by_type","(","self",",","type_name",":","str",")","->","Iterable","[","str","]",":","for","symbol_name","in","self",".","symbols",":","# This allows for searching with and without the table name (in case multiple tables contain","# the same symbol name and we've not specifically been told which one)","symbol","=","self",".","get_symbol","(","symbol_name",")","if","symbol",".","type_name","is","not","None","and","(","symbol",".","type_name","==","type_name","or","(","symbol",".","type_name",".","endswith","(","constants",".","BANG","+","type_name",")",")",")",":","yield","symbol",".","name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L188-L197"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.get_symbols_by_location","parameters":"(self, offset: int, size: int = 0)","argument_list":"","return_statement":"","docstring":"Returns the name of all symbols in this table that live at a\n particular offset.","docstring_summary":"Returns the name of all symbols in this table that live at a\n particular offset.","docstring_tokens":["Returns","the","name","of","all","symbols","in","this","table","that","live","at","a","particular","offset","."],"function":"def get_symbols_by_location(self, offset: int, size: int = 0) -> Iterable[str]:\n \"\"\"Returns the name of all symbols in this table that live at a\n particular offset.\"\"\"\n if size < 0:\n raise ValueError(\"Size must be strictly non-negative\")\n if not self._sort_symbols:\n self._sort_symbols = sorted([(self.get_symbol(sn).address, sn) for sn in self.symbols])\n sort_symbols = self._sort_symbols\n result = bisect.bisect_left(sort_symbols, (offset, \"\"))\n while result < len(sort_symbols) and \\\n (sort_symbols[result][0] >= offset and sort_symbols[result][0] <= offset + size):\n yield sort_symbols[result][1]\n result += 1","function_tokens":["def","get_symbols_by_location","(","self",",","offset",":","int",",","size",":","int","=","0",")","->","Iterable","[","str","]",":","if","size","<","0",":","raise","ValueError","(","\"Size must be strictly non-negative\"",")","if","not","self",".","_sort_symbols",":","self",".","_sort_symbols","=","sorted","(","[","(","self",".","get_symbol","(","sn",")",".","address",",","sn",")","for","sn","in","self",".","symbols","]",")","sort_symbols","=","self",".","_sort_symbols","result","=","bisect",".","bisect_left","(","sort_symbols",",","(","offset",",","\"\"",")",")","while","result","<","len","(","sort_symbols",")","and","(","sort_symbols","[","result","]","[","0","]",">=","offset","and","sort_symbols","[","result","]","[","0","]","<=","offset","+","size",")",":","yield","sort_symbols","[","result","]","[","1","]","result","+=","1"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L199-L211"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"BaseSymbolTableInterface.clear_symbol_cache","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Clears the symbol cache of this symbol table.","docstring_summary":"Clears the symbol cache of this symbol table.","docstring_tokens":["Clears","the","symbol","cache","of","this","symbol","table","."],"function":"def clear_symbol_cache(self) -> None:\n \"\"\"Clears the symbol cache of this symbol table.\"\"\"\n pass","function_tokens":["def","clear_symbol_cache","(","self",")","->","None",":","pass"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L213-L215"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolSpaceInterface.free_table_name","parameters":"(self, prefix: str = \"layer\")","argument_list":"","return_statement":"","docstring":"Returns an unused table name to ensure no collision occurs when\n inserting a symbol table.","docstring_summary":"Returns an unused table name to ensure no collision occurs when\n inserting a symbol table.","docstring_tokens":["Returns","an","unused","table","name","to","ensure","no","collision","occurs","when","inserting","a","symbol","table","."],"function":"def free_table_name(self, prefix: str = \"layer\") -> str:\n \"\"\"Returns an unused table name to ensure no collision occurs when\n inserting a symbol table.\"\"\"","function_tokens":["def","free_table_name","(","self",",","prefix",":","str","=","\"layer\"",")","->","str",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L222-L224"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolSpaceInterface.clear_symbol_cache","parameters":"(self, table_name: str)","argument_list":"","return_statement":"","docstring":"Clears the symbol cache for the specified table name. If no table\n name is specified, the caches of all symbol tables are cleared.","docstring_summary":"Clears the symbol cache for the specified table name. If no table\n name is specified, the caches of all symbol tables are cleared.","docstring_tokens":["Clears","the","symbol","cache","for","the","specified","table","name",".","If","no","table","name","is","specified","the","caches","of","all","symbol","tables","are","cleared","."],"function":"def clear_symbol_cache(self, table_name: str) -> None:\n \"\"\"Clears the symbol cache for the specified table name. If no table\n name is specified, the caches of all symbol tables are cleared.\"\"\"","function_tokens":["def","clear_symbol_cache","(","self",",","table_name",":","str",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L227-L229"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolSpaceInterface.get_symbols_by_type","parameters":"(self, type_name: str)","argument_list":"","return_statement":"","docstring":"Returns all symbols based on the type of the symbol.","docstring_summary":"Returns all symbols based on the type of the symbol.","docstring_tokens":["Returns","all","symbols","based","on","the","type","of","the","symbol","."],"function":"def get_symbols_by_type(self, type_name: str) -> Iterable[str]:\n \"\"\"Returns all symbols based on the type of the symbol.\"\"\"","function_tokens":["def","get_symbols_by_type","(","self",",","type_name",":","str",")","->","Iterable","[","str","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L232-L233"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolSpaceInterface.get_symbols_by_location","parameters":"(self, offset: int, size: int = 0, table_name: Optional[str] = None)","argument_list":"","return_statement":"","docstring":"Returns all symbols that exist at a specific relative address.","docstring_summary":"Returns all symbols that exist at a specific relative address.","docstring_tokens":["Returns","all","symbols","that","exist","at","a","specific","relative","address","."],"function":"def get_symbols_by_location(self, offset: int, size: int = 0, table_name: Optional[str] = None) -> Iterable[str]:\n \"\"\"Returns all symbols that exist at a specific relative address.\"\"\"","function_tokens":["def","get_symbols_by_location","(","self",",","offset",":","int",",","size",":","int","=","0",",","table_name",":","Optional","[","str","]","=","None",")","->","Iterable","[","str","]",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L236-L237"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolSpaceInterface.get_type","parameters":"(self, type_name: str)","argument_list":"","return_statement":"","docstring":"Look-up a type name across all the contained symbol tables.","docstring_summary":"Look-up a type name across all the contained symbol tables.","docstring_tokens":["Look","-","up","a","type","name","across","all","the","contained","symbol","tables","."],"function":"def get_type(self, type_name: str) -> objects.Template:\n \"\"\"Look-up a type name across all the contained symbol tables.\"\"\"","function_tokens":["def","get_type","(","self",",","type_name",":","str",")","->","objects",".","Template",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L240-L241"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolSpaceInterface.get_symbol","parameters":"(self, symbol_name: str)","argument_list":"","return_statement":"","docstring":"Look-up a symbol name across all the contained symbol tables.","docstring_summary":"Look-up a symbol name across all the contained symbol tables.","docstring_tokens":["Look","-","up","a","symbol","name","across","all","the","contained","symbol","tables","."],"function":"def get_symbol(self, symbol_name: str) -> SymbolInterface:\n \"\"\"Look-up a symbol name across all the contained symbol tables.\"\"\"","function_tokens":["def","get_symbol","(","self",",","symbol_name",":","str",")","->","SymbolInterface",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L244-L245"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolSpaceInterface.get_enumeration","parameters":"(self, enum_name: str)","argument_list":"","return_statement":"","docstring":"Look-up an enumeration across all the contained symbol tables.","docstring_summary":"Look-up an enumeration across all the contained symbol tables.","docstring_tokens":["Look","-","up","an","enumeration","across","all","the","contained","symbol","tables","."],"function":"def get_enumeration(self, enum_name: str) -> objects.Template:\n \"\"\"Look-up an enumeration across all the contained symbol tables.\"\"\"","function_tokens":["def","get_enumeration","(","self",",","enum_name",":","str",")","->","objects",".","Template",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L248-L249"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolSpaceInterface.has_type","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Determines whether a type exists in the contained symbol tables.","docstring_summary":"Determines whether a type exists in the contained symbol tables.","docstring_tokens":["Determines","whether","a","type","exists","in","the","contained","symbol","tables","."],"function":"def has_type(self, name: str) -> bool:\n \"\"\"Determines whether a type exists in the contained symbol tables.\"\"\"","function_tokens":["def","has_type","(","self",",","name",":","str",")","->","bool",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L252-L253"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolSpaceInterface.has_symbol","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Determines whether a symbol exists in the contained symbol\n tables.","docstring_summary":"Determines whether a symbol exists in the contained symbol\n tables.","docstring_tokens":["Determines","whether","a","symbol","exists","in","the","contained","symbol","tables","."],"function":"def has_symbol(self, name: str) -> bool:\n \"\"\"Determines whether a symbol exists in the contained symbol\n tables.\"\"\"","function_tokens":["def","has_symbol","(","self",",","name",":","str",")","->","bool",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L256-L258"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolSpaceInterface.has_enumeration","parameters":"(self, name: str)","argument_list":"","return_statement":"","docstring":"Determines whether an enumeration choice exists in the contained\n symbol tables.","docstring_summary":"Determines whether an enumeration choice exists in the contained\n symbol tables.","docstring_tokens":["Determines","whether","an","enumeration","choice","exists","in","the","contained","symbol","tables","."],"function":"def has_enumeration(self, name: str) -> bool:\n \"\"\"Determines whether an enumeration choice exists in the contained\n symbol tables.\"\"\"","function_tokens":["def","has_enumeration","(","self",",","name",":","str",")","->","bool",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L261-L263"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolSpaceInterface.append","parameters":"(self, value: BaseSymbolTableInterface)","argument_list":"","return_statement":"","docstring":"Adds a symbol_list to the end of the space.","docstring_summary":"Adds a symbol_list to the end of the space.","docstring_tokens":["Adds","a","symbol_list","to","the","end","of","the","space","."],"function":"def append(self, value: BaseSymbolTableInterface) -> None:\n \"\"\"Adds a symbol_list to the end of the space.\"\"\"","function_tokens":["def","append","(","self",",","value",":","BaseSymbolTableInterface",")","->","None",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L266-L267"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"SymbolTableInterface.__init__","parameters":"(self,\n context: 'interfaces.context.ContextInterface',\n config_path: str,\n name: str,\n native_types: 'NativeTableInterface',\n table_mapping: Optional[Dict[str, str]] = None,\n class_types: Optional[Mapping[str, Type[objects.ObjectInterface]]] = None)","argument_list":"","return_statement":"","docstring":"Instantiates an SymbolTable based on an IntermediateSymbolFormat JSON file. This is validated against the\n appropriate schema.\n\n Args:\n context: The volatility context for the symbol table\n config_path: The configuration path for the symbol table\n name: The name for the symbol table (this is used in symbols e.g. table!symbol )\n isf_url: The URL pointing to the ISF file location\n native_types: The NativeSymbolTable that contains the native types for this symbol table\n table_mapping: A dictionary linking names referenced in the file with symbol tables in the context\n class_types: A dictionary of type names and classes that override StructType when they are instantiated","docstring_summary":"Instantiates an SymbolTable based on an IntermediateSymbolFormat JSON file. This is validated against the\n appropriate schema.","docstring_tokens":["Instantiates","an","SymbolTable","based","on","an","IntermediateSymbolFormat","JSON","file",".","This","is","validated","against","the","appropriate","schema","."],"function":"def __init__(self,\n context: 'interfaces.context.ContextInterface',\n config_path: str,\n name: str,\n native_types: 'NativeTableInterface',\n table_mapping: Optional[Dict[str, str]] = None,\n class_types: Optional[Mapping[str, Type[objects.ObjectInterface]]] = None) -> None:\n \"\"\"Instantiates an SymbolTable based on an IntermediateSymbolFormat JSON file. This is validated against the\n appropriate schema.\n\n Args:\n context: The volatility context for the symbol table\n config_path: The configuration path for the symbol table\n name: The name for the symbol table (this is used in symbols e.g. table!symbol )\n isf_url: The URL pointing to the ISF file location\n native_types: The NativeSymbolTable that contains the native types for this symbol table\n table_mapping: A dictionary linking names referenced in the file with symbol tables in the context\n class_types: A dictionary of type names and classes that override StructType when they are instantiated\n \"\"\"\n configuration.ConfigurableInterface.__init__(self, context, config_path)\n BaseSymbolTableInterface.__init__(self, name, native_types, table_mapping, class_types = class_types)","function_tokens":["def","__init__","(","self",",","context",":","'interfaces.context.ContextInterface'",",","config_path",":","str",",","name",":","str",",","native_types",":","'NativeTableInterface'",",","table_mapping",":","Optional","[","Dict","[","str",",","str","]","]","=","None",",","class_types",":","Optional","[","Mapping","[","str",",","Type","[","objects",".","ObjectInterface","]","]","]","=","None",")","->","None",":","configuration",".","ConfigurableInterface",".","__init__","(","self",",","context",",","config_path",")","BaseSymbolTableInterface",".","__init__","(","self",",","name",",","native_types",",","table_mapping",",","class_types","=","class_types",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L274-L294"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py","language":"python","identifier":"MetadataInterface.__init__","parameters":"(self, json_data: Dict)","argument_list":"","return_statement":"","docstring":"Constructor that accepts json_data.","docstring_summary":"Constructor that accepts json_data.","docstring_tokens":["Constructor","that","accepts","json_data","."],"function":"def __init__(self, json_data: Dict) -> None:\n \"\"\"Constructor that accepts json_data.\"\"\"\n self._json_data = json_data","function_tokens":["def","__init__","(","self",",","json_data",":","Dict",")","->","None",":","self",".","_json_data","=","json_data"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/symbols.py#L333-L335"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py","language":"python","identifier":"FileHandlerInterface.__init__","parameters":"(self, filename: str)","argument_list":"","return_statement":"","docstring":"Creates a FileHandler\n\n Args:\n filename: The requested name of the filename for the data","docstring_summary":"Creates a FileHandler","docstring_tokens":["Creates","a","FileHandler"],"function":"def __init__(self, filename: str) -> None:\n \"\"\"Creates a FileHandler\n\n Args:\n filename: The requested name of the filename for the data\n \"\"\"\n self._preferred_filename = None\n self.preferred_filename = filename\n super().__init__()","function_tokens":["def","__init__","(","self",",","filename",":","str",")","->","None",":","self",".","_preferred_filename","=","None","self",".","preferred_filename","=","filename","super","(",")",".","__init__","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py#L28-L36"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py","language":"python","identifier":"FileHandlerInterface.preferred_filename","parameters":"(self)","argument_list":"","return_statement":"return self._preferred_filename","docstring":"The preferred filename to save the data to.\n Until this file has been written, this value may not be the final filename the data is written to.","docstring_summary":"The preferred filename to save the data to.\n Until this file has been written, this value may not be the final filename the data is written to.","docstring_tokens":["The","preferred","filename","to","save","the","data","to",".","Until","this","file","has","been","written","this","value","may","not","be","the","final","filename","the","data","is","written","to","."],"function":"def preferred_filename(self):\n \"\"\"The preferred filename to save the data to.\n Until this file has been written, this value may not be the final filename the data is written to.\n \"\"\"\n return self._preferred_filename","function_tokens":["def","preferred_filename","(","self",")",":","return","self",".","_preferred_filename"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py#L39-L43"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py","language":"python","identifier":"FileHandlerInterface.preferred_filename","parameters":"(self, filename)","argument_list":"","return_statement":"","docstring":"Sets the preferred filename","docstring_summary":"Sets the preferred filename","docstring_tokens":["Sets","the","preferred","filename"],"function":"def preferred_filename(self, filename):\n \"\"\"Sets the preferred filename\"\"\"\n if self.closed:\n raise IOError(\"FileHandler name cannot be changed once closed\")\n if not isinstance(filename, str):\n raise TypeError(\"FileHandler preferred filenames must be strings\")\n if os.path.sep in filename:\n raise ValueError(\"FileHandler filenames cannot contain path separators\")\n self._preferred_filename = filename","function_tokens":["def","preferred_filename","(","self",",","filename",")",":","if","self",".","closed",":","raise","IOError","(","\"FileHandler name cannot be changed once closed\"",")","if","not","isinstance","(","filename",",","str",")",":","raise","TypeError","(","\"FileHandler preferred filenames must be strings\"",")","if","os",".","path",".","sep","in","filename",":","raise","ValueError","(","\"FileHandler filenames cannot contain path separators\"",")","self",".","_preferred_filename","=","filename"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py#L46-L54"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py","language":"python","identifier":"FileHandlerInterface.close","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Method that commits the file and fixes the final filename for use","docstring_summary":"Method that commits the file and fixes the final filename for use","docstring_tokens":["Method","that","commits","the","file","and","fixes","the","final","filename","for","use"],"function":"def close(self):\n \"\"\"Method that commits the file and fixes the final filename for use\"\"\"","function_tokens":["def","close","(","self",")",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py#L57-L58"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py","language":"python","identifier":"PluginInterface.__init__","parameters":"(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"","docstring":"Args:\n context: The context that the plugin will operate within\n config_path: The path to configuration data within the context configuration data\n progress_callback: A callable that can provide feedback at progress points","docstring_summary":"","docstring_tokens":[],"function":"def __init__(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n progress_callback: constants.ProgressCallback = None) -> None:\n \"\"\"\n\n Args:\n context: The context that the plugin will operate within\n config_path: The path to configuration data within the context configuration data\n progress_callback: A callable that can provide feedback at progress points\n \"\"\"\n super().__init__(context, config_path)\n self._progress_callback = progress_callback or (lambda f, s: None)\n # Plugins self validate on construction, it makes it more difficult to work with them, but then\n # the validation doesn't need to be repeated over and over again by externals\n if self.unsatisfied(context, config_path):\n vollog.warning(\"Plugin failed validation\")\n raise exceptions.PluginRequirementException(\"The plugin configuration failed to validate\")\n # Populate any optional defaults\n for requirement in self.get_requirements():\n if requirement.name not in self.config:\n self.config[requirement.name] = requirement.default\n\n self._file_handler = FileHandlerInterface # type: Type[FileHandlerInterface]\n\n framework.require_interface_version(*self._required_framework_version)","function_tokens":["def","__init__","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","None",":","super","(",")",".","__init__","(","context",",","config_path",")","self",".","_progress_callback","=","progress_callback","or","(","lambda","f",",","s",":","None",")","# Plugins self validate on construction, it makes it more difficult to work with them, but then","# the validation doesn't need to be repeated over and over again by externals","if","self",".","unsatisfied","(","context",",","config_path",")",":","vollog",".","warning","(","\"Plugin failed validation\"",")","raise","exceptions",".","PluginRequirementException","(","\"The plugin configuration failed to validate\"",")","# Populate any optional defaults","for","requirement","in","self",".","get_requirements","(",")",":","if","requirement",".","name","not","in","self",".","config",":","self",".","config","[","requirement",".","name","]","=","requirement",".","default","self",".","_file_handler","=","FileHandlerInterface","# type: Type[FileHandlerInterface]","framework",".","require_interface_version","(","*","self",".","_required_framework_version",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py#L100-L125"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py","language":"python","identifier":"PluginInterface.open","parameters":"(self)","argument_list":"","return_statement":"return self._file_handler","docstring":"Returns a context manager and thus can be called like open","docstring_summary":"Returns a context manager and thus can be called like open","docstring_tokens":["Returns","a","context","manager","and","thus","can","be","called","like","open"],"function":"def open(self):\n \"\"\"Returns a context manager and thus can be called like open\"\"\"\n return self._file_handler","function_tokens":["def","open","(","self",")",":","return","self",".","_file_handler"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py#L128-L130"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py","language":"python","identifier":"PluginInterface.set_open_method","parameters":"(self, handler: Type[FileHandlerInterface])","argument_list":"","return_statement":"","docstring":"Sets the file handler to be used by this plugin.","docstring_summary":"Sets the file handler to be used by this plugin.","docstring_tokens":["Sets","the","file","handler","to","be","used","by","this","plugin","."],"function":"def set_open_method(self, handler: Type[FileHandlerInterface]) -> None:\n \"\"\"Sets the file handler to be used by this plugin.\"\"\"\n if not issubclass(handler, FileHandlerInterface):\n raise ValueError(\"FileHandler must be a subclass of FileHandlerInterface\")\n self._file_handler = handler","function_tokens":["def","set_open_method","(","self",",","handler",":","Type","[","FileHandlerInterface","]",")","->","None",":","if","not","issubclass","(","handler",",","FileHandlerInterface",")",":","raise","ValueError","(","\"FileHandler must be a subclass of FileHandlerInterface\"",")","self",".","_file_handler","=","handler"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py#L132-L136"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py","language":"python","identifier":"PluginInterface.get_requirements","parameters":"(cls)","argument_list":"","return_statement":"return super().get_requirements()","docstring":"Returns a list of Requirement objects for this plugin.","docstring_summary":"Returns a list of Requirement objects for this plugin.","docstring_tokens":["Returns","a","list","of","Requirement","objects","for","this","plugin","."],"function":"def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]:\n \"\"\"Returns a list of Requirement objects for this plugin.\"\"\"\n return super().get_requirements()","function_tokens":["def","get_requirements","(","cls",")","->","List","[","interfaces",".","configuration",".","RequirementInterface","]",":","return","super","(",")",".","get_requirements","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py#L139-L141"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py","language":"python","identifier":"PluginInterface.run","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Executes the functionality of the code.\n\n .. note:: This method expects `self.validate` to have been called to ensure all necessary options have been provided\n\n Returns:\n A TreeGrid object that can then be passed to a Renderer.","docstring_summary":"Executes the functionality of the code.","docstring_tokens":["Executes","the","functionality","of","the","code","."],"function":"def run(self) -> interfaces.renderers.TreeGrid:\n \"\"\"Executes the functionality of the code.\n\n .. note:: This method expects `self.validate` to have been called to ensure all necessary options have been provided\n\n Returns:\n A TreeGrid object that can then be passed to a Renderer.\n \"\"\"","function_tokens":["def","run","(","self",")","->","interfaces",".","renderers",".","TreeGrid",":"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/interfaces\/plugins.py#L144-L151"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"symbol_table_is_64bit","parameters":"(context: interfaces.context.ContextInterface, symbol_table_name: str)","argument_list":"","return_statement":"return context.symbol_space.get_type(symbol_table_name + constants.BANG + \"pointer\").size == 8","docstring":"Returns a boolean as to whether a particular symbol table within a\n context is 64-bit or not.","docstring_summary":"Returns a boolean as to whether a particular symbol table within a\n context is 64-bit or not.","docstring_tokens":["Returns","a","boolean","as","to","whether","a","particular","symbol","table","within","a","context","is","64","-","bit","or","not","."],"function":"def symbol_table_is_64bit(context: interfaces.context.ContextInterface, symbol_table_name: str) -> bool:\n \"\"\"Returns a boolean as to whether a particular symbol table within a\n context is 64-bit or not.\"\"\"\n return context.symbol_space.get_type(symbol_table_name + constants.BANG + \"pointer\").size == 8","function_tokens":["def","symbol_table_is_64bit","(","context",":","interfaces",".","context",".","ContextInterface",",","symbol_table_name",":","str",")","->","bool",":","return","context",".","symbol_space",".","get_type","(","symbol_table_name","+","constants",".","BANG","+","\"pointer\"",")",".","size","==","8"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L258-L261"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.clear_symbol_cache","parameters":"(self, table_name: str = None)","argument_list":"","return_statement":"","docstring":"Clears the symbol cache for the specified table name. If no table\n name is specified, the caches of all symbol tables are cleared.","docstring_summary":"Clears the symbol cache for the specified table name. If no table\n name is specified, the caches of all symbol tables are cleared.","docstring_tokens":["Clears","the","symbol","cache","for","the","specified","table","name",".","If","no","table","name","is","specified","the","caches","of","all","symbol","tables","are","cleared","."],"function":"def clear_symbol_cache(self, table_name: str = None) -> None:\n \"\"\"Clears the symbol cache for the specified table name. If no table\n name is specified, the caches of all symbol tables are cleared.\"\"\"\n table_list = list() # type: List[interfaces.symbols.BaseSymbolTableInterface]\n if table_name is None:\n table_list = list(self._dict.values())\n else:\n table_list.append(self._dict[table_name])\n for table in table_list:\n table.clear_symbol_cache()","function_tokens":["def","clear_symbol_cache","(","self",",","table_name",":","str","=","None",")","->","None",":","table_list","=","list","(",")","# type: List[interfaces.symbols.BaseSymbolTableInterface]","if","table_name","is","None",":","table_list","=","list","(","self",".","_dict",".","values","(",")",")","else",":","table_list",".","append","(","self",".","_dict","[","table_name","]",")","for","table","in","table_list",":","table",".","clear_symbol_cache","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L39-L48"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.free_table_name","parameters":"(self, prefix: str = \"layer\")","argument_list":"","return_statement":"return prefix + str(count)","docstring":"Returns an unused table name to ensure no collision occurs when\n inserting a symbol table.","docstring_summary":"Returns an unused table name to ensure no collision occurs when\n inserting a symbol table.","docstring_tokens":["Returns","an","unused","table","name","to","ensure","no","collision","occurs","when","inserting","a","symbol","table","."],"function":"def free_table_name(self, prefix: str = \"layer\") -> str:\n \"\"\"Returns an unused table name to ensure no collision occurs when\n inserting a symbol table.\"\"\"\n count = 1\n while prefix + str(count) in self:\n count += 1\n return prefix + str(count)","function_tokens":["def","free_table_name","(","self",",","prefix",":","str","=","\"layer\"",")","->","str",":","count","=","1","while","prefix","+","str","(","count",")","in","self",":","count","+=","1","return","prefix","+","str","(","count",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L50-L56"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.get_symbols_by_type","parameters":"(self, type_name: str)","argument_list":"","return_statement":"","docstring":"Returns all symbols based on the type of the symbol.","docstring_summary":"Returns all symbols based on the type of the symbol.","docstring_tokens":["Returns","all","symbols","based","on","the","type","of","the","symbol","."],"function":"def get_symbols_by_type(self, type_name: str) -> Iterable[str]:\n \"\"\"Returns all symbols based on the type of the symbol.\"\"\"\n for table in self._dict:\n for symbol_name in self._dict[table].get_symbols_by_type(type_name):\n yield table + constants.BANG + symbol_name","function_tokens":["def","get_symbols_by_type","(","self",",","type_name",":","str",")","->","Iterable","[","str","]",":","for","table","in","self",".","_dict",":","for","symbol_name","in","self",".","_dict","[","table","]",".","get_symbols_by_type","(","type_name",")",":","yield","table","+","constants",".","BANG","+","symbol_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L60-L64"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.get_symbols_by_location","parameters":"(self, offset: int, size: int = 0, table_name: str = None)","argument_list":"","return_statement":"","docstring":"Returns all symbols that exist at a specific relative address.","docstring_summary":"Returns all symbols that exist at a specific relative address.","docstring_tokens":["Returns","all","symbols","that","exist","at","a","specific","relative","address","."],"function":"def get_symbols_by_location(self, offset: int, size: int = 0, table_name: str = None) -> Iterable[str]:\n \"\"\"Returns all symbols that exist at a specific relative address.\"\"\"\n table_list = self._dict.values() # type: Iterable[interfaces.symbols.BaseSymbolTableInterface]\n if table_name is not None:\n if table_name in self._dict:\n table_list = [self._dict[table_name]]\n else:\n table_list = []\n for table in table_list:\n for symbol_name in table.get_symbols_by_location(offset = offset, size = size):\n yield table.name + constants.BANG + symbol_name","function_tokens":["def","get_symbols_by_location","(","self",",","offset",":","int",",","size",":","int","=","0",",","table_name",":","str","=","None",")","->","Iterable","[","str","]",":","table_list","=","self",".","_dict",".","values","(",")","# type: Iterable[interfaces.symbols.BaseSymbolTableInterface]","if","table_name","is","not","None",":","if","table_name","in","self",".","_dict",":","table_list","=","[","self",".","_dict","[","table_name","]","]","else",":","table_list","=","[","]","for","table","in","table_list",":","for","symbol_name","in","table",".","get_symbols_by_location","(","offset","=","offset",",","size","=","size",")",":","yield","table",".","name","+","constants",".","BANG","+","symbol_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L66-L76"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.__len__","parameters":"(self)","argument_list":"","return_statement":"return len(self._dict)","docstring":"Returns the number of tables within the space.","docstring_summary":"Returns the number of tables within the space.","docstring_tokens":["Returns","the","number","of","tables","within","the","space","."],"function":"def __len__(self) -> int:\n \"\"\"Returns the number of tables within the space.\"\"\"\n return len(self._dict)","function_tokens":["def","__len__","(","self",")","->","int",":","return","len","(","self",".","_dict",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L80-L82"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.__getitem__","parameters":"(self, i: str)","argument_list":"","return_statement":"return self._dict[i]","docstring":"Returns a specific table from the space.","docstring_summary":"Returns a specific table from the space.","docstring_tokens":["Returns","a","specific","table","from","the","space","."],"function":"def __getitem__(self, i: str) -> Any:\n \"\"\"Returns a specific table from the space.\"\"\"\n return self._dict[i]","function_tokens":["def","__getitem__","(","self",",","i",":","str",")","->","Any",":","return","self",".","_dict","[","i","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L84-L86"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.__iter__","parameters":"(self)","argument_list":"","return_statement":"return iter(self._dict)","docstring":"Iterates through all available tables in the symbol space.","docstring_summary":"Iterates through all available tables in the symbol space.","docstring_tokens":["Iterates","through","all","available","tables","in","the","symbol","space","."],"function":"def __iter__(self) -> Iterator[str]:\n \"\"\"Iterates through all available tables in the symbol space.\"\"\"\n return iter(self._dict)","function_tokens":["def","__iter__","(","self",")","->","Iterator","[","str","]",":","return","iter","(","self",".","_dict",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L88-L90"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.append","parameters":"(self, value: interfaces.symbols.BaseSymbolTableInterface)","argument_list":"","return_statement":"","docstring":"Adds a symbol_list to the end of the space.","docstring_summary":"Adds a symbol_list to the end of the space.","docstring_tokens":["Adds","a","symbol_list","to","the","end","of","the","space","."],"function":"def append(self, value: interfaces.symbols.BaseSymbolTableInterface) -> None:\n \"\"\"Adds a symbol_list to the end of the space.\"\"\"\n if not isinstance(value, interfaces.symbols.BaseSymbolTableInterface):\n raise TypeError(value)\n if value.name in self._dict:\n self.remove(value.name)\n self._dict[value.name] = value","function_tokens":["def","append","(","self",",","value",":","interfaces",".","symbols",".","BaseSymbolTableInterface",")","->","None",":","if","not","isinstance","(","value",",","interfaces",".","symbols",".","BaseSymbolTableInterface",")",":","raise","TypeError","(","value",")","if","value",".","name","in","self",".","_dict",":","self",".","remove","(","value",".","name",")","self",".","_dict","[","value",".","name","]","=","value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L92-L98"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.remove","parameters":"(self, key: str)","argument_list":"","return_statement":"","docstring":"Removes a named symbol_list from the space.","docstring_summary":"Removes a named symbol_list from the space.","docstring_tokens":["Removes","a","named","symbol_list","from","the","space","."],"function":"def remove(self, key: str) -> None:\n \"\"\"Removes a named symbol_list from the space.\"\"\"\n # Reset the resolved list, since we're removing some symbols\n self._resolved = {}\n del self._dict[key]","function_tokens":["def","remove","(","self",",","key",":","str",")","->","None",":","# Reset the resolved list, since we're removing some symbols","self",".","_resolved","=","{","}","del","self",".","_dict","[","key","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L100-L104"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace._weak_resolve","parameters":"(self, resolve_type: SymbolType, name: str)","argument_list":"","return_statement":"","docstring":"Takes a symbol name and resolves it with ReferentialTemplates.","docstring_summary":"Takes a symbol name and resolves it with ReferentialTemplates.","docstring_tokens":["Takes","a","symbol","name","and","resolves","it","with","ReferentialTemplates","."],"function":"def _weak_resolve(self, resolve_type: SymbolType, name: str) -> SymbolSpaceReturnType:\n \"\"\"Takes a symbol name and resolves it with ReferentialTemplates.\"\"\"\n if resolve_type == SymbolType.TYPE:\n get_function = 'get_type'\n elif resolve_type == SymbolType.SYMBOL:\n get_function = 'get_symbol'\n elif resolve_type == SymbolType.ENUM:\n get_function = 'get_enumeration'\n else:\n raise TypeError(\"Weak_resolve called without a proper SymbolType\")\n\n name_array = name.split(constants.BANG)\n if len(name_array) == 2:\n table_name = name_array[0]\n component_name = name_array[1]\n try:\n return getattr(self._dict[table_name], get_function)(component_name)\n except KeyError as e:\n raise exceptions.SymbolError(component_name, table_name,\n 'Type {} references missing Type\/Symbol\/Enum: {}'.format(name, e))\n raise exceptions.SymbolError(name, None, \"Malformed name: {}\".format(name))","function_tokens":["def","_weak_resolve","(","self",",","resolve_type",":","SymbolType",",","name",":","str",")","->","SymbolSpaceReturnType",":","if","resolve_type","==","SymbolType",".","TYPE",":","get_function","=","'get_type'","elif","resolve_type","==","SymbolType",".","SYMBOL",":","get_function","=","'get_symbol'","elif","resolve_type","==","SymbolType",".","ENUM",":","get_function","=","'get_enumeration'","else",":","raise","TypeError","(","\"Weak_resolve called without a proper SymbolType\"",")","name_array","=","name",".","split","(","constants",".","BANG",")","if","len","(","name_array",")","==","2",":","table_name","=","name_array","[","0","]","component_name","=","name_array","[","1","]","try",":","return","getattr","(","self",".","_dict","[","table_name","]",",","get_function",")","(","component_name",")","except","KeyError","as","e",":","raise","exceptions",".","SymbolError","(","component_name",",","table_name",",","'Type {} references missing Type\/Symbol\/Enum: {}'",".","format","(","name",",","e",")",")","raise","exceptions",".","SymbolError","(","name",",","None",",","\"Malformed name: {}\"",".","format","(","name",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L123-L143"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace._iterative_resolve","parameters":"(self, traverse_list)","argument_list":"","return_statement":"","docstring":"Iteratively resolves a type, populating linked child\n ReferenceTemplates with their properly resolved counterparts.","docstring_summary":"Iteratively resolves a type, populating linked child\n ReferenceTemplates with their properly resolved counterparts.","docstring_tokens":["Iteratively","resolves","a","type","populating","linked","child","ReferenceTemplates","with","their","properly","resolved","counterparts","."],"function":"def _iterative_resolve(self, traverse_list):\n \"\"\"Iteratively resolves a type, populating linked child\n ReferenceTemplates with their properly resolved counterparts.\"\"\"\n replacements = set()\n # Whole Symbols that still need traversing\n while traverse_list:\n template_traverse_list, traverse_list = [self._resolved[traverse_list[0]]], traverse_list[1:]\n # Traverse a single symbol looking for any ReferenceTemplate objects\n while template_traverse_list:\n traverser, template_traverse_list = template_traverse_list[0], template_traverse_list[1:]\n for child in traverser.children:\n if isinstance(child, objects.templates.ReferenceTemplate):\n # If we haven't seen it before, subresolve it and also add it\n # to the \"symbols that still need traversing\" list\n if child.vol.type_name not in self._resolved:\n traverse_list.append(child.vol.type_name)\n try:\n self._resolved[child.vol.type_name] = self._weak_resolve(\n SymbolType.TYPE, child.vol.type_name)\n except exceptions.SymbolError:\n self._resolved[child.vol.type_name] = self.UnresolvedTemplate(child.vol.type_name)\n # Stash the replacement\n replacements.add((traverser, child))\n elif child.children:\n template_traverse_list.append(child)\n for (parent, child) in replacements:\n parent.replace_child(child, self._resolved[child.vol.type_name])","function_tokens":["def","_iterative_resolve","(","self",",","traverse_list",")",":","replacements","=","set","(",")","# Whole Symbols that still need traversing","while","traverse_list",":","template_traverse_list",",","traverse_list","=","[","self",".","_resolved","[","traverse_list","[","0","]","]","]",",","traverse_list","[","1",":","]","# Traverse a single symbol looking for any ReferenceTemplate objects","while","template_traverse_list",":","traverser",",","template_traverse_list","=","template_traverse_list","[","0","]",",","template_traverse_list","[","1",":","]","for","child","in","traverser",".","children",":","if","isinstance","(","child",",","objects",".","templates",".","ReferenceTemplate",")",":","# If we haven't seen it before, subresolve it and also add it","# to the \"symbols that still need traversing\" list","if","child",".","vol",".","type_name","not","in","self",".","_resolved",":","traverse_list",".","append","(","child",".","vol",".","type_name",")","try",":","self",".","_resolved","[","child",".","vol",".","type_name","]","=","self",".","_weak_resolve","(","SymbolType",".","TYPE",",","child",".","vol",".","type_name",")","except","exceptions",".","SymbolError",":","self",".","_resolved","[","child",".","vol",".","type_name","]","=","self",".","UnresolvedTemplate","(","child",".","vol",".","type_name",")","# Stash the replacement","replacements",".","add","(","(","traverser",",","child",")",")","elif","child",".","children",":","template_traverse_list",".","append","(","child",")","for","(","parent",",","child",")","in","replacements",":","parent",".","replace_child","(","child",",","self",".","_resolved","[","child",".","vol",".","type_name","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L145-L171"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.get_type","parameters":"(self, type_name: str)","argument_list":"","return_statement":"return self._resolved[type_name]","docstring":"Takes a symbol name and resolves it.\n\n This method ensures that all referenced templates (including\n self-referential templates) are satisfied as ObjectTemplates","docstring_summary":"Takes a symbol name and resolves it.","docstring_tokens":["Takes","a","symbol","name","and","resolves","it","."],"function":"def get_type(self, type_name: str) -> interfaces.objects.Template:\n \"\"\"Takes a symbol name and resolves it.\n\n This method ensures that all referenced templates (including\n self-referential templates) are satisfied as ObjectTemplates\n \"\"\"\n # Traverse down any resolutions\n if type_name not in self._resolved:\n self._resolved[type_name] = self._weak_resolve(SymbolType.TYPE, type_name) # type: ignore\n self._iterative_resolve([type_name])\n if isinstance(self._resolved[type_name], objects.templates.ReferenceTemplate):\n table_name = None\n index = type_name.find(constants.BANG)\n if index > 0:\n table_name, type_name = type_name[:index], type_name[index + 1:]\n raise exceptions.SymbolError(type_name, table_name, \"Unresolvable symbol requested: {}\".format(type_name))\n return self._resolved[type_name]","function_tokens":["def","get_type","(","self",",","type_name",":","str",")","->","interfaces",".","objects",".","Template",":","# Traverse down any resolutions","if","type_name","not","in","self",".","_resolved",":","self",".","_resolved","[","type_name","]","=","self",".","_weak_resolve","(","SymbolType",".","TYPE",",","type_name",")","# type: ignore","self",".","_iterative_resolve","(","[","type_name","]",")","if","isinstance","(","self",".","_resolved","[","type_name","]",",","objects",".","templates",".","ReferenceTemplate",")",":","table_name","=","None","index","=","type_name",".","find","(","constants",".","BANG",")","if","index",">","0",":","table_name",",","type_name","=","type_name","[",":","index","]",",","type_name","[","index","+","1",":","]","raise","exceptions",".","SymbolError","(","type_name",",","table_name",",","\"Unresolvable symbol requested: {}\"",".","format","(","type_name",")",")","return","self",".","_resolved","[","type_name","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L173-L189"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.get_symbol","parameters":"(self, symbol_name: str)","argument_list":"","return_statement":"return retval","docstring":"Look-up a symbol name across all the contained symbol spaces.","docstring_summary":"Look-up a symbol name across all the contained symbol spaces.","docstring_tokens":["Look","-","up","a","symbol","name","across","all","the","contained","symbol","spaces","."],"function":"def get_symbol(self, symbol_name: str) -> interfaces.symbols.SymbolInterface:\n \"\"\"Look-up a symbol name across all the contained symbol spaces.\"\"\"\n retval = self._weak_resolve(SymbolType.SYMBOL, symbol_name)\n if symbol_name not in self._resolved_symbols and retval.type is not None:\n self._resolved_symbols[symbol_name] = self._subresolve(retval.type)\n if not isinstance(retval, interfaces.symbols.SymbolInterface):\n table_name = None\n index = symbol_name.find(constants.BANG)\n if index > 0:\n table_name, symbol_name = symbol_name[:index], symbol_name[index + 1:]\n raise exceptions.SymbolError(symbol_name, table_name, \"Unresolvable Symbol: {}\".format(symbol_name))\n return retval","function_tokens":["def","get_symbol","(","self",",","symbol_name",":","str",")","->","interfaces",".","symbols",".","SymbolInterface",":","retval","=","self",".","_weak_resolve","(","SymbolType",".","SYMBOL",",","symbol_name",")","if","symbol_name","not","in","self",".","_resolved_symbols","and","retval",".","type","is","not","None",":","self",".","_resolved_symbols","[","symbol_name","]","=","self",".","_subresolve","(","retval",".","type",")","if","not","isinstance","(","retval",",","interfaces",".","symbols",".","SymbolInterface",")",":","table_name","=","None","index","=","symbol_name",".","find","(","constants",".","BANG",")","if","index",">","0",":","table_name",",","symbol_name","=","symbol_name","[",":","index","]",",","symbol_name","[","index","+","1",":","]","raise","exceptions",".","SymbolError","(","symbol_name",",","table_name",",","\"Unresolvable Symbol: {}\"",".","format","(","symbol_name",")",")","return","retval"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L191-L202"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace._subresolve","parameters":"(self, object_template: interfaces.objects.Template)","argument_list":"","return_statement":"return object_template","docstring":"Ensure an ObjectTemplate doesn't contain any ReferenceTemplates","docstring_summary":"Ensure an ObjectTemplate doesn't contain any ReferenceTemplates","docstring_tokens":["Ensure","an","ObjectTemplate","doesn","t","contain","any","ReferenceTemplates"],"function":"def _subresolve(self, object_template: interfaces.objects.Template) -> interfaces.objects.Template:\n \"\"\"Ensure an ObjectTemplate doesn't contain any ReferenceTemplates\"\"\"\n for child in object_template.children:\n if isinstance(child, objects.templates.ReferenceTemplate):\n new_child = self.get_type(child.vol.type_name)\n else:\n new_child = self._subresolve(child)\n object_template.replace_child(old_child = child, new_child = new_child)\n return object_template","function_tokens":["def","_subresolve","(","self",",","object_template",":","interfaces",".","objects",".","Template",")","->","interfaces",".","objects",".","Template",":","for","child","in","object_template",".","children",":","if","isinstance","(","child",",","objects",".","templates",".","ReferenceTemplate",")",":","new_child","=","self",".","get_type","(","child",".","vol",".","type_name",")","else",":","new_child","=","self",".","_subresolve","(","child",")","object_template",".","replace_child","(","old_child","=","child",",","new_child","=","new_child",")","return","object_template"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L204-L212"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace.get_enumeration","parameters":"(self, enum_name: str)","argument_list":"","return_statement":"return retval","docstring":"Look-up a set of enumeration choices from a specific symbol\n table.","docstring_summary":"Look-up a set of enumeration choices from a specific symbol\n table.","docstring_tokens":["Look","-","up","a","set","of","enumeration","choices","from","a","specific","symbol","table","."],"function":"def get_enumeration(self, enum_name: str) -> interfaces.objects.Template:\n \"\"\"Look-up a set of enumeration choices from a specific symbol\n table.\"\"\"\n retval = self._weak_resolve(SymbolType.ENUM, enum_name)\n if not isinstance(retval, interfaces.objects.Template):\n table_name = None\n index = enum_name.find(constants.BANG)\n if index > 0:\n table_name, enum_name = enum_name[:index], enum_name[index + 1:]\n raise exceptions.SymbolError(enum_name, table_name, \"Unresolvable Enumeration: {}\".format(enum_name))\n return retval","function_tokens":["def","get_enumeration","(","self",",","enum_name",":","str",")","->","interfaces",".","objects",".","Template",":","retval","=","self",".","_weak_resolve","(","SymbolType",".","ENUM",",","enum_name",")","if","not","isinstance","(","retval",",","interfaces",".","objects",".","Template",")",":","table_name","=","None","index","=","enum_name",".","find","(","constants",".","BANG",")","if","index",">","0",":","table_name",",","enum_name","=","enum_name","[",":","index","]",",","enum_name","[","index","+","1",":","]","raise","exceptions",".","SymbolError","(","enum_name",",","table_name",",","\"Unresolvable Enumeration: {}\"",".","format","(","enum_name",")",")","return","retval"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L214-L224"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py","language":"python","identifier":"SymbolSpace._membership","parameters":"(self, member_type: SymbolType, name: str)","argument_list":"","return_statement":"return False","docstring":"Test for membership of a component within a table.","docstring_summary":"Test for membership of a component within a table.","docstring_tokens":["Test","for","membership","of","a","component","within","a","table","."],"function":"def _membership(self, member_type: SymbolType, name: str) -> bool:\n \"\"\"Test for membership of a component within a table.\"\"\"\n\n name_array = name.split(constants.BANG)\n if len(name_array) == 2:\n table_name = name_array[0]\n component_name = name_array[1]\n else:\n return False\n\n if table_name not in self:\n return False\n table = self[table_name]\n\n if member_type == SymbolType.TYPE:\n return component_name in table.types\n elif member_type == SymbolType.SYMBOL:\n return component_name in table.symbols\n elif member_type == SymbolType.ENUM:\n return component_name in table.enumerations\n return False","function_tokens":["def","_membership","(","self",",","member_type",":","SymbolType",",","name",":","str",")","->","bool",":","name_array","=","name",".","split","(","constants",".","BANG",")","if","len","(","name_array",")","==","2",":","table_name","=","name_array","[","0","]","component_name","=","name_array","[","1","]","else",":","return","False","if","table_name","not","in","self",":","return","False","table","=","self","[","table_name","]","if","member_type","==","SymbolType",".","TYPE",":","return","component_name","in","table",".","types","elif","member_type","==","SymbolType",".","SYMBOL",":","return","component_name","in","table",".","symbols","elif","member_type","==","SymbolType",".","ENUM",":","return","component_name","in","table",".","enumerations","return","False"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/__init__.py#L226-L246"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"IntermediateSymbolTable.__init__","parameters":"(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n name: str,\n isf_url: str,\n native_types: interfaces.symbols.NativeTableInterface = None,\n table_mapping: Optional[Dict[str, str]] = None,\n validate: bool = True,\n class_types: Optional[Mapping[str, Type[interfaces.objects.ObjectInterface]]] = None,\n symbol_shift: int = 0,\n symbol_mask: int = 0)","argument_list":"","return_statement":"","docstring":"Instantiates a SymbolTable based on an IntermediateSymbolFormat JSON file. This is validated against the\n appropriate schema. The validation can be disabled by passing validate = False, but this should almost never be\n done.\n\n Args:\n context: The volatility context for the symbol table\n config_path: The configuration path for the symbol table\n name: The name for the symbol table (this is used in symbols e.g. table!symbol )\n isf_url: The URL pointing to the ISF file location\n native_types: The NativeSymbolTable that contains the native types for this symbol table\n table_mapping: A dictionary linking names referenced in the file with symbol tables in the context\n validate: Determines whether the ISF file will be validated against the appropriate schema\n class_types: A dictionary of type names and classes that override StructType when they are instantiated\n symbol_shift: An offset by which to alter all returned symbols for this table\n symbol_mask: An address mask used for all returned symbol offsets from this table (a mask of 0 disables masking)","docstring_summary":"Instantiates a SymbolTable based on an IntermediateSymbolFormat JSON file. This is validated against the\n appropriate schema. The validation can be disabled by passing validate = False, but this should almost never be\n done.","docstring_tokens":["Instantiates","a","SymbolTable","based","on","an","IntermediateSymbolFormat","JSON","file",".","This","is","validated","against","the","appropriate","schema",".","The","validation","can","be","disabled","by","passing","validate","=","False","but","this","should","almost","never","be","done","."],"function":"def __init__(self,\n context: interfaces.context.ContextInterface,\n config_path: str,\n name: str,\n isf_url: str,\n native_types: interfaces.symbols.NativeTableInterface = None,\n table_mapping: Optional[Dict[str, str]] = None,\n validate: bool = True,\n class_types: Optional[Mapping[str, Type[interfaces.objects.ObjectInterface]]] = None,\n symbol_shift: int = 0,\n symbol_mask: int = 0) -> None:\n \"\"\"Instantiates a SymbolTable based on an IntermediateSymbolFormat JSON file. This is validated against the\n appropriate schema. The validation can be disabled by passing validate = False, but this should almost never be\n done.\n\n Args:\n context: The volatility context for the symbol table\n config_path: The configuration path for the symbol table\n name: The name for the symbol table (this is used in symbols e.g. table!symbol )\n isf_url: The URL pointing to the ISF file location\n native_types: The NativeSymbolTable that contains the native types for this symbol table\n table_mapping: A dictionary linking names referenced in the file with symbol tables in the context\n validate: Determines whether the ISF file will be validated against the appropriate schema\n class_types: A dictionary of type names and classes that override StructType when they are instantiated\n symbol_shift: An offset by which to alter all returned symbols for this table\n symbol_mask: An address mask used for all returned symbol offsets from this table (a mask of 0 disables masking)\n \"\"\"\n # Check there are no obvious errors\n # Open the file and test the version\n self._versions = dict([(x.version, x) for x in class_subclasses(ISFormatTable)])\n fp = volatility.framework.layers.resources.ResourceAccessor().open(isf_url)\n reader = codecs.getreader(\"utf-8\")\n json_object = json.load(reader(fp)) # type: ignore\n fp.close()\n\n # Validation is expensive, but we cache to store the hashes of successfully validated json objects\n if validate and not schemas.validate(json_object):\n raise exceptions.SymbolSpaceError(\"File does not pass version validation: {}\".format(isf_url))\n\n metadata = json_object.get('metadata', None)\n\n # Determine the delegate or throw an exception\n self._delegate = self._closest_version(metadata.get('format', \"0.0.0\"),\n self._versions)(context, config_path, name, json_object, native_types,\n table_mapping)\n if self._delegate.version < constants.ISF_MINIMUM_SUPPORTED:\n raise RuntimeError(\"ISF version {} is no longer supported: {}\".format(metadata.get('format', \"0.0.0\"),\n isf_url))\n elif self._delegate.version < constants.ISF_MINIMUM_DEPRECATED:\n vollog.warning(\"ISF version {} has been deprecated: {}\".format(metadata.get('format', \"0.0.0\"), isf_url))\n\n # Inherit\n super().__init__(context,\n config_path,\n name,\n native_types or self._delegate.natives,\n table_mapping = table_mapping,\n class_types = class_types)\n\n # Since we've been created with parameters, ensure our config is populated likewise\n self.config['isf_url'] = isf_url\n self.config['symbol_shift'] = symbol_shift\n self.config['symbol_mask'] = symbol_mask","function_tokens":["def","__init__","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","name",":","str",",","isf_url",":","str",",","native_types",":","interfaces",".","symbols",".","NativeTableInterface","=","None",",","table_mapping",":","Optional","[","Dict","[","str",",","str","]","]","=","None",",","validate",":","bool","=","True",",","class_types",":","Optional","[","Mapping","[","str",",","Type","[","interfaces",".","objects",".","ObjectInterface","]","]","]","=","None",",","symbol_shift",":","int","=","0",",","symbol_mask",":","int","=","0",")","->","None",":","# Check there are no obvious errors","# Open the file and test the version","self",".","_versions","=","dict","(","[","(","x",".","version",",","x",")","for","x","in","class_subclasses","(","ISFormatTable",")","]",")","fp","=","volatility",".","framework",".","layers",".","resources",".","ResourceAccessor","(",")",".","open","(","isf_url",")","reader","=","codecs",".","getreader","(","\"utf-8\"",")","json_object","=","json",".","load","(","reader","(","fp",")",")","# type: ignore","fp",".","close","(",")","# Validation is expensive, but we cache to store the hashes of successfully validated json objects","if","validate","and","not","schemas",".","validate","(","json_object",")",":","raise","exceptions",".","SymbolSpaceError","(","\"File does not pass version validation: {}\"",".","format","(","isf_url",")",")","metadata","=","json_object",".","get","(","'metadata'",",","None",")","# Determine the delegate or throw an exception","self",".","_delegate","=","self",".","_closest_version","(","metadata",".","get","(","'format'",",","\"0.0.0\"",")",",","self",".","_versions",")","(","context",",","config_path",",","name",",","json_object",",","native_types",",","table_mapping",")","if","self",".","_delegate",".","version","<","constants",".","ISF_MINIMUM_SUPPORTED",":","raise","RuntimeError","(","\"ISF version {} is no longer supported: {}\"",".","format","(","metadata",".","get","(","'format'",",","\"0.0.0\"",")",",","isf_url",")",")","elif","self",".","_delegate",".","version","<","constants",".","ISF_MINIMUM_DEPRECATED",":","vollog",".","warning","(","\"ISF version {} has been deprecated: {}\"",".","format","(","metadata",".","get","(","'format'",",","\"0.0.0\"",")",",","isf_url",")",")","# Inherit","super","(",")",".","__init__","(","context",",","config_path",",","name",",","native_types","or","self",".","_delegate",".","natives",",","table_mapping","=","table_mapping",",","class_types","=","class_types",")","# Since we've been created with parameters, ensure our config is populated likewise","self",".","config","[","'isf_url'","]","=","isf_url","self",".","config","[","'symbol_shift'","]","=","symbol_shift","self",".","config","[","'symbol_mask'","]","=","symbol_mask"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L77-L139"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"IntermediateSymbolTable._closest_version","parameters":"(version: str, versions: Dict[Tuple[int, int, int], Type['ISFormatTable']])","argument_list":"","return_statement":"return versions[max(supported_versions)]","docstring":"Determines the highest suitable handler for specified version\n format.\n\n An interface version such as Major.Minor.Patch means that Major\n of the provider must be equal to that of the consumer, and the\n provider (the JSON in this instance) must have a greater minor\n (indicating that only additive changes have been made) than\n the consumer (in this case, the file reader).","docstring_summary":"Determines the highest suitable handler for specified version\n format.","docstring_tokens":["Determines","the","highest","suitable","handler","for","specified","version","format","."],"function":"def _closest_version(version: str, versions: Dict[Tuple[int, int, int], Type['ISFormatTable']]) \\\n -> Type['ISFormatTable']:\n \"\"\"Determines the highest suitable handler for specified version\n format.\n\n An interface version such as Major.Minor.Patch means that Major\n of the provider must be equal to that of the consumer, and the\n provider (the JSON in this instance) must have a greater minor\n (indicating that only additive changes have been made) than\n the consumer (in this case, the file reader).\n \"\"\"\n major, minor, patch = [int(x) for x in version.split(\".\")]\n supported_versions = [x for x in versions if x[0] == major and x[1] >= minor]\n if not supported_versions:\n raise ValueError(\n \"No Intermediate Format interface versions support file interface version: {}\".format(version))\n return versions[max(supported_versions)]","function_tokens":["def","_closest_version","(","version",":","str",",","versions",":","Dict","[","Tuple","[","int",",","int",",","int","]",",","Type","[","'ISFormatTable'","]","]",")","->","Type","[","'ISFormatTable'","]",":","major",",","minor",",","patch","=","[","int","(","x",")","for","x","in","version",".","split","(","\".\"",")","]","supported_versions","=","[","x","for","x","in","versions","if","x","[","0","]","==","major","and","x","[","1","]",">=","minor","]","if","not","supported_versions",":","raise","ValueError","(","\"No Intermediate Format interface versions support file interface version: {}\"",".","format","(","version",")",")","return","versions","[","max","(","supported_versions",")","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L142-L158"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"IntermediateSymbolTable.file_symbol_url","parameters":"(cls, sub_path: str, filename: Optional[str] = None)","argument_list":"","return_statement":"","docstring":"Returns an iterator of appropriate file-scheme symbol URLs that can\n be opened by a ResourceAccessor class.\n\n Filter reduces the number of results returned to only those URLs\n containing that string","docstring_summary":"Returns an iterator of appropriate file-scheme symbol URLs that can\n be opened by a ResourceAccessor class.","docstring_tokens":["Returns","an","iterator","of","appropriate","file","-","scheme","symbol","URLs","that","can","be","opened","by","a","ResourceAccessor","class","."],"function":"def file_symbol_url(cls, sub_path: str, filename: Optional[str] = None) -> Generator[str, None, None]:\n \"\"\"Returns an iterator of appropriate file-scheme symbol URLs that can\n be opened by a ResourceAccessor class.\n\n Filter reduces the number of results returned to only those URLs\n containing that string\n \"\"\"\n\n # Check user-modifiable files first, then compressed ones\n extensions = constants.ISF_EXTENSIONS\n if filename is None:\n filename = \"*\"\n zip_match = filename\n else:\n # For zipfiles, the path separator is always \"\/\", so we need to change the path\n zip_match = \"\/\".join(os.path.split(filename))\n\n # Check user symbol directory first, then fallback to the framework's library to allow for overloading\n vollog.log(constants.LOGLEVEL_VVVV,\n \"Searching for symbols in {}\".format(\", \".join(volatility.symbols.__path__)))\n for path in volatility.symbols.__path__:\n if not os.path.isabs(path):\n path = os.path.abspath(os.path.join(__file__, path))\n for extension in extensions:\n # Hopefully these will not be large lists, otherwise this might be slow\n try:\n for found in pathlib.Path(path).joinpath(sub_path).resolve().rglob(filename + extension):\n yield found.as_uri()\n except FileNotFoundError:\n # If there's no linux symbols, don't cry about it\n pass\n\n # Finally try looking in zip files\n zip_path = os.path.join(path, sub_path + \".zip\")\n if os.path.exists(zip_path):\n # We have a zipfile, so run through it and look for sub files that match the filename\n with zipfile.ZipFile(zip_path) as zfile:\n for name in zfile.namelist():\n for extension in extensions:\n # By ending with an extension (and therefore, not \/), we should not return any directories\n if name.endswith(zip_match + extension) or (zip_match == \"*\" and name.endswith(extension)):\n yield \"jar:file:\" + str(pathlib.Path(zip_path)) + \"!\" + name","function_tokens":["def","file_symbol_url","(","cls",",","sub_path",":","str",",","filename",":","Optional","[","str","]","=","None",")","->","Generator","[","str",",","None",",","None","]",":","# Check user-modifiable files first, then compressed ones","extensions","=","constants",".","ISF_EXTENSIONS","if","filename","is","None",":","filename","=","\"*\"","zip_match","=","filename","else",":","# For zipfiles, the path separator is always \"\/\", so we need to change the path","zip_match","=","\"\/\"",".","join","(","os",".","path",".","split","(","filename",")",")","# Check user symbol directory first, then fallback to the framework's library to allow for overloading","vollog",".","log","(","constants",".","LOGLEVEL_VVVV",",","\"Searching for symbols in {}\"",".","format","(","\", \"",".","join","(","volatility",".","symbols",".","__path__",")",")",")","for","path","in","volatility",".","symbols",".","__path__",":","if","not","os",".","path",".","isabs","(","path",")",":","path","=","os",".","path",".","abspath","(","os",".","path",".","join","(","__file__",",","path",")",")","for","extension","in","extensions",":","# Hopefully these will not be large lists, otherwise this might be slow","try",":","for","found","in","pathlib",".","Path","(","path",")",".","joinpath","(","sub_path",")",".","resolve","(",")",".","rglob","(","filename","+","extension",")",":","yield","found",".","as_uri","(",")","except","FileNotFoundError",":","# If there's no linux symbols, don't cry about it","pass","# Finally try looking in zip files","zip_path","=","os",".","path",".","join","(","path",",","sub_path","+","\".zip\"",")","if","os",".","path",".","exists","(","zip_path",")",":","# We have a zipfile, so run through it and look for sub files that match the filename","with","zipfile",".","ZipFile","(","zip_path",")","as","zfile",":","for","name","in","zfile",".","namelist","(",")",":","for","extension","in","extensions",":","# By ending with an extension (and therefore, not \/), we should not return any directories","if","name",".","endswith","(","zip_match","+","extension",")","or","(","zip_match","==","\"*\"","and","name",".","endswith","(","extension",")",")",":","yield","\"jar:file:\"","+","str","(","pathlib",".","Path","(","zip_path",")",")","+","\"!\"","+","name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L173-L214"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"IntermediateSymbolTable.create","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n config_path: str,\n sub_path: str,\n filename: str,\n native_types: Optional[interfaces.symbols.NativeTableInterface] = None,\n table_mapping: Optional[Dict[str, str]] = None,\n class_types: Optional[Mapping[str, Type[interfaces.objects.ObjectInterface]]] = None,\n symbol_shift: int = 0,\n symbol_mask: int = 0)","argument_list":"","return_statement":"return table_name","docstring":"Takes a context and loads an intermediate symbol table based on a\n filename.\n\n Args:\n context: The context that the current plugin is being run within\n config_path: The configuration path for reading\/storing configuration information this symbol table may use\n sub_path: The path under a suitable symbol path (defaults to volatility\/symbols and volatility\/framework\/symbols) to check\n filename: Basename of the file to find under the sub_path\n native_types: Set of native types, defaults to native types read from the intermediate symbol format file\n table_mapping: a dictionary of table names mentioned within the ISF file, and the tables within the context which they map to\n symbol_shift: An offset by which to alter all returned symbols for this table\n symbol_mask: An address mask used for all returned symbol offsets from this table (a mask of 0 disables masking)\n\n Returns:\n the name of the added symbol table","docstring_summary":"Takes a context and loads an intermediate symbol table based on a\n filename.","docstring_tokens":["Takes","a","context","and","loads","an","intermediate","symbol","table","based","on","a","filename","."],"function":"def create(cls,\n context: interfaces.context.ContextInterface,\n config_path: str,\n sub_path: str,\n filename: str,\n native_types: Optional[interfaces.symbols.NativeTableInterface] = None,\n table_mapping: Optional[Dict[str, str]] = None,\n class_types: Optional[Mapping[str, Type[interfaces.objects.ObjectInterface]]] = None,\n symbol_shift: int = 0,\n symbol_mask: int = 0) -> str:\n \"\"\"Takes a context and loads an intermediate symbol table based on a\n filename.\n\n Args:\n context: The context that the current plugin is being run within\n config_path: The configuration path for reading\/storing configuration information this symbol table may use\n sub_path: The path under a suitable symbol path (defaults to volatility\/symbols and volatility\/framework\/symbols) to check\n filename: Basename of the file to find under the sub_path\n native_types: Set of native types, defaults to native types read from the intermediate symbol format file\n table_mapping: a dictionary of table names mentioned within the ISF file, and the tables within the context which they map to\n symbol_shift: An offset by which to alter all returned symbols for this table\n symbol_mask: An address mask used for all returned symbol offsets from this table (a mask of 0 disables masking)\n\n Returns:\n the name of the added symbol table\n \"\"\"\n urls = list(cls.file_symbol_url(sub_path, filename))\n if not urls:\n raise FileNotFoundError(\"No symbol files found at provided filename: {}\", filename)\n table_name = context.symbol_space.free_table_name(filename)\n table = cls(context = context,\n config_path = config_path,\n name = table_name,\n isf_url = urls[0],\n native_types = native_types,\n table_mapping = table_mapping,\n class_types = class_types,\n symbol_shift = symbol_shift,\n symbol_mask = symbol_mask)\n context.symbol_space.append(table)\n return table_name","function_tokens":["def","create","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","config_path",":","str",",","sub_path",":","str",",","filename",":","str",",","native_types",":","Optional","[","interfaces",".","symbols",".","NativeTableInterface","]","=","None",",","table_mapping",":","Optional","[","Dict","[","str",",","str","]","]","=","None",",","class_types",":","Optional","[","Mapping","[","str",",","Type","[","interfaces",".","objects",".","ObjectInterface","]","]","]","=","None",",","symbol_shift",":","int","=","0",",","symbol_mask",":","int","=","0",")","->","str",":","urls","=","list","(","cls",".","file_symbol_url","(","sub_path",",","filename",")",")","if","not","urls",":","raise","FileNotFoundError","(","\"No symbol files found at provided filename: {}\"",",","filename",")","table_name","=","context",".","symbol_space",".","free_table_name","(","filename",")","table","=","cls","(","context","=","context",",","config_path","=","config_path",",","name","=","table_name",",","isf_url","=","urls","[","0","]",",","native_types","=","native_types",",","table_mapping","=","table_mapping",",","class_types","=","class_types",",","symbol_shift","=","symbol_shift",",","symbol_mask","=","symbol_mask",")","context",".","symbol_space",".","append","(","table",")","return","table_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L217-L257"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"ISFormatTable._get_natives","parameters":"(self)","argument_list":"","return_statement":"return None","docstring":"Determines the appropriate native_types to use from the JSON\n data.","docstring_summary":"Determines the appropriate native_types to use from the JSON\n data.","docstring_tokens":["Determines","the","appropriate","native_types","to","use","from","the","JSON","data","."],"function":"def _get_natives(self) -> Optional[interfaces.symbols.NativeTableInterface]:\n \"\"\"Determines the appropriate native_types to use from the JSON\n data.\"\"\"\n # TODO: Consider how to generate the natives entirely from the ISF\n classes = {\"x64\": native.x64NativeTable, \"x86\": native.x86NativeTable}\n for nc in sorted(classes):\n native_class = classes[nc]\n for base_type in self._json_object['base_types']:\n try:\n if self._json_object['base_types'][base_type]['length'] != native_class.get_type(base_type).size:\n break\n except TypeError:\n # TODO: determine whether we should give voids a size - We don't give voids a length, whereas microsoft seemingly do\n pass\n else:\n vollog.debug(\"Choosing appropriate natives for symbol library: {}\".format(nc))\n return native_class.natives\n return None","function_tokens":["def","_get_natives","(","self",")","->","Optional","[","interfaces",".","symbols",".","NativeTableInterface","]",":","# TODO: Consider how to generate the natives entirely from the ISF","classes","=","{","\"x64\"",":","native",".","x64NativeTable",",","\"x86\"",":","native",".","x86NativeTable","}","for","nc","in","sorted","(","classes",")",":","native_class","=","classes","[","nc","]","for","base_type","in","self",".","_json_object","[","'base_types'","]",":","try",":","if","self",".","_json_object","[","'base_types'","]","[","base_type","]","[","'length'","]","!=","native_class",".","get_type","(","base_type",")",".","size",":","break","except","TypeError",":","# TODO: determine whether we should give voids a size - We don't give voids a length, whereas microsoft seemingly do","pass","else",":","vollog",".","debug","(","\"Choosing appropriate natives for symbol library: {}\"",".","format","(","nc",")",")","return","native_class",".","natives","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L289-L306"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"ISFormatTable.metadata","parameters":"(self)","argument_list":"","return_statement":"return None","docstring":"Returns a metadata object containing information about the symbol\n table.","docstring_summary":"Returns a metadata object containing information about the symbol\n table.","docstring_tokens":["Returns","a","metadata","object","containing","information","about","the","symbol","table","."],"function":"def metadata(self) -> Optional[interfaces.symbols.MetadataInterface]:\n \"\"\"Returns a metadata object containing information about the symbol\n table.\"\"\"\n return None","function_tokens":["def","metadata","(","self",")","->","Optional","[","interfaces",".","symbols",".","MetadataInterface","]",":","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L317-L320"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"ISFormatTable.clear_symbol_cache","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Clears the symbol cache of the symbol table.","docstring_summary":"Clears the symbol cache of the symbol table.","docstring_tokens":["Clears","the","symbol","cache","of","the","symbol","table","."],"function":"def clear_symbol_cache(self) -> None:\n \"\"\"Clears the symbol cache of the symbol table.\"\"\"\n self._symbol_cache.clear()","function_tokens":["def","clear_symbol_cache","(","self",")","->","None",":","self",".","_symbol_cache",".","clear","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L322-L324"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version1Format.get_symbol","parameters":"(self, name: str)","argument_list":"","return_statement":"return self._symbol_cache[name]","docstring":"Returns the location offset given by the symbol name.","docstring_summary":"Returns the location offset given by the symbol name.","docstring_tokens":["Returns","the","location","offset","given","by","the","symbol","name","."],"function":"def get_symbol(self, name: str) -> interfaces.symbols.SymbolInterface:\n \"\"\"Returns the location offset given by the symbol name.\"\"\"\n # TODO: Add the ability to add\/remove\/change symbols after creation\n # note that this should invalidate\/update the cache\n if self._symbol_cache.get(name, None):\n return self._symbol_cache[name]\n symbol = self._json_object['symbols'].get(name, None)\n if not symbol:\n raise exceptions.SymbolError(name, self.name, \"Unknown symbol: {}\".format(name))\n address = symbol['address'] + self.config.get('symbol_shift', 0)\n if self.config.get('symbol_mask', 0):\n address = address & self.config['symbol_mask']\n self._symbol_cache[name] = interfaces.symbols.SymbolInterface(name = name, address = address)\n return self._symbol_cache[name]","function_tokens":["def","get_symbol","(","self",",","name",":","str",")","->","interfaces",".","symbols",".","SymbolInterface",":","# TODO: Add the ability to add\/remove\/change symbols after creation","# note that this should invalidate\/update the cache","if","self",".","_symbol_cache",".","get","(","name",",","None",")",":","return","self",".","_symbol_cache","[","name","]","symbol","=","self",".","_json_object","[","'symbols'","]",".","get","(","name",",","None",")","if","not","symbol",":","raise","exceptions",".","SymbolError","(","name",",","self",".","name",",","\"Unknown symbol: {}\"",".","format","(","name",")",")","address","=","symbol","[","'address'","]","+","self",".","config",".","get","(","'symbol_shift'",",","0",")","if","self",".","config",".","get","(","'symbol_mask'",",","0",")",":","address","=","address","&","self",".","config","[","'symbol_mask'","]","self",".","_symbol_cache","[","name","]","=","interfaces",".","symbols",".","SymbolInterface","(","name","=","name",",","address","=","address",")","return","self",".","_symbol_cache","[","name","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L331-L344"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version1Format.symbols","parameters":"(self)","argument_list":"","return_statement":"return list(self._json_object.get('symbols', {}))","docstring":"Returns an iterator of the symbol names.","docstring_summary":"Returns an iterator of the symbol names.","docstring_tokens":["Returns","an","iterator","of","the","symbol","names","."],"function":"def symbols(self) -> Iterable[str]:\n \"\"\"Returns an iterator of the symbol names.\"\"\"\n return list(self._json_object.get('symbols', {}))","function_tokens":["def","symbols","(","self",")","->","Iterable","[","str","]",":","return","list","(","self",".","_json_object",".","get","(","'symbols'",",","{","}",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L347-L349"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version1Format.enumerations","parameters":"(self)","argument_list":"","return_statement":"return list(self._json_object.get('enums', {}))","docstring":"Returns an iterator of the available enumerations.","docstring_summary":"Returns an iterator of the available enumerations.","docstring_tokens":["Returns","an","iterator","of","the","available","enumerations","."],"function":"def enumerations(self) -> Iterable[str]:\n \"\"\"Returns an iterator of the available enumerations.\"\"\"\n return list(self._json_object.get('enums', {}))","function_tokens":["def","enumerations","(","self",")","->","Iterable","[","str","]",":","return","list","(","self",".","_json_object",".","get","(","'enums'",",","{","}",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L352-L354"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version1Format.types","parameters":"(self)","argument_list":"","return_statement":"return list(self._json_object.get('user_types', {})) + list(self.natives.types)","docstring":"Returns an iterator of the symbol type names.","docstring_summary":"Returns an iterator of the symbol type names.","docstring_tokens":["Returns","an","iterator","of","the","symbol","type","names","."],"function":"def types(self) -> Iterable[str]:\n \"\"\"Returns an iterator of the symbol type names.\"\"\"\n return list(self._json_object.get('user_types', {})) + list(self.natives.types)","function_tokens":["def","types","(","self",")","->","Iterable","[","str","]",":","return","list","(","self",".","_json_object",".","get","(","'user_types'",",","{","}",")",")","+","list","(","self",".","natives",".","types",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L357-L359"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version1Format._interdict_to_template","parameters":"(self, dictionary: Dict[str, Any])","argument_list":"","return_statement":"return objects.templates.ReferenceTemplate(type_name = reference_name)","docstring":"Converts an intermediate format dict into an object template.","docstring_summary":"Converts an intermediate format dict into an object template.","docstring_tokens":["Converts","an","intermediate","format","dict","into","an","object","template","."],"function":"def _interdict_to_template(self, dictionary: Dict[str, Any]) -> interfaces.objects.Template:\n \"\"\"Converts an intermediate format dict into an object template.\"\"\"\n if not dictionary:\n raise exceptions.SymbolSpaceError(\"Invalid intermediate dictionary: {}\".format(dictionary))\n\n type_name = dictionary['kind']\n if type_name == 'base':\n type_name = dictionary['name']\n\n if type_name in self.natives.types:\n # The symbol is a native type\n native_template = self.natives.get_type(self.name + constants.BANG + type_name)\n\n # Add specific additional parameters, etc\n update = {}\n if type_name == 'array':\n update['count'] = dictionary['count']\n update['subtype'] = self._interdict_to_template(dictionary['subtype'])\n elif type_name == 'pointer':\n if dictionary.get('base', None):\n base_type = self.natives.get_type(self.name + constants.BANG + dictionary['base'])\n update['data_format'] = base_type.vol['data_format']\n update['subtype'] = self._interdict_to_template(dictionary['subtype'])\n elif type_name == 'enum':\n update = self._lookup_enum(dictionary['name'])\n elif type_name == 'bitfield':\n update = {\n 'start_bit': dictionary['bit_position'],\n 'end_bit': dictionary['bit_position'] + dictionary['bit_length']\n }\n update['base_type'] = self._interdict_to_template(dictionary['type'])\n # We do *not* call native_template.clone(), since it slows everything down a lot\n # We require that the native.get_type method always returns a newly constructed python object\n native_template.update_vol(**update)\n return native_template\n\n # Otherwise\n if dictionary['kind'] not in objects.AggregateTypes.values():\n raise exceptions.SymbolSpaceError(\"Unknown Intermediate format: {}\".format(dictionary))\n\n reference_name = dictionary['name']\n if constants.BANG not in reference_name:\n reference_name = self.name + constants.BANG + reference_name\n else:\n reference_parts = reference_name.split(constants.BANG)\n reference_name = (self.table_mapping.get(reference_parts[0], reference_parts[0]) + constants.BANG +\n constants.BANG.join(reference_parts[1:]))\n\n return objects.templates.ReferenceTemplate(type_name = reference_name)","function_tokens":["def","_interdict_to_template","(","self",",","dictionary",":","Dict","[","str",",","Any","]",")","->","interfaces",".","objects",".","Template",":","if","not","dictionary",":","raise","exceptions",".","SymbolSpaceError","(","\"Invalid intermediate dictionary: {}\"",".","format","(","dictionary",")",")","type_name","=","dictionary","[","'kind'","]","if","type_name","==","'base'",":","type_name","=","dictionary","[","'name'","]","if","type_name","in","self",".","natives",".","types",":","# The symbol is a native type","native_template","=","self",".","natives",".","get_type","(","self",".","name","+","constants",".","BANG","+","type_name",")","# Add specific additional parameters, etc","update","=","{","}","if","type_name","==","'array'",":","update","[","'count'","]","=","dictionary","[","'count'","]","update","[","'subtype'","]","=","self",".","_interdict_to_template","(","dictionary","[","'subtype'","]",")","elif","type_name","==","'pointer'",":","if","dictionary",".","get","(","'base'",",","None",")",":","base_type","=","self",".","natives",".","get_type","(","self",".","name","+","constants",".","BANG","+","dictionary","[","'base'","]",")","update","[","'data_format'","]","=","base_type",".","vol","[","'data_format'","]","update","[","'subtype'","]","=","self",".","_interdict_to_template","(","dictionary","[","'subtype'","]",")","elif","type_name","==","'enum'",":","update","=","self",".","_lookup_enum","(","dictionary","[","'name'","]",")","elif","type_name","==","'bitfield'",":","update","=","{","'start_bit'",":","dictionary","[","'bit_position'","]",",","'end_bit'",":","dictionary","[","'bit_position'","]","+","dictionary","[","'bit_length'","]","}","update","[","'base_type'","]","=","self",".","_interdict_to_template","(","dictionary","[","'type'","]",")","# We do *not* call native_template.clone(), since it slows everything down a lot","# We require that the native.get_type method always returns a newly constructed python object","native_template",".","update_vol","(","*","*","update",")","return","native_template","# Otherwise","if","dictionary","[","'kind'","]","not","in","objects",".","AggregateTypes",".","values","(",")",":","raise","exceptions",".","SymbolSpaceError","(","\"Unknown Intermediate format: {}\"",".","format","(","dictionary",")",")","reference_name","=","dictionary","[","'name'","]","if","constants",".","BANG","not","in","reference_name",":","reference_name","=","self",".","name","+","constants",".","BANG","+","reference_name","else",":","reference_parts","=","reference_name",".","split","(","constants",".","BANG",")","reference_name","=","(","self",".","table_mapping",".","get","(","reference_parts","[","0","]",",","reference_parts","[","0","]",")","+","constants",".","BANG","+","constants",".","BANG",".","join","(","reference_parts","[","1",":","]",")",")","return","objects",".","templates",".","ReferenceTemplate","(","type_name","=","reference_name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L373-L421"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version1Format._lookup_enum","parameters":"(self, name: str)","argument_list":"","return_statement":"return result","docstring":"Looks up an enumeration and returns a dictionary of __init__\n parameters for an Enum.","docstring_summary":"Looks up an enumeration and returns a dictionary of __init__\n parameters for an Enum.","docstring_tokens":["Looks","up","an","enumeration","and","returns","a","dictionary","of","__init__","parameters","for","an","Enum","."],"function":"def _lookup_enum(self, name: str) -> Dict[str, Any]:\n \"\"\"Looks up an enumeration and returns a dictionary of __init__\n parameters for an Enum.\"\"\"\n lookup = self._json_object['enums'].get(name, None)\n if not lookup:\n raise exceptions.SymbolSpaceError(\"Unknown enumeration: {}\".format(name))\n result = {\"choices\": copy.deepcopy(lookup['constants']), \"base_type\": self.natives.get_type(lookup['base'])}\n return result","function_tokens":["def","_lookup_enum","(","self",",","name",":","str",")","->","Dict","[","str",",","Any","]",":","lookup","=","self",".","_json_object","[","'enums'","]",".","get","(","name",",","None",")","if","not","lookup",":","raise","exceptions",".","SymbolSpaceError","(","\"Unknown enumeration: {}\"",".","format","(","name",")",")","result","=","{","\"choices\"",":","copy",".","deepcopy","(","lookup","[","'constants'","]",")",",","\"base_type\"",":","self",".","natives",".","get_type","(","lookup","[","'base'","]",")","}","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L423-L430"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version1Format.get_enumeration","parameters":"(self, enum_name: str)","argument_list":"","return_statement":"return objects.templates.ObjectTemplate(type_name = self.name + constants.BANG + enum_name,\n object_class = objects.Enumeration,\n base_type = base_type,\n choices = curdict['constants'])","docstring":"Resolves an individual enumeration.","docstring_summary":"Resolves an individual enumeration.","docstring_tokens":["Resolves","an","individual","enumeration","."],"function":"def get_enumeration(self, enum_name: str) -> interfaces.objects.Template:\n \"\"\"Resolves an individual enumeration.\"\"\"\n if constants.BANG in enum_name:\n raise exceptions.SymbolError(enum_name, self.name,\n \"Enumeration for a different table requested: {}\".format(enum_name))\n if enum_name not in self._json_object['enums']:\n # Fall back to the natives table\n raise exceptions.SymbolError(enum_name, self.name,\n \"Enumeration not found in {} table: {}\".format(self.name, enum_name))\n curdict = self._json_object['enums'][enum_name]\n base_type = self.natives.get_type(curdict['base'])\n # The size isn't actually used, the base-type defines it.\n return objects.templates.ObjectTemplate(type_name = self.name + constants.BANG + enum_name,\n object_class = objects.Enumeration,\n base_type = base_type,\n choices = curdict['constants'])","function_tokens":["def","get_enumeration","(","self",",","enum_name",":","str",")","->","interfaces",".","objects",".","Template",":","if","constants",".","BANG","in","enum_name",":","raise","exceptions",".","SymbolError","(","enum_name",",","self",".","name",",","\"Enumeration for a different table requested: {}\"",".","format","(","enum_name",")",")","if","enum_name","not","in","self",".","_json_object","[","'enums'","]",":","# Fall back to the natives table","raise","exceptions",".","SymbolError","(","enum_name",",","self",".","name",",","\"Enumeration not found in {} table: {}\"",".","format","(","self",".","name",",","enum_name",")",")","curdict","=","self",".","_json_object","[","'enums'","]","[","enum_name","]","base_type","=","self",".","natives",".","get_type","(","curdict","[","'base'","]",")","# The size isn't actually used, the base-type defines it.","return","objects",".","templates",".","ObjectTemplate","(","type_name","=","self",".","name","+","constants",".","BANG","+","enum_name",",","object_class","=","objects",".","Enumeration",",","base_type","=","base_type",",","choices","=","curdict","[","'constants'","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L432-L447"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version1Format.get_type","parameters":"(self, type_name: str)","argument_list":"","return_statement":"return objects.templates.ObjectTemplate(type_name = self.name + constants.BANG + type_name,\n object_class = object_class,\n size = curdict['length'],\n members = members)","docstring":"Resolves an individual symbol.","docstring_summary":"Resolves an individual symbol.","docstring_tokens":["Resolves","an","individual","symbol","."],"function":"def get_type(self, type_name: str) -> interfaces.objects.Template:\n \"\"\"Resolves an individual symbol.\"\"\"\n if constants.BANG in type_name:\n index = type_name.find(constants.BANG)\n table_name, type_name = type_name[:index], type_name[index + 1:]\n raise exceptions.SymbolError(\n type_name, table_name,\n \"Symbol for a different table requested: {}\".format(table_name + constants.BANG + type_name))\n if type_name not in self._json_object['user_types']:\n # Fall back to the natives table\n return self.natives.get_type(self.name + constants.BANG + type_name)\n curdict = self._json_object['user_types'][type_name]\n members = {}\n for member_name in curdict['fields']:\n interdict = curdict['fields'][member_name]\n member = (interdict['offset'], self._interdict_to_template(interdict['type']))\n members[member_name] = member\n object_class = self.get_type_class(type_name)\n if object_class == objects.AggregateType:\n for clazz in objects.AggregateTypes:\n if objects.AggregateTypes[clazz] == curdict['kind']:\n object_class = clazz\n return objects.templates.ObjectTemplate(type_name = self.name + constants.BANG + type_name,\n object_class = object_class,\n size = curdict['length'],\n members = members)","function_tokens":["def","get_type","(","self",",","type_name",":","str",")","->","interfaces",".","objects",".","Template",":","if","constants",".","BANG","in","type_name",":","index","=","type_name",".","find","(","constants",".","BANG",")","table_name",",","type_name","=","type_name","[",":","index","]",",","type_name","[","index","+","1",":","]","raise","exceptions",".","SymbolError","(","type_name",",","table_name",",","\"Symbol for a different table requested: {}\"",".","format","(","table_name","+","constants",".","BANG","+","type_name",")",")","if","type_name","not","in","self",".","_json_object","[","'user_types'","]",":","# Fall back to the natives table","return","self",".","natives",".","get_type","(","self",".","name","+","constants",".","BANG","+","type_name",")","curdict","=","self",".","_json_object","[","'user_types'","]","[","type_name","]","members","=","{","}","for","member_name","in","curdict","[","'fields'","]",":","interdict","=","curdict","[","'fields'","]","[","member_name","]","member","=","(","interdict","[","'offset'","]",",","self",".","_interdict_to_template","(","interdict","[","'type'","]",")",")","members","[","member_name","]","=","member","object_class","=","self",".","get_type_class","(","type_name",")","if","object_class","==","objects",".","AggregateType",":","for","clazz","in","objects",".","AggregateTypes",":","if","objects",".","AggregateTypes","[","clazz","]","==","curdict","[","'kind'","]",":","object_class","=","clazz","return","objects",".","templates",".","ObjectTemplate","(","type_name","=","self",".","name","+","constants",".","BANG","+","type_name",",","object_class","=","object_class",",","size","=","curdict","[","'length'","]",",","members","=","members",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L449-L474"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version2Format._get_natives","parameters":"(self)","argument_list":"","return_statement":"return None","docstring":"Determines the appropriate native_types to use from the JSON\n data.","docstring_summary":"Determines the appropriate native_types to use from the JSON\n data.","docstring_tokens":["Determines","the","appropriate","native_types","to","use","from","the","JSON","data","."],"function":"def _get_natives(self) -> Optional[interfaces.symbols.NativeTableInterface]:\n \"\"\"Determines the appropriate native_types to use from the JSON\n data.\"\"\"\n classes = {\"x64\": native.x64NativeTable, \"x86\": native.x86NativeTable}\n for nc in sorted(classes):\n native_class = classes[nc]\n for base_type in self._json_object['base_types']:\n try:\n if self._json_object['base_types'][base_type]['size'] != native_class.get_type(base_type).size:\n break\n except TypeError:\n # TODO: determine whether we should give voids a size - We don't give voids a length, whereas microsoft seemingly do\n pass\n else:\n vollog.debug(\"Choosing appropriate natives for symbol library: {}\".format(nc))\n return native_class.natives\n return None","function_tokens":["def","_get_natives","(","self",")","->","Optional","[","interfaces",".","symbols",".","NativeTableInterface","]",":","classes","=","{","\"x64\"",":","native",".","x64NativeTable",",","\"x86\"",":","native",".","x86NativeTable","}","for","nc","in","sorted","(","classes",")",":","native_class","=","classes","[","nc","]","for","base_type","in","self",".","_json_object","[","'base_types'","]",":","try",":","if","self",".","_json_object","[","'base_types'","]","[","base_type","]","[","'size'","]","!=","native_class",".","get_type","(","base_type",")",".","size",":","break","except","TypeError",":","# TODO: determine whether we should give voids a size - We don't give voids a length, whereas microsoft seemingly do","pass","else",":","vollog",".","debug","(","\"Choosing appropriate natives for symbol library: {}\"",".","format","(","nc",")",")","return","native_class",".","natives","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L481-L497"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version2Format.get_type","parameters":"(self, type_name: str)","argument_list":"","return_statement":"return objects.templates.ObjectTemplate(type_name = self.name + constants.BANG + type_name,\n object_class = object_class,\n size = curdict['size'],\n members = members)","docstring":"Resolves an individual symbol.","docstring_summary":"Resolves an individual symbol.","docstring_tokens":["Resolves","an","individual","symbol","."],"function":"def get_type(self, type_name: str) -> interfaces.objects.Template:\n \"\"\"Resolves an individual symbol.\"\"\"\n if constants.BANG in type_name:\n index = type_name.find(constants.BANG)\n table_name, type_name = type_name[:index], type_name[index + 1:]\n raise exceptions.SymbolError(\n type_name, table_name,\n \"Symbol for a different table requested: {}\".format(table_name + constants.BANG + type_name))\n if type_name not in self._json_object['user_types']:\n # Fall back to the natives table\n if type_name in self.natives.types:\n return self.natives.get_type(self.name + constants.BANG + type_name)\n else:\n raise exceptions.SymbolError(type_name, self.name, \"Unknown symbol: {}\".format(type_name))\n curdict = self._json_object['user_types'][type_name]\n members = {}\n for member_name in curdict['fields']:\n interdict = curdict['fields'][member_name]\n member = (interdict['offset'], self._interdict_to_template(interdict['type']))\n members[member_name] = member\n object_class = self.get_type_class(type_name)\n if object_class == objects.AggregateType:\n for clazz in objects.AggregateTypes:\n if objects.AggregateTypes[clazz] == curdict['kind']:\n object_class = clazz\n return objects.templates.ObjectTemplate(type_name = self.name + constants.BANG + type_name,\n object_class = object_class,\n size = curdict['size'],\n members = members)","function_tokens":["def","get_type","(","self",",","type_name",":","str",")","->","interfaces",".","objects",".","Template",":","if","constants",".","BANG","in","type_name",":","index","=","type_name",".","find","(","constants",".","BANG",")","table_name",",","type_name","=","type_name","[",":","index","]",",","type_name","[","index","+","1",":","]","raise","exceptions",".","SymbolError","(","type_name",",","table_name",",","\"Symbol for a different table requested: {}\"",".","format","(","table_name","+","constants",".","BANG","+","type_name",")",")","if","type_name","not","in","self",".","_json_object","[","'user_types'","]",":","# Fall back to the natives table","if","type_name","in","self",".","natives",".","types",":","return","self",".","natives",".","get_type","(","self",".","name","+","constants",".","BANG","+","type_name",")","else",":","raise","exceptions",".","SymbolError","(","type_name",",","self",".","name",",","\"Unknown symbol: {}\"",".","format","(","type_name",")",")","curdict","=","self",".","_json_object","[","'user_types'","]","[","type_name","]","members","=","{","}","for","member_name","in","curdict","[","'fields'","]",":","interdict","=","curdict","[","'fields'","]","[","member_name","]","member","=","(","interdict","[","'offset'","]",",","self",".","_interdict_to_template","(","interdict","[","'type'","]",")",")","members","[","member_name","]","=","member","object_class","=","self",".","get_type_class","(","type_name",")","if","object_class","==","objects",".","AggregateType",":","for","clazz","in","objects",".","AggregateTypes",":","if","objects",".","AggregateTypes","[","clazz","]","==","curdict","[","'kind'","]",":","object_class","=","clazz","return","objects",".","templates",".","ObjectTemplate","(","type_name","=","self",".","name","+","constants",".","BANG","+","type_name",",","object_class","=","object_class",",","size","=","curdict","[","'size'","]",",","members","=","members",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L499-L527"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version3Format.get_symbol","parameters":"(self, name: str)","argument_list":"","return_statement":"return self._symbol_cache[name]","docstring":"Returns the symbol given by the symbol name.","docstring_summary":"Returns the symbol given by the symbol name.","docstring_tokens":["Returns","the","symbol","given","by","the","symbol","name","."],"function":"def get_symbol(self, name: str) -> interfaces.symbols.SymbolInterface:\n \"\"\"Returns the symbol given by the symbol name.\"\"\"\n if self._symbol_cache.get(name, None):\n return self._symbol_cache[name]\n symbol = self._json_object['symbols'].get(name, None)\n if not symbol:\n raise exceptions.SymbolError(name, self.name, \"Unknown symbol: {}\".format(name))\n symbol_type = None\n if 'type' in symbol:\n symbol_type = self._interdict_to_template(symbol['type'])\n\n # Mask the addresses if necessary\n address = symbol['address'] + self.config.get('symbol_shift', 0)\n if self.config.get('symbol_mask', 0):\n address = address & self.config['symbol_mask']\n self._symbol_cache[name] = interfaces.symbols.SymbolInterface(name = name,\n address = address,\n type = symbol_type)\n return self._symbol_cache[name]","function_tokens":["def","get_symbol","(","self",",","name",":","str",")","->","interfaces",".","symbols",".","SymbolInterface",":","if","self",".","_symbol_cache",".","get","(","name",",","None",")",":","return","self",".","_symbol_cache","[","name","]","symbol","=","self",".","_json_object","[","'symbols'","]",".","get","(","name",",","None",")","if","not","symbol",":","raise","exceptions",".","SymbolError","(","name",",","self",".","name",",","\"Unknown symbol: {}\"",".","format","(","name",")",")","symbol_type","=","None","if","'type'","in","symbol",":","symbol_type","=","self",".","_interdict_to_template","(","symbol","[","'type'","]",")","# Mask the addresses if necessary","address","=","symbol","[","'address'","]","+","self",".","config",".","get","(","'symbol_shift'",",","0",")","if","self",".","config",".","get","(","'symbol_mask'",",","0",")",":","address","=","address","&","self",".","config","[","'symbol_mask'","]","self",".","_symbol_cache","[","name","]","=","interfaces",".","symbols",".","SymbolInterface","(","name","=","name",",","address","=","address",",","type","=","symbol_type",")","return","self",".","_symbol_cache","[","name","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L534-L552"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version4Format._get_natives","parameters":"(self)","argument_list":"","return_statement":"return native.NativeTable(name = \"native\", native_dictionary = native_dict)","docstring":"Determines the appropriate native_types to use from the JSON\n data.","docstring_summary":"Determines the appropriate native_types to use from the JSON\n data.","docstring_tokens":["Determines","the","appropriate","native_types","to","use","from","the","JSON","data","."],"function":"def _get_natives(self) -> Optional[interfaces.symbols.NativeTableInterface]:\n \"\"\"Determines the appropriate native_types to use from the JSON\n data.\"\"\"\n native_dict = {}\n base_types = self._json_object['base_types']\n for base_type in base_types:\n # Void are ignored because voids are not a volatility primitive, they are a specific Volatility object\n if base_type != 'void':\n current = base_types[base_type]\n # TODO: Fix up the typing of this, it bugs out because of the tuple assignment\n if current['kind'] not in self.format_mapping:\n raise ValueError(\"Unsupported base kind\")\n format_val = (current['size'], current['endian'], current['signed'])\n object_type = self.format_mapping[current['kind']]\n if base_type == 'pointer':\n object_type = objects.Pointer\n native_dict[base_type] = (object_type, format_val)\n return native.NativeTable(name = \"native\", native_dictionary = native_dict)","function_tokens":["def","_get_natives","(","self",")","->","Optional","[","interfaces",".","symbols",".","NativeTableInterface","]",":","native_dict","=","{","}","base_types","=","self",".","_json_object","[","'base_types'","]","for","base_type","in","base_types",":","# Void are ignored because voids are not a volatility primitive, they are a specific Volatility object","if","base_type","!=","'void'",":","current","=","base_types","[","base_type","]","# TODO: Fix up the typing of this, it bugs out because of the tuple assignment","if","current","[","'kind'","]","not","in","self",".","format_mapping",":","raise","ValueError","(","\"Unsupported base kind\"",")","format_val","=","(","current","[","'size'","]",",","current","[","'endian'","]",",","current","[","'signed'","]",")","object_type","=","self",".","format_mapping","[","current","[","'kind'","]","]","if","base_type","==","'pointer'",":","object_type","=","objects",".","Pointer","native_dict","[","base_type","]","=","(","object_type",",","format_val",")","return","native",".","NativeTable","(","name","=","\"native\"",",","native_dictionary","=","native_dict",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L567-L584"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version5Format.get_symbol","parameters":"(self, name: str)","argument_list":"","return_statement":"return self._symbol_cache[name]","docstring":"Returns the symbol given by the symbol name.","docstring_summary":"Returns the symbol given by the symbol name.","docstring_tokens":["Returns","the","symbol","given","by","the","symbol","name","."],"function":"def get_symbol(self, name: str) -> interfaces.symbols.SymbolInterface:\n \"\"\"Returns the symbol given by the symbol name.\"\"\"\n if self._symbol_cache.get(name, None):\n return self._symbol_cache[name]\n symbol = self._json_object['symbols'].get(name, None)\n if not symbol:\n raise exceptions.SymbolError(name, self.name, \"Unknown symbol: {}\".format(name))\n symbol_type = None\n if 'type' in symbol:\n symbol_type = self._interdict_to_template(symbol['type'])\n symbol_constant_data = None\n if 'constant_data' in symbol:\n symbol_constant_data = base64.b64decode(symbol.get('constant_data'))\n\n # Mask the addresses if necessary\n address = symbol['address'] + self.config.get('symbol_shift', 0)\n if self.config.get('symbol_mask', 0):\n address = address & self.config['symbol_mask']\n self._symbol_cache[name] = interfaces.symbols.SymbolInterface(name = name,\n address = address,\n type = symbol_type,\n constant_data = symbol_constant_data)\n return self._symbol_cache[name]","function_tokens":["def","get_symbol","(","self",",","name",":","str",")","->","interfaces",".","symbols",".","SymbolInterface",":","if","self",".","_symbol_cache",".","get","(","name",",","None",")",":","return","self",".","_symbol_cache","[","name","]","symbol","=","self",".","_json_object","[","'symbols'","]",".","get","(","name",",","None",")","if","not","symbol",":","raise","exceptions",".","SymbolError","(","name",",","self",".","name",",","\"Unknown symbol: {}\"",".","format","(","name",")",")","symbol_type","=","None","if","'type'","in","symbol",":","symbol_type","=","self",".","_interdict_to_template","(","symbol","[","'type'","]",")","symbol_constant_data","=","None","if","'constant_data'","in","symbol",":","symbol_constant_data","=","base64",".","b64decode","(","symbol",".","get","(","'constant_data'",")",")","# Mask the addresses if necessary","address","=","symbol","[","'address'","]","+","self",".","config",".","get","(","'symbol_shift'",",","0",")","if","self",".","config",".","get","(","'symbol_mask'",",","0",")",":","address","=","address","&","self",".","config","[","'symbol_mask'","]","self",".","_symbol_cache","[","name","]","=","interfaces",".","symbols",".","SymbolInterface","(","name","=","name",",","address","=","address",",","type","=","symbol_type",",","constant_data","=","symbol_constant_data",")","return","self",".","_symbol_cache","[","name","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L591-L613"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version6Format.metadata","parameters":"(self)","argument_list":"","return_statement":"return None","docstring":"Returns a MetadataInterface object.","docstring_summary":"Returns a MetadataInterface object.","docstring_tokens":["Returns","a","MetadataInterface","object","."],"function":"def metadata(self) -> Optional[interfaces.symbols.MetadataInterface]:\n \"\"\"Returns a MetadataInterface object.\"\"\"\n if self._json_object.get('metadata', {}).get('windows'):\n return metadata.WindowsMetadata(self._json_object['metadata']['windows'])\n if self._json_object.get('metadata', {}).get('linux'):\n return metadata.LinuxMetadata(self._json_object['metadata']['linux'])\n return None","function_tokens":["def","metadata","(","self",")","->","Optional","[","interfaces",".","symbols",".","MetadataInterface","]",":","if","self",".","_json_object",".","get","(","'metadata'",",","{","}",")",".","get","(","'windows'",")",":","return","metadata",".","WindowsMetadata","(","self",".","_json_object","[","'metadata'","]","[","'windows'","]",")","if","self",".","_json_object",".","get","(","'metadata'",",","{","}",")",".","get","(","'linux'",")",":","return","metadata",".","LinuxMetadata","(","self",".","_json_object","[","'metadata'","]","[","'linux'","]",")","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L621-L627"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version8Format._process_fields","parameters":"(self, fields: Dict[str, Dict[str, Any]])","argument_list":"","return_statement":"return members","docstring":"For each type field, it walks its tree of subtypes, reducing the hierarchy to just one level.\n It creates a tuple of offset and object templates for each field.","docstring_summary":"For each type field, it walks its tree of subtypes, reducing the hierarchy to just one level.\n It creates a tuple of offset and object templates for each field.","docstring_tokens":["For","each","type","field","it","walks","its","tree","of","subtypes","reducing","the","hierarchy","to","just","one","level",".","It","creates","a","tuple","of","offset","and","object","templates","for","each","field","."],"function":"def _process_fields(self, fields: Dict[str, Dict[str, Any]]) -> Dict[Any, Tuple[int, interfaces.objects.Template]]:\n \"\"\"For each type field, it walks its tree of subtypes, reducing the hierarchy to just one level.\n It creates a tuple of offset and object templates for each field.\n \"\"\"\n members = {}\n for new_offset, member_name, member_value in self._reduce_fields(fields):\n member = (new_offset, self._interdict_to_template(member_value['type']))\n members[member_name] = member\n return members","function_tokens":["def","_process_fields","(","self",",","fields",":","Dict","[","str",",","Dict","[","str",",","Any","]","]",")","->","Dict","[","Any",",","Tuple","[","int",",","interfaces",".","objects",".","Template","]","]",":","members","=","{","}","for","new_offset",",","member_name",",","member_value","in","self",".","_reduce_fields","(","fields",")",":","member","=","(","new_offset",",","self",".","_interdict_to_template","(","member_value","[","'type'","]",")",")","members","[","member_name","]","=","member","return","members"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L639-L647"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version8Format._reduce_fields","parameters":"(self,\n fields: Dict[str, Dict[str, Any]],\n parent_offset: int = 0)","argument_list":"","return_statement":"","docstring":"Reduce the fields bringing them one level up. It supports anonymous types such as structs or unions in any\n level of depth.","docstring_summary":"Reduce the fields bringing them one level up. It supports anonymous types such as structs or unions in any\n level of depth.","docstring_tokens":["Reduce","the","fields","bringing","them","one","level","up",".","It","supports","anonymous","types","such","as","structs","or","unions","in","any","level","of","depth","."],"function":"def _reduce_fields(self,\n fields: Dict[str, Dict[str, Any]],\n parent_offset: int = 0) -> Generator[Tuple[int, str, Dict], None, None]:\n \"\"\"Reduce the fields bringing them one level up. It supports anonymous types such as structs or unions in any\n level of depth.\"\"\"\n for member_name, member_value in fields.items():\n new_offset = parent_offset + member_value.get('offset', 0)\n if member_value.get('anonymous', False) and isinstance(member_value, dict):\n # Gets the subtype from the json ISF and recursively reduce its fields\n subtype = self._json_object['user_types'].get(member_value['type']['name'], {})\n yield from self._reduce_fields(subtype['fields'], new_offset)\n else:\n yield new_offset, member_name, member_value","function_tokens":["def","_reduce_fields","(","self",",","fields",":","Dict","[","str",",","Dict","[","str",",","Any","]","]",",","parent_offset",":","int","=","0",")","->","Generator","[","Tuple","[","int",",","str",",","Dict","]",",","None",",","None","]",":","for","member_name",",","member_value","in","fields",".","items","(",")",":","new_offset","=","parent_offset","+","member_value",".","get","(","'offset'",",","0",")","if","member_value",".","get","(","'anonymous'",",","False",")","and","isinstance","(","member_value",",","dict",")",":","# Gets the subtype from the json ISF and recursively reduce its fields","subtype","=","self",".","_json_object","[","'user_types'","]",".","get","(","member_value","[","'type'","]","[","'name'","]",",","{","}",")","yield","from","self",".","_reduce_fields","(","subtype","[","'fields'","]",",","new_offset",")","else",":","yield","new_offset",",","member_name",",","member_value"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L649-L661"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py","language":"python","identifier":"Version8Format.get_type","parameters":"(self, type_name: str)","argument_list":"","return_statement":"return objects.templates.ObjectTemplate(type_name = self.name + constants.BANG + type_name,\n object_class = object_class,\n size = type_definition['size'],\n members = members)","docstring":"Resolves an individual symbol.","docstring_summary":"Resolves an individual symbol.","docstring_tokens":["Resolves","an","individual","symbol","."],"function":"def get_type(self, type_name: str) -> interfaces.objects.Template:\n \"\"\"Resolves an individual symbol.\"\"\"\n index = type_name.find(constants.BANG)\n if index != -1:\n table_name, type_name = type_name[:index], type_name[index + 1:]\n raise exceptions.SymbolError(\n type_name, table_name,\n \"Symbol for a different table requested: {}\".format(table_name + constants.BANG + type_name))\n\n type_definition = self._json_object['user_types'].get(type_name)\n if type_definition is None:\n # Fall back to the natives table\n return self.natives.get_type(self.name + constants.BANG + type_name)\n\n members = self._process_fields(type_definition['fields'])\n\n object_class = self.get_type_class(type_name)\n if object_class == objects.AggregateType:\n for clazz in objects.AggregateTypes:\n if objects.AggregateTypes[clazz] == type_definition['kind']:\n object_class = clazz\n return objects.templates.ObjectTemplate(type_name = self.name + constants.BANG + type_name,\n object_class = object_class,\n size = type_definition['size'],\n members = members)","function_tokens":["def","get_type","(","self",",","type_name",":","str",")","->","interfaces",".","objects",".","Template",":","index","=","type_name",".","find","(","constants",".","BANG",")","if","index","!=","-","1",":","table_name",",","type_name","=","type_name","[",":","index","]",",","type_name","[","index","+","1",":","]","raise","exceptions",".","SymbolError","(","type_name",",","table_name",",","\"Symbol for a different table requested: {}\"",".","format","(","table_name","+","constants",".","BANG","+","type_name",")",")","type_definition","=","self",".","_json_object","[","'user_types'","]",".","get","(","type_name",")","if","type_definition","is","None",":","# Fall back to the natives table","return","self",".","natives",".","get_type","(","self",".","name","+","constants",".","BANG","+","type_name",")","members","=","self",".","_process_fields","(","type_definition","[","'fields'","]",")","object_class","=","self",".","get_type_class","(","type_name",")","if","object_class","==","objects",".","AggregateType",":","for","clazz","in","objects",".","AggregateTypes",":","if","objects",".","AggregateTypes","[","clazz","]","==","type_definition","[","'kind'","]",":","object_class","=","clazz","return","objects",".","templates",".","ObjectTemplate","(","type_name","=","self",".","name","+","constants",".","BANG","+","type_name",",","object_class","=","object_class",",","size","=","type_definition","[","'size'","]",",","members","=","members",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/intermed.py#L663-L687"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/native.py","language":"python","identifier":"NativeTable.types","parameters":"(self)","argument_list":"","return_statement":"return self._types","docstring":"Returns an iterator of the symbol type names.","docstring_summary":"Returns an iterator of the symbol type names.","docstring_tokens":["Returns","an","iterator","of","the","symbol","type","names","."],"function":"def types(self) -> Iterable[str]:\n \"\"\"Returns an iterator of the symbol type names.\"\"\"\n return self._types","function_tokens":["def","types","(","self",")","->","Iterable","[","str","]",":","return","self",".","_types"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/native.py#L31-L33"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/native.py","language":"python","identifier":"NativeTable.get_type","parameters":"(self, type_name: str)","argument_list":"","return_statement":"return objects.templates.ObjectTemplate(\n self.get_type_class(type_name), # pylint: disable=W0142\n type_name = prefix + type_name,\n data_format = objects.DataFormatInfo(*native_format),\n **additional)","docstring":"Resolves a symbol name into an object template.\n\n This always construct a new python object, rather than using a\n cached value otherwise changes made later may affect the cached\n copy. Calling clone after every native type construction was\n extremely slow.","docstring_summary":"Resolves a symbol name into an object template.","docstring_tokens":["Resolves","a","symbol","name","into","an","object","template","."],"function":"def get_type(self, type_name: str) -> interfaces.objects.Template:\n \"\"\"Resolves a symbol name into an object template.\n\n This always construct a new python object, rather than using a\n cached value otherwise changes made later may affect the cached\n copy. Calling clone after every native type construction was\n extremely slow.\n \"\"\"\n # NOTE: These need updating whenever the object init signatures change\n prefix = \"\"\n if constants.BANG in type_name:\n name_split = type_name.split(constants.BANG)\n if len(name_split) > 2:\n raise ValueError(\"SymbolName cannot contain multiple {} separators\".format(constants.BANG))\n table_name, type_name = name_split\n prefix = table_name + constants.BANG\n\n additional = {} # type: Dict[str, Any]\n obj = None # type: Optional[Type[interfaces.objects.ObjectInterface]]\n if type_name == 'void' or type_name == 'function':\n obj = objects.Void\n elif type_name == 'array':\n obj = objects.Array\n additional = {\"count\": 0, \"subtype\": self.get_type('void')}\n elif type_name == 'enum':\n obj = objects.Enumeration\n additional = {\"base_type\": self.get_type('void'), \"choices\": {}}\n elif type_name == 'bitfield':\n obj = objects.BitField\n additional = {\"start_bit\": 0, \"end_bit\": 0, \"base_type\": self.get_type('void')}\n elif type_name == 'string':\n obj = objects.String\n additional = {\"max_length\": 0}\n elif type_name == 'bytes':\n obj = objects.Bytes\n additional = {\"length\": 0}\n if obj is not None:\n return objects.templates.ObjectTemplate(obj, type_name = prefix + type_name, **additional)\n\n _native_type, native_format = self._native_dictionary[type_name]\n if type_name == 'pointer':\n additional = {'subtype': self.get_type('void')}\n return objects.templates.ObjectTemplate(\n self.get_type_class(type_name), # pylint: disable=W0142\n type_name = prefix + type_name,\n data_format = objects.DataFormatInfo(*native_format),\n **additional)","function_tokens":["def","get_type","(","self",",","type_name",":","str",")","->","interfaces",".","objects",".","Template",":","# NOTE: These need updating whenever the object init signatures change","prefix","=","\"\"","if","constants",".","BANG","in","type_name",":","name_split","=","type_name",".","split","(","constants",".","BANG",")","if","len","(","name_split",")",">","2",":","raise","ValueError","(","\"SymbolName cannot contain multiple {} separators\"",".","format","(","constants",".","BANG",")",")","table_name",",","type_name","=","name_split","prefix","=","table_name","+","constants",".","BANG","additional","=","{","}","# type: Dict[str, Any]","obj","=","None","# type: Optional[Type[interfaces.objects.ObjectInterface]]","if","type_name","==","'void'","or","type_name","==","'function'",":","obj","=","objects",".","Void","elif","type_name","==","'array'",":","obj","=","objects",".","Array","additional","=","{","\"count\"",":","0",",","\"subtype\"",":","self",".","get_type","(","'void'",")","}","elif","type_name","==","'enum'",":","obj","=","objects",".","Enumeration","additional","=","{","\"base_type\"",":","self",".","get_type","(","'void'",")",",","\"choices\"",":","{","}","}","elif","type_name","==","'bitfield'",":","obj","=","objects",".","BitField","additional","=","{","\"start_bit\"",":","0",",","\"end_bit\"",":","0",",","\"base_type\"",":","self",".","get_type","(","'void'",")","}","elif","type_name","==","'string'",":","obj","=","objects",".","String","additional","=","{","\"max_length\"",":","0","}","elif","type_name","==","'bytes'",":","obj","=","objects",".","Bytes","additional","=","{","\"length\"",":","0","}","if","obj","is","not","None",":","return","objects",".","templates",".","ObjectTemplate","(","obj",",","type_name","=","prefix","+","type_name",",","*","*","additional",")","_native_type",",","native_format","=","self",".","_native_dictionary","[","type_name","]","if","type_name","==","'pointer'",":","additional","=","{","'subtype'",":","self",".","get_type","(","'void'",")","}","return","objects",".","templates",".","ObjectTemplate","(","self",".","get_type_class","(","type_name",")",",","# pylint: disable=W0142","type_name","=","prefix","+","type_name",",","data_format","=","objects",".","DataFormatInfo","(","*","native_format",")",",","*","*","additional",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/native.py#L35-L81"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/wrappers.py","language":"python","identifier":"Flags.__call__","parameters":"(self, value: int)","argument_list":"","return_statement":"return result","docstring":"Return the appropriate Flags.","docstring_summary":"Return the appropriate Flags.","docstring_tokens":["Return","the","appropriate","Flags","."],"function":"def __call__(self, value: int) -> List[str]:\n \"\"\"Return the appropriate Flags.\"\"\"\n result = []\n for k, v in self.choices.items():\n if value & v:\n result.append(k)\n return result","function_tokens":["def","__call__","(","self",",","value",":","int",")","->","List","[","str","]",":","result","=","[","]","for","k",",","v","in","self",".","choices",".","items","(",")",":","if","value","&","v",":","result",".","append","(","k",")","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/wrappers.py#L21-L27"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdb.py","language":"python","identifier":"PDBUtility.symbol_table_from_offset","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n offset: int,\n symbol_table_class: str,\n config_path: str = None,\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return cls.load_windows_symbol_table(context, guid, age, pdb_name, symbol_table_class, config_path,\n progress_callback)","docstring":"Produces the name of a symbol table loaded from the offset for an MZ header\n\n Args:\n context: The context on which to operate\n layer_name: The name of the (contiguous) layer within the context that contains the MZ file\n offset: The offset in the layer at which the MZ file begins\n symbol_table_class: The type of symbol class to construct the SymbolTable\n config_path: New path for the produced symbol table configuration with the config tree\n progress_callback: Callable called to update ongoing progress\n\n Returns:\n None if no pdb information can be determined, else returned the name of the loaded symbols for the MZ","docstring_summary":"Produces the name of a symbol table loaded from the offset for an MZ header","docstring_tokens":["Produces","the","name","of","a","symbol","table","loaded","from","the","offset","for","an","MZ","header"],"function":"def symbol_table_from_offset(cls,\n context: interfaces.context.ContextInterface,\n layer_name: str,\n offset: int,\n symbol_table_class: str,\n config_path: str = None,\n progress_callback: constants.ProgressCallback = None) -> Optional[str]:\n \"\"\"Produces the name of a symbol table loaded from the offset for an MZ header\n\n Args:\n context: The context on which to operate\n layer_name: The name of the (contiguous) layer within the context that contains the MZ file\n offset: The offset in the layer at which the MZ file begins\n symbol_table_class: The type of symbol class to construct the SymbolTable\n config_path: New path for the produced symbol table configuration with the config tree\n progress_callback: Callable called to update ongoing progress\n\n Returns:\n None if no pdb information can be determined, else returned the name of the loaded symbols for the MZ\n \"\"\"\n result = cls.get_guid_from_mz(context, layer_name, offset)\n if result is None:\n return None\n guid, age, pdb_name = result\n if config_path is None:\n config_path = interfaces.configuration.path_join('pdbutility', pdb_name.replace('.', '_'))\n\n return cls.load_windows_symbol_table(context, guid, age, pdb_name, symbol_table_class, config_path,\n progress_callback)","function_tokens":["def","symbol_table_from_offset","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","offset",":","int",",","symbol_table_class",":","str",",","config_path",":","str","=","None",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","Optional","[","str","]",":","result","=","cls",".","get_guid_from_mz","(","context",",","layer_name",",","offset",")","if","result","is","None",":","return","None","guid",",","age",",","pdb_name","=","result","if","config_path","is","None",":","config_path","=","interfaces",".","configuration",".","path_join","(","'pdbutility'",",","pdb_name",".","replace","(","'.'",",","'_'",")",")","return","cls",".","load_windows_symbol_table","(","context",",","guid",",","age",",","pdb_name",",","symbol_table_class",",","config_path",",","progress_callback",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdb.py#L27-L55"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdb.py","language":"python","identifier":"PDBUtility.load_windows_symbol_table","parameters":"(cls,\n context: interfaces.context.ContextInterface,\n guid: str,\n age: int,\n pdb_name: str,\n symbol_table_class: str,\n config_path: str = 'pdbutility',\n progress_callback: constants.ProgressCallback = None)","argument_list":"","return_statement":"return context.config[config_path]","docstring":"Loads (downlading if necessary) a windows symbol table","docstring_summary":"Loads (downlading if necessary) a windows symbol table","docstring_tokens":["Loads","(","downlading","if","necessary",")","a","windows","symbol","table"],"function":"def load_windows_symbol_table(cls,\n context: interfaces.context.ContextInterface,\n guid: str,\n age: int,\n pdb_name: str,\n symbol_table_class: str,\n config_path: str = 'pdbutility',\n progress_callback: constants.ProgressCallback = None):\n \"\"\"Loads (downlading if necessary) a windows symbol table\"\"\"\n\n filter_string = os.path.join(pdb_name.strip('\\x00'), guid.upper() + \"-\" + str(age))\n\n isf_path = False\n # Take the first result of search for the intermediate file\n for value in intermed.IntermediateSymbolTable.file_symbol_url(\"windows\", filter_string):\n isf_path = value\n break\n else:\n # If none are found, attempt to download the pdb, convert it and try again\n cls.download_pdb_isf(context, guid.upper(), age, pdb_name, progress_callback)\n # Try again\n for value in intermed.IntermediateSymbolTable.file_symbol_url(\"windows\", filter_string):\n isf_path = value\n break\n\n if not isf_path:\n vollog.debug(\"Required symbol library path not found: {}\".format(filter_string))\n return None\n\n vollog.debug(\"Using symbol library: {}\".format(filter_string))\n\n # Set the discovered options\n join = interfaces.configuration.path_join\n context.config[join(config_path, \"class\")] = symbol_table_class\n context.config[join(config_path, \"isf_url\")] = isf_path\n parent_config_path = interfaces.configuration.parent_path(config_path)\n requirement_name = interfaces.configuration.path_head(config_path)\n\n # Construct the appropriate symbol table\n requirement = SymbolTableRequirement(name = requirement_name, description = \"PDBUtility generated symbol table\")\n requirement.construct(context, parent_config_path)\n return context.config[config_path]","function_tokens":["def","load_windows_symbol_table","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","guid",":","str",",","age",":","int",",","pdb_name",":","str",",","symbol_table_class",":","str",",","config_path",":","str","=","'pdbutility'",",","progress_callback",":","constants",".","ProgressCallback","=","None",")",":","filter_string","=","os",".","path",".","join","(","pdb_name",".","strip","(","'\\x00'",")",",","guid",".","upper","(",")","+","\"-\"","+","str","(","age",")",")","isf_path","=","False","# Take the first result of search for the intermediate file","for","value","in","intermed",".","IntermediateSymbolTable",".","file_symbol_url","(","\"windows\"",",","filter_string",")",":","isf_path","=","value","break","else",":","# If none are found, attempt to download the pdb, convert it and try again","cls",".","download_pdb_isf","(","context",",","guid",".","upper","(",")",",","age",",","pdb_name",",","progress_callback",")","# Try again","for","value","in","intermed",".","IntermediateSymbolTable",".","file_symbol_url","(","\"windows\"",",","filter_string",")",":","isf_path","=","value","break","if","not","isf_path",":","vollog",".","debug","(","\"Required symbol library path not found: {}\"",".","format","(","filter_string",")",")","return","None","vollog",".","debug","(","\"Using symbol library: {}\"",".","format","(","filter_string",")",")","# Set the discovered options","join","=","interfaces",".","configuration",".","path_join","context",".","config","[","join","(","config_path",",","\"class\"",")","]","=","symbol_table_class","context",".","config","[","join","(","config_path",",","\"isf_url\"",")","]","=","isf_path","parent_config_path","=","interfaces",".","configuration",".","parent_path","(","config_path",")","requirement_name","=","interfaces",".","configuration",".","path_head","(","config_path",")","# Construct the appropriate symbol table","requirement","=","SymbolTableRequirement","(","name","=","requirement_name",",","description","=","\"PDBUtility generated symbol table\"",")","requirement",".","construct","(","context",",","parent_config_path",")","return","context",".","config","[","config_path","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdb.py#L58-L99"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdb.py","language":"python","identifier":"PDBUtility.get_guid_from_mz","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n offset: int)","argument_list":"","return_statement":"return guid, age, pdb_name","docstring":"Takes the offset to an MZ header, locates any available pdb headers, and extracts the guid, age and pdb_name from them\n\n Args:\n context: The context on which to operate\n layer_name: The name of the (contiguous) layer within the context that contains the MZ file\n offset: The offset in the layer at which the MZ file begins\n\n Returns:\n A tuple of the guid, age and pdb_name, or None if no PDB record can be found","docstring_summary":"Takes the offset to an MZ header, locates any available pdb headers, and extracts the guid, age and pdb_name from them","docstring_tokens":["Takes","the","offset","to","an","MZ","header","locates","any","available","pdb","headers","and","extracts","the","guid","age","and","pdb_name","from","them"],"function":"def get_guid_from_mz(cls, context: interfaces.context.ContextInterface, layer_name: str,\n offset: int) -> Optional[Tuple[str, int, str]]:\n \"\"\"Takes the offset to an MZ header, locates any available pdb headers, and extracts the guid, age and pdb_name from them\n\n Args:\n context: The context on which to operate\n layer_name: The name of the (contiguous) layer within the context that contains the MZ file\n offset: The offset in the layer at which the MZ file begins\n\n Returns:\n A tuple of the guid, age and pdb_name, or None if no PDB record can be found\n \"\"\"\n try:\n import pefile\n except ImportError:\n vollog.error(\"Get_guid_from_mz requires the following python module: pefile\")\n return None\n\n layer = context.layers[layer_name]\n mz_sig = layer.read(offset, 2)\n\n # Check it is actually the MZ header\n if mz_sig != b\"MZ\":\n return None\n\n nt_header_start = ord(layer.read(offset + 0x3C, 1))\n optional_header_size = struct.unpack('","Optional","[","Tuple","[","str",",","int",",","str","]","]",":","try",":","import","pefile","except","ImportError",":","vollog",".","error","(","\"Get_guid_from_mz requires the following python module: pefile\"",")","return","None","layer","=","context",".","layers","[","layer_name","]","mz_sig","=","layer",".","read","(","offset",",","2",")","# Check it is actually the MZ header","if","mz_sig","!=","b\"MZ\"",":","return","None","nt_header_start","=","ord","(","layer",".","read","(","offset","+","0x3C",",","1",")",")","optional_header_size","=","struct",".","unpack","(","' None:\n \"\"\"Attempts to download the PDB file, convert it to an ISF file and\n save it to one of the symbol locations.\"\"\"\n # Check for writability\n filter_string = os.path.join(pdb_name, guid + \"-\" + str(age))\n for path in symbols.__path__:\n\n # Store any temporary files created by downloading PDB files\n tmp_files = []\n potential_output_filename = os.path.join(path, \"windows\", filter_string + \".json.xz\")\n data_written = False\n try:\n os.makedirs(os.path.dirname(potential_output_filename), exist_ok = True)\n with lzma.open(potential_output_filename, \"w\") as of:\n # Once we haven't thrown an error, do the computation\n filename = pdbconv.PdbRetreiver().retreive_pdb(guid + str(age),\n file_name = pdb_name,\n progress_callback = progress_callback)\n if filename:\n tmp_files.append(filename)\n location = \"file:\" + request.pathname2url(tmp_files[-1])\n json_output = pdbconv.PdbReader(context, location, progress_callback).get_json()\n of.write(bytes(json.dumps(json_output, indent = 2, sort_keys = True), 'utf-8'))\n # After we've successfully written it out, record the fact so we don't clear it out\n data_written = True\n else:\n vollog.warning(\"Symbol file could not be found on remote server\" + (\" \" * 100))\n break\n except PermissionError:\n vollog.warning(\"Cannot write necessary symbol file, please check permissions on {}\".format(\n potential_output_filename))\n continue\n finally:\n # If something else failed, removed the symbol file so we don't pick it up in the future\n if not data_written and os.path.exists(potential_output_filename):\n os.remove(potential_output_filename)\n # Clear out all the temporary file if we constructed one\n for filename in tmp_files:\n try:\n os.remove(filename)\n except PermissionError:\n vollog.warning(\"Temporary file could not be removed: {}\".format(filename))\n else:\n vollog.warning(\"Cannot write downloaded symbols, please add the appropriate symbols\"\n \" or add\/modify a symbols directory that is writable\")","function_tokens":["def","download_pdb_isf","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","guid",":","str",",","age",":","int",",","pdb_name",":","str",",","progress_callback",":","constants",".","ProgressCallback","=","None",")","->","None",":","# Check for writability","filter_string","=","os",".","path",".","join","(","pdb_name",",","guid","+","\"-\"","+","str","(","age",")",")","for","path","in","symbols",".","__path__",":","# Store any temporary files created by downloading PDB files","tmp_files","=","[","]","potential_output_filename","=","os",".","path",".","join","(","path",",","\"windows\"",",","filter_string","+","\".json.xz\"",")","data_written","=","False","try",":","os",".","makedirs","(","os",".","path",".","dirname","(","potential_output_filename",")",",","exist_ok","=","True",")","with","lzma",".","open","(","potential_output_filename",",","\"w\"",")","as","of",":","# Once we haven't thrown an error, do the computation","filename","=","pdbconv",".","PdbRetreiver","(",")",".","retreive_pdb","(","guid","+","str","(","age",")",",","file_name","=","pdb_name",",","progress_callback","=","progress_callback",")","if","filename",":","tmp_files",".","append","(","filename",")","location","=","\"file:\"","+","request",".","pathname2url","(","tmp_files","[","-","1","]",")","json_output","=","pdbconv",".","PdbReader","(","context",",","location",",","progress_callback",")",".","get_json","(",")","of",".","write","(","bytes","(","json",".","dumps","(","json_output",",","indent","=","2",",","sort_keys","=","True",")",",","'utf-8'",")",")","# After we've successfully written it out, record the fact so we don't clear it out","data_written","=","True","else",":","vollog",".","warning","(","\"Symbol file could not be found on remote server\"","+","(","\" \"","*","100",")",")","break","except","PermissionError",":","vollog",".","warning","(","\"Cannot write necessary symbol file, please check permissions on {}\"",".","format","(","potential_output_filename",")",")","continue","finally",":","# If something else failed, removed the symbol file so we don't pick it up in the future","if","not","data_written","and","os",".","path",".","exists","(","potential_output_filename",")",":","os",".","remove","(","potential_output_filename",")","# Clear out all the temporary file if we constructed one","for","filename","in","tmp_files",":","try",":","os",".","remove","(","filename",")","except","PermissionError",":","vollog",".","warning","(","\"Temporary file could not be removed: {}\"",".","format","(","filename",")",")","else",":","vollog",".","warning","(","\"Cannot write downloaded symbols, please add the appropriate symbols\"","\" or add\/modify a symbols directory that is writable\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdb.py#L150-L199"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdb.py","language":"python","identifier":"PDBUtility.pdbname_scan","parameters":"(cls,\n ctx: interfaces.context.ContextInterface,\n layer_name: str,\n page_size: int,\n pdb_names: List[bytes],\n progress_callback: constants.ProgressCallback = None,\n start: Optional[int] = None,\n end: Optional[int] = None)","argument_list":"","return_statement":"","docstring":"Scans through `layer_name` at `ctx` looking for RSDS headers that\n indicate one of four common pdb kernel names (as listed in\n `self.pdb_names`) and returns the tuple (GUID, age, pdb_name,\n signature_offset, mz_offset)\n\n .. note:: This is automagical and therefore not guaranteed to provide correct results.\n\n The UI should always provide the user an opportunity to specify the\n appropriate types and PDB values themselves","docstring_summary":"Scans through `layer_name` at `ctx` looking for RSDS headers that\n indicate one of four common pdb kernel names (as listed in\n `self.pdb_names`) and returns the tuple (GUID, age, pdb_name,\n signature_offset, mz_offset)","docstring_tokens":["Scans","through","layer_name","at","ctx","looking","for","RSDS","headers","that","indicate","one","of","four","common","pdb","kernel","names","(","as","listed","in","self",".","pdb_names",")","and","returns","the","tuple","(","GUID","age","pdb_name","signature_offset","mz_offset",")"],"function":"def pdbname_scan(cls,\n ctx: interfaces.context.ContextInterface,\n layer_name: str,\n page_size: int,\n pdb_names: List[bytes],\n progress_callback: constants.ProgressCallback = None,\n start: Optional[int] = None,\n end: Optional[int] = None) -> Generator[Dict[str, Optional[Union[bytes, str, int]]], None, None]:\n \"\"\"Scans through `layer_name` at `ctx` looking for RSDS headers that\n indicate one of four common pdb kernel names (as listed in\n `self.pdb_names`) and returns the tuple (GUID, age, pdb_name,\n signature_offset, mz_offset)\n\n .. note:: This is automagical and therefore not guaranteed to provide correct results.\n\n The UI should always provide the user an opportunity to specify the\n appropriate types and PDB values themselves\n \"\"\"\n min_pfn = 0\n\n if start is None:\n start = ctx.layers[layer_name].minimum_address\n if end is None:\n end = ctx.layers[layer_name].maximum_address\n\n for (GUID, age, pdb_name,\n signature_offset) in ctx.layers[layer_name].scan(ctx,\n PdbSignatureScanner(pdb_names),\n progress_callback = progress_callback,\n sections = [(start, end - start)]):\n mz_offset = None\n sig_pfn = signature_offset \/\/ page_size\n\n for i in range(sig_pfn, min_pfn, -1):\n if not ctx.layers[layer_name].is_valid(i * page_size, 2):\n break\n\n data = ctx.layers[layer_name].read(i * page_size, 2)\n if data == b'MZ':\n mz_offset = i * page_size\n break\n min_pfn = sig_pfn\n\n yield {\n 'GUID': GUID,\n 'age': age,\n 'pdb_name': str(pdb_name, \"utf-8\"),\n 'signature_offset': signature_offset,\n 'mz_offset': mz_offset\n }","function_tokens":["def","pdbname_scan","(","cls",",","ctx",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","page_size",":","int",",","pdb_names",":","List","[","bytes","]",",","progress_callback",":","constants",".","ProgressCallback","=","None",",","start",":","Optional","[","int","]","=","None",",","end",":","Optional","[","int","]","=","None",")","->","Generator","[","Dict","[","str",",","Optional","[","Union","[","bytes",",","str",",","int","]","]","]",",","None",",","None","]",":","min_pfn","=","0","if","start","is","None",":","start","=","ctx",".","layers","[","layer_name","]",".","minimum_address","if","end","is","None",":","end","=","ctx",".","layers","[","layer_name","]",".","maximum_address","for","(","GUID",",","age",",","pdb_name",",","signature_offset",")","in","ctx",".","layers","[","layer_name","]",".","scan","(","ctx",",","PdbSignatureScanner","(","pdb_names",")",",","progress_callback","=","progress_callback",",","sections","=","[","(","start",",","end","-","start",")","]",")",":","mz_offset","=","None","sig_pfn","=","signature_offset","\/\/","page_size","for","i","in","range","(","sig_pfn",",","min_pfn",",","-","1",")",":","if","not","ctx",".","layers","[","layer_name","]",".","is_valid","(","i","*","page_size",",","2",")",":","break","data","=","ctx",".","layers","[","layer_name","]",".","read","(","i","*","page_size",",","2",")","if","data","==","b'MZ'",":","mz_offset","=","i","*","page_size","break","min_pfn","=","sig_pfn","yield","{","'GUID'",":","GUID",",","'age'",":","age",",","'pdb_name'",":","str","(","pdb_name",",","\"utf-8\"",")",",","'signature_offset'",":","signature_offset",",","'mz_offset'",":","mz_offset","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdb.py#L202-L251"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.load_pdb_layer","parameters":"(cls, context: interfaces.context.ContextInterface,\n location: str)","argument_list":"","return_statement":"return msf_layer_name, new_context","docstring":"Loads a PDB file into a layer within the context and returns the\n name of the new layer.\n\n Note: the context may be changed by this method","docstring_summary":"Loads a PDB file into a layer within the context and returns the\n name of the new layer.","docstring_tokens":["Loads","a","PDB","file","into","a","layer","within","the","context","and","returns","the","name","of","the","new","layer","."],"function":"def load_pdb_layer(cls, context: interfaces.context.ContextInterface,\n location: str) -> Tuple[str, interfaces.context.ContextInterface]:\n \"\"\"Loads a PDB file into a layer within the context and returns the\n name of the new layer.\n\n Note: the context may be changed by this method\n \"\"\"\n physical_layer_name = context.layers.free_layer_name(\"FileLayer\")\n physical_config_path = interfaces.configuration.path_join(\"pdbreader\", physical_layer_name)\n\n # Create the file layer\n # This must be specific to get us started, setup the config and run\n new_context = context.clone()\n new_context.config[interfaces.configuration.path_join(physical_config_path, \"location\")] = location\n\n physical_layer = physical.FileLayer(new_context, physical_config_path, physical_layer_name)\n new_context.add_layer(physical_layer)\n\n # Add on the MSF format layer\n msf_layer_name = context.layers.free_layer_name(\"MSFLayer\")\n msf_config_path = interfaces.configuration.path_join(\"pdbreader\", msf_layer_name)\n new_context.config[interfaces.configuration.path_join(msf_config_path, \"base_layer\")] = physical_layer_name\n msf_layer = msf.PdbMultiStreamFormat(new_context, msf_config_path, msf_layer_name)\n new_context.add_layer(msf_layer)\n\n msf_layer.read_streams()\n\n return msf_layer_name, new_context","function_tokens":["def","load_pdb_layer","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","location",":","str",")","->","Tuple","[","str",",","interfaces",".","context",".","ContextInterface","]",":","physical_layer_name","=","context",".","layers",".","free_layer_name","(","\"FileLayer\"",")","physical_config_path","=","interfaces",".","configuration",".","path_join","(","\"pdbreader\"",",","physical_layer_name",")","# Create the file layer","# This must be specific to get us started, setup the config and run","new_context","=","context",".","clone","(",")","new_context",".","config","[","interfaces",".","configuration",".","path_join","(","physical_config_path",",","\"location\"",")","]","=","location","physical_layer","=","physical",".","FileLayer","(","new_context",",","physical_config_path",",","physical_layer_name",")","new_context",".","add_layer","(","physical_layer",")","# Add on the MSF format layer","msf_layer_name","=","context",".","layers",".","free_layer_name","(","\"MSFLayer\"",")","msf_config_path","=","interfaces",".","configuration",".","path_join","(","\"pdbreader\"",",","msf_layer_name",")","new_context",".","config","[","interfaces",".","configuration",".","path_join","(","msf_config_path",",","\"base_layer\"",")","]","=","physical_layer_name","msf_layer","=","msf",".","PdbMultiStreamFormat","(","new_context",",","msf_config_path",",","msf_layer_name",")","new_context",".","add_layer","(","msf_layer",")","msf_layer",".","read_streams","(",")","return","msf_layer_name",",","new_context"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L287-L314"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.read_necessary_streams","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Read streams to populate the various internal components for a PDB\n table.","docstring_summary":"Read streams to populate the various internal components for a PDB\n table.","docstring_tokens":["Read","streams","to","populate","the","various","internal","components","for","a","PDB","table","."],"function":"def read_necessary_streams(self):\n \"\"\"Read streams to populate the various internal components for a PDB\n table.\"\"\"\n if not self.metadata['windows'].get('pdb', None):\n self.read_pdb_info_stream()\n if not self.user_types:\n self.read_tpi_stream()\n if not self.symbols:\n self.read_symbol_stream()","function_tokens":["def","read_necessary_streams","(","self",")",":","if","not","self",".","metadata","[","'windows'","]",".","get","(","'pdb'",",","None",")",":","self",".","read_pdb_info_stream","(",")","if","not","self",".","user_types",":","self",".","read_tpi_stream","(",")","if","not","self",".","symbols",":","self",".","read_symbol_stream","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L324-L332"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.read_tpi_stream","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Reads the TPI type steam.","docstring_summary":"Reads the TPI type steam.","docstring_tokens":["Reads","the","TPI","type","steam","."],"function":"def read_tpi_stream(self) -> None:\n \"\"\"Reads the TPI type steam.\"\"\"\n vollog.debug(\"Reading TPI\")\n tpi_layer = self._context.layers.get(self._layer_name + \"_stream2\", None)\n if not tpi_layer:\n raise ValueError(\"No TPI stream available\")\n module = self._context.module(module_name = tpi_layer.pdb_symbol_table, layer_name = tpi_layer.name, offset = 0)\n header = module.object(object_type = \"TPI_HEADER\", offset = 0)\n\n # Check the header\n if not (56 <= header.header_size < 1024):\n raise ValueError(\"TPI Stream Header size outside normal bounds\")\n if header.index_min < 4096:\n raise ValueError(\"Minimum TPI index is 4096, found: {}\".format(header.index_min))\n if header.index_max < header.index_min:\n raise ValueError(\"Maximum TPI index is smaller than minimum TPI index, found: {} < {} \".format(\n header.index_max, header.index_min))\n\n # Reset the state\n self.types = []\n type_references = {} # type: Dict[str, int]\n\n offset = header.header_size\n # Ensure we use the same type everywhere\n length_type = \"unsigned short\"\n length_len = module.get_type(length_type).size\n type_index = 1\n while tpi_layer.maximum_address - offset > 0:\n self._progress_callback(offset * 100 \/ tpi_layer.maximum_address, \"Reading TPI layer\")\n length = module.object(object_type = length_type, offset = offset)\n if not isinstance(length, int):\n raise TypeError(\"Non-integer length provided\")\n offset += length_len\n output, consumed = self.consume_type(module, offset, length)\n leaf_type, name, value = output\n for tag_type in ['unnamed', 'anonymous']:\n if name == '<{}-tag>'.format(tag_type) or name == '__{}'.format(tag_type):\n name = '__{}_'.format(tag_type) + hex(len(self.types) + 0x1000)[2:]\n if name:\n type_references[name] = len(self.types)\n self.types.append((leaf_type, name, value))\n offset += length\n type_index += 1\n # Since types can only refer to earlier types, assigning the name at this point is fine\n\n if tpi_layer.maximum_address - offset != 0:\n raise ValueError(\"Type values did not fill the TPI stream correctly\")\n\n self.process_types(type_references)","function_tokens":["def","read_tpi_stream","(","self",")","->","None",":","vollog",".","debug","(","\"Reading TPI\"",")","tpi_layer","=","self",".","_context",".","layers",".","get","(","self",".","_layer_name","+","\"_stream2\"",",","None",")","if","not","tpi_layer",":","raise","ValueError","(","\"No TPI stream available\"",")","module","=","self",".","_context",".","module","(","module_name","=","tpi_layer",".","pdb_symbol_table",",","layer_name","=","tpi_layer",".","name",",","offset","=","0",")","header","=","module",".","object","(","object_type","=","\"TPI_HEADER\"",",","offset","=","0",")","# Check the header","if","not","(","56","<=","header",".","header_size","<","1024",")",":","raise","ValueError","(","\"TPI Stream Header size outside normal bounds\"",")","if","header",".","index_min","<","4096",":","raise","ValueError","(","\"Minimum TPI index is 4096, found: {}\"",".","format","(","header",".","index_min",")",")","if","header",".","index_max","<","header",".","index_min",":","raise","ValueError","(","\"Maximum TPI index is smaller than minimum TPI index, found: {} < {} \"",".","format","(","header",".","index_max",",","header",".","index_min",")",")","# Reset the state","self",".","types","=","[","]","type_references","=","{","}","# type: Dict[str, int]","offset","=","header",".","header_size","# Ensure we use the same type everywhere","length_type","=","\"unsigned short\"","length_len","=","module",".","get_type","(","length_type",")",".","size","type_index","=","1","while","tpi_layer",".","maximum_address","-","offset",">","0",":","self",".","_progress_callback","(","offset","*","100","\/","tpi_layer",".","maximum_address",",","\"Reading TPI layer\"",")","length","=","module",".","object","(","object_type","=","length_type",",","offset","=","offset",")","if","not","isinstance","(","length",",","int",")",":","raise","TypeError","(","\"Non-integer length provided\"",")","offset","+=","length_len","output",",","consumed","=","self",".","consume_type","(","module",",","offset",",","length",")","leaf_type",",","name",",","value","=","output","for","tag_type","in","[","'unnamed'",",","'anonymous'","]",":","if","name","==","'<{}-tag>'",".","format","(","tag_type",")","or","name","==","'__{}'",".","format","(","tag_type",")",":","name","=","'__{}_'",".","format","(","tag_type",")","+","hex","(","len","(","self",".","types",")","+","0x1000",")","[","2",":","]","if","name",":","type_references","[","name","]","=","len","(","self",".","types",")","self",".","types",".","append","(","(","leaf_type",",","name",",","value",")",")","offset","+=","length","type_index","+=","1","# Since types can only refer to earlier types, assigning the name at this point is fine","if","tpi_layer",".","maximum_address","-","offset","!=","0",":","raise","ValueError","(","\"Type values did not fill the TPI stream correctly\"",")","self",".","process_types","(","type_references",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L334-L382"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.read_dbi_stream","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Reads the DBI Stream.","docstring_summary":"Reads the DBI Stream.","docstring_tokens":["Reads","the","DBI","Stream","."],"function":"def read_dbi_stream(self) -> None:\n \"\"\"Reads the DBI Stream.\"\"\"\n vollog.debug(\"Reading DBI stream\")\n dbi_layer = self._context.layers.get(self._layer_name + \"_stream3\", None)\n if not dbi_layer:\n raise ValueError(\"No DBI stream available\")\n module = self._context.module(module_name = dbi_layer.pdb_symbol_table, layer_name = dbi_layer.name, offset = 0)\n self._dbiheader = module.object(object_type = \"DBI_HEADER\", offset = 0)\n\n if not self._dbiheader:\n raise ValueError(\"DBI Header could not be read\")\n\n # Skip past sections we don't care about to get to the DBG header\n dbg_hdr_offset = (self._dbiheader.vol.size + self._dbiheader.module_size + self._dbiheader.secconSize +\n self._dbiheader.secmapSize + self._dbiheader.filinfSize + self._dbiheader.tsmapSize +\n self._dbiheader.ecinfoSize)\n self._dbidbgheader = module.object(object_type = \"DBI_DBG_HEADER\", offset = dbg_hdr_offset)\n\n self._sections = []\n self._omap_mapping = []\n\n if self._dbidbgheader.snSectionHdrOrig != -1:\n section_orig_layer_name = self._layer_name + \"_stream\" + str(self._dbidbgheader.snSectionHdrOrig)\n consumed, length = 0, self.context.layers[section_orig_layer_name].maximum_address\n while consumed < length:\n section = self.context.object(dbi_layer.pdb_symbol_table + constants.BANG + \"IMAGE_SECTION_HEADER\",\n offset = consumed,\n layer_name = section_orig_layer_name)\n self._sections.append(section)\n consumed += section.vol.size\n\n if self._dbidbgheader.snOmapFromSrc != -1:\n omap_layer_name = self._layer_name + \"_stream\" + str(self._dbidbgheader.snOmapFromSrc)\n length = self.context.layers[omap_layer_name].maximum_address\n data = self.context.layers[omap_layer_name].read(0, length)\n # For speed we don't use the framework to read this (usually sizeable) data\n for i in range(0, length, 8):\n self._omap_mapping.append(\n (int.from_bytes(data[i:i + 4],\n byteorder = 'little'), int.from_bytes(data[i + 4:i + 8], byteorder = 'little')))\n elif self._dbidbgheader.snSectionHdr != -1:\n section_layer_name = self._layer_name + \"_stream\" + str(self._dbidbgheader.snSectionHdr)\n consumed, length = 0, self.context.layers[section_layer_name].maximum_address\n while consumed < length:\n section = self.context.object(dbi_layer.pdb_symbol_table + constants.BANG + \"IMAGE_SECTION_HEADER\",\n offset = consumed,\n layer_name = section_layer_name)\n self._sections.append(section)\n consumed += section.vol.size","function_tokens":["def","read_dbi_stream","(","self",")","->","None",":","vollog",".","debug","(","\"Reading DBI stream\"",")","dbi_layer","=","self",".","_context",".","layers",".","get","(","self",".","_layer_name","+","\"_stream3\"",",","None",")","if","not","dbi_layer",":","raise","ValueError","(","\"No DBI stream available\"",")","module","=","self",".","_context",".","module","(","module_name","=","dbi_layer",".","pdb_symbol_table",",","layer_name","=","dbi_layer",".","name",",","offset","=","0",")","self",".","_dbiheader","=","module",".","object","(","object_type","=","\"DBI_HEADER\"",",","offset","=","0",")","if","not","self",".","_dbiheader",":","raise","ValueError","(","\"DBI Header could not be read\"",")","# Skip past sections we don't care about to get to the DBG header","dbg_hdr_offset","=","(","self",".","_dbiheader",".","vol",".","size","+","self",".","_dbiheader",".","module_size","+","self",".","_dbiheader",".","secconSize","+","self",".","_dbiheader",".","secmapSize","+","self",".","_dbiheader",".","filinfSize","+","self",".","_dbiheader",".","tsmapSize","+","self",".","_dbiheader",".","ecinfoSize",")","self",".","_dbidbgheader","=","module",".","object","(","object_type","=","\"DBI_DBG_HEADER\"",",","offset","=","dbg_hdr_offset",")","self",".","_sections","=","[","]","self",".","_omap_mapping","=","[","]","if","self",".","_dbidbgheader",".","snSectionHdrOrig","!=","-","1",":","section_orig_layer_name","=","self",".","_layer_name","+","\"_stream\"","+","str","(","self",".","_dbidbgheader",".","snSectionHdrOrig",")","consumed",",","length","=","0",",","self",".","context",".","layers","[","section_orig_layer_name","]",".","maximum_address","while","consumed","<","length",":","section","=","self",".","context",".","object","(","dbi_layer",".","pdb_symbol_table","+","constants",".","BANG","+","\"IMAGE_SECTION_HEADER\"",",","offset","=","consumed",",","layer_name","=","section_orig_layer_name",")","self",".","_sections",".","append","(","section",")","consumed","+=","section",".","vol",".","size","if","self",".","_dbidbgheader",".","snOmapFromSrc","!=","-","1",":","omap_layer_name","=","self",".","_layer_name","+","\"_stream\"","+","str","(","self",".","_dbidbgheader",".","snOmapFromSrc",")","length","=","self",".","context",".","layers","[","omap_layer_name","]",".","maximum_address","data","=","self",".","context",".","layers","[","omap_layer_name","]",".","read","(","0",",","length",")","# For speed we don't use the framework to read this (usually sizeable) data","for","i","in","range","(","0",",","length",",","8",")",":","self",".","_omap_mapping",".","append","(","(","int",".","from_bytes","(","data","[","i",":","i","+","4","]",",","byteorder","=","'little'",")",",","int",".","from_bytes","(","data","[","i","+","4",":","i","+","8","]",",","byteorder","=","'little'",")",")",")","elif","self",".","_dbidbgheader",".","snSectionHdr","!=","-","1",":","section_layer_name","=","self",".","_layer_name","+","\"_stream\"","+","str","(","self",".","_dbidbgheader",".","snSectionHdr",")","consumed",",","length","=","0",",","self",".","context",".","layers","[","section_layer_name","]",".","maximum_address","while","consumed","<","length",":","section","=","self",".","context",".","object","(","dbi_layer",".","pdb_symbol_table","+","constants",".","BANG","+","\"IMAGE_SECTION_HEADER\"",",","offset","=","consumed",",","layer_name","=","section_layer_name",")","self",".","_sections",".","append","(","section",")","consumed","+=","section",".","vol",".","size"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L384-L432"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.read_symbol_stream","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Reads in the symbol stream.","docstring_summary":"Reads in the symbol stream.","docstring_tokens":["Reads","in","the","symbol","stream","."],"function":"def read_symbol_stream(self):\n \"\"\"Reads in the symbol stream.\"\"\"\n self.symbols = {}\n\n if not self._dbiheader:\n self.read_dbi_stream()\n\n vollog.debug(\"Reading Symbols\")\n\n symrec_layer = self._context.layers.get(self._layer_name + \"_stream\" + str(self._dbiheader.symrecStream), None)\n if not symrec_layer:\n raise ValueError(\"No SymRec stream available\")\n module = self._context.module(module_name = symrec_layer.pdb_symbol_table,\n layer_name = symrec_layer.name,\n offset = 0)\n\n offset = 0\n max_address = symrec_layer.maximum_address\n\n while offset < max_address:\n self._progress_callback(offset * 100 \/ max_address, \"Reading Symbol layer\")\n sym = module.object(object_type = \"GLOBAL_SYMBOL\", offset = offset)\n leaf_type = module.object(object_type = \"unsigned short\", offset = sym.leaf_type.vol.offset)\n name = None\n address = None\n if sym.segment < len(self._sections):\n if leaf_type == 0x110e:\n # v3 symbol (c-string)\n name = self.parse_string(sym.name, False, sym.length - sym.vol.size + 2)\n address = self._sections[sym.segment - 1].VirtualAddress + sym.offset\n elif leaf_type == 0x1009:\n # v2 symbol (pascal-string)\n name = self.parse_string(sym.name, True, sym.length - sym.vol.size + 2)\n address = self._sections[sym.segment - 1].VirtualAddress + sym.offset\n else:\n vollog.debug(\"Only v2 and v3 symbols are supported\")\n if name:\n if self._omap_mapping:\n address = self.omap_lookup(address)\n stripped_name = self.name_strip(name)\n self.symbols[stripped_name] = {\"address\": address}\n if name != self.name_strip(name):\n self.symbols[stripped_name][\"linkage_name\"] = name\n offset += sym.length + 2","function_tokens":["def","read_symbol_stream","(","self",")",":","self",".","symbols","=","{","}","if","not","self",".","_dbiheader",":","self",".","read_dbi_stream","(",")","vollog",".","debug","(","\"Reading Symbols\"",")","symrec_layer","=","self",".","_context",".","layers",".","get","(","self",".","_layer_name","+","\"_stream\"","+","str","(","self",".","_dbiheader",".","symrecStream",")",",","None",")","if","not","symrec_layer",":","raise","ValueError","(","\"No SymRec stream available\"",")","module","=","self",".","_context",".","module","(","module_name","=","symrec_layer",".","pdb_symbol_table",",","layer_name","=","symrec_layer",".","name",",","offset","=","0",")","offset","=","0","max_address","=","symrec_layer",".","maximum_address","while","offset","<","max_address",":","self",".","_progress_callback","(","offset","*","100","\/","max_address",",","\"Reading Symbol layer\"",")","sym","=","module",".","object","(","object_type","=","\"GLOBAL_SYMBOL\"",",","offset","=","offset",")","leaf_type","=","module",".","object","(","object_type","=","\"unsigned short\"",",","offset","=","sym",".","leaf_type",".","vol",".","offset",")","name","=","None","address","=","None","if","sym",".","segment","<","len","(","self",".","_sections",")",":","if","leaf_type","==","0x110e",":","# v3 symbol (c-string)","name","=","self",".","parse_string","(","sym",".","name",",","False",",","sym",".","length","-","sym",".","vol",".","size","+","2",")","address","=","self",".","_sections","[","sym",".","segment","-","1","]",".","VirtualAddress","+","sym",".","offset","elif","leaf_type","==","0x1009",":","# v2 symbol (pascal-string)","name","=","self",".","parse_string","(","sym",".","name",",","True",",","sym",".","length","-","sym",".","vol",".","size","+","2",")","address","=","self",".","_sections","[","sym",".","segment","-","1","]",".","VirtualAddress","+","sym",".","offset","else",":","vollog",".","debug","(","\"Only v2 and v3 symbols are supported\"",")","if","name",":","if","self",".","_omap_mapping",":","address","=","self",".","omap_lookup","(","address",")","stripped_name","=","self",".","name_strip","(","name",")","self",".","symbols","[","stripped_name","]","=","{","\"address\"",":","address","}","if","name","!=","self",".","name_strip","(","name",")",":","self",".","symbols","[","stripped_name","]","[","\"linkage_name\"","]","=","name","offset","+=","sym",".","length","+","2"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L434-L477"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.read_pdb_info_stream","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Reads in the pdb information stream.","docstring_summary":"Reads in the pdb information stream.","docstring_tokens":["Reads","in","the","pdb","information","stream","."],"function":"def read_pdb_info_stream(self):\n \"\"\"Reads in the pdb information stream.\"\"\"\n if not self._dbiheader:\n self.read_dbi_stream()\n\n vollog.debug(\"Reading PDB Info\")\n pdb_info_layer = self._context.layers.get(self._layer_name + \"_stream1\", None)\n if not pdb_info_layer:\n raise ValueError(\"No PDB Info Stream available\")\n module = self._context.module(module_name = pdb_info_layer.pdb_symbol_table,\n layer_name = pdb_info_layer.name,\n offset = 0)\n pdb_info = module.object(object_type = \"PDB_INFORMATION\", offset = 0)\n\n self.metadata['windows']['pdb'] = {\n \"GUID\": self.convert_bytes_to_guid(pdb_info.GUID),\n \"age\": pdb_info.age,\n \"database\": \"ntkrnlmp.pdb\",\n \"machine_type\": self._dbiheader.machine\n }","function_tokens":["def","read_pdb_info_stream","(","self",")",":","if","not","self",".","_dbiheader",":","self",".","read_dbi_stream","(",")","vollog",".","debug","(","\"Reading PDB Info\"",")","pdb_info_layer","=","self",".","_context",".","layers",".","get","(","self",".","_layer_name","+","\"_stream1\"",",","None",")","if","not","pdb_info_layer",":","raise","ValueError","(","\"No PDB Info Stream available\"",")","module","=","self",".","_context",".","module","(","module_name","=","pdb_info_layer",".","pdb_symbol_table",",","layer_name","=","pdb_info_layer",".","name",",","offset","=","0",")","pdb_info","=","module",".","object","(","object_type","=","\"PDB_INFORMATION\"",",","offset","=","0",")","self",".","metadata","[","'windows'","]","[","'pdb'","]","=","{","\"GUID\"",":","self",".","convert_bytes_to_guid","(","pdb_info",".","GUID",")",",","\"age\"",":","pdb_info",".","age",",","\"database\"",":","\"ntkrnlmp.pdb\"",",","\"machine_type\"",":","self",".","_dbiheader",".","machine","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L479-L498"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.convert_bytes_to_guid","parameters":"(self, original: bytes)","argument_list":"","return_statement":"return str(binascii.hexlify(bytes(guid_list)), \"latin-1\").upper()","docstring":"Convert the bytes to the correct ordering for a GUID.","docstring_summary":"Convert the bytes to the correct ordering for a GUID.","docstring_tokens":["Convert","the","bytes","to","the","correct","ordering","for","a","GUID","."],"function":"def convert_bytes_to_guid(self, original: bytes) -> str:\n \"\"\"Convert the bytes to the correct ordering for a GUID.\"\"\"\n orig_guid_list = [x for x in original]\n guid_list = []\n for i in [3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15]:\n guid_list.append(orig_guid_list[i])\n return str(binascii.hexlify(bytes(guid_list)), \"latin-1\").upper()","function_tokens":["def","convert_bytes_to_guid","(","self",",","original",":","bytes",")","->","str",":","orig_guid_list","=","[","x","for","x","in","original","]","guid_list","=","[","]","for","i","in","[","3",",","2",",","1",",","0",",","5",",","4",",","7",",","6",",","8",",","9",",","10",",","11",",","12",",","13",",","14",",","15","]",":","guid_list",".","append","(","orig_guid_list","[","i","]",")","return","str","(","binascii",".","hexlify","(","bytes","(","guid_list",")",")",",","\"latin-1\"",")",".","upper","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L500-L506"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.omap_lookup","parameters":"(self, address)","argument_list":"","return_statement":"return self._omap_mapping[pos][1] + (address - self._omap_mapping[pos][0])","docstring":"Looks up an address using the omap mapping.","docstring_summary":"Looks up an address using the omap mapping.","docstring_tokens":["Looks","up","an","address","using","the","omap","mapping","."],"function":"def omap_lookup(self, address):\n \"\"\"Looks up an address using the omap mapping.\"\"\"\n pos = bisect(self._omap_mapping, (address, -1))\n if self._omap_mapping[pos][0] > address:\n pos -= 1\n\n if not self._omap_mapping[pos][1]:\n return 0\n return self._omap_mapping[pos][1] + (address - self._omap_mapping[pos][0])","function_tokens":["def","omap_lookup","(","self",",","address",")",":","pos","=","bisect","(","self",".","_omap_mapping",",","(","address",",","-","1",")",")","if","self",".","_omap_mapping","[","pos","]","[","0","]",">","address",":","pos","-=","1","if","not","self",".","_omap_mapping","[","pos","]","[","1","]",":","return","0","return","self",".","_omap_mapping","[","pos","]","[","1","]","+","(","address","-","self",".","_omap_mapping","[","pos","]","[","0","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L510-L518"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.name_strip","parameters":"(self, name)","argument_list":"","return_statement":"return new_name","docstring":"Strips unnecessary components from the start of a symbol name.","docstring_summary":"Strips unnecessary components from the start of a symbol name.","docstring_tokens":["Strips","unnecessary","components","from","the","start","of","a","symbol","name","."],"function":"def name_strip(self, name):\n \"\"\"Strips unnecessary components from the start of a symbol name.\"\"\"\n new_name = name\n\n if new_name[:1] in [\"_\", \"@\", \"\\u007F\"]:\n new_name = new_name[1:]\n\n name_array = new_name.split(\"@\")\n if len(name_array) == 2:\n if name_array[1].isnumeric() and name_array[0][0] != \"?\":\n new_name = name_array[0]\n else:\n new_name = name\n\n return new_name","function_tokens":["def","name_strip","(","self",",","name",")",":","new_name","=","name","if","new_name","[",":","1","]","in","[","\"_\"",",","\"@\"",",","\"\\u007F\"","]",":","new_name","=","new_name","[","1",":","]","name_array","=","new_name",".","split","(","\"@\"",")","if","len","(","name_array",")","==","2",":","if","name_array","[","1","]",".","isnumeric","(",")","and","name_array","[","0","]","[","0","]","!=","\"?\"",":","new_name","=","name_array","[","0","]","else",":","new_name","=","name","return","new_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L520-L534"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.get_json","parameters":"(self)","argument_list":"","return_statement":"return {\n \"user_types\": self.user_types,\n \"enums\": self.enumerations,\n \"base_types\": self.bases,\n \"symbols\": self.symbols,\n \"metadata\": self.metadata,\n }","docstring":"Returns the intermediate format JSON data from this pdb file.","docstring_summary":"Returns the intermediate format JSON data from this pdb file.","docstring_tokens":["Returns","the","intermediate","format","JSON","data","from","this","pdb","file","."],"function":"def get_json(self):\n \"\"\"Returns the intermediate format JSON data from this pdb file.\"\"\"\n self.read_necessary_streams()\n\n # Set the time\/datestamp for the output\n self.metadata[\"producer\"] = {\n \"datetime\": datetime.datetime.now().isoformat(),\n \"name\": \"volatility3\",\n \"version\": constants.PACKAGE_VERSION\n }\n\n return {\n \"user_types\": self.user_types,\n \"enums\": self.enumerations,\n \"base_types\": self.bases,\n \"symbols\": self.symbols,\n \"metadata\": self.metadata,\n }","function_tokens":["def","get_json","(","self",")",":","self",".","read_necessary_streams","(",")","# Set the time\/datestamp for the output","self",".","metadata","[","\"producer\"","]","=","{","\"datetime\"",":","datetime",".","datetime",".","now","(",")",".","isoformat","(",")",",","\"name\"",":","\"volatility3\"",",","\"version\"",":","constants",".","PACKAGE_VERSION","}","return","{","\"user_types\"",":","self",".","user_types",",","\"enums\"",":","self",".","enumerations",",","\"base_types\"",":","self",".","bases",",","\"symbols\"",":","self",".","symbols",",","\"metadata\"",":","self",".","metadata",",","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L536-L553"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.get_type_from_index","parameters":"(self, index: int)","argument_list":"","return_statement":"","docstring":"Takes a type index and returns appropriate dictionary.","docstring_summary":"Takes a type index and returns appropriate dictionary.","docstring_tokens":["Takes","a","type","index","and","returns","appropriate","dictionary","."],"function":"def get_type_from_index(self, index: int) -> Union[List[Any], Dict[str, Any]]:\n \"\"\"Takes a type index and returns appropriate dictionary.\"\"\"\n if index < 0x1000:\n base_name, base = primatives[index & 0xff]\n self.bases[base_name] = base\n result = {\"kind\": \"base\", \"name\": base_name} # type: Union[List[Dict[str, Any]], Dict[str, Any]]\n indirection = (index & 0xf00)\n if indirection:\n pointer_name, pointer_base = indirections[indirection]\n if self.bases.get('pointer', None) and self.bases['pointer'] == pointer_base:\n result = {\"kind\": \"pointer\", \"subtype\": result}\n else:\n self.bases[pointer_name] = pointer_base\n result = {\"kind\": \"pointer\", \"base\": pointer_name, \"subtype\": result}\n return result\n else:\n leaf_type, name, value = self.types[index - 0x1000]\n result = {\"kind\": \"struct\", \"name\": name}\n if leaf_type in [leaf_type.LF_MODIFIER]:\n result = self.get_type_from_index(value.subtype_index)\n elif leaf_type in [leaf_type.LF_ARRAY, leaf_type.LF_ARRAY_ST, leaf_type.LF_STRIDED_ARRAY]:\n result = {\n \"count\": ForwardArrayCount(value.size, value.element_type),\n \"kind\": \"array\",\n \"subtype\": self.get_type_from_index(value.element_type)\n }\n elif leaf_type in [leaf_type.LF_BITFIELD]:\n result = {\n \"kind\": \"bitfield\",\n \"type\": self.get_type_from_index(value.underlying_type),\n \"bit_length\": value.length,\n \"bit_position\": value.position\n }\n elif leaf_type in [leaf_type.LF_POINTER]:\n # Since we use the base['pointer'] to set the size for pointers, update it and check we don't get conflicts\n size = self.get_size_from_index(index)\n if self.bases.get(\"pointer\", None) is None:\n self.bases['pointer'] = {\"endian\": \"little\", \"kind\": \"int\", \"signed\": False, \"size\": size}\n else:\n if size != self.bases['pointer']['size']:\n raise ValueError(\"Native pointers with different sizes!\")\n result = {\"kind\": \"pointer\", \"subtype\": self.get_type_from_index(value.subtype_index)}\n elif leaf_type in [leaf_type.LF_PROCEDURE]:\n return {\"kind\": \"function\"}\n elif leaf_type in [leaf_type.LF_UNION]:\n result = {\"kind\": \"union\", \"name\": name}\n elif leaf_type in [leaf_type.LF_ENUM]:\n result = {\"kind\": \"enum\", \"name\": name}\n elif leaf_type in [leaf_type.LF_FIELDLIST]:\n result = value\n elif not name:\n raise ValueError(\"No name for structure that should be named\")\n return result","function_tokens":["def","get_type_from_index","(","self",",","index",":","int",")","->","Union","[","List","[","Any","]",",","Dict","[","str",",","Any","]","]",":","if","index","<","0x1000",":","base_name",",","base","=","primatives","[","index","&","0xff","]","self",".","bases","[","base_name","]","=","base","result","=","{","\"kind\"",":","\"base\"",",","\"name\"",":","base_name","}","# type: Union[List[Dict[str, Any]], Dict[str, Any]]","indirection","=","(","index","&","0xf00",")","if","indirection",":","pointer_name",",","pointer_base","=","indirections","[","indirection","]","if","self",".","bases",".","get","(","'pointer'",",","None",")","and","self",".","bases","[","'pointer'","]","==","pointer_base",":","result","=","{","\"kind\"",":","\"pointer\"",",","\"subtype\"",":","result","}","else",":","self",".","bases","[","pointer_name","]","=","pointer_base","result","=","{","\"kind\"",":","\"pointer\"",",","\"base\"",":","pointer_name",",","\"subtype\"",":","result","}","return","result","else",":","leaf_type",",","name",",","value","=","self",".","types","[","index","-","0x1000","]","result","=","{","\"kind\"",":","\"struct\"",",","\"name\"",":","name","}","if","leaf_type","in","[","leaf_type",".","LF_MODIFIER","]",":","result","=","self",".","get_type_from_index","(","value",".","subtype_index",")","elif","leaf_type","in","[","leaf_type",".","LF_ARRAY",",","leaf_type",".","LF_ARRAY_ST",",","leaf_type",".","LF_STRIDED_ARRAY","]",":","result","=","{","\"count\"",":","ForwardArrayCount","(","value",".","size",",","value",".","element_type",")",",","\"kind\"",":","\"array\"",",","\"subtype\"",":","self",".","get_type_from_index","(","value",".","element_type",")","}","elif","leaf_type","in","[","leaf_type",".","LF_BITFIELD","]",":","result","=","{","\"kind\"",":","\"bitfield\"",",","\"type\"",":","self",".","get_type_from_index","(","value",".","underlying_type",")",",","\"bit_length\"",":","value",".","length",",","\"bit_position\"",":","value",".","position","}","elif","leaf_type","in","[","leaf_type",".","LF_POINTER","]",":","# Since we use the base['pointer'] to set the size for pointers, update it and check we don't get conflicts","size","=","self",".","get_size_from_index","(","index",")","if","self",".","bases",".","get","(","\"pointer\"",",","None",")","is","None",":","self",".","bases","[","'pointer'","]","=","{","\"endian\"",":","\"little\"",",","\"kind\"",":","\"int\"",",","\"signed\"",":","False",",","\"size\"",":","size","}","else",":","if","size","!=","self",".","bases","[","'pointer'","]","[","'size'","]",":","raise","ValueError","(","\"Native pointers with different sizes!\"",")","result","=","{","\"kind\"",":","\"pointer\"",",","\"subtype\"",":","self",".","get_type_from_index","(","value",".","subtype_index",")","}","elif","leaf_type","in","[","leaf_type",".","LF_PROCEDURE","]",":","return","{","\"kind\"",":","\"function\"","}","elif","leaf_type","in","[","leaf_type",".","LF_UNION","]",":","result","=","{","\"kind\"",":","\"union\"",",","\"name\"",":","name","}","elif","leaf_type","in","[","leaf_type",".","LF_ENUM","]",":","result","=","{","\"kind\"",":","\"enum\"",",","\"name\"",":","name","}","elif","leaf_type","in","[","leaf_type",".","LF_FIELDLIST","]",":","result","=","value","elif","not","name",":","raise","ValueError","(","\"No name for structure that should be named\"",")","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L555-L607"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.get_size_from_index","parameters":"(self, index: int)","argument_list":"","return_statement":"return result","docstring":"Returns the size of the structure based on the type index\n provided.","docstring_summary":"Returns the size of the structure based on the type index\n provided.","docstring_tokens":["Returns","the","size","of","the","structure","based","on","the","type","index","provided","."],"function":"def get_size_from_index(self, index: int) -> int:\n \"\"\"Returns the size of the structure based on the type index\n provided.\"\"\"\n result = -1\n name = '' # type: Optional[str]\n if index < 0x1000:\n if (index & 0xf00):\n _, base = indirections[index & 0xf00]\n else:\n _, base = primatives[index & 0xff]\n result = base['size']\n else:\n leaf_type, name, value = self.types[index - 0x1000]\n if leaf_type in [\n leaf_type.LF_UNION, leaf_type.LF_CLASS, leaf_type.LF_CLASS_ST, leaf_type.LF_STRUCTURE,\n leaf_type.LF_STRUCTURE_ST, leaf_type.LF_INTERFACE\n ]:\n if not value.properties.forward_reference:\n result = value.size\n elif leaf_type in [leaf_type.LF_ARRAY, leaf_type.LF_ARRAY_ST, leaf_type.LF_STRIDED_ARRAY]:\n result = value.size\n elif leaf_type in [leaf_type.LF_MODIFIER, leaf_type.LF_ENUM, leaf_type.LF_ARGLIST]:\n result = self.get_size_from_index(value.subtype_index)\n elif leaf_type in [leaf_type.LF_MEMBER]:\n result = self.get_size_from_index(value.field_type)\n elif leaf_type in [leaf_type.LF_BITFIELD]:\n result = self.get_size_from_index(value.underlying_type)\n elif leaf_type in [leaf_type.LF_POINTER]:\n result = value.size\n if not result:\n if value.pointer_type == 0x0a:\n return 4\n elif value.pointer_type == 0x0c:\n return 8\n else:\n raise ValueError(\"Pointer size could not be determined\")\n elif leaf_type in [leaf_type.LF_PROCEDURE]:\n raise ValueError(\"LF_PROCEDURE size could not be identified\")\n else:\n raise ValueError(\"Unable to determine size of leaf_type {}\".format(leaf_type.lookup()))\n if result <= 0:\n raise ValueError(\"Invalid size identified: {} ({})\".format(index, name))\n return result","function_tokens":["def","get_size_from_index","(","self",",","index",":","int",")","->","int",":","result","=","-","1","name","=","''","# type: Optional[str]","if","index","<","0x1000",":","if","(","index","&","0xf00",")",":","_",",","base","=","indirections","[","index","&","0xf00","]","else",":","_",",","base","=","primatives","[","index","&","0xff","]","result","=","base","[","'size'","]","else",":","leaf_type",",","name",",","value","=","self",".","types","[","index","-","0x1000","]","if","leaf_type","in","[","leaf_type",".","LF_UNION",",","leaf_type",".","LF_CLASS",",","leaf_type",".","LF_CLASS_ST",",","leaf_type",".","LF_STRUCTURE",",","leaf_type",".","LF_STRUCTURE_ST",",","leaf_type",".","LF_INTERFACE","]",":","if","not","value",".","properties",".","forward_reference",":","result","=","value",".","size","elif","leaf_type","in","[","leaf_type",".","LF_ARRAY",",","leaf_type",".","LF_ARRAY_ST",",","leaf_type",".","LF_STRIDED_ARRAY","]",":","result","=","value",".","size","elif","leaf_type","in","[","leaf_type",".","LF_MODIFIER",",","leaf_type",".","LF_ENUM",",","leaf_type",".","LF_ARGLIST","]",":","result","=","self",".","get_size_from_index","(","value",".","subtype_index",")","elif","leaf_type","in","[","leaf_type",".","LF_MEMBER","]",":","result","=","self",".","get_size_from_index","(","value",".","field_type",")","elif","leaf_type","in","[","leaf_type",".","LF_BITFIELD","]",":","result","=","self",".","get_size_from_index","(","value",".","underlying_type",")","elif","leaf_type","in","[","leaf_type",".","LF_POINTER","]",":","result","=","value",".","size","if","not","result",":","if","value",".","pointer_type","==","0x0a",":","return","4","elif","value",".","pointer_type","==","0x0c",":","return","8","else",":","raise","ValueError","(","\"Pointer size could not be determined\"",")","elif","leaf_type","in","[","leaf_type",".","LF_PROCEDURE","]",":","raise","ValueError","(","\"LF_PROCEDURE size could not be identified\"",")","else",":","raise","ValueError","(","\"Unable to determine size of leaf_type {}\"",".","format","(","leaf_type",".","lookup","(",")",")",")","if","result","<=","0",":","raise","ValueError","(","\"Invalid size identified: {} ({})\"",".","format","(","index",",","name",")",")","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L609-L651"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.process_types","parameters":"(self, type_references: Dict[str, int])","argument_list":"","return_statement":"","docstring":"Reads the TPI and symbol streams to populate the reader's\n variables.","docstring_summary":"Reads the TPI and symbol streams to populate the reader's\n variables.","docstring_tokens":["Reads","the","TPI","and","symbol","streams","to","populate","the","reader","s","variables","."],"function":"def process_types(self, type_references: Dict[str, int]) -> None:\n \"\"\"Reads the TPI and symbol streams to populate the reader's\n variables.\"\"\"\n\n self.bases = {}\n self.user_types = {}\n self.enumerations = {}\n\n max_len = len(self.types)\n for index in range(max_len):\n self._progress_callback(index * 100 \/ max_len, \"Processing types\")\n leaf_type, name, value = self.types[index]\n if leaf_type in [\n leaf_type.LF_CLASS, leaf_type.LF_CLASS_ST, leaf_type.LF_STRUCTURE, leaf_type.LF_STRUCTURE_ST,\n leaf_type.LF_INTERFACE\n ]:\n if not value.properties.forward_reference and name:\n self.user_types[name] = {\n \"kind\": \"struct\",\n \"size\": value.size,\n \"fields\": self.convert_fields(value.fields - 0x1000)\n }\n elif leaf_type in [leaf_type.LF_UNION]:\n if not value.properties.forward_reference and name:\n # Deal with UNION types\n self.user_types[name] = {\n \"kind\": \"union\",\n \"size\": value.size,\n \"fields\": self.convert_fields(value.fields - 0x1000)\n }\n elif leaf_type in [leaf_type.LF_ENUM]:\n if not value.properties.forward_reference and name:\n base = self.get_type_from_index(value.subtype_index)\n if not isinstance(base, Dict):\n raise ValueError(\"Invalid base type returned for Enumeration\")\n constants = self.get_type_from_index(value.fields)\n if not isinstance(constants, list):\n raise ValueError(\"Enumeration fields type not a list\")\n self.enumerations[name] = {\n 'base': base['name'],\n 'size': self.get_size_from_index(value.subtype_index),\n 'constants': dict([(name, enum.value) for _, name, enum in constants])\n }\n\n # Re-run through for ForwardSizeReferences\n self.user_types = self.replace_forward_references(self.user_types, type_references)","function_tokens":["def","process_types","(","self",",","type_references",":","Dict","[","str",",","int","]",")","->","None",":","self",".","bases","=","{","}","self",".","user_types","=","{","}","self",".","enumerations","=","{","}","max_len","=","len","(","self",".","types",")","for","index","in","range","(","max_len",")",":","self",".","_progress_callback","(","index","*","100","\/","max_len",",","\"Processing types\"",")","leaf_type",",","name",",","value","=","self",".","types","[","index","]","if","leaf_type","in","[","leaf_type",".","LF_CLASS",",","leaf_type",".","LF_CLASS_ST",",","leaf_type",".","LF_STRUCTURE",",","leaf_type",".","LF_STRUCTURE_ST",",","leaf_type",".","LF_INTERFACE","]",":","if","not","value",".","properties",".","forward_reference","and","name",":","self",".","user_types","[","name","]","=","{","\"kind\"",":","\"struct\"",",","\"size\"",":","value",".","size",",","\"fields\"",":","self",".","convert_fields","(","value",".","fields","-","0x1000",")","}","elif","leaf_type","in","[","leaf_type",".","LF_UNION","]",":","if","not","value",".","properties",".","forward_reference","and","name",":","# Deal with UNION types","self",".","user_types","[","name","]","=","{","\"kind\"",":","\"union\"",",","\"size\"",":","value",".","size",",","\"fields\"",":","self",".","convert_fields","(","value",".","fields","-","0x1000",")","}","elif","leaf_type","in","[","leaf_type",".","LF_ENUM","]",":","if","not","value",".","properties",".","forward_reference","and","name",":","base","=","self",".","get_type_from_index","(","value",".","subtype_index",")","if","not","isinstance","(","base",",","Dict",")",":","raise","ValueError","(","\"Invalid base type returned for Enumeration\"",")","constants","=","self",".","get_type_from_index","(","value",".","fields",")","if","not","isinstance","(","constants",",","list",")",":","raise","ValueError","(","\"Enumeration fields type not a list\"",")","self",".","enumerations","[","name","]","=","{","'base'",":","base","[","'name'","]",",","'size'",":","self",".","get_size_from_index","(","value",".","subtype_index",")",",","'constants'",":","dict","(","[","(","name",",","enum",".","value",")","for","_",",","name",",","enum","in","constants","]",")","}","# Re-run through for ForwardSizeReferences","self",".","user_types","=","self",".","replace_forward_references","(","self",".","user_types",",","type_references",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L655-L700"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.consume_type","parameters":"(\n self, module: interfaces.context.ModuleInterface, offset: int, length: int\n )","argument_list":"","return_statement":"return result, consumed","docstring":"Returns a (leaf_type, name, object) Tuple for a type, and the number\n of bytes consumed.","docstring_summary":"Returns a (leaf_type, name, object) Tuple for a type, and the number\n of bytes consumed.","docstring_tokens":["Returns","a","(","leaf_type","name","object",")","Tuple","for","a","type","and","the","number","of","bytes","consumed","."],"function":"def consume_type(\n self, module: interfaces.context.ModuleInterface, offset: int, length: int\n ) -> Tuple[Tuple[Optional[interfaces.objects.ObjectInterface], Optional[str], Union[\n None, List, interfaces.objects.ObjectInterface]], int]:\n \"\"\"Returns a (leaf_type, name, object) Tuple for a type, and the number\n of bytes consumed.\"\"\"\n leaf_type = self.context.object(module.get_enumeration(\"LEAF_TYPE\"),\n layer_name = module._layer_name,\n offset = offset)\n consumed = leaf_type.vol.base_type.size\n remaining = length - consumed\n\n if leaf_type in [\n leaf_type.LF_CLASS, leaf_type.LF_CLASS_ST, leaf_type.LF_STRUCTURE, leaf_type.LF_STRUCTURE_ST,\n leaf_type.LF_INTERFACE\n ]:\n structure = module.object(object_type = \"LF_STRUCTURE\", offset = offset + consumed)\n name_offset = structure.name.vol.offset - structure.vol.offset\n name, value, excess = self.determine_extended_value(leaf_type, structure.size, module,\n remaining - name_offset)\n structure.size = value\n structure.name = name\n consumed += remaining\n result = leaf_type, name, structure\n elif leaf_type in [leaf_type.LF_MEMBER, leaf_type.LF_MEMBER_ST]:\n member = module.object(object_type = \"LF_MEMBER\", offset = offset + consumed)\n name_offset = member.name.vol.offset - member.vol.offset\n name, value, excess = self.determine_extended_value(leaf_type, member.offset, module,\n remaining - name_offset)\n member.offset = value\n member.name = name\n result = leaf_type, name, member\n consumed += member.vol.size + len(name) + 1 + excess\n elif leaf_type in [leaf_type.LF_ARRAY, leaf_type.LF_ARRAY_ST, leaf_type.LF_STRIDED_ARRAY]:\n array = module.object(object_type = \"LF_ARRAY\", offset = offset + consumed)\n name_offset = array.name.vol.offset - array.vol.offset\n name, value, excess = self.determine_extended_value(leaf_type, array.size, module, remaining - name_offset)\n array.size = value\n array.name = name\n result = leaf_type, name, array\n consumed += remaining\n elif leaf_type in [leaf_type.LF_ENUMERATE]:\n enum = module.object(object_type = 'LF_ENUMERATE', offset = offset + consumed)\n name_offset = enum.name.vol.offset - enum.vol.offset\n name, value, excess = self.determine_extended_value(leaf_type, enum.value, module, remaining - name_offset)\n enum.value = value\n enum.name = name\n result = leaf_type, name, enum\n consumed += enum.vol.size + len(name) + 1 + excess\n elif leaf_type in [leaf_type.LF_ARGLIST, leaf_type.LF_ENUM]:\n enum = module.object(object_type = \"LF_ENUM\", offset = offset + consumed)\n name_offset = enum.name.vol.offset - enum.vol.offset\n name = self.parse_string(enum.name, leaf_type < leaf_type.LF_ST_MAX, size = remaining - name_offset)\n enum.name = name\n result = leaf_type, name, enum\n consumed += remaining\n elif leaf_type in [leaf_type.LF_UNION]:\n union = module.object(object_type = \"LF_UNION\", offset = offset + consumed)\n name_offset = union.name.vol.offset - union.vol.offset\n name = self.parse_string(union.name, leaf_type < leaf_type.LF_ST_MAX, size = remaining - name_offset)\n result = leaf_type, name, union\n consumed += remaining\n elif leaf_type in [leaf_type.LF_MODIFIER, leaf_type.LF_POINTER, leaf_type.LF_PROCEDURE]:\n obj = module.object(object_type = leaf_type.lookup(), offset = offset + consumed)\n result = leaf_type, None, obj\n consumed += remaining\n elif leaf_type in [leaf_type.LF_FIELDLIST]:\n sub_length = remaining\n sub_offset = offset + consumed\n fields = []\n while length > consumed:\n subfield, sub_consumed = self.consume_type(module, sub_offset, sub_length)\n sub_consumed += self.consume_padding(module.layer_name, sub_offset + sub_consumed)\n sub_length -= sub_consumed\n sub_offset += sub_consumed\n consumed += sub_consumed\n fields.append(subfield)\n result = leaf_type, None, fields\n elif leaf_type in [leaf_type.LF_BITFIELD]:\n bitfield = module.object(object_type = \"LF_BITFIELD\", offset = offset + consumed)\n result = leaf_type, None, bitfield\n consumed += remaining\n else:\n raise TypeError(\"Unhandled leaf_type: {}\".format(leaf_type))\n\n return result, consumed","function_tokens":["def","consume_type","(","self",",","module",":","interfaces",".","context",".","ModuleInterface",",","offset",":","int",",","length",":","int",")","->","Tuple","[","Tuple","[","Optional","[","interfaces",".","objects",".","ObjectInterface","]",",","Optional","[","str","]",",","Union","[","None",",","List",",","interfaces",".","objects",".","ObjectInterface","]","]",",","int","]",":","leaf_type","=","self",".","context",".","object","(","module",".","get_enumeration","(","\"LEAF_TYPE\"",")",",","layer_name","=","module",".","_layer_name",",","offset","=","offset",")","consumed","=","leaf_type",".","vol",".","base_type",".","size","remaining","=","length","-","consumed","if","leaf_type","in","[","leaf_type",".","LF_CLASS",",","leaf_type",".","LF_CLASS_ST",",","leaf_type",".","LF_STRUCTURE",",","leaf_type",".","LF_STRUCTURE_ST",",","leaf_type",".","LF_INTERFACE","]",":","structure","=","module",".","object","(","object_type","=","\"LF_STRUCTURE\"",",","offset","=","offset","+","consumed",")","name_offset","=","structure",".","name",".","vol",".","offset","-","structure",".","vol",".","offset","name",",","value",",","excess","=","self",".","determine_extended_value","(","leaf_type",",","structure",".","size",",","module",",","remaining","-","name_offset",")","structure",".","size","=","value","structure",".","name","=","name","consumed","+=","remaining","result","=","leaf_type",",","name",",","structure","elif","leaf_type","in","[","leaf_type",".","LF_MEMBER",",","leaf_type",".","LF_MEMBER_ST","]",":","member","=","module",".","object","(","object_type","=","\"LF_MEMBER\"",",","offset","=","offset","+","consumed",")","name_offset","=","member",".","name",".","vol",".","offset","-","member",".","vol",".","offset","name",",","value",",","excess","=","self",".","determine_extended_value","(","leaf_type",",","member",".","offset",",","module",",","remaining","-","name_offset",")","member",".","offset","=","value","member",".","name","=","name","result","=","leaf_type",",","name",",","member","consumed","+=","member",".","vol",".","size","+","len","(","name",")","+","1","+","excess","elif","leaf_type","in","[","leaf_type",".","LF_ARRAY",",","leaf_type",".","LF_ARRAY_ST",",","leaf_type",".","LF_STRIDED_ARRAY","]",":","array","=","module",".","object","(","object_type","=","\"LF_ARRAY\"",",","offset","=","offset","+","consumed",")","name_offset","=","array",".","name",".","vol",".","offset","-","array",".","vol",".","offset","name",",","value",",","excess","=","self",".","determine_extended_value","(","leaf_type",",","array",".","size",",","module",",","remaining","-","name_offset",")","array",".","size","=","value","array",".","name","=","name","result","=","leaf_type",",","name",",","array","consumed","+=","remaining","elif","leaf_type","in","[","leaf_type",".","LF_ENUMERATE","]",":","enum","=","module",".","object","(","object_type","=","'LF_ENUMERATE'",",","offset","=","offset","+","consumed",")","name_offset","=","enum",".","name",".","vol",".","offset","-","enum",".","vol",".","offset","name",",","value",",","excess","=","self",".","determine_extended_value","(","leaf_type",",","enum",".","value",",","module",",","remaining","-","name_offset",")","enum",".","value","=","value","enum",".","name","=","name","result","=","leaf_type",",","name",",","enum","consumed","+=","enum",".","vol",".","size","+","len","(","name",")","+","1","+","excess","elif","leaf_type","in","[","leaf_type",".","LF_ARGLIST",",","leaf_type",".","LF_ENUM","]",":","enum","=","module",".","object","(","object_type","=","\"LF_ENUM\"",",","offset","=","offset","+","consumed",")","name_offset","=","enum",".","name",".","vol",".","offset","-","enum",".","vol",".","offset","name","=","self",".","parse_string","(","enum",".","name",",","leaf_type","<","leaf_type",".","LF_ST_MAX",",","size","=","remaining","-","name_offset",")","enum",".","name","=","name","result","=","leaf_type",",","name",",","enum","consumed","+=","remaining","elif","leaf_type","in","[","leaf_type",".","LF_UNION","]",":","union","=","module",".","object","(","object_type","=","\"LF_UNION\"",",","offset","=","offset","+","consumed",")","name_offset","=","union",".","name",".","vol",".","offset","-","union",".","vol",".","offset","name","=","self",".","parse_string","(","union",".","name",",","leaf_type","<","leaf_type",".","LF_ST_MAX",",","size","=","remaining","-","name_offset",")","result","=","leaf_type",",","name",",","union","consumed","+=","remaining","elif","leaf_type","in","[","leaf_type",".","LF_MODIFIER",",","leaf_type",".","LF_POINTER",",","leaf_type",".","LF_PROCEDURE","]",":","obj","=","module",".","object","(","object_type","=","leaf_type",".","lookup","(",")",",","offset","=","offset","+","consumed",")","result","=","leaf_type",",","None",",","obj","consumed","+=","remaining","elif","leaf_type","in","[","leaf_type",".","LF_FIELDLIST","]",":","sub_length","=","remaining","sub_offset","=","offset","+","consumed","fields","=","[","]","while","length",">","consumed",":","subfield",",","sub_consumed","=","self",".","consume_type","(","module",",","sub_offset",",","sub_length",")","sub_consumed","+=","self",".","consume_padding","(","module",".","layer_name",",","sub_offset","+","sub_consumed",")","sub_length","-=","sub_consumed","sub_offset","+=","sub_consumed","consumed","+=","sub_consumed","fields",".","append","(","subfield",")","result","=","leaf_type",",","None",",","fields","elif","leaf_type","in","[","leaf_type",".","LF_BITFIELD","]",":","bitfield","=","module",".","object","(","object_type","=","\"LF_BITFIELD\"",",","offset","=","offset","+","consumed",")","result","=","leaf_type",",","None",",","bitfield","consumed","+=","remaining","else",":","raise","TypeError","(","\"Unhandled leaf_type: {}\"",".","format","(","leaf_type",")",")","return","result",",","consumed"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L702-L787"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.consume_padding","parameters":"(self, layer_name: str, offset: int)","argument_list":"","return_statement":"return (int(val[0]) & 0x0f)","docstring":"Returns the amount of padding used between fields.","docstring_summary":"Returns the amount of padding used between fields.","docstring_tokens":["Returns","the","amount","of","padding","used","between","fields","."],"function":"def consume_padding(self, layer_name: str, offset: int) -> int:\n \"\"\"Returns the amount of padding used between fields.\"\"\"\n val = self.context.layers[layer_name].read(offset, 1)\n if not ((val[0] & 0xf0) == 0xf0):\n return 0\n return (int(val[0]) & 0x0f)","function_tokens":["def","consume_padding","(","self",",","layer_name",":","str",",","offset",":","int",")","->","int",":","val","=","self",".","context",".","layers","[","layer_name","]",".","read","(","offset",",","1",")","if","not","(","(","val","[","0","]","&","0xf0",")","==","0xf0",")",":","return","0","return","(","int","(","val","[","0","]",")","&","0x0f",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L789-L794"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.convert_fields","parameters":"(self, fields: int)","argument_list":"","return_statement":"return result","docstring":"Converts a field list into a list of fields.","docstring_summary":"Converts a field list into a list of fields.","docstring_tokens":["Converts","a","field","list","into","a","list","of","fields","."],"function":"def convert_fields(self, fields: int) -> Dict[Optional[str], Dict[str, Any]]:\n \"\"\"Converts a field list into a list of fields.\"\"\"\n result = {} # type: Dict[Optional[str], Dict[str, Any]]\n _, _, fields_struct = self.types[fields]\n if not isinstance(fields_struct, list):\n vollog.warning(\"Fields structure did not contain a list of fields\")\n return result\n for field in fields_struct:\n _, name, member = field\n result[name] = {\"offset\": member.offset, \"type\": self.get_type_from_index(member.field_type)}\n return result","function_tokens":["def","convert_fields","(","self",",","fields",":","int",")","->","Dict","[","Optional","[","str","]",",","Dict","[","str",",","Any","]","]",":","result","=","{","}","# type: Dict[Optional[str], Dict[str, Any]]","_",",","_",",","fields_struct","=","self",".","types","[","fields","]","if","not","isinstance","(","fields_struct",",","list",")",":","vollog",".","warning","(","\"Fields structure did not contain a list of fields\"",")","return","result","for","field","in","fields_struct",":","_",",","name",",","member","=","field","result","[","name","]","=","{","\"offset\"",":","member",".","offset",",","\"type\"",":","self",".","get_type_from_index","(","member",".","field_type",")","}","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L796-L806"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.replace_forward_references","parameters":"(self, types, type_references)","argument_list":"","return_statement":"return types","docstring":"Finds all ForwardArrayCounts and calculates them once\n ForwardReferences have been resolved.","docstring_summary":"Finds all ForwardArrayCounts and calculates them once\n ForwardReferences have been resolved.","docstring_tokens":["Finds","all","ForwardArrayCounts","and","calculates","them","once","ForwardReferences","have","been","resolved","."],"function":"def replace_forward_references(self, types, type_references):\n \"\"\"Finds all ForwardArrayCounts and calculates them once\n ForwardReferences have been resolved.\"\"\"\n if isinstance(types, dict):\n for k, v in types.items():\n types[k] = self.replace_forward_references(v, type_references)\n elif isinstance(types, list):\n new_types = []\n for v in types:\n new_types.append(self.replace_forward_references(v, type_references))\n types = new_types\n elif isinstance(types, ForwardArrayCount):\n element_type = types.element_type\n # If we're a forward array count, we need to do the calculation now after all the types have been processed\n loop = True\n while loop:\n loop = False\n if element_type > 0x1000:\n _, name, toplevel_type = self.types[element_type - 0x1000]\n # If there's no name, the original size is probably fine as long as we're not indirect (LF_MODIFIER)\n if not name and isinstance(\n toplevel_type,\n interfaces.objects.ObjectInterface) and toplevel_type.vol.type_name.endswith('LF_MODIFIER'):\n # We have check they don't point to a forward reference, so we go round again with the subtype\n element_type = toplevel_type.subtype_index\n loop = True\n elif name:\n # If there is a name, look it up so we're not using a reference but the real thing\n element_type = type_references[name] + 0x1000\n return types.size \/\/ self.get_size_from_index(element_type)\n return types","function_tokens":["def","replace_forward_references","(","self",",","types",",","type_references",")",":","if","isinstance","(","types",",","dict",")",":","for","k",",","v","in","types",".","items","(",")",":","types","[","k","]","=","self",".","replace_forward_references","(","v",",","type_references",")","elif","isinstance","(","types",",","list",")",":","new_types","=","[","]","for","v","in","types",":","new_types",".","append","(","self",".","replace_forward_references","(","v",",","type_references",")",")","types","=","new_types","elif","isinstance","(","types",",","ForwardArrayCount",")",":","element_type","=","types",".","element_type","# If we're a forward array count, we need to do the calculation now after all the types have been processed","loop","=","True","while","loop",":","loop","=","False","if","element_type",">","0x1000",":","_",",","name",",","toplevel_type","=","self",".","types","[","element_type","-","0x1000","]","# If there's no name, the original size is probably fine as long as we're not indirect (LF_MODIFIER)","if","not","name","and","isinstance","(","toplevel_type",",","interfaces",".","objects",".","ObjectInterface",")","and","toplevel_type",".","vol",".","type_name",".","endswith","(","'LF_MODIFIER'",")",":","# We have check they don't point to a forward reference, so we go round again with the subtype","element_type","=","toplevel_type",".","subtype_index","loop","=","True","elif","name",":","# If there is a name, look it up so we're not using a reference but the real thing","element_type","=","type_references","[","name","]","+","0x1000","return","types",".","size","\/\/","self",".","get_size_from_index","(","element_type",")","return","types"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L808-L838"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.parse_string","parameters":"(structure: interfaces.objects.ObjectInterface,\n parse_as_pascal: bool = False,\n size: int = 0)","argument_list":"","return_statement":"return str(name)","docstring":"Consumes either a c-string or a pascal string depending on the\n leaf_type.","docstring_summary":"Consumes either a c-string or a pascal string depending on the\n leaf_type.","docstring_tokens":["Consumes","either","a","c","-","string","or","a","pascal","string","depending","on","the","leaf_type","."],"function":"def parse_string(structure: interfaces.objects.ObjectInterface,\n parse_as_pascal: bool = False,\n size: int = 0) -> str:\n \"\"\"Consumes either a c-string or a pascal string depending on the\n leaf_type.\"\"\"\n if not parse_as_pascal:\n name = structure.cast(\"string\", max_length = size, encoding = \"latin-1\")\n else:\n name = structure.cast(\"pascal_string\")\n name = name.string.cast(\"string\", max_length = name.length, encoding = \"latin-1\")\n return str(name)","function_tokens":["def","parse_string","(","structure",":","interfaces",".","objects",".","ObjectInterface",",","parse_as_pascal",":","bool","=","False",",","size",":","int","=","0",")","->","str",":","if","not","parse_as_pascal",":","name","=","structure",".","cast","(","\"string\"",",","max_length","=","size",",","encoding","=","\"latin-1\"",")","else",":","name","=","structure",".","cast","(","\"pascal_string\"",")","name","=","name",".","string",".","cast","(","\"string\"",",","max_length","=","name",".","length",",","encoding","=","\"latin-1\"",")","return","str","(","name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L843-L853"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py","language":"python","identifier":"PdbReader.determine_extended_value","parameters":"(self, leaf_type: interfaces.objects.ObjectInterface,\n value: interfaces.objects.ObjectInterface, module: interfaces.context.ModuleInterface,\n length: int)","argument_list":"","return_statement":"return name_str, value, excess","docstring":"Reads a value and potentially consumes more data to construct the\n value.","docstring_summary":"Reads a value and potentially consumes more data to construct the\n value.","docstring_tokens":["Reads","a","value","and","potentially","consumes","more","data","to","construct","the","value","."],"function":"def determine_extended_value(self, leaf_type: interfaces.objects.ObjectInterface,\n value: interfaces.objects.ObjectInterface, module: interfaces.context.ModuleInterface,\n length: int) -> Tuple[str, interfaces.objects.ObjectInterface, int]:\n \"\"\"Reads a value and potentially consumes more data to construct the\n value.\"\"\"\n excess = 0\n if value >= leaf_type.LF_CHAR:\n sub_leaf_type = self.context.object(self.context.symbol_space.get_enumeration(leaf_type.vol.type_name),\n layer_name = leaf_type.vol.layer_name,\n offset = value.vol.offset)\n # Set the offset at just after the previous size type\n offset = value.vol.offset + value.vol.data_format.length\n if sub_leaf_type in [leaf_type.LF_CHAR]:\n value = module.object(object_type = 'char', offset = offset)\n elif sub_leaf_type in [leaf_type.LF_SHORT]:\n value = module.object(object_type = 'short', offset = offset)\n elif sub_leaf_type in [leaf_type.LF_USHORT]:\n value = module.object(object_type = 'unsigned short', offset = offset)\n elif sub_leaf_type in [leaf_type.LF_LONG]:\n value = module.object(object_type = 'long', offset = offset)\n elif sub_leaf_type in [leaf_type.LF_ULONG]:\n value = module.object(object_type = 'unsigned long', offset = offset)\n else:\n raise TypeError(\"Unexpected extended value type\")\n excess = value.vol.data_format.length\n # Updated the consume\/offset counters\n name = module.object(object_type = \"string\", offset = value.vol.offset + value.vol.data_format.length)\n name_str = self.parse_string(name, leaf_type < leaf_type.LF_ST_MAX, size = length - excess)\n return name_str, value, excess","function_tokens":["def","determine_extended_value","(","self",",","leaf_type",":","interfaces",".","objects",".","ObjectInterface",",","value",":","interfaces",".","objects",".","ObjectInterface",",","module",":","interfaces",".","context",".","ModuleInterface",",","length",":","int",")","->","Tuple","[","str",",","interfaces",".","objects",".","ObjectInterface",",","int","]",":","excess","=","0","if","value",">=","leaf_type",".","LF_CHAR",":","sub_leaf_type","=","self",".","context",".","object","(","self",".","context",".","symbol_space",".","get_enumeration","(","leaf_type",".","vol",".","type_name",")",",","layer_name","=","leaf_type",".","vol",".","layer_name",",","offset","=","value",".","vol",".","offset",")","# Set the offset at just after the previous size type","offset","=","value",".","vol",".","offset","+","value",".","vol",".","data_format",".","length","if","sub_leaf_type","in","[","leaf_type",".","LF_CHAR","]",":","value","=","module",".","object","(","object_type","=","'char'",",","offset","=","offset",")","elif","sub_leaf_type","in","[","leaf_type",".","LF_SHORT","]",":","value","=","module",".","object","(","object_type","=","'short'",",","offset","=","offset",")","elif","sub_leaf_type","in","[","leaf_type",".","LF_USHORT","]",":","value","=","module",".","object","(","object_type","=","'unsigned short'",",","offset","=","offset",")","elif","sub_leaf_type","in","[","leaf_type",".","LF_LONG","]",":","value","=","module",".","object","(","object_type","=","'long'",",","offset","=","offset",")","elif","sub_leaf_type","in","[","leaf_type",".","LF_ULONG","]",":","value","=","module",".","object","(","object_type","=","'unsigned long'",",","offset","=","offset",")","else",":","raise","TypeError","(","\"Unexpected extended value type\"",")","excess","=","value",".","vol",".","data_format",".","length","# Updated the consume\/offset counters","name","=","module",".","object","(","object_type","=","\"string\"",",","offset","=","value",".","vol",".","offset","+","value",".","vol",".","data_format",".","length",")","name_str","=","self",".","parse_string","(","name",",","leaf_type","<","leaf_type",".","LF_ST_MAX",",","size","=","length","-","excess",")","return","name_str",",","value",",","excess"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/pdbconv.py#L855-L883"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/versions.py","language":"python","identifier":"OsDistinguisher.__call__","parameters":"(self, context: interfaces.context.ContextInterface, symbol_table: str)","argument_list":"","return_statement":"return True","docstring":"Args:\n context: The context that contains the symbol table named `symbol_table`\n symbol_table: Name of the symbol table within the context to distinguish the version of\n\n Returns:\n True if the symbol table is of the required version","docstring_summary":"","docstring_tokens":[],"function":"def __call__(self, context: interfaces.context.ContextInterface, symbol_table: str) -> bool:\n \"\"\"\n\n Args:\n context: The context that contains the symbol table named `symbol_table`\n symbol_table: Name of the symbol table within the context to distinguish the version of\n\n Returns:\n True if the symbol table is of the required version\n \"\"\"\n\n try:\n pe_version = context.symbol_space[symbol_table].metadata.pe_version\n major, minor, revision, build = pe_version\n return self._version_check((major, minor, revision, build))\n except (AttributeError, ValueError, TypeError):\n vollog.log(constants.LOGLEVEL_VVV, \"Windows PE version data is not available\")\n\n # fall back to the backup method, if necessary\n for name, member, response in self._fallback_checks:\n if member is None:\n if (context.symbol_space.has_symbol(symbol_table + constants.BANG + name)\n or context.symbol_space.has_type(symbol_table + constants.BANG + name)) != response:\n return False\n else:\n try:\n symbol_type = context.symbol_space.get_type(symbol_table + constants.BANG + name)\n if symbol_type.has_member(member) != response:\n return False\n except exceptions.SymbolError:\n if not response:\n return False\n\n return True","function_tokens":["def","__call__","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","symbol_table",":","str",")","->","bool",":","try",":","pe_version","=","context",".","symbol_space","[","symbol_table","]",".","metadata",".","pe_version","major",",","minor",",","revision",",","build","=","pe_version","return","self",".","_version_check","(","(","major",",","minor",",","revision",",","build",")",")","except","(","AttributeError",",","ValueError",",","TypeError",")",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Windows PE version data is not available\"",")","# fall back to the backup method, if necessary","for","name",",","member",",","response","in","self",".","_fallback_checks",":","if","member","is","None",":","if","(","context",".","symbol_space",".","has_symbol","(","symbol_table","+","constants",".","BANG","+","name",")","or","context",".","symbol_space",".","has_type","(","symbol_table","+","constants",".","BANG","+","name",")",")","!=","response",":","return","False","else",":","try",":","symbol_type","=","context",".","symbol_space",".","get_type","(","symbol_table","+","constants",".","BANG","+","name",")","if","symbol_type",".","has_member","(","member",")","!=","response",":","return","False","except","exceptions",".","SymbolError",":","if","not","response",":","return","False","return","True"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/versions.py#L40-L73"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"MMVAD_SHORT.traverse","parameters":"(self, visited = None, depth = 0)","argument_list":"","return_statement":"","docstring":"Traverse the VAD tree, determining each underlying VAD node type by\n looking up the pool tag for the structure and then casting into a new\n object.","docstring_summary":"Traverse the VAD tree, determining each underlying VAD node type by\n looking up the pool tag for the structure and then casting into a new\n object.","docstring_tokens":["Traverse","the","VAD","tree","determining","each","underlying","VAD","node","type","by","looking","up","the","pool","tag","for","the","structure","and","then","casting","into","a","new","object","."],"function":"def traverse(self, visited = None, depth = 0):\n \"\"\"Traverse the VAD tree, determining each underlying VAD node type by\n looking up the pool tag for the structure and then casting into a new\n object.\"\"\"\n\n # TODO: this is an arbitrary limit chosen based on past observations\n if depth > 100:\n vollog.log(constants.LOGLEVEL_VVV, \"Vad tree is too deep, something went wrong!\")\n raise RuntimeError(\"Vad tree is too deep\")\n\n if visited is None:\n visited = set()\n\n vad_address = self.vol.offset\n\n if vad_address in visited:\n vollog.log(constants.LOGLEVEL_VVV, \"VAD node already seen!\")\n return\n\n visited.add(vad_address)\n tag = self.get_tag()\n\n if tag in [\"VadS\", \"VadF\"]:\n target = \"_MMVAD_SHORT\"\n elif tag != None and tag.startswith(\"Vad\"):\n target = \"_MMVAD\"\n elif depth == 0:\n # the root node at depth 0 is allowed to not have a tag\n # but we still want to continue and access its right & left child\n target = None\n else:\n # any node other than the root that doesn't have a recognized tag\n # is just garbage and we skip the node entirely\n vollog.log(constants.LOGLEVEL_VVV,\n \"Skipping VAD at {} depth {} with tag {}\".format(self.vol.offset, depth, tag))\n return\n\n if target:\n vad_object = self.cast(target)\n yield vad_object\n\n try:\n for vad_node in self.get_left_child().dereference().traverse(visited, depth + 1):\n yield vad_node\n except exceptions.InvalidAddressException as excp:\n vollog.log(constants.LOGLEVEL_VVV, \"Invalid address on LeftChild: {0:#x}\".format(excp.invalid_address))\n\n try:\n for vad_node in self.get_right_child().dereference().traverse(visited, depth + 1):\n yield vad_node\n except exceptions.InvalidAddressException as excp:\n vollog.log(constants.LOGLEVEL_VVV, \"Invalid address on RightChild: {0:#x}\".format(excp.invalid_address))","function_tokens":["def","traverse","(","self",",","visited","=","None",",","depth","=","0",")",":","# TODO: this is an arbitrary limit chosen based on past observations","if","depth",">","100",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Vad tree is too deep, something went wrong!\"",")","raise","RuntimeError","(","\"Vad tree is too deep\"",")","if","visited","is","None",":","visited","=","set","(",")","vad_address","=","self",".","vol",".","offset","if","vad_address","in","visited",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"VAD node already seen!\"",")","return","visited",".","add","(","vad_address",")","tag","=","self",".","get_tag","(",")","if","tag","in","[","\"VadS\"",",","\"VadF\"","]",":","target","=","\"_MMVAD_SHORT\"","elif","tag","!=","None","and","tag",".","startswith","(","\"Vad\"",")",":","target","=","\"_MMVAD\"","elif","depth","==","0",":","# the root node at depth 0 is allowed to not have a tag","# but we still want to continue and access its right & left child","target","=","None","else",":","# any node other than the root that doesn't have a recognized tag","# is just garbage and we skip the node entirely","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Skipping VAD at {} depth {} with tag {}\"",".","format","(","self",".","vol",".","offset",",","depth",",","tag",")",")","return","if","target",":","vad_object","=","self",".","cast","(","target",")","yield","vad_object","try",":","for","vad_node","in","self",".","get_left_child","(",")",".","dereference","(",")",".","traverse","(","visited",",","depth","+","1",")",":","yield","vad_node","except","exceptions",".","InvalidAddressException","as","excp",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Invalid address on LeftChild: {0:#x}\"",".","format","(","excp",".","invalid_address",")",")","try",":","for","vad_node","in","self",".","get_right_child","(",")",".","dereference","(",")",".","traverse","(","visited",",","depth","+","1",")",":","yield","vad_node","except","exceptions",".","InvalidAddressException","as","excp",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Invalid address on RightChild: {0:#x}\"",".","format","(","excp",".","invalid_address",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L62-L113"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"MMVAD_SHORT.get_right_child","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Get the right child member.","docstring_summary":"Get the right child member.","docstring_tokens":["Get","the","right","child","member","."],"function":"def get_right_child(self):\n \"\"\"Get the right child member.\"\"\"\n\n if self.has_member(\"RightChild\"):\n return self.RightChild\n\n elif self.has_member(\"Right\"):\n return self.Right\n\n # this is for windows 8 and 10\n elif self.has_member(\"VadNode\"):\n if self.VadNode.has_member(\"RightChild\"):\n return self.VadNode.RightChild\n if self.VadNode.has_member(\"Right\"):\n return self.VadNode.Right\n\n # also for windows 8 and 10\n elif self.has_member(\"Core\"):\n if self.Core.has_member(\"VadNode\"):\n if self.Core.VadNode.has_member(\"RightChild\"):\n return self.Core.VadNode.RightChild\n if self.Core.VadNode.has_member(\"Right\"):\n return self.Core.VadNode.Right\n\n raise AttributeError(\"Unable to find the right child member\")","function_tokens":["def","get_right_child","(","self",")",":","if","self",".","has_member","(","\"RightChild\"",")",":","return","self",".","RightChild","elif","self",".","has_member","(","\"Right\"",")",":","return","self",".","Right","# this is for windows 8 and 10","elif","self",".","has_member","(","\"VadNode\"",")",":","if","self",".","VadNode",".","has_member","(","\"RightChild\"",")",":","return","self",".","VadNode",".","RightChild","if","self",".","VadNode",".","has_member","(","\"Right\"",")",":","return","self",".","VadNode",".","Right","# also for windows 8 and 10","elif","self",".","has_member","(","\"Core\"",")",":","if","self",".","Core",".","has_member","(","\"VadNode\"",")",":","if","self",".","Core",".","VadNode",".","has_member","(","\"RightChild\"",")",":","return","self",".","Core",".","VadNode",".","RightChild","if","self",".","Core",".","VadNode",".","has_member","(","\"Right\"",")",":","return","self",".","Core",".","VadNode",".","Right","raise","AttributeError","(","\"Unable to find the right child member\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L115-L139"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"MMVAD_SHORT.get_left_child","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Get the left child member.","docstring_summary":"Get the left child member.","docstring_tokens":["Get","the","left","child","member","."],"function":"def get_left_child(self):\n \"\"\"Get the left child member.\"\"\"\n\n if self.has_member(\"LeftChild\"):\n return self.LeftChild\n\n elif self.has_member(\"Left\"):\n return self.Left\n\n # this is for windows 8 and 10\n elif self.has_member(\"VadNode\"):\n if self.VadNode.has_member(\"LeftChild\"):\n return self.VadNode.LeftChild\n if self.VadNode.has_member(\"Left\"):\n return self.VadNode.Left\n\n # also for windows 8 and 10\n elif self.has_member(\"Core\"):\n if self.Core.has_member(\"VadNode\"):\n if self.Core.VadNode.has_member(\"LeftChild\"):\n return self.Core.VadNode.LeftChild\n if self.Core.VadNode.has_member(\"Left\"):\n return self.Core.VadNode.Left\n\n raise AttributeError(\"Unable to find the left child member\")","function_tokens":["def","get_left_child","(","self",")",":","if","self",".","has_member","(","\"LeftChild\"",")",":","return","self",".","LeftChild","elif","self",".","has_member","(","\"Left\"",")",":","return","self",".","Left","# this is for windows 8 and 10","elif","self",".","has_member","(","\"VadNode\"",")",":","if","self",".","VadNode",".","has_member","(","\"LeftChild\"",")",":","return","self",".","VadNode",".","LeftChild","if","self",".","VadNode",".","has_member","(","\"Left\"",")",":","return","self",".","VadNode",".","Left","# also for windows 8 and 10","elif","self",".","has_member","(","\"Core\"",")",":","if","self",".","Core",".","has_member","(","\"VadNode\"",")",":","if","self",".","Core",".","VadNode",".","has_member","(","\"LeftChild\"",")",":","return","self",".","Core",".","VadNode",".","LeftChild","if","self",".","Core",".","VadNode",".","has_member","(","\"Left\"",")",":","return","self",".","Core",".","VadNode",".","Left","raise","AttributeError","(","\"Unable to find the left child member\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L141-L165"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"MMVAD_SHORT.get_parent","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Get the VAD's parent member.","docstring_summary":"Get the VAD's parent member.","docstring_tokens":["Get","the","VAD","s","parent","member","."],"function":"def get_parent(self):\n \"\"\"Get the VAD's parent member.\"\"\"\n\n # this is for xp and 2003\n if self.has_member(\"Parent\"):\n return self.Parent\n\n # this is for vista through windows 7\n elif self.has_member(\"u1\") and self.u1.has_member(\"Parent\"):\n return self.u1.Parent & ~0x3\n\n # this is for windows 8 and 10\n elif self.has_member(\"VadNode\"):\n\n if self.VadNode.has_member(\"u1\"):\n return self.VadNode.u1.Parent & ~0x3\n\n elif self.VadNode.has_member(\"ParentValue\"):\n return self.VadNode.ParentValue & ~0x3\n\n # also for windows 8 and 10\n elif self.has_member(\"Core\"):\n\n if self.Core.VadNode.has_member(\"u1\"):\n return self.Core.VadNode.u1.Parent & ~0x3\n\n elif self.Core.VadNode.has_member(\"ParentValue\"):\n return self.Core.VadNode.ParentValue & ~0x3\n\n raise AttributeError(\"Unable to find the parent member\")","function_tokens":["def","get_parent","(","self",")",":","# this is for xp and 2003","if","self",".","has_member","(","\"Parent\"",")",":","return","self",".","Parent","# this is for vista through windows 7","elif","self",".","has_member","(","\"u1\"",")","and","self",".","u1",".","has_member","(","\"Parent\"",")",":","return","self",".","u1",".","Parent","&","~","0x3","# this is for windows 8 and 10","elif","self",".","has_member","(","\"VadNode\"",")",":","if","self",".","VadNode",".","has_member","(","\"u1\"",")",":","return","self",".","VadNode",".","u1",".","Parent","&","~","0x3","elif","self",".","VadNode",".","has_member","(","\"ParentValue\"",")",":","return","self",".","VadNode",".","ParentValue","&","~","0x3","# also for windows 8 and 10","elif","self",".","has_member","(","\"Core\"",")",":","if","self",".","Core",".","VadNode",".","has_member","(","\"u1\"",")",":","return","self",".","Core",".","VadNode",".","u1",".","Parent","&","~","0x3","elif","self",".","Core",".","VadNode",".","has_member","(","\"ParentValue\"",")",":","return","self",".","Core",".","VadNode",".","ParentValue","&","~","0x3","raise","AttributeError","(","\"Unable to find the parent member\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L167-L196"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"MMVAD_SHORT.get_start","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Get the VAD's starting virtual address.","docstring_summary":"Get the VAD's starting virtual address.","docstring_tokens":["Get","the","VAD","s","starting","virtual","address","."],"function":"def get_start(self):\n \"\"\"Get the VAD's starting virtual address.\"\"\"\n\n if self.has_member(\"StartingVpn\"):\n\n if self.has_member(\"StartingVpnHigh\"):\n return (self.StartingVpn << 12) | (self.StartingVpnHigh << 44)\n else:\n return self.StartingVpn << 12\n\n elif self.has_member(\"Core\"):\n\n if self.Core.has_member(\"StartingVpnHigh\"):\n return (self.Core.StartingVpn << 12) | (self.Core.StartingVpnHigh << 44)\n else:\n return self.Core.StartingVpn << 12\n\n raise AttributeError(\"Unable to find the starting VPN member\")","function_tokens":["def","get_start","(","self",")",":","if","self",".","has_member","(","\"StartingVpn\"",")",":","if","self",".","has_member","(","\"StartingVpnHigh\"",")",":","return","(","self",".","StartingVpn","<<","12",")","|","(","self",".","StartingVpnHigh","<<","44",")","else",":","return","self",".","StartingVpn","<<","12","elif","self",".","has_member","(","\"Core\"",")",":","if","self",".","Core",".","has_member","(","\"StartingVpnHigh\"",")",":","return","(","self",".","Core",".","StartingVpn","<<","12",")","|","(","self",".","Core",".","StartingVpnHigh","<<","44",")","else",":","return","self",".","Core",".","StartingVpn","<<","12","raise","AttributeError","(","\"Unable to find the starting VPN member\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L198-L215"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"MMVAD_SHORT.get_end","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Get the VAD's ending virtual address.","docstring_summary":"Get the VAD's ending virtual address.","docstring_tokens":["Get","the","VAD","s","ending","virtual","address","."],"function":"def get_end(self):\n \"\"\"Get the VAD's ending virtual address.\"\"\"\n\n if self.has_member(\"EndingVpn\"):\n\n if self.has_member(\"EndingVpnHigh\"):\n return (((self.EndingVpn + 1) << 12) | (self.EndingVpnHigh << 44)) - 1\n else:\n return ((self.EndingVpn + 1) << 12) - 1\n\n elif self.has_member(\"Core\"):\n if self.Core.has_member(\"EndingVpnHigh\"):\n return (((self.Core.EndingVpn + 1) << 12) | (self.Core.EndingVpnHigh << 44)) - 1\n else:\n return ((self.Core.EndingVpn + 1) << 12) - 1\n\n raise AttributeError(\"Unable to find the ending VPN member\")","function_tokens":["def","get_end","(","self",")",":","if","self",".","has_member","(","\"EndingVpn\"",")",":","if","self",".","has_member","(","\"EndingVpnHigh\"",")",":","return","(","(","(","self",".","EndingVpn","+","1",")","<<","12",")","|","(","self",".","EndingVpnHigh","<<","44",")",")","-","1","else",":","return","(","(","self",".","EndingVpn","+","1",")","<<","12",")","-","1","elif","self",".","has_member","(","\"Core\"",")",":","if","self",".","Core",".","has_member","(","\"EndingVpnHigh\"",")",":","return","(","(","(","self",".","Core",".","EndingVpn","+","1",")","<<","12",")","|","(","self",".","Core",".","EndingVpnHigh","<<","44",")",")","-","1","else",":","return","(","(","self",".","Core",".","EndingVpn","+","1",")","<<","12",")","-","1","raise","AttributeError","(","\"Unable to find the ending VPN member\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L217-L233"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"MMVAD_SHORT.get_commit_charge","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Get the VAD's commit charge (number of committed pages)","docstring_summary":"Get the VAD's commit charge (number of committed pages)","docstring_tokens":["Get","the","VAD","s","commit","charge","(","number","of","committed","pages",")"],"function":"def get_commit_charge(self):\n \"\"\"Get the VAD's commit charge (number of committed pages)\"\"\"\n\n if self.has_member(\"u1\") and self.u1.has_member(\"VadFlags1\"):\n return self.u1.VadFlags1.CommitCharge\n\n elif self.has_member(\"u\") and self.u.has_member(\"VadFlags\"):\n return self.u.VadFlags.CommitCharge\n\n elif self.has_member(\"Core\"):\n return self.Core.u1.VadFlags1.CommitCharge\n\n raise AttributeError(\"Unable to find the commit charge member\")","function_tokens":["def","get_commit_charge","(","self",")",":","if","self",".","has_member","(","\"u1\"",")","and","self",".","u1",".","has_member","(","\"VadFlags1\"",")",":","return","self",".","u1",".","VadFlags1",".","CommitCharge","elif","self",".","has_member","(","\"u\"",")","and","self",".","u",".","has_member","(","\"VadFlags\"",")",":","return","self",".","u",".","VadFlags",".","CommitCharge","elif","self",".","has_member","(","\"Core\"",")",":","return","self",".","Core",".","u1",".","VadFlags1",".","CommitCharge","raise","AttributeError","(","\"Unable to find the commit charge member\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L235-L247"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"MMVAD_SHORT.get_private_memory","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Get the VAD's private memory setting.","docstring_summary":"Get the VAD's private memory setting.","docstring_tokens":["Get","the","VAD","s","private","memory","setting","."],"function":"def get_private_memory(self):\n \"\"\"Get the VAD's private memory setting.\"\"\"\n\n if self.has_member(\"u1\") and self.u1.has_member(\"VadFlags1\") and self.u1.VadFlags1.has_member(\"PrivateMemory\"):\n return self.u1.VadFlags1.PrivateMemory\n\n elif self.has_member(\"u\") and self.u.has_member(\"VadFlags\") and self.u.VadFlags.has_member(\"PrivateMemory\"):\n return self.u.VadFlags.PrivateMemory\n\n elif self.has_member(\"Core\"):\n if (self.Core.has_member(\"u1\") and self.Core.u1.has_member(\"VadFlags1\")\n and self.Core.u1.VadFlags1.has_member(\"PrivateMemory\")):\n return self.Core.u1.VadFlags1.PrivateMemory\n\n elif (self.Core.has_member(\"u\") and self.Core.u.has_member(\"VadFlags\")\n and self.Core.u.VadFlags.has_member(\"PrivateMemory\")):\n return self.Core.u.VadFlags.PrivateMemory\n\n raise AttributeError(\"Unable to find the private memory member\")","function_tokens":["def","get_private_memory","(","self",")",":","if","self",".","has_member","(","\"u1\"",")","and","self",".","u1",".","has_member","(","\"VadFlags1\"",")","and","self",".","u1",".","VadFlags1",".","has_member","(","\"PrivateMemory\"",")",":","return","self",".","u1",".","VadFlags1",".","PrivateMemory","elif","self",".","has_member","(","\"u\"",")","and","self",".","u",".","has_member","(","\"VadFlags\"",")","and","self",".","u",".","VadFlags",".","has_member","(","\"PrivateMemory\"",")",":","return","self",".","u",".","VadFlags",".","PrivateMemory","elif","self",".","has_member","(","\"Core\"",")",":","if","(","self",".","Core",".","has_member","(","\"u1\"",")","and","self",".","Core",".","u1",".","has_member","(","\"VadFlags1\"",")","and","self",".","Core",".","u1",".","VadFlags1",".","has_member","(","\"PrivateMemory\"",")",")",":","return","self",".","Core",".","u1",".","VadFlags1",".","PrivateMemory","elif","(","self",".","Core",".","has_member","(","\"u\"",")","and","self",".","Core",".","u",".","has_member","(","\"VadFlags\"",")","and","self",".","Core",".","u",".","VadFlags",".","has_member","(","\"PrivateMemory\"",")",")",":","return","self",".","Core",".","u",".","VadFlags",".","PrivateMemory","raise","AttributeError","(","\"Unable to find the private memory member\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L249-L267"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"MMVAD_SHORT.get_protection","parameters":"(self, protect_values, winnt_protections)","argument_list":"","return_statement":"return \"|\".join(names)","docstring":"Get the VAD's protection constants as a string.","docstring_summary":"Get the VAD's protection constants as a string.","docstring_tokens":["Get","the","VAD","s","protection","constants","as","a","string","."],"function":"def get_protection(self, protect_values, winnt_protections):\n \"\"\"Get the VAD's protection constants as a string.\"\"\"\n\n protect = None\n\n if self.has_member(\"u\"):\n protect = self.u.VadFlags.Protection\n\n elif self.has_member(\"Core\"):\n protect = self.Core.u.VadFlags.Protection\n\n try:\n value = protect_values[protect]\n except IndexError:\n value = 0\n\n names = []\n\n for name, mask in winnt_protections.items():\n if value & mask != 0:\n names.append(name)\n\n return \"|\".join(names)","function_tokens":["def","get_protection","(","self",",","protect_values",",","winnt_protections",")",":","protect","=","None","if","self",".","has_member","(","\"u\"",")",":","protect","=","self",".","u",".","VadFlags",".","Protection","elif","self",".","has_member","(","\"Core\"",")",":","protect","=","self",".","Core",".","u",".","VadFlags",".","Protection","try",":","value","=","protect_values","[","protect","]","except","IndexError",":","value","=","0","names","=","[","]","for","name",",","mask","in","winnt_protections",".","items","(",")",":","if","value","&","mask","!=","0",":","names",".","append","(","name",")","return","\"|\"",".","join","(","names",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L269-L291"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"MMVAD_SHORT.get_file_name","parameters":"(self)","argument_list":"","return_statement":"return renderers.NotApplicableValue()","docstring":"Only long(er) vads have mapped files.","docstring_summary":"Only long(er) vads have mapped files.","docstring_tokens":["Only","long","(","er",")","vads","have","mapped","files","."],"function":"def get_file_name(self):\n \"\"\"Only long(er) vads have mapped files.\"\"\"\n return renderers.NotApplicableValue()","function_tokens":["def","get_file_name","(","self",")",":","return","renderers",".","NotApplicableValue","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L293-L295"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"MMVAD.get_file_name","parameters":"(self)","argument_list":"","return_statement":"return file_name","docstring":"Get the name of the file mapped into the memory range (if any)","docstring_summary":"Get the name of the file mapped into the memory range (if any)","docstring_tokens":["Get","the","name","of","the","file","mapped","into","the","memory","range","(","if","any",")"],"function":"def get_file_name(self):\n \"\"\"Get the name of the file mapped into the memory range (if any)\"\"\"\n\n file_name = renderers.NotApplicableValue()\n\n try:\n # this is for xp and 2003\n if self.has_member(\"ControlArea\"):\n file_name = self.ControlArea.FilePointer.FileName.get_string()\n\n # this is for vista through windows 7\n else:\n file_name = self.Subsection.ControlArea.FilePointer.dereference().cast(\n \"_FILE_OBJECT\").FileName.get_string()\n\n except exceptions.InvalidAddressException:\n pass\n\n return file_name","function_tokens":["def","get_file_name","(","self",")",":","file_name","=","renderers",".","NotApplicableValue","(",")","try",":","# this is for xp and 2003","if","self",".","has_member","(","\"ControlArea\"",")",":","file_name","=","self",".","ControlArea",".","FilePointer",".","FileName",".","get_string","(",")","# this is for vista through windows 7","else",":","file_name","=","self",".","Subsection",".","ControlArea",".","FilePointer",".","dereference","(",")",".","cast","(","\"_FILE_OBJECT\"",")",".","FileName",".","get_string","(",")","except","exceptions",".","InvalidAddressException",":","pass","return","file_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L302-L320"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"DRIVER_OBJECT.is_valid","parameters":"(self)","argument_list":"","return_statement":"return True","docstring":"Determine if the object is valid.","docstring_summary":"Determine if the object is valid.","docstring_tokens":["Determine","if","the","object","is","valid","."],"function":"def is_valid(self) -> bool:\n \"\"\"Determine if the object is valid.\"\"\"\n return True","function_tokens":["def","is_valid","(","self",")","->","bool",":","return","True"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L362-L364"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"OBJECT_SYMBOLIC_LINK.is_valid","parameters":"(self)","argument_list":"","return_statement":"return True","docstring":"Determine if the object is valid.","docstring_summary":"Determine if the object is valid.","docstring_tokens":["Determine","if","the","object","is","valid","."],"function":"def is_valid(self) -> bool:\n \"\"\"Determine if the object is valid.\"\"\"\n return True","function_tokens":["def","is_valid","(","self",")","->","bool",":","return","True"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L374-L376"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"FILE_OBJECT.is_valid","parameters":"(self)","argument_list":"","return_statement":"return self.FileName.Length > 0 and self._context.layers[self.FileName.Buffer.vol.native_layer_name].is_valid(\n self.FileName.Buffer)","docstring":"Determine if the object is valid.","docstring_summary":"Determine if the object is valid.","docstring_tokens":["Determine","if","the","object","is","valid","."],"function":"def is_valid(self) -> bool:\n \"\"\"Determine if the object is valid.\"\"\"\n return self.FileName.Length > 0 and self._context.layers[self.FileName.Buffer.vol.native_layer_name].is_valid(\n self.FileName.Buffer)","function_tokens":["def","is_valid","(","self",")","->","bool",":","return","self",".","FileName",".","Length",">","0","and","self",".","_context",".","layers","[","self",".","FileName",".","Buffer",".","vol",".","native_layer_name","]",".","is_valid","(","self",".","FileName",".","Buffer",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L385-L388"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"KMUTANT.is_valid","parameters":"(self)","argument_list":"","return_statement":"return True","docstring":"Determine if the object is valid.","docstring_summary":"Determine if the object is valid.","docstring_tokens":["Determine","if","the","object","is","valid","."],"function":"def is_valid(self) -> bool:\n \"\"\"Determine if the object is valid.\"\"\"\n return True","function_tokens":["def","is_valid","(","self",")","->","bool",":","return","True"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L416-L418"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"KMUTANT.get_name","parameters":"(self)","argument_list":"","return_statement":"return header.NameInfo.Name.String","docstring":"Get the object's name from the object header.","docstring_summary":"Get the object's name from the object header.","docstring_tokens":["Get","the","object","s","name","from","the","object","header","."],"function":"def get_name(self) -> str:\n \"\"\"Get the object's name from the object header.\"\"\"\n header = self.get_object_header()\n return header.NameInfo.Name.String","function_tokens":["def","get_name","(","self",")","->","str",":","header","=","self",".","get_object_header","(",")","return","header",".","NameInfo",".","Name",".","String"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L420-L423"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"ETHREAD.owning_process","parameters":"(self, kernel_layer: str = None)","argument_list":"","return_statement":"return self.ThreadsProcess.dereference(kernel_layer)","docstring":"Return the EPROCESS that owns this thread.","docstring_summary":"Return the EPROCESS that owns this thread.","docstring_tokens":["Return","the","EPROCESS","that","owns","this","thread","."],"function":"def owning_process(self, kernel_layer: str = None) -> interfaces.objects.ObjectInterface:\n \"\"\"Return the EPROCESS that owns this thread.\"\"\"\n return self.ThreadsProcess.dereference(kernel_layer)","function_tokens":["def","owning_process","(","self",",","kernel_layer",":","str","=","None",")","->","interfaces",".","objects",".","ObjectInterface",":","return","self",".","ThreadsProcess",".","dereference","(","kernel_layer",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L429-L431"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"EPROCESS.is_valid","parameters":"(self)","argument_list":"","return_statement":"return True","docstring":"Determine if the object is valid.","docstring_summary":"Determine if the object is valid.","docstring_tokens":["Determine","if","the","object","is","valid","."],"function":"def is_valid(self) -> bool:\n \"\"\"Determine if the object is valid.\"\"\"\n\n try:\n name = objects.utility.array_to_string(self.ImageFileName)\n if not name or len(name) == 0 or name[0] == \"\\x00\":\n return False\n\n # The System\/PID 4 process has no create time\n if not (str(name) == \"System\" and self.UniqueProcessId == 4):\n if self.CreateTime.QuadPart == 0:\n return False\n\n ctime = self.get_create_time()\n if not isinstance(ctime, datetime.datetime):\n return False\n\n if not (1998 < ctime.year < 2030):\n return False\n\n # NT pids are divisible by 4\n if self.UniqueProcessId % 4 != 0:\n return False\n\n # check for all 0s besides the PCID entries\n if isinstance(self.Pcb.DirectoryTableBase, objects.Array):\n dtb = self.Pcb.DirectoryTableBase.cast(\"pointer\")\n else:\n dtb = self.Pcb.DirectoryTableBase\n\n if dtb == 0:\n return False\n\n # check for all 0s besides the PCID entries\n if dtb & ~0xfff == 0:\n return False\n\n ## TODO: we can also add the thread Flink and Blink tests if necessary\n\n except exceptions.InvalidAddressException:\n return False\n\n return True","function_tokens":["def","is_valid","(","self",")","->","bool",":","try",":","name","=","objects",".","utility",".","array_to_string","(","self",".","ImageFileName",")","if","not","name","or","len","(","name",")","==","0","or","name","[","0","]","==","\"\\x00\"",":","return","False","# The System\/PID 4 process has no create time","if","not","(","str","(","name",")","==","\"System\"","and","self",".","UniqueProcessId","==","4",")",":","if","self",".","CreateTime",".","QuadPart","==","0",":","return","False","ctime","=","self",".","get_create_time","(",")","if","not","isinstance","(","ctime",",","datetime",".","datetime",")",":","return","False","if","not","(","1998","<","ctime",".","year","<","2030",")",":","return","False","# NT pids are divisible by 4","if","self",".","UniqueProcessId","%","4","!=","0",":","return","False","# check for all 0s besides the PCID entries","if","isinstance","(","self",".","Pcb",".","DirectoryTableBase",",","objects",".","Array",")",":","dtb","=","self",".","Pcb",".","DirectoryTableBase",".","cast","(","\"pointer\"",")","else",":","dtb","=","self",".","Pcb",".","DirectoryTableBase","if","dtb","==","0",":","return","False","# check for all 0s besides the PCID entries","if","dtb","&","~","0xfff","==","0",":","return","False","## TODO: we can also add the thread Flink and Blink tests if necessary","except","exceptions",".","InvalidAddressException",":","return","False","return","True"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L473-L515"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"EPROCESS.add_process_layer","parameters":"(self, config_prefix: str = None, preferred_name: str = None)","argument_list":"","return_statement":"return self._add_process_layer(self._context, dtb, config_prefix, preferred_name)","docstring":"Constructs a new layer based on the process's DirectoryTableBase.","docstring_summary":"Constructs a new layer based on the process's DirectoryTableBase.","docstring_tokens":["Constructs","a","new","layer","based","on","the","process","s","DirectoryTableBase","."],"function":"def add_process_layer(self, config_prefix: str = None, preferred_name: str = None):\n \"\"\"Constructs a new layer based on the process's DirectoryTableBase.\"\"\"\n\n parent_layer = self._context.layers[self.vol.layer_name]\n\n if not isinstance(parent_layer, intel.Intel):\n # We can't get bits_per_register unless we're an intel space (since that's not defined at the higher layer)\n raise TypeError(\"Parent layer is not a translation layer, unable to construct process layer\")\n\n # Presumably for 64-bit systems, the DTB is defined as an array, rather than an unsigned long long\n dtb = 0 # type: int\n if isinstance(self.Pcb.DirectoryTableBase, objects.Array):\n dtb = self.Pcb.DirectoryTableBase.cast(\"unsigned long long\")\n else:\n dtb = self.Pcb.DirectoryTableBase\n dtb = dtb & ((1 << parent_layer.bits_per_register) - 1)\n\n if preferred_name is None:\n preferred_name = self.vol.layer_name + \"_Process{}\".format(self.UniqueProcessId)\n\n # Add the constructed layer and return the name\n return self._add_process_layer(self._context, dtb, config_prefix, preferred_name)","function_tokens":["def","add_process_layer","(","self",",","config_prefix",":","str","=","None",",","preferred_name",":","str","=","None",")",":","parent_layer","=","self",".","_context",".","layers","[","self",".","vol",".","layer_name","]","if","not","isinstance","(","parent_layer",",","intel",".","Intel",")",":","# We can't get bits_per_register unless we're an intel space (since that's not defined at the higher layer)","raise","TypeError","(","\"Parent layer is not a translation layer, unable to construct process layer\"",")","# Presumably for 64-bit systems, the DTB is defined as an array, rather than an unsigned long long","dtb","=","0","# type: int","if","isinstance","(","self",".","Pcb",".","DirectoryTableBase",",","objects",".","Array",")",":","dtb","=","self",".","Pcb",".","DirectoryTableBase",".","cast","(","\"unsigned long long\"",")","else",":","dtb","=","self",".","Pcb",".","DirectoryTableBase","dtb","=","dtb","&","(","(","1","<<","parent_layer",".","bits_per_register",")","-","1",")","if","preferred_name","is","None",":","preferred_name","=","self",".","vol",".","layer_name","+","\"_Process{}\"",".","format","(","self",".","UniqueProcessId",")","# Add the constructed layer and return the name","return","self",".","_add_process_layer","(","self",".","_context",",","dtb",",","config_prefix",",","preferred_name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L517-L538"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"EPROCESS.get_peb","parameters":"(self)","argument_list":"","return_statement":"return peb","docstring":"Constructs a PEB object","docstring_summary":"Constructs a PEB object","docstring_tokens":["Constructs","a","PEB","object"],"function":"def get_peb(self) -> interfaces.objects.ObjectInterface:\n \"\"\"Constructs a PEB object\"\"\"\n if constants.BANG not in self.vol.type_name:\n raise ValueError(\"Invalid symbol table name syntax (no {} found)\".format(constants.BANG))\n\n # add_process_layer can raise InvalidAddressException.\n # if that happens, we let the exception propagate upwards\n proc_layer_name = self.add_process_layer()\n\n proc_layer = self._context.layers[proc_layer_name]\n if not proc_layer.is_valid(self.Peb):\n raise exceptions.InvalidAddressException(proc_layer_name, self.Peb,\n \"Invalid address at {:0x}\".format(self.Peb))\n\n sym_table = self.vol.type_name.split(constants.BANG)[0]\n peb = self._context.object(\"{}{}_PEB\".format(sym_table, constants.BANG),\n layer_name = proc_layer_name,\n offset = self.Peb)\n return peb","function_tokens":["def","get_peb","(","self",")","->","interfaces",".","objects",".","ObjectInterface",":","if","constants",".","BANG","not","in","self",".","vol",".","type_name",":","raise","ValueError","(","\"Invalid symbol table name syntax (no {} found)\"",".","format","(","constants",".","BANG",")",")","# add_process_layer can raise InvalidAddressException.","# if that happens, we let the exception propagate upwards","proc_layer_name","=","self",".","add_process_layer","(",")","proc_layer","=","self",".","_context",".","layers","[","proc_layer_name","]","if","not","proc_layer",".","is_valid","(","self",".","Peb",")",":","raise","exceptions",".","InvalidAddressException","(","proc_layer_name",",","self",".","Peb",",","\"Invalid address at {:0x}\"",".","format","(","self",".","Peb",")",")","sym_table","=","self",".","vol",".","type_name",".","split","(","constants",".","BANG",")","[","0","]","peb","=","self",".","_context",".","object","(","\"{}{}_PEB\"",".","format","(","sym_table",",","constants",".","BANG",")",",","layer_name","=","proc_layer_name",",","offset","=","self",".","Peb",")","return","peb"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L540-L558"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"EPROCESS.load_order_modules","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Generator for DLLs in the order that they were loaded.","docstring_summary":"Generator for DLLs in the order that they were loaded.","docstring_tokens":["Generator","for","DLLs","in","the","order","that","they","were","loaded","."],"function":"def load_order_modules(self) -> Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Generator for DLLs in the order that they were loaded.\"\"\"\n\n try:\n peb = self.get_peb()\n for entry in peb.Ldr.InLoadOrderModuleList.to_list(\n \"{}{}_LDR_DATA_TABLE_ENTRY\".format(self.get_symbol_table_name(), constants.BANG),\n \"InLoadOrderLinks\"):\n yield entry\n except exceptions.InvalidAddressException:\n return","function_tokens":["def","load_order_modules","(","self",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","try",":","peb","=","self",".","get_peb","(",")","for","entry","in","peb",".","Ldr",".","InLoadOrderModuleList",".","to_list","(","\"{}{}_LDR_DATA_TABLE_ENTRY\"",".","format","(","self",".","get_symbol_table_name","(",")",",","constants",".","BANG",")",",","\"InLoadOrderLinks\"",")",":","yield","entry","except","exceptions",".","InvalidAddressException",":","return"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L560-L570"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"EPROCESS.init_order_modules","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Generator for DLLs in the order that they were initialized","docstring_summary":"Generator for DLLs in the order that they were initialized","docstring_tokens":["Generator","for","DLLs","in","the","order","that","they","were","initialized"],"function":"def init_order_modules(self) -> Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Generator for DLLs in the order that they were initialized\"\"\"\n\n try:\n peb = self.get_peb()\n for entry in peb.Ldr.InInitializationOrderModuleList.to_list(\n \"{}{}_LDR_DATA_TABLE_ENTRY\".format(self.get_symbol_table_name(), constants.BANG),\n \"InInitializationOrderLinks\"):\n yield entry\n except exceptions.InvalidAddressException:\n return","function_tokens":["def","init_order_modules","(","self",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","try",":","peb","=","self",".","get_peb","(",")","for","entry","in","peb",".","Ldr",".","InInitializationOrderModuleList",".","to_list","(","\"{}{}_LDR_DATA_TABLE_ENTRY\"",".","format","(","self",".","get_symbol_table_name","(",")",",","constants",".","BANG",")",",","\"InInitializationOrderLinks\"",")",":","yield","entry","except","exceptions",".","InvalidAddressException",":","return"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L572-L582"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"EPROCESS.mem_order_modules","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Generator for DLLs in the order that they appear in memory","docstring_summary":"Generator for DLLs in the order that they appear in memory","docstring_tokens":["Generator","for","DLLs","in","the","order","that","they","appear","in","memory"],"function":"def mem_order_modules(self) -> Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Generator for DLLs in the order that they appear in memory\"\"\"\n\n try:\n peb = self.get_peb()\n for entry in peb.Ldr.InMemoryOrderModuleList.to_list(\n \"{}{}_LDR_DATA_TABLE_ENTRY\".format(self.get_symbol_table_name(), constants.BANG),\n \"InMemoryOrderLinks\"):\n yield entry\n except exceptions.InvalidAddressException:\n return","function_tokens":["def","mem_order_modules","(","self",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","try",":","peb","=","self",".","get_peb","(",")","for","entry","in","peb",".","Ldr",".","InMemoryOrderModuleList",".","to_list","(","\"{}{}_LDR_DATA_TABLE_ENTRY\"",".","format","(","self",".","get_symbol_table_name","(",")",",","constants",".","BANG",")",",","\"InMemoryOrderLinks\"",")",":","yield","entry","except","exceptions",".","InvalidAddressException",":","return"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L584-L594"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"EPROCESS.environment_variables","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Generator for environment variables.\n\n The PEB points to our env block - a series of null-terminated\n unicode strings. Each string cannot be more than 0x7FFF chars.\n End of the list is a quad-null.","docstring_summary":"Generator for environment variables.","docstring_tokens":["Generator","for","environment","variables","."],"function":"def environment_variables(self):\n \"\"\"Generator for environment variables.\n\n The PEB points to our env block - a series of null-terminated\n unicode strings. Each string cannot be more than 0x7FFF chars.\n End of the list is a quad-null.\n \"\"\"\n context = self._context\n process_space = self.add_process_layer()\n\n try:\n block = self.get_peb().ProcessParameters.Environment\n try:\n block_size = self.get_peb().ProcessParameters.EnvironmentSize\n except AttributeError: # Windows XP\n block_size = self.get_peb().ProcessParameters.Length\n envars = context.layers[process_space].read(block, block_size).decode(\"utf-16-le\",\n errors = 'replace').split('\\x00')[:-1]\n except exceptions.InvalidAddressException:\n return renderers.UnreadableValue()\n\n for envar in envars:\n split_index = envar.find('=')\n env = envar[:split_index]\n var = envar[split_index + 1:]\n\n # Exlude parse problem with some types of env\n if env and var:\n yield env, var","function_tokens":["def","environment_variables","(","self",")",":","context","=","self",".","_context","process_space","=","self",".","add_process_layer","(",")","try",":","block","=","self",".","get_peb","(",")",".","ProcessParameters",".","Environment","try",":","block_size","=","self",".","get_peb","(",")",".","ProcessParameters",".","EnvironmentSize","except","AttributeError",":","# Windows XP","block_size","=","self",".","get_peb","(",")",".","ProcessParameters",".","Length","envars","=","context",".","layers","[","process_space","]",".","read","(","block",",","block_size",")",".","decode","(","\"utf-16-le\"",",","errors","=","'replace'",")",".","split","(","'\\x00'",")","[",":","-","1","]","except","exceptions",".","InvalidAddressException",":","return","renderers",".","UnreadableValue","(",")","for","envar","in","envars",":","split_index","=","envar",".","find","(","'='",")","env","=","envar","[",":","split_index","]","var","=","envar","[","split_index","+","1",":","]","# Exlude parse problem with some types of env","if","env","and","var",":","yield","env",",","var"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L668-L696"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"LIST_ENTRY.to_list","parameters":"(self,\n symbol_type: str,\n member: str,\n forward: bool = True,\n sentinel: bool = True,\n layer: Optional[str] = None)","argument_list":"","return_statement":"","docstring":"Returns an iterator of the entries in the list.","docstring_summary":"Returns an iterator of the entries in the list.","docstring_tokens":["Returns","an","iterator","of","the","entries","in","the","list","."],"function":"def to_list(self,\n symbol_type: str,\n member: str,\n forward: bool = True,\n sentinel: bool = True,\n layer: Optional[str] = None) -> Iterator[interfaces.objects.ObjectInterface]:\n \"\"\"Returns an iterator of the entries in the list.\"\"\"\n\n layer = layer or self.vol.layer_name\n\n relative_offset = self._context.symbol_space.get_type(symbol_type).relative_child_offset(member)\n\n direction = 'Blink'\n if forward:\n direction = 'Flink'\n\n trans_layer = self._context.layers[layer]\n\n try:\n trans_layer.is_valid(self.vol.offset)\n link = getattr(self, direction).dereference()\n except exceptions.InvalidAddressException:\n return\n\n if not sentinel:\n yield self._context.object(symbol_type,\n layer,\n offset = self.vol.offset - relative_offset,\n native_layer_name = layer or self.vol.native_layer_name)\n\n seen = {self.vol.offset}\n while link.vol.offset not in seen:\n obj_offset = link.vol.offset - relative_offset\n\n try:\n trans_layer.is_valid(obj_offset)\n except exceptions.InvalidAddressException:\n return\n\n obj = self._context.object(symbol_type,\n layer,\n offset = obj_offset,\n native_layer_name = layer or self.vol.native_layer_name)\n yield obj\n\n seen.add(link.vol.offset)\n\n try:\n link = getattr(link, direction).dereference()\n except exceptions.InvalidAddressException:\n return","function_tokens":["def","to_list","(","self",",","symbol_type",":","str",",","member",":","str",",","forward",":","bool","=","True",",","sentinel",":","bool","=","True",",","layer",":","Optional","[","str","]","=","None",")","->","Iterator","[","interfaces",".","objects",".","ObjectInterface","]",":","layer","=","layer","or","self",".","vol",".","layer_name","relative_offset","=","self",".","_context",".","symbol_space",".","get_type","(","symbol_type",")",".","relative_child_offset","(","member",")","direction","=","'Blink'","if","forward",":","direction","=","'Flink'","trans_layer","=","self",".","_context",".","layers","[","layer","]","try",":","trans_layer",".","is_valid","(","self",".","vol",".","offset",")","link","=","getattr","(","self",",","direction",")",".","dereference","(",")","except","exceptions",".","InvalidAddressException",":","return","if","not","sentinel",":","yield","self",".","_context",".","object","(","symbol_type",",","layer",",","offset","=","self",".","vol",".","offset","-","relative_offset",",","native_layer_name","=","layer","or","self",".","vol",".","native_layer_name",")","seen","=","{","self",".","vol",".","offset","}","while","link",".","vol",".","offset","not","in","seen",":","obj_offset","=","link",".","vol",".","offset","-","relative_offset","try",":","trans_layer",".","is_valid","(","obj_offset",")","except","exceptions",".","InvalidAddressException",":","return","obj","=","self",".","_context",".","object","(","symbol_type",",","layer",",","offset","=","obj_offset",",","native_layer_name","=","layer","or","self",".","vol",".","native_layer_name",")","yield","obj","seen",".","add","(","link",".","vol",".","offset",")","try",":","link","=","getattr","(","link",",","direction",")",".","dereference","(",")","except","exceptions",".","InvalidAddressException",":","return"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L702-L752"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"TOKEN.get_sids","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Yield a sid for the current token object.","docstring_summary":"Yield a sid for the current token object.","docstring_tokens":["Yield","a","sid","for","the","current","token","object","."],"function":"def get_sids(self) -> Iterable[str]:\n \"\"\"Yield a sid for the current token object.\"\"\"\n\n if self.UserAndGroupCount < 0xFFFF:\n layer_name = self.vol.layer_name\n kvo = self._context.layers[layer_name].config[\"kernel_virtual_offset\"]\n symbol_table = self.get_symbol_table_name()\n ntkrnlmp = self._context.module(symbol_table, layer_name = layer_name, offset = kvo)\n UserAndGroups = ntkrnlmp.object(object_type = \"array\",\n offset = self.UserAndGroups.dereference().vol.get(\"offset\") - kvo,\n subtype = ntkrnlmp.get_type(\"_SID_AND_ATTRIBUTES\"),\n count = self.UserAndGroupCount)\n for sid_and_attr in UserAndGroups:\n try:\n sid = sid_and_attr.Sid.dereference().cast(\"_SID\")\n # catch invalid pointers (UserAndGroupCount is too high)\n if sid is None:\n return\n # this mimics the windows API IsValidSid\n if sid.Revision & 0xF != 1 or sid.SubAuthorityCount > 15:\n return\n id_auth = \"\"\n for i in sid.IdentifierAuthority.Value:\n id_auth = i\n SubAuthority = ntkrnlmp.object(object_type = \"array\",\n offset = sid.SubAuthority.vol.offset - kvo,\n subtype = ntkrnlmp.get_type(\"unsigned long\"),\n count = int(sid.SubAuthorityCount))\n yield \"S-\" + \"-\".join(str(i) for i in (sid.Revision, id_auth) + tuple(SubAuthority))\n except exceptions.InvalidAddressException:\n vollog.log(constants.LOGLEVEL_VVVV, \"InvalidAddressException while parsing for token sid\")","function_tokens":["def","get_sids","(","self",")","->","Iterable","[","str","]",":","if","self",".","UserAndGroupCount","<","0xFFFF",":","layer_name","=","self",".","vol",".","layer_name","kvo","=","self",".","_context",".","layers","[","layer_name","]",".","config","[","\"kernel_virtual_offset\"","]","symbol_table","=","self",".","get_symbol_table_name","(",")","ntkrnlmp","=","self",".","_context",".","module","(","symbol_table",",","layer_name","=","layer_name",",","offset","=","kvo",")","UserAndGroups","=","ntkrnlmp",".","object","(","object_type","=","\"array\"",",","offset","=","self",".","UserAndGroups",".","dereference","(",")",".","vol",".","get","(","\"offset\"",")","-","kvo",",","subtype","=","ntkrnlmp",".","get_type","(","\"_SID_AND_ATTRIBUTES\"",")",",","count","=","self",".","UserAndGroupCount",")","for","sid_and_attr","in","UserAndGroups",":","try",":","sid","=","sid_and_attr",".","Sid",".","dereference","(",")",".","cast","(","\"_SID\"",")","# catch invalid pointers (UserAndGroupCount is too high)","if","sid","is","None",":","return","# this mimics the windows API IsValidSid","if","sid",".","Revision","&","0xF","!=","1","or","sid",".","SubAuthorityCount",">","15",":","return","id_auth","=","\"\"","for","i","in","sid",".","IdentifierAuthority",".","Value",":","id_auth","=","i","SubAuthority","=","ntkrnlmp",".","object","(","object_type","=","\"array\"",",","offset","=","sid",".","SubAuthority",".","vol",".","offset","-","kvo",",","subtype","=","ntkrnlmp",".","get_type","(","\"unsigned long\"",")",",","count","=","int","(","sid",".","SubAuthorityCount",")",")","yield","\"S-\"","+","\"-\"",".","join","(","str","(","i",")","for","i","in","(","sid",".","Revision",",","id_auth",")","+","tuple","(","SubAuthority",")",")","except","exceptions",".","InvalidAddressException",":","vollog",".","log","(","constants",".","LOGLEVEL_VVVV",",","\"InvalidAddressException while parsing for token sid\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L761-L791"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py","language":"python","identifier":"TOKEN.privileges","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Return a list of privileges for the current token object.","docstring_summary":"Return a list of privileges for the current token object.","docstring_tokens":["Return","a","list","of","privileges","for","the","current","token","object","."],"function":"def privileges(self):\n \"\"\"Return a list of privileges for the current token object.\"\"\"\n\n try:\n for priv_index in range(64):\n yield (priv_index, bool(self.Privileges.Present & (2 ** priv_index)),\n bool(self.Privileges.Enabled & (2 ** priv_index)),\n bool(self.Privileges.EnabledByDefault & (2 ** priv_index)))\n except AttributeError: # Windows XP\n if self.PrivilegeCount < 1024:\n # This is a pointer to an array of _LUID_AND_ATTRIBUTES\n for luid in self.Privileges.dereference().cast(\n \"array\",\n count = self.PrivilegeCount,\n subtype = self._context.symbol_space[self.get_symbol_table_name()].get_type(\n \"_LUID_AND_ATTRIBUTES\")):\n # The Attributes member is a flag\n enabled = luid.Attributes & 2 != 0\n default = luid.Attributes & 1 != 0\n yield luid.Luid.LowPart, True, enabled, default\n else:\n vollog.log(constants.LOGLEVEL_VVVV, \"Broken Token Privileges.\")","function_tokens":["def","privileges","(","self",")",":","try",":","for","priv_index","in","range","(","64",")",":","yield","(","priv_index",",","bool","(","self",".","Privileges",".","Present","&","(","2","**","priv_index",")",")",",","bool","(","self",".","Privileges",".","Enabled","&","(","2","**","priv_index",")",")",",","bool","(","self",".","Privileges",".","EnabledByDefault","&","(","2","**","priv_index",")",")",")","except","AttributeError",":","# Windows XP","if","self",".","PrivilegeCount","<","1024",":","# This is a pointer to an array of _LUID_AND_ATTRIBUTES","for","luid","in","self",".","Privileges",".","dereference","(",")",".","cast","(","\"array\"",",","count","=","self",".","PrivilegeCount",",","subtype","=","self",".","_context",".","symbol_space","[","self",".","get_symbol_table_name","(",")","]",".","get_type","(","\"_LUID_AND_ATTRIBUTES\"",")",")",":","# The Attributes member is a flag","enabled","=","luid",".","Attributes","&","2","!=","0","default","=","luid",".","Attributes","&","1","!=","0","yield","luid",".","Luid",".","LowPart",",","True",",","enabled",",","default","else",":","vollog",".","log","(","constants",".","LOGLEVEL_VVVV",",","\"Broken Token Privileges.\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/__init__.py#L793-L814"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pe.py","language":"python","identifier":"IMAGE_DOS_HEADER.get_nt_header","parameters":"(self)","argument_list":"","return_statement":"return nt_header","docstring":"Carve out the NT header from this DOS header. This reflects on the\n PE file's Machine type to create a 32- or 64-bit NT header structure.\n\n Returns:\n <_IMAGE_NT_HEADERS> or <_IMAGE_NT_HEADERS64> instance","docstring_summary":"Carve out the NT header from this DOS header. This reflects on the\n PE file's Machine type to create a 32- or 64-bit NT header structure.","docstring_tokens":["Carve","out","the","NT","header","from","this","DOS","header",".","This","reflects","on","the","PE","file","s","Machine","type","to","create","a","32","-","or","64","-","bit","NT","header","structure","."],"function":"def get_nt_header(self) -> interfaces.objects.ObjectInterface:\n \"\"\"Carve out the NT header from this DOS header. This reflects on the\n PE file's Machine type to create a 32- or 64-bit NT header structure.\n\n Returns:\n <_IMAGE_NT_HEADERS> or <_IMAGE_NT_HEADERS64> instance\n \"\"\"\n\n if self.e_magic != 0x5a4d:\n raise ValueError(\"e_magic {0:04X} is not a valid DOS signature.\".format(self.e_magic))\n\n layer_name = self.vol.layer_name\n symbol_table_name = self.get_symbol_table_name()\n\n nt_header = self._context.object(symbol_table_name + constants.BANG + \"_IMAGE_NT_HEADERS\",\n layer_name = layer_name,\n offset = self.vol.offset + self.e_lfanew)\n\n if nt_header.Signature != 0x4550:\n raise ValueError(\"NT header signature {0:04X} is not a valid\".format(nt_header.Signature))\n\n # this checks if we need a PE32+ header\n if nt_header.FileHeader.Machine == 34404:\n nt_header = nt_header.cast(\"_IMAGE_NT_HEADERS64\")\n\n return nt_header","function_tokens":["def","get_nt_header","(","self",")","->","interfaces",".","objects",".","ObjectInterface",":","if","self",".","e_magic","!=","0x5a4d",":","raise","ValueError","(","\"e_magic {0:04X} is not a valid DOS signature.\"",".","format","(","self",".","e_magic",")",")","layer_name","=","self",".","vol",".","layer_name","symbol_table_name","=","self",".","get_symbol_table_name","(",")","nt_header","=","self",".","_context",".","object","(","symbol_table_name","+","constants",".","BANG","+","\"_IMAGE_NT_HEADERS\"",",","layer_name","=","layer_name",",","offset","=","self",".","vol",".","offset","+","self",".","e_lfanew",")","if","nt_header",".","Signature","!=","0x4550",":","raise","ValueError","(","\"NT header signature {0:04X} is not a valid\"",".","format","(","nt_header",".","Signature",")",")","# this checks if we need a PE32+ header","if","nt_header",".","FileHeader",".","Machine","==","34404",":","nt_header","=","nt_header",".","cast","(","\"_IMAGE_NT_HEADERS64\"",")","return","nt_header"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pe.py#L14-L39"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pe.py","language":"python","identifier":"IMAGE_DOS_HEADER.replace_header_field","parameters":"(self, sect: interfaces.objects.ObjectInterface, header: bytes,\n item: interfaces.objects.ObjectInterface, value: int)","argument_list":"","return_statement":"return result","docstring":"Replaces a member in an _IMAGE_SECTION_HEADER structure.\n\n Args:\n sect: the section instance\n header: raw data for the section\n item: the member of the section to replace\n value: new value for the member\n\n Returns:\n The raw data with the replaced header field","docstring_summary":"Replaces a member in an _IMAGE_SECTION_HEADER structure.","docstring_tokens":["Replaces","a","member","in","an","_IMAGE_SECTION_HEADER","structure","."],"function":"def replace_header_field(self, sect: interfaces.objects.ObjectInterface, header: bytes,\n item: interfaces.objects.ObjectInterface, value: int) -> bytes:\n \"\"\"Replaces a member in an _IMAGE_SECTION_HEADER structure.\n\n Args:\n sect: the section instance\n header: raw data for the section\n item: the member of the section to replace\n value: new value for the member\n\n Returns:\n The raw data with the replaced header field\n \"\"\"\n\n member_size = self._context.symbol_space.get_type(item.vol.type_name).size\n start = item.vol.offset - sect.vol.offset\n newval = objects.convert_value_to_data(value, int, item.vol.data_format)\n result = header[:start] + newval + header[start + member_size:]\n return result","function_tokens":["def","replace_header_field","(","self",",","sect",":","interfaces",".","objects",".","ObjectInterface",",","header",":","bytes",",","item",":","interfaces",".","objects",".","ObjectInterface",",","value",":","int",")","->","bytes",":","member_size","=","self",".","_context",".","symbol_space",".","get_type","(","item",".","vol",".","type_name",")",".","size","start","=","item",".","vol",".","offset","-","sect",".","vol",".","offset","newval","=","objects",".","convert_value_to_data","(","value",",","int",",","item",".","vol",".","data_format",")","result","=","header","[",":","start","]","+","newval","+","header","[","start","+","member_size",":","]","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pe.py#L41-L59"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pe.py","language":"python","identifier":"IMAGE_DOS_HEADER.fix_image_base","parameters":"(self, raw_data: bytes, nt_header: interfaces.objects.ObjectInterface)","argument_list":"","return_statement":"return raw_data[:image_base_offset] + newval + raw_data[image_base_offset + member_size:]","docstring":"Fix the _OPTIONAL_HEADER.ImageBase value (which is either an\n unsigned long for 32-bit PE's or unsigned long long for 64-bit PE's) to\n match the address where the PE file was carved out of memory.\n\n Args:\n raw_data: a bytes object of the PE's data\n nt_header: <_IMAGE_NT_HEADERS> or <_IMAGE_NT_HEADERS64> instance\n\n Returns:\n patched with the correct address","docstring_summary":"Fix the _OPTIONAL_HEADER.ImageBase value (which is either an\n unsigned long for 32-bit PE's or unsigned long long for 64-bit PE's) to\n match the address where the PE file was carved out of memory.","docstring_tokens":["Fix","the","_OPTIONAL_HEADER",".","ImageBase","value","(","which","is","either","an","unsigned","long","for","32","-","bit","PE","s","or","unsigned","long","long","for","64","-","bit","PE","s",")","to","match","the","address","where","the","PE","file","was","carved","out","of","memory","."],"function":"def fix_image_base(self, raw_data: bytes, nt_header: interfaces.objects.ObjectInterface) -> bytes:\n \"\"\"Fix the _OPTIONAL_HEADER.ImageBase value (which is either an\n unsigned long for 32-bit PE's or unsigned long long for 64-bit PE's) to\n match the address where the PE file was carved out of memory.\n\n Args:\n raw_data: a bytes object of the PE's data\n nt_header: <_IMAGE_NT_HEADERS> or <_IMAGE_NT_HEADERS64> instance\n\n Returns:\n patched with the correct address\n \"\"\"\n\n image_base_offset = nt_header.OptionalHeader.ImageBase.vol.offset - self.vol.offset\n image_base_type = nt_header.OptionalHeader.ImageBase.vol.type_name\n member_size = self._context.symbol_space.get_type(image_base_type).size\n newval = objects.convert_value_to_data(self.vol.offset, int, nt_header.OptionalHeader.ImageBase.vol.data_format)\n return raw_data[:image_base_offset] + newval + raw_data[image_base_offset + member_size:]","function_tokens":["def","fix_image_base","(","self",",","raw_data",":","bytes",",","nt_header",":","interfaces",".","objects",".","ObjectInterface",")","->","bytes",":","image_base_offset","=","nt_header",".","OptionalHeader",".","ImageBase",".","vol",".","offset","-","self",".","vol",".","offset","image_base_type","=","nt_header",".","OptionalHeader",".","ImageBase",".","vol",".","type_name","member_size","=","self",".","_context",".","symbol_space",".","get_type","(","image_base_type",")",".","size","newval","=","objects",".","convert_value_to_data","(","self",".","vol",".","offset",",","int",",","nt_header",".","OptionalHeader",".","ImageBase",".","vol",".","data_format",")","return","raw_data","[",":","image_base_offset","]","+","newval","+","raw_data","[","image_base_offset","+","member_size",":","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pe.py#L61-L78"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pe.py","language":"python","identifier":"IMAGE_DOS_HEADER.reconstruct","parameters":"(self)","argument_list":"","return_statement":"","docstring":"This method generates the content necessary to reconstruct a PE file\n from memory. It preserves slack space (similar to the old --memory) and\n automatically fixes the ImageBase in the output PE file.\n\n Returns:\n of ( offset, data)","docstring_summary":"This method generates the content necessary to reconstruct a PE file\n from memory. It preserves slack space (similar to the old --memory) and\n automatically fixes the ImageBase in the output PE file.","docstring_tokens":["This","method","generates","the","content","necessary","to","reconstruct","a","PE","file","from","memory",".","It","preserves","slack","space","(","similar","to","the","old","--","memory",")","and","automatically","fixes","the","ImageBase","in","the","output","PE","file","."],"function":"def reconstruct(self) -> Generator[Tuple[int, bytes], None, None]:\n \"\"\"This method generates the content necessary to reconstruct a PE file\n from memory. It preserves slack space (similar to the old --memory) and\n automatically fixes the ImageBase in the output PE file.\n\n Returns:\n of ( offset, data)\n \"\"\"\n\n nt_header = self.get_nt_header()\n\n layer_name = self.vol.layer_name\n symbol_table_name = self.get_symbol_table_name()\n\n section_alignment = nt_header.OptionalHeader.SectionAlignment\n\n sect_header_size = self._context.symbol_space.get_type(symbol_table_name + constants.BANG +\n \"_IMAGE_SECTION_HEADER\").size\n\n size_of_image = nt_header.OptionalHeader.SizeOfImage\n\n # no legitimate PE is going to be larger than this\n if size_of_image > (1024 * 1024 * 100):\n raise ValueError(\"The claimed SizeOfImage is too large: {}\".format(size_of_image))\n\n read_layer = self._context.layers[layer_name]\n\n raw_data = read_layer.read(self.vol.offset, nt_header.OptionalHeader.SizeOfImage, pad = True)\n\n # fix the PE image base before yielding the initial view of the data\n fixed_data = self.fix_image_base(raw_data, nt_header)\n yield 0, fixed_data\n\n start_addr = nt_header.FileHeader.SizeOfOptionalHeader + \\\n (nt_header.OptionalHeader.vol.offset - self.vol.offset)\n\n counter = 0\n for sect in nt_header.get_sections():\n\n if sect.VirtualAddress > size_of_image:\n raise ValueError(\"Section VirtualAddress is too large: {}\".format(sect.VirtualAddress))\n\n if sect.Misc.VirtualSize > size_of_image:\n raise ValueError(\"Section VirtualSize is too large: {}\".format(sect.Misc.VirtualSize))\n\n if sect.SizeOfRawData > size_of_image:\n raise ValueError(\"Section SizeOfRawData is too large: {}\".format(sect.SizeOfRawData))\n\n if sect is not None:\n # It doesn't matter if this is too big, because it'll get overwritten by the later layers\n sect_size = conversion.round(sect.Misc.VirtualSize, section_alignment, up = True)\n sectheader = read_layer.read(sect.vol.offset, sect_header_size)\n sectheader = self.replace_header_field(sect, sectheader, sect.PointerToRawData, sect.VirtualAddress)\n sectheader = self.replace_header_field(sect, sectheader, sect.SizeOfRawData, sect_size)\n sectheader = self.replace_header_field(sect, sectheader, sect.Misc.VirtualSize, sect_size)\n\n offset = start_addr + (counter * sect_header_size)\n yield offset, sectheader\n counter += 1","function_tokens":["def","reconstruct","(","self",")","->","Generator","[","Tuple","[","int",",","bytes","]",",","None",",","None","]",":","nt_header","=","self",".","get_nt_header","(",")","layer_name","=","self",".","vol",".","layer_name","symbol_table_name","=","self",".","get_symbol_table_name","(",")","section_alignment","=","nt_header",".","OptionalHeader",".","SectionAlignment","sect_header_size","=","self",".","_context",".","symbol_space",".","get_type","(","symbol_table_name","+","constants",".","BANG","+","\"_IMAGE_SECTION_HEADER\"",")",".","size","size_of_image","=","nt_header",".","OptionalHeader",".","SizeOfImage","# no legitimate PE is going to be larger than this","if","size_of_image",">","(","1024","*","1024","*","100",")",":","raise","ValueError","(","\"The claimed SizeOfImage is too large: {}\"",".","format","(","size_of_image",")",")","read_layer","=","self",".","_context",".","layers","[","layer_name","]","raw_data","=","read_layer",".","read","(","self",".","vol",".","offset",",","nt_header",".","OptionalHeader",".","SizeOfImage",",","pad","=","True",")","# fix the PE image base before yielding the initial view of the data","fixed_data","=","self",".","fix_image_base","(","raw_data",",","nt_header",")","yield","0",",","fixed_data","start_addr","=","nt_header",".","FileHeader",".","SizeOfOptionalHeader","+","(","nt_header",".","OptionalHeader",".","vol",".","offset","-","self",".","vol",".","offset",")","counter","=","0","for","sect","in","nt_header",".","get_sections","(",")",":","if","sect",".","VirtualAddress",">","size_of_image",":","raise","ValueError","(","\"Section VirtualAddress is too large: {}\"",".","format","(","sect",".","VirtualAddress",")",")","if","sect",".","Misc",".","VirtualSize",">","size_of_image",":","raise","ValueError","(","\"Section VirtualSize is too large: {}\"",".","format","(","sect",".","Misc",".","VirtualSize",")",")","if","sect",".","SizeOfRawData",">","size_of_image",":","raise","ValueError","(","\"Section SizeOfRawData is too large: {}\"",".","format","(","sect",".","SizeOfRawData",")",")","if","sect","is","not","None",":","# It doesn't matter if this is too big, because it'll get overwritten by the later layers","sect_size","=","conversion",".","round","(","sect",".","Misc",".","VirtualSize",",","section_alignment",",","up","=","True",")","sectheader","=","read_layer",".","read","(","sect",".","vol",".","offset",",","sect_header_size",")","sectheader","=","self",".","replace_header_field","(","sect",",","sectheader",",","sect",".","PointerToRawData",",","sect",".","VirtualAddress",")","sectheader","=","self",".","replace_header_field","(","sect",",","sectheader",",","sect",".","SizeOfRawData",",","sect_size",")","sectheader","=","self",".","replace_header_field","(","sect",",","sectheader",",","sect",".","Misc",".","VirtualSize",",","sect_size",")","offset","=","start_addr","+","(","counter","*","sect_header_size",")","yield","offset",",","sectheader","counter","+=","1"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pe.py#L80-L138"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pe.py","language":"python","identifier":"IMAGE_NT_HEADERS.get_sections","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Iterate through the section headers for this PE file.\n\n Yields:\n <_IMAGE_SECTION_HEADER> objects","docstring_summary":"Iterate through the section headers for this PE file.","docstring_tokens":["Iterate","through","the","section","headers","for","this","PE","file","."],"function":"def get_sections(self) -> Generator[interfaces.objects.ObjectInterface, None, None]:\n \"\"\"Iterate through the section headers for this PE file.\n\n Yields:\n <_IMAGE_SECTION_HEADER> objects\n \"\"\"\n layer_name = self.vol.layer_name\n symbol_table_name = self.get_symbol_table_name()\n\n sect_header_size = self._context.symbol_space.get_type(symbol_table_name + constants.BANG +\n \"_IMAGE_SECTION_HEADER\").size\n start_addr = self.FileHeader.SizeOfOptionalHeader + self.OptionalHeader.vol.offset\n\n for i in range(self.FileHeader.NumberOfSections):\n sect_addr = start_addr + (i * sect_header_size)\n yield self._context.object(symbol_table_name + constants.BANG + \"_IMAGE_SECTION_HEADER\",\n offset = sect_addr,\n layer_name = layer_name)","function_tokens":["def","get_sections","(","self",")","->","Generator","[","interfaces",".","objects",".","ObjectInterface",",","None",",","None","]",":","layer_name","=","self",".","vol",".","layer_name","symbol_table_name","=","self",".","get_symbol_table_name","(",")","sect_header_size","=","self",".","_context",".","symbol_space",".","get_type","(","symbol_table_name","+","constants",".","BANG","+","\"_IMAGE_SECTION_HEADER\"",")",".","size","start_addr","=","self",".","FileHeader",".","SizeOfOptionalHeader","+","self",".","OptionalHeader",".","vol",".","offset","for","i","in","range","(","self",".","FileHeader",".","NumberOfSections",")",":","sect_addr","=","start_addr","+","(","i","*","sect_header_size",")","yield","self",".","_context",".","object","(","symbol_table_name","+","constants",".","BANG","+","\"_IMAGE_SECTION_HEADER\"",",","offset","=","sect_addr",",","layer_name","=","layer_name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pe.py#L143-L160"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/network.py","language":"python","identifier":"_TCP_LISTENER.dual_stack_sockets","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Handle Windows dual-stack sockets","docstring_summary":"Handle Windows dual-stack sockets","docstring_tokens":["Handle","Windows","dual","-","stack","sockets"],"function":"def dual_stack_sockets(self):\n \"\"\"Handle Windows dual-stack sockets\"\"\"\n\n # If this pointer is valid, the socket is bound to\n # a specific IP address. Otherwise, the socket is\n # listening on all IP addresses of the address family.\n\n # Note the remote address is always INADDR_ANY or\n # INADDR6_ANY for sockets. The moment a client\n # connects to the listener, a TCP_ENDPOINT is created\n # and that structure contains the remote address.\n\n inaddr = self.get_in_addr()\n\n if inaddr:\n if self.get_address_family() == AF_INET:\n yield \"v4\", inet_ntop(socket.AF_INET, inaddr.addr4), inaddr_any\n elif self.get_address_family() == AF_INET6:\n yield \"v6\", inet_ntop(socket.AF_INET6, inaddr.addr6), inaddr6_any\n else:\n yield \"v4\", inaddr_any, inaddr_any\n if self.get_address_family() == AF_INET6:\n yield \"v6\", inaddr6_any, inaddr6_any","function_tokens":["def","dual_stack_sockets","(","self",")",":","# If this pointer is valid, the socket is bound to","# a specific IP address. Otherwise, the socket is","# listening on all IP addresses of the address family.","# Note the remote address is always INADDR_ANY or","# INADDR6_ANY for sockets. The moment a client","# connects to the listener, a TCP_ENDPOINT is created","# and that structure contains the remote address.","inaddr","=","self",".","get_in_addr","(",")","if","inaddr",":","if","self",".","get_address_family","(",")","==","AF_INET",":","yield","\"v4\"",",","inet_ntop","(","socket",".","AF_INET",",","inaddr",".","addr4",")",",","inaddr_any","elif","self",".","get_address_family","(",")","==","AF_INET6",":","yield","\"v6\"",",","inet_ntop","(","socket",".","AF_INET6",",","inaddr",".","addr6",")",",","inaddr6_any","else",":","yield","\"v4\"",",","inaddr_any",",","inaddr_any","if","self",".","get_address_family","(",")","==","AF_INET6",":","yield","\"v6\"",",","inaddr6_any",",","inaddr6_any"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/network.py#L122-L144"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py","language":"python","identifier":"POOL_HEADER.get_object","parameters":"(self,\n type_name: str,\n use_top_down: bool,\n executive: bool = False,\n kernel_symbol_table: Optional[str] = None,\n native_layer_name: Optional[str] = None)","argument_list":"","return_statement":"return None","docstring":"Carve an object or data structure from a kernel pool allocation\n\n Args:\n type_name: the data structure type name\n native_layer_name: the name of the layer where the data originally lived\n object_type: the object type (executive kernel objects only)\n kernel_symbol_table: in case objects of a different symbol table are scanned for\n\n Returns:\n An object as found from a POOL_HEADER","docstring_summary":"Carve an object or data structure from a kernel pool allocation","docstring_tokens":["Carve","an","object","or","data","structure","from","a","kernel","pool","allocation"],"function":"def get_object(self,\n type_name: str,\n use_top_down: bool,\n executive: bool = False,\n kernel_symbol_table: Optional[str] = None,\n native_layer_name: Optional[str] = None) -> Optional[interfaces.objects.ObjectInterface]:\n \"\"\"Carve an object or data structure from a kernel pool allocation\n\n Args:\n type_name: the data structure type name\n native_layer_name: the name of the layer where the data originally lived\n object_type: the object type (executive kernel objects only)\n kernel_symbol_table: in case objects of a different symbol table are scanned for\n\n Returns:\n An object as found from a POOL_HEADER\n \"\"\"\n\n symbol_table_name = self.vol.type_name.split(constants.BANG)[0]\n if constants.BANG in type_name:\n symbol_table_name, type_name = type_name.split(constants.BANG)[0:2]\n\n # when checking for symbols from a table other than nt_symbols grab _OBJECT_HEADER from the kernel\n # because symbol_table_name will be different from kernel_symbol_table.\n if kernel_symbol_table:\n object_header_type = self._context.symbol_space.get_type(kernel_symbol_table + constants.BANG +\n \"_OBJECT_HEADER\")\n else:\n # otherwise symbol_table_name *is* the kernel symbol table, so just use that.\n object_header_type = self._context.symbol_space.get_type(symbol_table_name + constants.BANG +\n \"_OBJECT_HEADER\")\n\n pool_header_size = self.vol.size\n\n # if there is no object type, then just instantiate a structure\n if not executive:\n mem_object = self._context.object(symbol_table_name + constants.BANG + type_name,\n layer_name = self.vol.layer_name,\n offset = self.vol.offset + pool_header_size,\n native_layer_name = native_layer_name)\n return mem_object\n\n # otherwise we have an executive object in the pool\n else:\n if symbols.symbol_table_is_64bit(self._context, symbol_table_name):\n alignment = 16\n else:\n alignment = 8\n\n # use the top down approach for windows 8 and later\n if use_top_down:\n body_offset = object_header_type.relative_child_offset('Body')\n infomask_offset = object_header_type.relative_child_offset('InfoMask')\n pointercount_offset = object_header_type.relative_child_offset('PointerCount')\n pointercount_size = object_header_type.members['PointerCount'][1].size\n optional_headers, lengths_of_optional_headers = self._calculate_optional_header_lengths(\n self._context, symbol_table_name)\n padding_available = None if 'PADDING_INFO' not in optional_headers else optional_headers.index(\n 'PADDING_INFO')\n max_optional_headers_length = sum(lengths_of_optional_headers)\n\n # define the starting and ending bounds for the scan\n start_offset = self.vol.offset + pool_header_size\n addr_limit = min(max_optional_headers_length, self.BlockSize * alignment)\n\n # A single read is better than lots of little one-byte reads.\n # We're ok padding this, because the byte we'd check would be 0 which would only be valid if there\n # were no optional headers in the first place (ie, if we read too much for headers that don't exist,\n # but the bit we could read were valid)\n infomask_data = self._context.layers[self.vol.layer_name].read(start_offset,\n addr_limit + infomask_offset,\n pad = True)\n\n # Addr stores the offset to the potential start of the OBJECT_HEADER from just after the POOL_HEADER\n # It will always be aligned to a particular alignment\n for addr in range(0, addr_limit, alignment):\n infomask_value = infomask_data[addr + infomask_offset]\n pointercount_value = int.from_bytes(\n infomask_data[addr + pointercount_offset:addr + pointercount_offset + pointercount_size],\n byteorder = 'little',\n signed = True)\n if not 0x1000000 > pointercount_value >= 0:\n continue\n\n padding_present = False\n optional_headers_length = 0\n for i in range(len(lengths_of_optional_headers)):\n if infomask_value & (1 << i):\n optional_headers_length += lengths_of_optional_headers[i]\n if i == padding_available:\n padding_present = True\n\n # PADDING_INFO is a special case (4 bytes that contain the total padding length)\n padding_length = 0\n if padding_present:\n # Read the four bytes from just before the next optional_headers_length minus the padding_info size\n #\n # ---------------\n # POOL_HEADER\n # ---------------\n #\n # start of PADDING_INFO\n # ---------------\n # End of other optional headers\n # ---------------\n # OBJECT_HEADER\n # ---------------\n if addr - optional_headers_length < 0:\n continue\n padding_length = struct.unpack(\n \"= padding_length > addr:\n continue\n\n try:\n mem_object = self._context.object(symbol_table_name + constants.BANG + type_name,\n layer_name = self.vol.layer_name,\n offset = addr + body_offset + start_offset,\n native_layer_name = native_layer_name)\n\n if mem_object.is_valid():\n return mem_object\n\n except (TypeError, exceptions.InvalidAddressException):\n pass\n\n # use the bottom up approach for windows 7 and earlier\n else:\n type_size = self._context.symbol_space.get_type(symbol_table_name + constants.BANG + type_name).size\n rounded_size = conversion.round(type_size, alignment, up = True)\n\n mem_object = self._context.object(symbol_table_name + constants.BANG + type_name,\n layer_name = self.vol.layer_name,\n offset = self.vol.offset + self.BlockSize * alignment - rounded_size,\n native_layer_name = native_layer_name)\n\n try:\n if mem_object.is_valid():\n return mem_object\n except (TypeError, exceptions.InvalidAddressException):\n return None\n return None","function_tokens":["def","get_object","(","self",",","type_name",":","str",",","use_top_down",":","bool",",","executive",":","bool","=","False",",","kernel_symbol_table",":","Optional","[","str","]","=","None",",","native_layer_name",":","Optional","[","str","]","=","None",")","->","Optional","[","interfaces",".","objects",".","ObjectInterface","]",":","symbol_table_name","=","self",".","vol",".","type_name",".","split","(","constants",".","BANG",")","[","0","]","if","constants",".","BANG","in","type_name",":","symbol_table_name",",","type_name","=","type_name",".","split","(","constants",".","BANG",")","[","0",":","2","]","# when checking for symbols from a table other than nt_symbols grab _OBJECT_HEADER from the kernel","# because symbol_table_name will be different from kernel_symbol_table.","if","kernel_symbol_table",":","object_header_type","=","self",".","_context",".","symbol_space",".","get_type","(","kernel_symbol_table","+","constants",".","BANG","+","\"_OBJECT_HEADER\"",")","else",":","# otherwise symbol_table_name *is* the kernel symbol table, so just use that.","object_header_type","=","self",".","_context",".","symbol_space",".","get_type","(","symbol_table_name","+","constants",".","BANG","+","\"_OBJECT_HEADER\"",")","pool_header_size","=","self",".","vol",".","size","# if there is no object type, then just instantiate a structure","if","not","executive",":","mem_object","=","self",".","_context",".","object","(","symbol_table_name","+","constants",".","BANG","+","type_name",",","layer_name","=","self",".","vol",".","layer_name",",","offset","=","self",".","vol",".","offset","+","pool_header_size",",","native_layer_name","=","native_layer_name",")","return","mem_object","# otherwise we have an executive object in the pool","else",":","if","symbols",".","symbol_table_is_64bit","(","self",".","_context",",","symbol_table_name",")",":","alignment","=","16","else",":","alignment","=","8","# use the top down approach for windows 8 and later","if","use_top_down",":","body_offset","=","object_header_type",".","relative_child_offset","(","'Body'",")","infomask_offset","=","object_header_type",".","relative_child_offset","(","'InfoMask'",")","pointercount_offset","=","object_header_type",".","relative_child_offset","(","'PointerCount'",")","pointercount_size","=","object_header_type",".","members","[","'PointerCount'","]","[","1","]",".","size","optional_headers",",","lengths_of_optional_headers","=","self",".","_calculate_optional_header_lengths","(","self",".","_context",",","symbol_table_name",")","padding_available","=","None","if","'PADDING_INFO'","not","in","optional_headers","else","optional_headers",".","index","(","'PADDING_INFO'",")","max_optional_headers_length","=","sum","(","lengths_of_optional_headers",")","# define the starting and ending bounds for the scan","start_offset","=","self",".","vol",".","offset","+","pool_header_size","addr_limit","=","min","(","max_optional_headers_length",",","self",".","BlockSize","*","alignment",")","# A single read is better than lots of little one-byte reads.","# We're ok padding this, because the byte we'd check would be 0 which would only be valid if there","# were no optional headers in the first place (ie, if we read too much for headers that don't exist,","# but the bit we could read were valid)","infomask_data","=","self",".","_context",".","layers","[","self",".","vol",".","layer_name","]",".","read","(","start_offset",",","addr_limit","+","infomask_offset",",","pad","=","True",")","# Addr stores the offset to the potential start of the OBJECT_HEADER from just after the POOL_HEADER","# It will always be aligned to a particular alignment","for","addr","in","range","(","0",",","addr_limit",",","alignment",")",":","infomask_value","=","infomask_data","[","addr","+","infomask_offset","]","pointercount_value","=","int",".","from_bytes","(","infomask_data","[","addr","+","pointercount_offset",":","addr","+","pointercount_offset","+","pointercount_size","]",",","byteorder","=","'little'",",","signed","=","True",")","if","not","0x1000000",">","pointercount_value",">=","0",":","continue","padding_present","=","False","optional_headers_length","=","0","for","i","in","range","(","len","(","lengths_of_optional_headers",")",")",":","if","infomask_value","&","(","1","<<","i",")",":","optional_headers_length","+=","lengths_of_optional_headers","[","i","]","if","i","==","padding_available",":","padding_present","=","True","# PADDING_INFO is a special case (4 bytes that contain the total padding length)","padding_length","=","0","if","padding_present",":","# Read the four bytes from just before the next optional_headers_length minus the padding_info size","#","# ---------------","# POOL_HEADER","# ---------------","#","# start of PADDING_INFO","# ---------------","# End of other optional headers","# ---------------","# OBJECT_HEADER","# ---------------","if","addr","-","optional_headers_length","<","0",":","continue","padding_length","=","struct",".","unpack","(","\"=","padding_length",">","addr",":","continue","try",":","mem_object","=","self",".","_context",".","object","(","symbol_table_name","+","constants",".","BANG","+","type_name",",","layer_name","=","self",".","vol",".","layer_name",",","offset","=","addr","+","body_offset","+","start_offset",",","native_layer_name","=","native_layer_name",")","if","mem_object",".","is_valid","(",")",":","return","mem_object","except","(","TypeError",",","exceptions",".","InvalidAddressException",")",":","pass","# use the bottom up approach for windows 7 and earlier","else",":","type_size","=","self",".","_context",".","symbol_space",".","get_type","(","symbol_table_name","+","constants",".","BANG","+","type_name",")",".","size","rounded_size","=","conversion",".","round","(","type_size",",","alignment",",","up","=","True",")","mem_object","=","self",".","_context",".","object","(","symbol_table_name","+","constants",".","BANG","+","type_name",",","layer_name","=","self",".","vol",".","layer_name",",","offset","=","self",".","vol",".","offset","+","self",".","BlockSize","*","alignment","-","rounded_size",",","native_layer_name","=","native_layer_name",")","try",":","if","mem_object",".","is_valid","(",")",":","return","mem_object","except","(","TypeError",",","exceptions",".","InvalidAddressException",")",":","return","None","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py#L19-L165"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py","language":"python","identifier":"POOL_TRACKER_BIG_PAGES.get_key","parameters":"(self)","argument_list":"","return_statement":"return \"\".join([chr(x) if 32 < x < 127 else '' for x in tag_bytes])","docstring":"Returns the Key value as a 4 character string","docstring_summary":"Returns the Key value as a 4 character string","docstring_tokens":["Returns","the","Key","value","as","a","4","character","string"],"function":"def get_key(self) -> str:\n \"\"\"Returns the Key value as a 4 character string\"\"\"\n tag_bytes = objects.convert_value_to_data(self.Key, int, objects.DataFormatInfo(4, \"little\", False))\n return \"\".join([chr(x) if 32 < x < 127 else '' for x in tag_bytes])","function_tokens":["def","get_key","(","self",")","->","str",":","tag_bytes","=","objects",".","convert_value_to_data","(","self",".","Key",",","int",",","objects",".","DataFormatInfo","(","4",",","\"little\"",",","False",")",")","return","\"\"",".","join","(","[","chr","(","x",")","if","32","<","x","<","127","else","''","for","x","in","tag_bytes","]",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py#L232-L235"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py","language":"python","identifier":"POOL_TRACKER_BIG_PAGES.get_pool_type","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the enum name for the PoolType value on applicable systems","docstring_summary":"Returns the enum name for the PoolType value on applicable systems","docstring_tokens":["Returns","the","enum","name","for","the","PoolType","value","on","applicable","systems"],"function":"def get_pool_type(self) -> Union[str, interfaces.renderers.BaseAbsentValue]:\n \"\"\"Returns the enum name for the PoolType value on applicable systems\"\"\"\n # Not applicable until Vista\n if hasattr(self, 'PoolType'):\n if not self.pool_type_lookup:\n self._generate_pool_type_lookup()\n return self.pool_type_lookup.get(self.PoolType, \"Unknown choice {}\".format(self.PoolType))\n else:\n return renderers.NotApplicableValue()","function_tokens":["def","get_pool_type","(","self",")","->","Union","[","str",",","interfaces",".","renderers",".","BaseAbsentValue","]",":","# Not applicable until Vista","if","hasattr","(","self",",","'PoolType'",")",":","if","not","self",".","pool_type_lookup",":","self",".","_generate_pool_type_lookup","(",")","return","self",".","pool_type_lookup",".","get","(","self",".","PoolType",",","\"Unknown choice {}\"",".","format","(","self",".","PoolType",")",")","else",":","return","renderers",".","NotApplicableValue","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py#L237-L245"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py","language":"python","identifier":"POOL_TRACKER_BIG_PAGES.get_number_of_bytes","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the NumberOfBytes value on applicable systems","docstring_summary":"Returns the NumberOfBytes value on applicable systems","docstring_tokens":["Returns","the","NumberOfBytes","value","on","applicable","systems"],"function":"def get_number_of_bytes(self) -> Union[int, interfaces.renderers.BaseAbsentValue]:\n \"\"\"Returns the NumberOfBytes value on applicable systems\"\"\"\n # Not applicable until Vista\n try:\n return self.NumberOfBytes\n except AttributeError:\n return renderers.NotApplicableValue()","function_tokens":["def","get_number_of_bytes","(","self",")","->","Union","[","int",",","interfaces",".","renderers",".","BaseAbsentValue","]",":","# Not applicable until Vista","try",":","return","self",".","NumberOfBytes","except","AttributeError",":","return","renderers",".","NotApplicableValue","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py#L247-L253"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py","language":"python","identifier":"OBJECT_HEADER.is_valid","parameters":"(self)","argument_list":"","return_statement":"return True","docstring":"Determine if the object is valid.","docstring_summary":"Determine if the object is valid.","docstring_tokens":["Determine","if","the","object","is","valid","."],"function":"def is_valid(self) -> bool:\n \"\"\"Determine if the object is valid.\"\"\"\n\n # if self.InfoMask > 0x48:\n # return False\n\n try:\n if self.PointerCount > 0x1000000 or self.PointerCount < 0:\n return False\n except exceptions.InvalidAddressException:\n return False\n\n return True","function_tokens":["def","is_valid","(","self",")","->","bool",":","# if self.InfoMask > 0x48:","# return False","try",":","if","self",".","PointerCount",">","0x1000000","or","self",".","PointerCount","<","0",":","return","False","except","exceptions",".","InvalidAddressException",":","return","False","return","True"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py#L276-L288"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py","language":"python","identifier":"OBJECT_HEADER.get_object_type","parameters":"(self, type_map: Dict[int, str], cookie: int = None)","argument_list":"","return_statement":"return self.vol.object_header_object_type","docstring":"Across all Windows versions, the _OBJECT_HEADER embeds details on\n the type of object (i.e. process, file) but the way its embedded\n differs between versions.\n\n This API abstracts away those details.","docstring_summary":"Across all Windows versions, the _OBJECT_HEADER embeds details on\n the type of object (i.e. process, file) but the way its embedded\n differs between versions.","docstring_tokens":["Across","all","Windows","versions","the","_OBJECT_HEADER","embeds","details","on","the","type","of","object","(","i",".","e",".","process","file",")","but","the","way","its","embedded","differs","between","versions","."],"function":"def get_object_type(self, type_map: Dict[int, str], cookie: int = None) -> Optional[str]:\n \"\"\"Across all Windows versions, the _OBJECT_HEADER embeds details on\n the type of object (i.e. process, file) but the way its embedded\n differs between versions.\n\n This API abstracts away those details.\n \"\"\"\n\n if self.vol.get('object_header_object_type', None) is not None:\n return self.vol.object_header_object_type\n\n try:\n # vista and earlier have a Type member\n self._vol['object_header_object_type'] = self.Type.Name.String\n except AttributeError:\n # windows 7 and later have a TypeIndex, but windows 10\n # further encodes the index value with nt1!ObHeaderCookie\n try:\n type_index = ((self.vol.offset >> 8) ^ cookie ^ self.TypeIndex) & 0xFF\n except (AttributeError, TypeError):\n type_index = self.TypeIndex\n\n self._vol['object_header_object_type'] = type_map.get(type_index)\n return self.vol.object_header_object_type","function_tokens":["def","get_object_type","(","self",",","type_map",":","Dict","[","int",",","str","]",",","cookie",":","int","=","None",")","->","Optional","[","str","]",":","if","self",".","vol",".","get","(","'object_header_object_type'",",","None",")","is","not","None",":","return","self",".","vol",".","object_header_object_type","try",":","# vista and earlier have a Type member","self",".","_vol","[","'object_header_object_type'","]","=","self",".","Type",".","Name",".","String","except","AttributeError",":","# windows 7 and later have a TypeIndex, but windows 10","# further encodes the index value with nt1!ObHeaderCookie","try",":","type_index","=","(","(","self",".","vol",".","offset",">>","8",")","^","cookie","^","self",".","TypeIndex",")","&","0xFF","except","(","AttributeError",",","TypeError",")",":","type_index","=","self",".","TypeIndex","self",".","_vol","[","'object_header_object_type'","]","=","type_map",".","get","(","type_index",")","return","self",".","vol",".","object_header_object_type"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/pool.py#L290-L313"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py","language":"python","identifier":"SERVICE_RECORD.is_valid","parameters":"(self)","argument_list":"","return_statement":"return True","docstring":"Determine if the structure is valid.","docstring_summary":"Determine if the structure is valid.","docstring_tokens":["Determine","if","the","structure","is","valid","."],"function":"def is_valid(self) -> bool:\n \"\"\"Determine if the structure is valid.\"\"\"\n if self.Order < 0 or self.Order > 0xFFFF:\n return False\n\n try:\n _ = self.State.description\n _ = self.Start.description\n except ValueError:\n return False\n\n return True","function_tokens":["def","is_valid","(","self",")","->","bool",":","if","self",".","Order","<","0","or","self",".","Order",">","0xFFFF",":","return","False","try",":","_","=","self",".","State",".","description","_","=","self",".","Start",".","description","except","ValueError",":","return","False","return","True"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py#L15-L26"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py","language":"python","identifier":"SERVICE_RECORD.get_pid","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Return the pid of the process, if any.","docstring_summary":"Return the pid of the process, if any.","docstring_tokens":["Return","the","pid","of","the","process","if","any","."],"function":"def get_pid(self) -> Union[int, interfaces.renderers.BaseAbsentValue]:\n \"\"\"Return the pid of the process, if any.\"\"\"\n if self.State.description != \"SERVICE_RUNNING\" or \"PROCESS\" not in self.get_type():\n return renderers.NotApplicableValue()\n\n try:\n return self.ServiceProcess.ProcessId\n except exceptions.InvalidAddressException:\n return renderers.UnreadableValue()","function_tokens":["def","get_pid","(","self",")","->","Union","[","int",",","interfaces",".","renderers",".","BaseAbsentValue","]",":","if","self",".","State",".","description","!=","\"SERVICE_RUNNING\"","or","\"PROCESS\"","not","in","self",".","get_type","(",")",":","return","renderers",".","NotApplicableValue","(",")","try",":","return","self",".","ServiceProcess",".","ProcessId","except","exceptions",".","InvalidAddressException",":","return","renderers",".","UnreadableValue","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py#L28-L36"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py","language":"python","identifier":"SERVICE_RECORD.get_binary","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the binary associated with the service.","docstring_summary":"Returns the binary associated with the service.","docstring_tokens":["Returns","the","binary","associated","with","the","service","."],"function":"def get_binary(self) -> Union[str, interfaces.renderers.BaseAbsentValue]:\n \"\"\"Returns the binary associated with the service.\"\"\"\n if self.State.description != \"SERVICE_RUNNING\":\n return renderers.NotApplicableValue()\n\n # depending on whether the service is for a process\n # or kernel driver, the binary path is stored differently\n try:\n if \"PROCESS\" in self.get_type():\n return self.ServiceProcess.BinaryPath.dereference().cast(\"string\",\n encoding = \"utf-16\",\n errors = \"replace\",\n max_length = 512)\n else:\n return self.DriverName.dereference().cast(\"string\",\n encoding = \"utf-16\",\n errors = \"replace\",\n max_length = 512)\n except exceptions.InvalidAddressException:\n return renderers.UnreadableValue()","function_tokens":["def","get_binary","(","self",")","->","Union","[","str",",","interfaces",".","renderers",".","BaseAbsentValue","]",":","if","self",".","State",".","description","!=","\"SERVICE_RUNNING\"",":","return","renderers",".","NotApplicableValue","(",")","# depending on whether the service is for a process","# or kernel driver, the binary path is stored differently","try",":","if","\"PROCESS\"","in","self",".","get_type","(",")",":","return","self",".","ServiceProcess",".","BinaryPath",".","dereference","(",")",".","cast","(","\"string\"",",","encoding","=","\"utf-16\"",",","errors","=","\"replace\"",",","max_length","=","512",")","else",":","return","self",".","DriverName",".","dereference","(",")",".","cast","(","\"string\"",",","encoding","=","\"utf-16\"",",","errors","=","\"replace\"",",","max_length","=","512",")","except","exceptions",".","InvalidAddressException",":","return","renderers",".","UnreadableValue","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py#L38-L57"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py","language":"python","identifier":"SERVICE_RECORD.get_name","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the service name.","docstring_summary":"Returns the service name.","docstring_tokens":["Returns","the","service","name","."],"function":"def get_name(self) -> Union[str, interfaces.renderers.BaseAbsentValue]:\n \"\"\"Returns the service name.\"\"\"\n try:\n return self.ServiceName.dereference().cast(\"string\",\n encoding = \"utf-16\",\n errors = \"replace\",\n max_length = 512)\n except exceptions.InvalidAddressException:\n return renderers.UnreadableValue()","function_tokens":["def","get_name","(","self",")","->","Union","[","str",",","interfaces",".","renderers",".","BaseAbsentValue","]",":","try",":","return","self",".","ServiceName",".","dereference","(",")",".","cast","(","\"string\"",",","encoding","=","\"utf-16\"",",","errors","=","\"replace\"",",","max_length","=","512",")","except","exceptions",".","InvalidAddressException",":","return","renderers",".","UnreadableValue","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py#L59-L67"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py","language":"python","identifier":"SERVICE_RECORD.get_display","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns the service display.","docstring_summary":"Returns the service display.","docstring_tokens":["Returns","the","service","display","."],"function":"def get_display(self) -> Union[str, interfaces.renderers.BaseAbsentValue]:\n \"\"\"Returns the service display.\"\"\"\n try:\n return self.DisplayName.dereference().cast(\"string\",\n encoding = \"utf-16\",\n errors = \"replace\",\n max_length = 512)\n except exceptions.InvalidAddressException:\n return renderers.UnreadableValue()","function_tokens":["def","get_display","(","self",")","->","Union","[","str",",","interfaces",".","renderers",".","BaseAbsentValue","]",":","try",":","return","self",".","DisplayName",".","dereference","(",")",".","cast","(","\"string\"",",","encoding","=","\"utf-16\"",",","errors","=","\"replace\"",",","max_length","=","512",")","except","exceptions",".","InvalidAddressException",":","return","renderers",".","UnreadableValue","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py#L69-L77"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py","language":"python","identifier":"SERVICE_RECORD.get_type","parameters":"(self)","argument_list":"","return_statement":"return \"|\".join(type_flags(self.Type))","docstring":"Returns the binary types.","docstring_summary":"Returns the binary types.","docstring_tokens":["Returns","the","binary","types","."],"function":"def get_type(self) -> str:\n \"\"\"Returns the binary types.\"\"\"\n\n SERVICE_TYPE_FLAGS = {\n 'SERVICE_KERNEL_DRIVER': 1,\n 'SERVICE_FILE_SYSTEM_DRIVER': 2,\n 'SERVICE_ADAPTOR': 4,\n 'SERVICE_RECOGNIZER_DRIVER': 8,\n 'SERVICE_WIN32_OWN_PROCESS': 16,\n 'SERVICE_WIN32_SHARE_PROCESS': 32,\n 'SERVICE_INTERACTIVE_PROCESS': 256\n }\n\n type_flags = Flags(choices = SERVICE_TYPE_FLAGS)\n return \"|\".join(type_flags(self.Type))","function_tokens":["def","get_type","(","self",")","->","str",":","SERVICE_TYPE_FLAGS","=","{","'SERVICE_KERNEL_DRIVER'",":","1",",","'SERVICE_FILE_SYSTEM_DRIVER'",":","2",",","'SERVICE_ADAPTOR'",":","4",",","'SERVICE_RECOGNIZER_DRIVER'",":","8",",","'SERVICE_WIN32_OWN_PROCESS'",":","16",",","'SERVICE_WIN32_SHARE_PROCESS'",":","32",",","'SERVICE_INTERACTIVE_PROCESS'",":","256","}","type_flags","=","Flags","(","choices","=","SERVICE_TYPE_FLAGS",")","return","\"|\"",".","join","(","type_flags","(","self",".","Type",")",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py#L79-L93"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py","language":"python","identifier":"SERVICE_RECORD.traverse","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Generator that enumerates other services.","docstring_summary":"Generator that enumerates other services.","docstring_tokens":["Generator","that","enumerates","other","services","."],"function":"def traverse(self):\n \"\"\"Generator that enumerates other services.\"\"\"\n\n try:\n if hasattr(self, \"PrevEntry\"):\n yield self\n # make sure we dereference these pointers, or the\n # is_valid() checks will apply to the pointer and\n # not the _SERVICE_RECORD object as intended.\n rec = self.PrevEntry\n while rec and rec.is_valid():\n yield rec\n rec = rec.PrevEntry\n else:\n rec = self\n while rec and rec.is_valid():\n yield rec\n rec = rec.ServiceList.Blink.dereference()\n except exceptions.InvalidAddressException:\n return","function_tokens":["def","traverse","(","self",")",":","try",":","if","hasattr","(","self",",","\"PrevEntry\"",")",":","yield","self","# make sure we dereference these pointers, or the","# is_valid() checks will apply to the pointer and","# not the _SERVICE_RECORD object as intended.","rec","=","self",".","PrevEntry","while","rec","and","rec",".","is_valid","(",")",":","yield","rec","rec","=","rec",".","PrevEntry","else",":","rec","=","self","while","rec","and","rec",".","is_valid","(",")",":","yield","rec","rec","=","rec",".","ServiceList",".","Blink",".","dereference","(",")","except","exceptions",".","InvalidAddressException",":","return"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py#L95-L114"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py","language":"python","identifier":"SERVICE_HEADER.is_valid","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Determine if the structure is valid.","docstring_summary":"Determine if the structure is valid.","docstring_tokens":["Determine","if","the","structure","is","valid","."],"function":"def is_valid(self) -> bool:\n \"\"\"Determine if the structure is valid.\"\"\"\n try:\n return self.ServiceRecord.is_valid()\n except exceptions.InvalidAddressException:\n return False","function_tokens":["def","is_valid","(","self",")","->","bool",":","try",":","return","self",".","ServiceRecord",".","is_valid","(",")","except","exceptions",".","InvalidAddressException",":","return","False"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/services.py#L120-L125"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py","language":"python","identifier":"RegValueTypes.get","parameters":"(cls, value)","argument_list":"","return_statement":"","docstring":"An alternative method for using this enum when the value may be\n unknown.\n\n This is used to support unknown value requests in Python <3.6.","docstring_summary":"An alternative method for using this enum when the value may be\n unknown.","docstring_tokens":["An","alternative","method","for","using","this","enum","when","the","value","may","be","unknown","."],"function":"def get(cls, value):\n \"\"\"An alternative method for using this enum when the value may be\n unknown.\n\n This is used to support unknown value requests in Python <3.6.\n \"\"\"\n try:\n return cls(value)\n except ValueError:\n return cls(RegValueTypes.REG_UNKNOWN)","function_tokens":["def","get","(","cls",",","value",")",":","try",":","return","cls","(","value",")","except","ValueError",":","return","cls","(","RegValueTypes",".","REG_UNKNOWN",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py#L40-L49"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py","language":"python","identifier":"CMHIVE.is_valid","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Determine if the object is valid.","docstring_summary":"Determine if the object is valid.","docstring_tokens":["Determine","if","the","object","is","valid","."],"function":"def is_valid(self) -> bool:\n \"\"\"Determine if the object is valid.\"\"\"\n try:\n return self.Hive.Signature == 0xbee0bee0\n except exceptions.InvalidAddressException:\n return False","function_tokens":["def","is_valid","(","self",")","->","bool",":","try",":","return","self",".","Hive",".","Signature","==","0xbee0bee0","except","exceptions",".","InvalidAddressException",":","return","False"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py#L76-L81"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py","language":"python","identifier":"CMHIVE.get_name","parameters":"(self)","argument_list":"","return_statement":"return None","docstring":"Determine a name for the hive.\n\n Note that some attributes are unpredictably blank across\n different OS versions while others are populated, so we check\n all possibilities and take the first one that's not empty","docstring_summary":"Determine a name for the hive.","docstring_tokens":["Determine","a","name","for","the","hive","."],"function":"def get_name(self) -> Optional[interfaces.objects.ObjectInterface]:\n \"\"\"Determine a name for the hive.\n\n Note that some attributes are unpredictably blank across\n different OS versions while others are populated, so we check\n all possibilities and take the first one that's not empty\n \"\"\"\n\n for attr in [\"FileFullPath\", \"FileUserName\", \"HiveRootPath\"]:\n try:\n return getattr(self, attr).get_string()\n except (AttributeError, exceptions.InvalidAddressException):\n pass\n\n return None","function_tokens":["def","get_name","(","self",")","->","Optional","[","interfaces",".","objects",".","ObjectInterface","]",":","for","attr","in","[","\"FileFullPath\"",",","\"FileUserName\"",",","\"HiveRootPath\"","]",":","try",":","return","getattr","(","self",",","attr",")",".","get_string","(",")","except","(","AttributeError",",","exceptions",".","InvalidAddressException",")",":","pass","return","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py#L83-L97"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py","language":"python","identifier":"CM_KEY_BODY._skip_key_hive_entry_path","parameters":"(self, kcb_flags)","argument_list":"","return_statement":"return False","docstring":"Win10 14393 introduced an extra path element that it skips over by\n checking for Flags that contain KEY_HIVE_ENTRY.","docstring_summary":"Win10 14393 introduced an extra path element that it skips over by\n checking for Flags that contain KEY_HIVE_ENTRY.","docstring_tokens":["Win10","14393","introduced","an","extra","path","element","that","it","skips","over","by","checking","for","Flags","that","contain","KEY_HIVE_ENTRY","."],"function":"def _skip_key_hive_entry_path(self, kcb_flags):\n \"\"\"Win10 14393 introduced an extra path element that it skips over by\n checking for Flags that contain KEY_HIVE_ENTRY.\"\"\"\n\n # _CM_KEY_BODY.Trans introduced in Win10 14393\n if hasattr(self, \"Trans\") and RegKeyFlags.KEY_HIVE_ENTRY & kcb_flags == RegKeyFlags.KEY_HIVE_ENTRY:\n return True\n\n return False","function_tokens":["def","_skip_key_hive_entry_path","(","self",",","kcb_flags",")",":","# _CM_KEY_BODY.Trans introduced in Win10 14393","if","hasattr","(","self",",","\"Trans\"",")","and","RegKeyFlags",".","KEY_HIVE_ENTRY","&","kcb_flags","==","RegKeyFlags",".","KEY_HIVE_ENTRY",":","return","True","return","False"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py#L106-L114"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py","language":"python","identifier":"CM_KEY_NODE.get_subkeys","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns a list of the key nodes.","docstring_summary":"Returns a list of the key nodes.","docstring_tokens":["Returns","a","list","of","the","key","nodes","."],"function":"def get_subkeys(self) -> Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Returns a list of the key nodes.\"\"\"\n hive = self._context.layers[self.vol.layer_name]\n if not isinstance(hive, RegistryHive):\n raise TypeError(\"CM_KEY_NODE was not instantiated on a RegistryHive layer\")\n for index in range(2):\n # Use get_cell because it should *always* be a KeyIndex\n subkey_node = hive.get_cell(self.SubKeyLists[index]).u.KeyIndex\n yield from self._get_subkeys_recursive(hive, subkey_node)","function_tokens":["def","get_subkeys","(","self",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","hive","=","self",".","_context",".","layers","[","self",".","vol",".","layer_name","]","if","not","isinstance","(","hive",",","RegistryHive",")",":","raise","TypeError","(","\"CM_KEY_NODE was not instantiated on a RegistryHive layer\"",")","for","index","in","range","(","2",")",":","# Use get_cell because it should *always* be a KeyIndex","subkey_node","=","hive",".","get_cell","(","self",".","SubKeyLists","[","index","]",")",".","u",".","KeyIndex","yield","from","self",".","_get_subkeys_recursive","(","hive",",","subkey_node",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py#L145-L153"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py","language":"python","identifier":"CM_KEY_NODE._get_subkeys_recursive","parameters":"(\n self, hive: RegistryHive,\n node: interfaces.objects.ObjectInterface)","argument_list":"","return_statement":"","docstring":"Recursively descend a node returning subkeys.","docstring_summary":"Recursively descend a node returning subkeys.","docstring_tokens":["Recursively","descend","a","node","returning","subkeys","."],"function":"def _get_subkeys_recursive(\n self, hive: RegistryHive,\n node: interfaces.objects.ObjectInterface) -> Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Recursively descend a node returning subkeys.\"\"\"\n # The keylist appears to include 4 bytes of key name after each value\n # We can either double the list and only use the even items, or\n # We could change the array type to a struct with both parts\n try:\n signature = node.cast('string', max_length = 2, encoding = 'latin-1')\n except (exceptions.InvalidAddressException, RegistryFormatException):\n return\n\n listjump = None\n if signature == 'ri':\n listjump = 1\n elif signature == 'lh' or signature == 'lf':\n listjump = 2\n elif node.vol.type_name.endswith(constants.BANG + \"_CM_KEY_NODE\"):\n yield node\n else:\n vollog.debug(\"Unexpected node type encountered when traversing subkeys: {}, signature: {}\".format(\n node.vol.type_name, signature))\n\n if listjump:\n node.List.count = node.Count * listjump\n for subnode_offset in node.List[::listjump]:\n if (subnode_offset & 0x7fffffff) > hive.maximum_address:\n vollog.log(constants.LOGLEVEL_VVV,\n \"Node found with address outside the valid Hive size: {}\".format(hex(subnode_offset)))\n else:\n try:\n subnode = hive.get_node(subnode_offset)\n except (exceptions.InvalidAddressException, RegistryFormatException):\n vollog.log(constants.LOGLEVEL_VVV,\n \"Failed to get node at {}, skipping\".format(hex(subnode_offset)))\n continue\n yield from self._get_subkeys_recursive(hive, subnode)","function_tokens":["def","_get_subkeys_recursive","(","self",",","hive",":","RegistryHive",",","node",":","interfaces",".","objects",".","ObjectInterface",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","# The keylist appears to include 4 bytes of key name after each value","# We can either double the list and only use the even items, or","# We could change the array type to a struct with both parts","try",":","signature","=","node",".","cast","(","'string'",",","max_length","=","2",",","encoding","=","'latin-1'",")","except","(","exceptions",".","InvalidAddressException",",","RegistryFormatException",")",":","return","listjump","=","None","if","signature","==","'ri'",":","listjump","=","1","elif","signature","==","'lh'","or","signature","==","'lf'",":","listjump","=","2","elif","node",".","vol",".","type_name",".","endswith","(","constants",".","BANG","+","\"_CM_KEY_NODE\"",")",":","yield","node","else",":","vollog",".","debug","(","\"Unexpected node type encountered when traversing subkeys: {}, signature: {}\"",".","format","(","node",".","vol",".","type_name",",","signature",")",")","if","listjump",":","node",".","List",".","count","=","node",".","Count","*","listjump","for","subnode_offset","in","node",".","List","[",":",":","listjump","]",":","if","(","subnode_offset","&","0x7fffffff",")",">","hive",".","maximum_address",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Node found with address outside the valid Hive size: {}\"",".","format","(","hex","(","subnode_offset",")",")",")","else",":","try",":","subnode","=","hive",".","get_node","(","subnode_offset",")","except","(","exceptions",".","InvalidAddressException",",","RegistryFormatException",")",":","vollog",".","log","(","constants",".","LOGLEVEL_VVV",",","\"Failed to get node at {}, skipping\"",".","format","(","hex","(","subnode_offset",")",")",")","continue","yield","from","self",".","_get_subkeys_recursive","(","hive",",","subnode",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py#L155-L191"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py","language":"python","identifier":"CM_KEY_NODE.get_values","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns a list of the Value nodes for a key.","docstring_summary":"Returns a list of the Value nodes for a key.","docstring_tokens":["Returns","a","list","of","the","Value","nodes","for","a","key","."],"function":"def get_values(self) -> Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Returns a list of the Value nodes for a key.\"\"\"\n hive = self._context.layers[self.vol.layer_name]\n if not isinstance(hive, RegistryHive):\n raise TypeError(\"CM_KEY_NODE was not instantiated on a RegistryHive layer\")\n child_list = hive.get_cell(self.ValueList.List).u.KeyList\n child_list.count = self.ValueList.Count\n\n try:\n for v in child_list:\n if v != 0:\n try:\n node = hive.get_node(v)\n except (RegistryInvalidIndex, RegistryFormatException) as excp:\n vollog.debug(\"Invalid address {}\".format(excp))\n continue\n if node.vol.type_name.endswith(constants.BANG + '_CM_KEY_VALUE'):\n yield node\n except (exceptions.InvalidAddressException, RegistryFormatException) as excp:\n vollog.debug(\"Invalid address in get_values iteration: {}\".format(excp))\n return","function_tokens":["def","get_values","(","self",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","hive","=","self",".","_context",".","layers","[","self",".","vol",".","layer_name","]","if","not","isinstance","(","hive",",","RegistryHive",")",":","raise","TypeError","(","\"CM_KEY_NODE was not instantiated on a RegistryHive layer\"",")","child_list","=","hive",".","get_cell","(","self",".","ValueList",".","List",")",".","u",".","KeyList","child_list",".","count","=","self",".","ValueList",".","Count","try",":","for","v","in","child_list",":","if","v","!=","0",":","try",":","node","=","hive",".","get_node","(","v",")","except","(","RegistryInvalidIndex",",","RegistryFormatException",")","as","excp",":","vollog",".","debug","(","\"Invalid address {}\"",".","format","(","excp",")",")","continue","if","node",".","vol",".","type_name",".","endswith","(","constants",".","BANG","+","'_CM_KEY_VALUE'",")",":","yield","node","except","(","exceptions",".","InvalidAddressException",",","RegistryFormatException",")","as","excp",":","vollog",".","debug","(","\"Invalid address in get_values iteration: {}\"",".","format","(","excp",")",")","return"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py#L193-L213"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py","language":"python","identifier":"CM_KEY_NODE.get_name","parameters":"(self)","argument_list":"","return_statement":"return self.Name.cast(\"string\", max_length = namelength, encoding = \"latin-1\")","docstring":"Gets the name for the current key node","docstring_summary":"Gets the name for the current key node","docstring_tokens":["Gets","the","name","for","the","current","key","node"],"function":"def get_name(self) -> interfaces.objects.ObjectInterface:\n \"\"\"Gets the name for the current key node\"\"\"\n namelength = self.NameLength\n self.Name.count = namelength\n return self.Name.cast(\"string\", max_length = namelength, encoding = \"latin-1\")","function_tokens":["def","get_name","(","self",")","->","interfaces",".","objects",".","ObjectInterface",":","namelength","=","self",".","NameLength","self",".","Name",".","count","=","namelength","return","self",".","Name",".","cast","(","\"string\"",",","max_length","=","namelength",",","encoding","=","\"latin-1\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py#L215-L219"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py","language":"python","identifier":"CM_KEY_VALUE.get_name","parameters":"(self)","argument_list":"","return_statement":"return self.Name.cast(\"string\", max_length = namelength, encoding = \"latin-1\")","docstring":"Gets the name for the current key value","docstring_summary":"Gets the name for the current key value","docstring_tokens":["Gets","the","name","for","the","current","key","value"],"function":"def get_name(self) -> interfaces.objects.ObjectInterface:\n \"\"\"Gets the name for the current key value\"\"\"\n namelength = self.NameLength\n self.Name.count = namelength\n return self.Name.cast(\"string\", max_length = namelength, encoding = \"latin-1\")","function_tokens":["def","get_name","(","self",")","->","interfaces",".","objects",".","ObjectInterface",":","namelength","=","self",".","NameLength","self",".","Name",".","count","=","namelength","return","self",".","Name",".","cast","(","\"string\"",",","max_length","=","namelength",",","encoding","=","\"latin-1\"",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py#L236-L240"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/registry.py","language":"python","identifier":"CM_KEY_VALUE.decode_data","parameters":"(self)","argument_list":"","return_statement":"return data","docstring":"Properly decodes the data associated with the value node","docstring_summary":"Properly decodes the data associated with the value node","docstring_tokens":["Properly","decodes","the","data","associated","with","the","value","node"],"function":"def decode_data(self) -> Union[int, bytes]:\n \"\"\"Properly decodes the data associated with the value node\"\"\"\n # Determine if the data is stored inline\n datalen = self.DataLength\n data = b\"\"\n # Check if the data is stored inline\n layer = self._context.layers[self.vol.layer_name]\n if not isinstance(layer, RegistryHive):\n raise TypeError(\"Key value was not instantiated on a RegistryHive layer\")\n\n # If the high-bit is set\n if datalen & 0x80000000:\n # Remove the high bit\n datalen = datalen & 0x7fffffff\n if (0 > datalen or datalen > 4):\n raise ValueError(\"Unable to read inline registry value with excessive length: {}\".format(datalen))\n else:\n data = layer.read(self.Data.vol.offset, datalen)\n elif layer.hive.Version == 5 and datalen > 0x4000:\n # We're bigdata\n big_data = layer.get_node(self.Data)\n # Oddly, we get a list of addresses, at which are addresses, which then point to data blocks\n for i in range(big_data.Count):\n # The value 4 should actually be unsigned-int.size, but since it's a file format that shouldn't change\n # the direct value 4 can be used instead\n block_offset = layer.get_cell(big_data.List + (i * 4)).cast(\"unsigned int\")\n if isinstance(block_offset, int) and block_offset < layer.maximum_address:\n amount = min(BIG_DATA_MAXLEN, datalen)\n data += layer.read(offset = layer.get_cell(block_offset).vol.offset, length = amount)\n datalen -= amount\n else:\n # Suspect Data actually points to a Cell,\n # but the length at the start could be negative so just adding 4 to jump past it\n data = layer.read(self.Data + 4, datalen)\n\n self_type = RegValueTypes.get(self.Type)\n if self_type == RegValueTypes.REG_DWORD:\n if len(data) != struct.calcsize(\"L\"):\n raise ValueError(\"Size of data does not match the type of registry value {}\".format(self.get_name()))\n return struct.unpack(\">L\", data)[0]\n if self_type == RegValueTypes.REG_QWORD:\n if len(data) != struct.calcsize(\"","Union","[","int",",","bytes","]",":","# Determine if the data is stored inline","datalen","=","self",".","DataLength","data","=","b\"\"","# Check if the data is stored inline","layer","=","self",".","_context",".","layers","[","self",".","vol",".","layer_name","]","if","not","isinstance","(","layer",",","RegistryHive",")",":","raise","TypeError","(","\"Key value was not instantiated on a RegistryHive layer\"",")","# If the high-bit is set","if","datalen","&","0x80000000",":","# Remove the high bit","datalen","=","datalen","&","0x7fffffff","if","(","0",">","datalen","or","datalen",">","4",")",":","raise","ValueError","(","\"Unable to read inline registry value with excessive length: {}\"",".","format","(","datalen",")",")","else",":","data","=","layer",".","read","(","self",".","Data",".","vol",".","offset",",","datalen",")","elif","layer",".","hive",".","Version","==","5","and","datalen",">","0x4000",":","# We're bigdata","big_data","=","layer",".","get_node","(","self",".","Data",")","# Oddly, we get a list of addresses, at which are addresses, which then point to data blocks","for","i","in","range","(","big_data",".","Count",")",":","# The value 4 should actually be unsigned-int.size, but since it's a file format that shouldn't change","# the direct value 4 can be used instead","block_offset","=","layer",".","get_cell","(","big_data",".","List","+","(","i","*","4",")",")",".","cast","(","\"unsigned int\"",")","if","isinstance","(","block_offset",",","int",")","and","block_offset","<","layer",".","maximum_address",":","amount","=","min","(","BIG_DATA_MAXLEN",",","datalen",")","data","+=","layer",".","read","(","offset","=","layer",".","get_cell","(","block_offset",")",".","vol",".","offset",",","length","=","amount",")","datalen","-=","amount","else",":","# Suspect Data actually points to a Cell,","# but the length at the start could be negative so just adding 4 to jump past it","data","=","layer",".","read","(","self",".","Data","+","4",",","datalen",")","self_type","=","RegValueTypes",".","get","(","self",".","Type",")","if","self_type","==","RegValueTypes",".","REG_DWORD",":","if","len","(","data",")","!=","struct",".","calcsize","(","\"L\"",")",":","raise","ValueError","(","\"Size of data does not match the type of registry value {}\"",".","format","(","self",".","get_name","(",")",")",")","return","struct",".","unpack","(","\">L\"",",","data",")","[","0","]","if","self_type","==","RegValueTypes",".","REG_QWORD",":","if","len","(","data",")","!=","struct",".","calcsize","(","\"> 8) & 0xffffffff","docstring":"Returns the CSDVersion as an integer (i.e. Service Pack number)","docstring_summary":"Returns the CSDVersion as an integer (i.e. Service Pack number)","docstring_tokens":["Returns","the","CSDVersion","as","an","integer","(","i",".","e",".","Service","Pack","number",")"],"function":"def get_csdversion(self):\n \"\"\"Returns the CSDVersion as an integer (i.e. Service Pack number)\"\"\"\n\n layer_name = self.vol.layer_name\n symbol_table_name = self.get_symbol_table_name()\n\n csdresult = self._context.object(symbol_table_name + constants.BANG + \"unsigned long\",\n layer_name = layer_name,\n offset = self.CmNtCSDVersion)\n\n return (csdresult >> 8) & 0xffffffff","function_tokens":["def","get_csdversion","(","self",")",":","layer_name","=","self",".","vol",".","layer_name","symbol_table_name","=","self",".","get_symbol_table_name","(",")","csdresult","=","self",".","_context",".","object","(","symbol_table_name","+","constants",".","BANG","+","\"unsigned long\"",",","layer_name","=","layer_name",",","offset","=","self",".","CmNtCSDVersion",")","return","(","csdresult",">>","8",")","&","0xffffffff"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/windows\/extensions\/kdbg.py#L23-L33"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/__init__.py","language":"python","identifier":"MacUtilities.mask_mods_list","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n mods: Iterator[Any])","argument_list":"","return_statement":"return [(objects.utility.array_to_string(mod.name), mod.address & mask, (mod.address & mask) + mod.size)\n for mod in mods]","docstring":"A helper function to mask the starting and end address of kernel modules","docstring_summary":"A helper function to mask the starting and end address of kernel modules","docstring_tokens":["A","helper","function","to","mask","the","starting","and","end","address","of","kernel","modules"],"function":"def mask_mods_list(cls, context: interfaces.context.ContextInterface, layer_name: str,\n mods: Iterator[Any]) -> List[Tuple[interfaces.objects.ObjectInterface, Any, Any]]:\n \"\"\"\n A helper function to mask the starting and end address of kernel modules\n \"\"\"\n mask = context.layers[layer_name].address_mask\n\n return [(objects.utility.array_to_string(mod.name), mod.address & mask, (mod.address & mask) + mod.size)\n for mod in mods]","function_tokens":["def","mask_mods_list","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","mods",":","Iterator","[","Any","]",")","->","List","[","Tuple","[","interfaces",".","objects",".","ObjectInterface",",","Any",",","Any","]","]",":","mask","=","context",".","layers","[","layer_name","]",".","address_mask","return","[","(","objects",".","utility",".","array_to_string","(","mod",".","name",")",",","mod",".","address","&","mask",",","(","mod",".","address","&","mask",")","+","mod",".","size",")","for","mod","in","mods","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/__init__.py#L42-L50"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/__init__.py","language":"python","identifier":"MacUtilities.files_descriptors_for_process","parameters":"(cls, context: interfaces.context.ContextInterface, symbol_table_name: str,\n task: interfaces.objects.ObjectInterface)","argument_list":"","return_statement":"","docstring":"Creates a generator for the file descriptors of a process\n\n Args:\n symbol_table_name: The name of the symbol table associated with the process\n context:\n task: The process structure to enumerate file descriptors from\n\n Return:\n A 3 element tuple is yielded for each file descriptor:\n 1) The file's object\n 2) The path referenced by the descriptor.\n The path is either empty, the full path of the file in the file system, or the formatted name for sockets, pipes, etc.\n 3) The file descriptor number","docstring_summary":"Creates a generator for the file descriptors of a process","docstring_tokens":["Creates","a","generator","for","the","file","descriptors","of","a","process"],"function":"def files_descriptors_for_process(cls, context: interfaces.context.ContextInterface, symbol_table_name: str,\n task: interfaces.objects.ObjectInterface):\n \"\"\"Creates a generator for the file descriptors of a process\n\n Args:\n symbol_table_name: The name of the symbol table associated with the process\n context:\n task: The process structure to enumerate file descriptors from\n\n Return:\n A 3 element tuple is yielded for each file descriptor:\n 1) The file's object\n 2) The path referenced by the descriptor.\n The path is either empty, the full path of the file in the file system, or the formatted name for sockets, pipes, etc.\n 3) The file descriptor number\n \"\"\"\n\n try:\n num_fds = task.p_fd.fd_lastfile\n except exceptions.InvalidAddressException:\n num_fds = 1024\n\n try:\n nfiles = task.p_fd.fd_nfiles\n except exceptions.InvalidAddressException:\n nfiles = 1024\n\n if nfiles > num_fds:\n num_fds = nfiles\n\n if num_fds > 4096:\n num_fds = 1024\n\n file_type = symbol_table_name + constants.BANG + 'fileproc'\n\n try:\n table_addr = task.p_fd.fd_ofiles.dereference()\n except exceptions.InvalidAddressException:\n return\n\n fds = objects.utility.array_of_pointers(table_addr, count = num_fds, subtype = file_type, context = context)\n\n for fd_num, f in enumerate(fds):\n if f != 0:\n try:\n ftype = f.f_fglob.get_fg_type()\n except exceptions.InvalidAddressException:\n continue\n\n if ftype == 'VNODE':\n vnode = f.f_fglob.fg_data.dereference().cast(\"vnode\")\n path = vnode.full_path()\n elif ftype:\n path = \"<{}>\".format(ftype.lower())\n\n yield f, path, fd_num","function_tokens":["def","files_descriptors_for_process","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","symbol_table_name",":","str",",","task",":","interfaces",".","objects",".","ObjectInterface",")",":","try",":","num_fds","=","task",".","p_fd",".","fd_lastfile","except","exceptions",".","InvalidAddressException",":","num_fds","=","1024","try",":","nfiles","=","task",".","p_fd",".","fd_nfiles","except","exceptions",".","InvalidAddressException",":","nfiles","=","1024","if","nfiles",">","num_fds",":","num_fds","=","nfiles","if","num_fds",">","4096",":","num_fds","=","1024","file_type","=","symbol_table_name","+","constants",".","BANG","+","'fileproc'","try",":","table_addr","=","task",".","p_fd",".","fd_ofiles",".","dereference","(",")","except","exceptions",".","InvalidAddressException",":","return","fds","=","objects",".","utility",".","array_of_pointers","(","table_addr",",","count","=","num_fds",",","subtype","=","file_type",",","context","=","context",")","for","fd_num",",","f","in","enumerate","(","fds",")",":","if","f","!=","0",":","try",":","ftype","=","f",".","f_fglob",".","get_fg_type","(",")","except","exceptions",".","InvalidAddressException",":","continue","if","ftype","==","'VNODE'",":","vnode","=","f",".","f_fglob",".","fg_data",".","dereference","(",")",".","cast","(","\"vnode\"",")","path","=","vnode",".","full_path","(",")","elif","ftype",":","path","=","\"<{}>\"",".","format","(","ftype",".","lower","(",")",")","yield","f",",","path",",","fd_num"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/__init__.py#L99-L154"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py","language":"python","identifier":"proc.add_process_layer","parameters":"(self, config_prefix: str = None, preferred_name: str = None)","argument_list":"","return_statement":"return self._add_process_layer(self._context, dtb, config_prefix, preferred_name)","docstring":"Constructs a new layer based on the process's DTB.\n\n Returns the name of the Layer or None.","docstring_summary":"Constructs a new layer based on the process's DTB.","docstring_tokens":["Constructs","a","new","layer","based","on","the","process","s","DTB","."],"function":"def add_process_layer(self, config_prefix: str = None, preferred_name: str = None) -> Optional[str]:\n \"\"\"Constructs a new layer based on the process's DTB.\n\n Returns the name of the Layer or None.\n \"\"\"\n parent_layer = self._context.layers[self.vol.layer_name]\n\n if not isinstance(parent_layer, interfaces.layers.TranslationLayerInterface):\n raise TypeError(\"Parent layer is not a translation layer, unable to construct process layer\")\n\n try:\n dtb = self.get_task().map.pmap.pm_cr3\n except exceptions.InvalidAddressException:\n return None\n\n if preferred_name is None:\n preferred_name = self.vol.layer_name + \"_Process{}\".format(self.p_pid)\n\n # Add the constructed layer and return the name\n return self._add_process_layer(self._context, dtb, config_prefix, preferred_name)","function_tokens":["def","add_process_layer","(","self",",","config_prefix",":","str","=","None",",","preferred_name",":","str","=","None",")","->","Optional","[","str","]",":","parent_layer","=","self",".","_context",".","layers","[","self",".","vol",".","layer_name","]","if","not","isinstance","(","parent_layer",",","interfaces",".","layers",".","TranslationLayerInterface",")",":","raise","TypeError","(","\"Parent layer is not a translation layer, unable to construct process layer\"",")","try",":","dtb","=","self",".","get_task","(",")",".","map",".","pmap",".","pm_cr3","except","exceptions",".","InvalidAddressException",":","return","None","if","preferred_name","is","None",":","preferred_name","=","self",".","vol",".","layer_name","+","\"_Process{}\"",".","format","(","self",".","p_pid",")","# Add the constructed layer and return the name","return","self",".","_add_process_layer","(","self",".","_context",",","dtb",",","config_prefix",",","preferred_name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py#L19-L38"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py","language":"python","identifier":"proc.get_process_memory_sections","parameters":"(self,\n context: interfaces.context.ContextInterface,\n config_prefix: str,\n rw_no_file: bool = False)","argument_list":"","return_statement":"","docstring":"Returns a list of sections based on the memory manager's view of\n this task's virtual memory.","docstring_summary":"Returns a list of sections based on the memory manager's view of\n this task's virtual memory.","docstring_tokens":["Returns","a","list","of","sections","based","on","the","memory","manager","s","view","of","this","task","s","virtual","memory","."],"function":"def get_process_memory_sections(self,\n context: interfaces.context.ContextInterface,\n config_prefix: str,\n rw_no_file: bool = False) -> \\\n Generator[Tuple[int, int], None, None]:\n \"\"\"Returns a list of sections based on the memory manager's view of\n this task's virtual memory.\"\"\"\n for vma in self.get_map_iter():\n start = int(vma.links.start)\n end = int(vma.links.end)\n\n if rw_no_file:\n if vma.get_perms() != \"rw\" or vma.get_path(context, config_prefix) != \"\":\n if vma.get_special_path() != \"[heap]\":\n continue\n\n yield (start, end - start)","function_tokens":["def","get_process_memory_sections","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","config_prefix",":","str",",","rw_no_file",":","bool","=","False",")","->","Generator","[","Tuple","[","int",",","int","]",",","None",",","None","]",":","for","vma","in","self",".","get_map_iter","(",")",":","start","=","int","(","vma",".","links",".","start",")","end","=","int","(","vma",".","links",".","end",")","if","rw_no_file",":","if","vma",".","get_perms","(",")","!=","\"rw\"","or","vma",".","get_path","(","context",",","config_prefix",")","!=","\"\"",":","if","vma",".","get_special_path","(",")","!=","\"[heap]\"",":","continue","yield","(","start",",","end","-","start",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py#L67-L83"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py","language":"python","identifier":"vm_map_entry.is_suspicious","parameters":"(self, context, config_prefix)","argument_list":"","return_statement":"return ret","docstring":"Flags memory regions that are mapped rwx or that map an executable\n not back from a file on disk.","docstring_summary":"Flags memory regions that are mapped rwx or that map an executable\n not back from a file on disk.","docstring_tokens":["Flags","memory","regions","that","are","mapped","rwx","or","that","map","an","executable","not","back","from","a","file","on","disk","."],"function":"def is_suspicious(self, context, config_prefix):\n \"\"\"Flags memory regions that are mapped rwx or that map an executable\n not back from a file on disk.\"\"\"\n ret = False\n\n perms = self.get_perms()\n\n if perms == \"rwx\":\n ret = True\n\n elif perms == \"r-x\" and self.get_path(context, config_prefix) == \"\":\n ret = True\n\n return ret","function_tokens":["def","is_suspicious","(","self",",","context",",","config_prefix",")",":","ret","=","False","perms","=","self",".","get_perms","(",")","if","perms","==","\"rwx\"",":","ret","=","True","elif","perms","==","\"r-x\"","and","self",".","get_path","(","context",",","config_prefix",")","==","\"\"",":","ret","=","True","return","ret"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py#L159-L172"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py","language":"python","identifier":"queue_entry.walk_list","parameters":"(self,\n list_head: interfaces.objects.ObjectInterface,\n member_name: str,\n type_name: str,\n max_size: int = 4096)","argument_list":"","return_statement":"","docstring":"Walks a queue in a smear-aware and smear-resistant manner\n\n smear is detected by:\n - the max_size parameter sets an upper bound\n - each seen entry is only allowed once\n\n attempts to work around smear:\n - the list is walked in both directions to help find as many elements as possible\n\n Args:\n list_head - the head of the list\n member_name - the name of the embedded list member\n type_name - the type of each element in the list\n max_size - the maximum amount of elements that will be returned\n\n Returns:\n Each instance of the queue cast as \"type_name\" type","docstring_summary":"Walks a queue in a smear-aware and smear-resistant manner","docstring_tokens":["Walks","a","queue","in","a","smear","-","aware","and","smear","-","resistant","manner"],"function":"def walk_list(self,\n list_head: interfaces.objects.ObjectInterface,\n member_name: str,\n type_name: str,\n max_size: int = 4096) -> Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"\n Walks a queue in a smear-aware and smear-resistant manner\n\n smear is detected by:\n - the max_size parameter sets an upper bound\n - each seen entry is only allowed once\n\n attempts to work around smear:\n - the list is walked in both directions to help find as many elements as possible\n\n Args:\n list_head - the head of the list\n member_name - the name of the embedded list member\n type_name - the type of each element in the list\n max_size - the maximum amount of elements that will be returned\n\n Returns:\n Each instance of the queue cast as \"type_name\" type\n \"\"\"\n\n yielded = 0\n\n seen = set()\n\n for attr in ['next', 'prev']:\n try:\n n = getattr(self, attr).dereference().cast(type_name)\n\n while n is not None and n.vol.offset != list_head:\n if n.vol.offset in seen:\n break\n\n yield n\n\n seen.add(n.vol.offset)\n\n yielded = yielded + 1\n if yielded == max_size:\n return\n\n n = getattr(n.member(attr = member_name), attr).dereference().cast(type_name)\n\n except exceptions.InvalidAddressException:\n pass","function_tokens":["def","walk_list","(","self",",","list_head",":","interfaces",".","objects",".","ObjectInterface",",","member_name",":","str",",","type_name",":","str",",","max_size",":","int","=","4096",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","yielded","=","0","seen","=","set","(",")","for","attr","in","[","'next'",",","'prev'","]",":","try",":","n","=","getattr","(","self",",","attr",")",".","dereference","(",")",".","cast","(","type_name",")","while","n","is","not","None","and","n",".","vol",".","offset","!=","list_head",":","if","n",".","vol",".","offset","in","seen",":","break","yield","n","seen",".","add","(","n",".","vol",".","offset",")","yielded","=","yielded","+","1","if","yielded","==","max_size",":","return","n","=","getattr","(","n",".","member","(","attr","=","member_name",")",",","attr",")",".","dereference","(",")",".","cast","(","type_name",")","except","exceptions",".","InvalidAddressException",":","pass"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py#L396-L444"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py","language":"python","identifier":"sysctl_oid.get_perms","parameters":"(self)","argument_list":"","return_statement":"return ret","docstring":"Returns the actions allowed on the node\n\n Args: None\n\n Returns:\n A combination of:\n R - readable \n W - writeable\n L - self handles locking","docstring_summary":"Returns the actions allowed on the node","docstring_tokens":["Returns","the","actions","allowed","on","the","node"],"function":"def get_perms(self) -> str:\n \"\"\"\n Returns the actions allowed on the node\n\n Args: None\n\n Returns:\n A combination of:\n R - readable \n W - writeable\n L - self handles locking\n \"\"\"\n ret = \"\"\n\n checks = [0x80000000, 0x40000000, 0x00800000]\n perms = [\"R\", \"W\", \"L\"]\n\n for (i, c) in enumerate(checks):\n if c & self.oid_kind:\n ret = ret + perms[i]\n else:\n ret = ret + \"-\"\n\n return ret","function_tokens":["def","get_perms","(","self",")","->","str",":","ret","=","\"\"","checks","=","[","0x80000000",",","0x40000000",",","0x00800000","]","perms","=","[","\"R\"",",","\"W\"",",","\"L\"","]","for","(","i",",","c",")","in","enumerate","(","checks",")",":","if","c","&","self",".","oid_kind",":","ret","=","ret","+","perms","[","i","]","else",":","ret","=","ret","+","\"-\"","return","ret"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py#L512-L535"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py","language":"python","identifier":"sysctl_oid.get_ctltype","parameters":"(self)","argument_list":"","return_statement":"return ret","docstring":"Returns the type of the sysctl node\n\n Args: None\n\n Returns:\n One of:\n CTLTYPE_NODE\n CTLTYPE_INT\n CTLTYPE_STRING\n CTLTYPE_QUAD\n CTLTYPE_OPAQUE\n an empty string for nodes not in the above types\n\n Based on sysctl_sysctl_debug_dump_node","docstring_summary":"Returns the type of the sysctl node","docstring_tokens":["Returns","the","type","of","the","sysctl","node"],"function":"def get_ctltype(self) -> str:\n \"\"\"\n Returns the type of the sysctl node\n\n Args: None\n\n Returns:\n One of:\n CTLTYPE_NODE\n CTLTYPE_INT\n CTLTYPE_STRING\n CTLTYPE_QUAD\n CTLTYPE_OPAQUE\n an empty string for nodes not in the above types\n\n Based on sysctl_sysctl_debug_dump_node\n \"\"\"\n types = {1: 'CTLTYPE_NODE', 2: 'CTLTYPE_INT', 3: 'CTLTYPE_STRING', 4: 'CTLTYPE_QUAD', 5: 'CTLTYPE_OPAQUE'}\n\n ctltype = self.oid_kind & 0xf\n\n if 0 < ctltype < 6:\n ret = types[ctltype]\n else:\n ret = \"\"\n\n return ret","function_tokens":["def","get_ctltype","(","self",")","->","str",":","types","=","{","1",":","'CTLTYPE_NODE'",",","2",":","'CTLTYPE_INT'",",","3",":","'CTLTYPE_STRING'",",","4",":","'CTLTYPE_QUAD'",",","5",":","'CTLTYPE_OPAQUE'","}","ctltype","=","self",".","oid_kind","&","0xf","if","0","<","ctltype","<","6",":","ret","=","types","[","ctltype","]","else",":","ret","=","\"\"","return","ret"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/mac\/extensions\/__init__.py#L537-L563"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/__init__.py","language":"python","identifier":"LinuxUtilities.mask_mods_list","parameters":"(cls, context: interfaces.context.ContextInterface, layer_name: str,\n mods: Iterator[interfaces.objects.ObjectInterface])","argument_list":"","return_statement":"return [(utility.array_to_string(mod.name), mod.get_module_base() & mask,\n (mod.get_module_base() & mask) + mod.get_core_size()) for mod in mods]","docstring":"A helper function to mask the starting and end address of kernel modules","docstring_summary":"A helper function to mask the starting and end address of kernel modules","docstring_tokens":["A","helper","function","to","mask","the","starting","and","end","address","of","kernel","modules"],"function":"def mask_mods_list(cls, context: interfaces.context.ContextInterface, layer_name: str,\n mods: Iterator[interfaces.objects.ObjectInterface]) -> List[Tuple[str, int, int]]:\n \"\"\"\n A helper function to mask the starting and end address of kernel modules\n \"\"\"\n mask = context.layers[layer_name].address_mask\n\n return [(utility.array_to_string(mod.name), mod.get_module_base() & mask,\n (mod.get_module_base() & mask) + mod.get_core_size()) for mod in mods]","function_tokens":["def","mask_mods_list","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","mods",":","Iterator","[","interfaces",".","objects",".","ObjectInterface","]",")","->","List","[","Tuple","[","str",",","int",",","int","]","]",":","mask","=","context",".","layers","[","layer_name","]",".","address_mask","return","[","(","utility",".","array_to_string","(","mod",".","name",")",",","mod",".","get_module_base","(",")","&","mask",",","(","mod",".","get_module_base","(",")","&","mask",")","+","mod",".","get_core_size","(",")",")","for","mod","in","mods","]"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/__init__.py#L198-L206"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/__init__.py","language":"python","identifier":"LinuxUtilities.generate_kernel_handler_info","parameters":"(\n cls, context: interfaces.context.ContextInterface, layer_name: str, kernel_name: str,\n mods_list: Iterator[interfaces.objects.ObjectInterface])","argument_list":"","return_statement":"return [(constants.linux.KERNEL_NAME, start_addr, end_addr)] + \\\n LinuxUtilities.mask_mods_list(context, layer_name, mods_list)","docstring":"A helper function that gets the beginning and end address of the kernel module","docstring_summary":"A helper function that gets the beginning and end address of the kernel module","docstring_tokens":["A","helper","function","that","gets","the","beginning","and","end","address","of","the","kernel","module"],"function":"def generate_kernel_handler_info(\n cls, context: interfaces.context.ContextInterface, layer_name: str, kernel_name: str,\n mods_list: Iterator[interfaces.objects.ObjectInterface]) -> List[Tuple[str, int, int]]:\n \"\"\"\n A helper function that gets the beginning and end address of the kernel module\n \"\"\"\n\n kernel = contexts.Module(context, kernel_name, layer_name, 0)\n\n mask = context.layers[layer_name].address_mask\n\n start_addr = kernel.object_from_symbol(\"_text\")\n start_addr = start_addr.vol.offset & mask\n\n end_addr = kernel.object_from_symbol(\"_etext\")\n end_addr = end_addr.vol.offset & mask\n\n return [(constants.linux.KERNEL_NAME, start_addr, end_addr)] + \\\n LinuxUtilities.mask_mods_list(context, layer_name, mods_list)","function_tokens":["def","generate_kernel_handler_info","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","layer_name",":","str",",","kernel_name",":","str",",","mods_list",":","Iterator","[","interfaces",".","objects",".","ObjectInterface","]",")","->","List","[","Tuple","[","str",",","int",",","int","]","]",":","kernel","=","contexts",".","Module","(","context",",","kernel_name",",","layer_name",",","0",")","mask","=","context",".","layers","[","layer_name","]",".","address_mask","start_addr","=","kernel",".","object_from_symbol","(","\"_text\"",")","start_addr","=","start_addr",".","vol",".","offset","&","mask","end_addr","=","kernel",".","object_from_symbol","(","\"_etext\"",")","end_addr","=","end_addr",".","vol",".","offset","&","mask","return","[","(","constants",".","linux",".","KERNEL_NAME",",","start_addr",",","end_addr",")","]","+","LinuxUtilities",".","mask_mods_list","(","context",",","layer_name",",","mods_list",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/__init__.py#L209-L227"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/__init__.py","language":"python","identifier":"LinuxUtilities.lookup_module_address","parameters":"(cls, context: interfaces.context.ContextInterface, handlers: List[Tuple[str, int, int]],\n target_address: int)","argument_list":"","return_statement":"return mod_name, symbol_name","docstring":"Searches between the start and end address of the kernel module using target_address.\n Returns the module and symbol name of the address provided.","docstring_summary":"Searches between the start and end address of the kernel module using target_address.\n Returns the module and symbol name of the address provided.","docstring_tokens":["Searches","between","the","start","and","end","address","of","the","kernel","module","using","target_address",".","Returns","the","module","and","symbol","name","of","the","address","provided","."],"function":"def lookup_module_address(cls, context: interfaces.context.ContextInterface, handlers: List[Tuple[str, int, int]],\n target_address: int):\n \"\"\"\n Searches between the start and end address of the kernel module using target_address.\n Returns the module and symbol name of the address provided.\n \"\"\"\n\n mod_name = \"UNKNOWN\"\n symbol_name = \"N\/A\"\n\n for name, start, end in handlers:\n if start <= target_address <= end:\n mod_name = name\n if name == constants.linux.KERNEL_NAME:\n symbols = list(context.symbol_space.get_symbols_by_location(target_address))\n\n if len(symbols):\n symbol_name = symbols[0].split(constants.BANG)[1] if constants.BANG in symbols[0] else \\\n symbols[0]\n\n break\n\n return mod_name, symbol_name","function_tokens":["def","lookup_module_address","(","cls",",","context",":","interfaces",".","context",".","ContextInterface",",","handlers",":","List","[","Tuple","[","str",",","int",",","int","]","]",",","target_address",":","int",")",":","mod_name","=","\"UNKNOWN\"","symbol_name","=","\"N\/A\"","for","name",",","start",",","end","in","handlers",":","if","start","<=","target_address","<=","end",":","mod_name","=","name","if","name","==","constants",".","linux",".","KERNEL_NAME",":","symbols","=","list","(","context",".","symbol_space",".","get_symbols_by_location","(","target_address",")",")","if","len","(","symbols",")",":","symbol_name","=","symbols","[","0","]",".","split","(","constants",".","BANG",")","[","1","]","if","constants",".","BANG","in","symbols","[","0","]","else","symbols","[","0","]","break","return","mod_name",",","symbol_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/__init__.py#L230-L252"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/elf.py","language":"python","identifier":"elf.is_valid","parameters":"(self)","argument_list":"","return_statement":"return self._type_prefix is not None and self._hdr is not None","docstring":"Determine whether it is a valid object","docstring_summary":"Determine whether it is a valid object","docstring_tokens":["Determine","whether","it","is","a","valid","object"],"function":"def is_valid(self):\n '''\n Determine whether it is a valid object\n '''\n return self._type_prefix is not None and self._hdr is not None","function_tokens":["def","is_valid","(","self",")",":","return","self",".","_type_prefix","is","not","None","and","self",".","_hdr","is","not","None"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/elf.py#L59-L63"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py","language":"python","identifier":"module.get_name","parameters":"(self)","argument_list":"","return_statement":"return utility.array_to_string(self.name)","docstring":"Get the name of the module as a string","docstring_summary":"Get the name of the module as a string","docstring_tokens":["Get","the","name","of","the","module","as","a","string"],"function":"def get_name(self):\n \"\"\" Get the name of the module as a string \"\"\"\n return utility.array_to_string(self.name)","function_tokens":["def","get_name","(","self",")",":","return","utility",".","array_to_string","(","self",".","name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py#L65-L67"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py","language":"python","identifier":"module._get_sect_count","parameters":"(self, grp)","argument_list":"","return_statement":"return idx","docstring":"Try to determine the number of valid sections","docstring_summary":"Try to determine the number of valid sections","docstring_tokens":["Try","to","determine","the","number","of","valid","sections"],"function":"def _get_sect_count(self, grp):\n \"\"\" Try to determine the number of valid sections \"\"\"\n arr = self._context.object(\n self.get_symbol_table().name + constants.BANG + \"array\",\n layer_name = self.vol.layer_name,\n offset = grp.attrs,\n subtype = self._context.symbol_space.get_type(self.get_symbol_table().name + constants.BANG + \"pointer\"),\n count = 25)\n\n idx = 0\n while arr[idx]:\n idx = idx + 1\n\n return idx","function_tokens":["def","_get_sect_count","(","self",",","grp",")",":","arr","=","self",".","_context",".","object","(","self",".","get_symbol_table","(",")",".","name","+","constants",".","BANG","+","\"array\"",",","layer_name","=","self",".","vol",".","layer_name",",","offset","=","grp",".","attrs",",","subtype","=","self",".","_context",".","symbol_space",".","get_type","(","self",".","get_symbol_table","(",")",".","name","+","constants",".","BANG","+","\"pointer\"",")",",","count","=","25",")","idx","=","0","while","arr","[","idx","]",":","idx","=","idx","+","1","return","idx"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py#L69-L82"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py","language":"python","identifier":"module.get_sections","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Get sections of the module","docstring_summary":"Get sections of the module","docstring_tokens":["Get","sections","of","the","module"],"function":"def get_sections(self):\n \"\"\" Get sections of the module \"\"\"\n if self.sect_attrs.has_member(\"nsections\"):\n num_sects = self.sect_attrs.nsections\n else:\n num_sects = self._get_sect_count(self.sect_attrs.grp)\n\n arr = self._context.object(self.get_symbol_table().name + constants.BANG + \"array\",\n layer_name = self.vol.layer_name,\n offset = self.sect_attrs.attrs.vol.offset,\n subtype = self._context.symbol_space.get_type(self.get_symbol_table().name +\n constants.BANG + 'module_sect_attr'),\n count = num_sects)\n\n for attr in arr:\n yield attr","function_tokens":["def","get_sections","(","self",")",":","if","self",".","sect_attrs",".","has_member","(","\"nsections\"",")",":","num_sects","=","self",".","sect_attrs",".","nsections","else",":","num_sects","=","self",".","_get_sect_count","(","self",".","sect_attrs",".","grp",")","arr","=","self",".","_context",".","object","(","self",".","get_symbol_table","(",")",".","name","+","constants",".","BANG","+","\"array\"",",","layer_name","=","self",".","vol",".","layer_name",",","offset","=","self",".","sect_attrs",".","attrs",".","vol",".","offset",",","subtype","=","self",".","_context",".","symbol_space",".","get_type","(","self",".","get_symbol_table","(",")",".","name","+","constants",".","BANG","+","'module_sect_attr'",")",",","count","=","num_sects",")","for","attr","in","arr",":","yield","attr"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py#L84-L99"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py","language":"python","identifier":"module.get_symbol","parameters":"(self, wanted_sym_name)","argument_list":"","return_statement":"","docstring":"Get value for a given symbol name","docstring_summary":"Get value for a given symbol name","docstring_tokens":["Get","value","for","a","given","symbol","name"],"function":"def get_symbol(self, wanted_sym_name):\n \"\"\" Get value for a given symbol name \"\"\"\n for sym in self.get_symbols():\n sym_name = sym.get_name()\n sym_addr = sym.st_value\n if wanted_sym_name == sym_name:\n return sym_addr","function_tokens":["def","get_symbol","(","self",",","wanted_sym_name",")",":","for","sym","in","self",".","get_symbols","(",")",":","sym_name","=","sym",".","get_name","(",")","sym_addr","=","sym",".","st_value","if","wanted_sym_name","==","sym_name",":","return","sym_addr"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py#L125-L131"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py","language":"python","identifier":"task_struct.add_process_layer","parameters":"(self, config_prefix: str = None, preferred_name: str = None)","argument_list":"","return_statement":"return self._add_process_layer(self._context, dtb, config_prefix, preferred_name)","docstring":"Constructs a new layer based on the process's DTB.\n\n Returns the name of the Layer or None.","docstring_summary":"Constructs a new layer based on the process's DTB.","docstring_tokens":["Constructs","a","new","layer","based","on","the","process","s","DTB","."],"function":"def add_process_layer(self, config_prefix: str = None, preferred_name: str = None) -> Optional[str]:\n \"\"\"Constructs a new layer based on the process's DTB.\n\n Returns the name of the Layer or None.\n \"\"\"\n\n parent_layer = self._context.layers[self.vol.layer_name]\n try:\n pgd = self.mm.pgd\n except exceptions.InvalidAddressException:\n return None\n\n if not isinstance(parent_layer, linear.LinearlyMappedLayer):\n raise TypeError(\"Parent layer is not a translation layer, unable to construct process layer\")\n\n dtb, layer_name = parent_layer.translate(pgd)\n if not dtb:\n return None\n\n if preferred_name is None:\n preferred_name = self.vol.layer_name + \"_Process{}\".format(self.pid)\n\n # Add the constructed layer and return the name\n return self._add_process_layer(self._context, dtb, config_prefix, preferred_name)","function_tokens":["def","add_process_layer","(","self",",","config_prefix",":","str","=","None",",","preferred_name",":","str","=","None",")","->","Optional","[","str","]",":","parent_layer","=","self",".","_context",".","layers","[","self",".","vol",".","layer_name","]","try",":","pgd","=","self",".","mm",".","pgd","except","exceptions",".","InvalidAddressException",":","return","None","if","not","isinstance","(","parent_layer",",","linear",".","LinearlyMappedLayer",")",":","raise","TypeError","(","\"Parent layer is not a translation layer, unable to construct process layer\"",")","dtb",",","layer_name","=","parent_layer",".","translate","(","pgd",")","if","not","dtb",":","return","None","if","preferred_name","is","None",":","preferred_name","=","self",".","vol",".","layer_name","+","\"_Process{}\"",".","format","(","self",".","pid",")","# Add the constructed layer and return the name","return","self",".","_add_process_layer","(","self",".","_context",",","dtb",",","config_prefix",",","preferred_name",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py#L165-L188"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py","language":"python","identifier":"task_struct.get_process_memory_sections","parameters":"(self, heap_only: bool = False)","argument_list":"","return_statement":"","docstring":"Returns a list of sections based on the memory manager's view of\n this task's virtual memory.","docstring_summary":"Returns a list of sections based on the memory manager's view of\n this task's virtual memory.","docstring_tokens":["Returns","a","list","of","sections","based","on","the","memory","manager","s","view","of","this","task","s","virtual","memory","."],"function":"def get_process_memory_sections(self, heap_only: bool = False) -> Generator[Tuple[int, int], None, None]:\n \"\"\"Returns a list of sections based on the memory manager's view of\n this task's virtual memory.\"\"\"\n for vma in self.mm.get_mmap_iter():\n start = int(vma.vm_start)\n end = int(vma.vm_end)\n\n if heap_only and not (start <= self.mm.brk and end >= self.mm.start_brk):\n continue\n else:\n # FIXME: Check if this actually needs to be printed out or not\n vollog.info(\"adding vma: {:x} {:x} | {:x} {:x}\".format(start, self.mm.brk, end, self.mm.start_brk))\n\n yield (start, end - start)","function_tokens":["def","get_process_memory_sections","(","self",",","heap_only",":","bool","=","False",")","->","Generator","[","Tuple","[","int",",","int","]",",","None",",","None","]",":","for","vma","in","self",".","mm",".","get_mmap_iter","(",")",":","start","=","int","(","vma",".","vm_start",")","end","=","int","(","vma",".","vm_end",")","if","heap_only","and","not","(","start","<=","self",".","mm",".","brk","and","end",">=","self",".","mm",".","start_brk",")",":","continue","else",":","# FIXME: Check if this actually needs to be printed out or not","vollog",".","info","(","\"adding vma: {:x} {:x} | {:x} {:x}\"",".","format","(","start",",","self",".","mm",".","brk",",","end",",","self",".","mm",".","start_brk",")",")","yield","(","start",",","end","-","start",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py#L190-L203"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py","language":"python","identifier":"mm_struct.get_mmap_iter","parameters":"(self)","argument_list":"","return_statement":"","docstring":"Returns an iterator for the mmap list member of an mm_struct.","docstring_summary":"Returns an iterator for the mmap list member of an mm_struct.","docstring_tokens":["Returns","an","iterator","for","the","mmap","list","member","of","an","mm_struct","."],"function":"def get_mmap_iter(self) -> Iterable[interfaces.objects.ObjectInterface]:\n \"\"\"Returns an iterator for the mmap list member of an mm_struct.\"\"\"\n\n if not self.mmap:\n return\n\n yield self.mmap\n\n seen = {self.mmap.vol.offset}\n link = self.mmap.vm_next\n\n while link != 0 and link.vol.offset not in seen:\n yield link\n seen.add(link.vol.offset)\n link = link.vm_next","function_tokens":["def","get_mmap_iter","(","self",")","->","Iterable","[","interfaces",".","objects",".","ObjectInterface","]",":","if","not","self",".","mmap",":","return","yield","self",".","mmap","seen","=","{","self",".","mmap",".","vol",".","offset","}","link","=","self",".","mmap",".","vm_next","while","link","!=","0","and","link",".","vol",".","offset","not","in","seen",":","yield","link","seen",".","add","(","link",".","vol",".","offset",")","link","=","link",".","vm_next"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py#L229-L243"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py","language":"python","identifier":"vm_area_struct._parse_flags","parameters":"(self, vm_flags, parse_flags)","argument_list":"","return_statement":"return retval","docstring":"Returns an string representation of the flags in a\n vm_area_struct.","docstring_summary":"Returns an string representation of the flags in a\n vm_area_struct.","docstring_tokens":["Returns","an","string","representation","of","the","flags","in","a","vm_area_struct","."],"function":"def _parse_flags(self, vm_flags, parse_flags) -> str:\n \"\"\"Returns an string representation of the flags in a\n vm_area_struct.\"\"\"\n\n retval = \"\"\n\n for mask, char in parse_flags.items():\n if (vm_flags & mask) == mask:\n retval = retval + char\n else:\n retval = retval + '-'\n\n return retval","function_tokens":["def","_parse_flags","(","self",",","vm_flags",",","parse_flags",")","->","str",":","retval","=","\"\"","for","mask",",","char","in","parse_flags",".","items","(",")",":","if","(","vm_flags","&","mask",")","==","mask",":","retval","=","retval","+","char","else",":","retval","=","retval","+","'-'","return","retval"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py#L301-L313"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py","language":"python","identifier":"list_head.to_list","parameters":"(self,\n symbol_type: str,\n member: str,\n forward: bool = True,\n sentinel: bool = True,\n layer: Optional[str] = None)","argument_list":"","return_statement":"","docstring":"Returns an iterator of the entries in the list.","docstring_summary":"Returns an iterator of the entries in the list.","docstring_tokens":["Returns","an","iterator","of","the","entries","in","the","list","."],"function":"def to_list(self,\n symbol_type: str,\n member: str,\n forward: bool = True,\n sentinel: bool = True,\n layer: Optional[str] = None) -> Iterator[interfaces.objects.ObjectInterface]:\n \"\"\"Returns an iterator of the entries in the list.\"\"\"\n layer = layer or self.vol.layer_name\n\n relative_offset = self._context.symbol_space.get_type(symbol_type).relative_child_offset(member)\n\n direction = 'prev'\n if forward:\n direction = 'next'\n try:\n link = getattr(self, direction).dereference()\n except exceptions.InvalidAddressException:\n return\n\n if not sentinel:\n yield self._context.object(symbol_type, layer, offset = self.vol.offset - relative_offset)\n\n seen = {self.vol.offset}\n while link.vol.offset not in seen:\n\n obj = self._context.object(symbol_type, layer, offset = link.vol.offset - relative_offset)\n yield obj\n\n seen.add(link.vol.offset)\n try:\n link = getattr(link, direction).dereference()\n except exceptions.InvalidAddressException:\n break","function_tokens":["def","to_list","(","self",",","symbol_type",":","str",",","member",":","str",",","forward",":","bool","=","True",",","sentinel",":","bool","=","True",",","layer",":","Optional","[","str","]","=","None",")","->","Iterator","[","interfaces",".","objects",".","ObjectInterface","]",":","layer","=","layer","or","self",".","vol",".","layer_name","relative_offset","=","self",".","_context",".","symbol_space",".","get_type","(","symbol_type",")",".","relative_child_offset","(","member",")","direction","=","'prev'","if","forward",":","direction","=","'next'","try",":","link","=","getattr","(","self",",","direction",")",".","dereference","(",")","except","exceptions",".","InvalidAddressException",":","return","if","not","sentinel",":","yield","self",".","_context",".","object","(","symbol_type",",","layer",",","offset","=","self",".","vol",".","offset","-","relative_offset",")","seen","=","{","self",".","vol",".","offset","}","while","link",".","vol",".","offset","not","in","seen",":","obj","=","self",".","_context",".","object","(","symbol_type",",","layer",",","offset","=","link",".","vol",".","offset","-","relative_offset",")","yield","obj","seen",".","add","(","link",".","vol",".","offset",")","try",":","link","=","getattr","(","link",",","direction",")",".","dereference","(",")","except","exceptions",".","InvalidAddressException",":","break"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/linux\/extensions\/__init__.py#L401-L433"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/generic\/__init__.py","language":"python","identifier":"GenericIntelProcess._add_process_layer","parameters":"(self,\n context: interfaces.context.ContextInterface,\n dtb: Union[int, interfaces.objects.ObjectInterface],\n config_prefix: str = None,\n preferred_name: str = None)","argument_list":"","return_statement":"return preferred_name","docstring":"Constructs a new layer based on the process's DirectoryTableBase.","docstring_summary":"Constructs a new layer based on the process's DirectoryTableBase.","docstring_tokens":["Constructs","a","new","layer","based","on","the","process","s","DirectoryTableBase","."],"function":"def _add_process_layer(self,\n context: interfaces.context.ContextInterface,\n dtb: Union[int, interfaces.objects.ObjectInterface],\n config_prefix: str = None,\n preferred_name: str = None) -> str:\n \"\"\"Constructs a new layer based on the process's DirectoryTableBase.\"\"\"\n\n if config_prefix is None:\n # TODO: Ensure collisions can't happen by verifying the config_prefix is empty\n random_prefix = ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits)\n for _ in range(8))\n config_prefix = interfaces.configuration.path_join(\"temporary\", \"_\" + random_prefix)\n\n # Figure out a suitable name we can use for the new layer\n if preferred_name is None:\n preferred_name = context.layers.free_layer_name(prefix = self.vol.layer_name + \"_Process\")\n else:\n if preferred_name in context.layers:\n preferred_name = context.layers.free_layer_name(prefix = preferred_name)\n\n # Copy the parent's config and then make suitable changes\n parent_layer = context.layers[self.vol.layer_name]\n parent_config = parent_layer.build_configuration()\n # It's an intel layer, because we hardwire the \"memory_layer\" config option\n # FIXME: this could be for other architectures if we don't hardwire this\/these values\n parent_config['memory_layer'] = parent_layer.config['memory_layer']\n parent_config['page_map_offset'] = dtb\n\n # Set the new configuration and construct the layer\n config_path = interfaces.configuration.path_join(config_prefix, preferred_name)\n context.config.splice(config_path, parent_config)\n new_layer = parent_layer.__class__(context, config_path = config_path, name = preferred_name)\n\n # Add the constructed layer and return the name\n context.layers.add_layer(new_layer)\n return preferred_name","function_tokens":["def","_add_process_layer","(","self",",","context",":","interfaces",".","context",".","ContextInterface",",","dtb",":","Union","[","int",",","interfaces",".","objects",".","ObjectInterface","]",",","config_prefix",":","str","=","None",",","preferred_name",":","str","=","None",")","->","str",":","if","config_prefix","is","None",":","# TODO: Ensure collisions can't happen by verifying the config_prefix is empty","random_prefix","=","''",".","join","(","random",".","SystemRandom","(",")",".","choice","(","string",".","ascii_uppercase","+","string",".","digits",")","for","_","in","range","(","8",")",")","config_prefix","=","interfaces",".","configuration",".","path_join","(","\"temporary\"",",","\"_\"","+","random_prefix",")","# Figure out a suitable name we can use for the new layer","if","preferred_name","is","None",":","preferred_name","=","context",".","layers",".","free_layer_name","(","prefix","=","self",".","vol",".","layer_name","+","\"_Process\"",")","else",":","if","preferred_name","in","context",".","layers",":","preferred_name","=","context",".","layers",".","free_layer_name","(","prefix","=","preferred_name",")","# Copy the parent's config and then make suitable changes","parent_layer","=","context",".","layers","[","self",".","vol",".","layer_name","]","parent_config","=","parent_layer",".","build_configuration","(",")","# It's an intel layer, because we hardwire the \"memory_layer\" config option","# FIXME: this could be for other architectures if we don't hardwire this\/these values","parent_config","[","'memory_layer'","]","=","parent_layer",".","config","[","'memory_layer'","]","parent_config","[","'page_map_offset'","]","=","dtb","# Set the new configuration and construct the layer","config_path","=","interfaces",".","configuration",".","path_join","(","config_prefix",",","preferred_name",")","context",".","config",".","splice","(","config_path",",","parent_config",")","new_layer","=","parent_layer",".","__class__","(","context",",","config_path","=","config_path",",","name","=","preferred_name",")","# Add the constructed layer and return the name","context",".","layers",".","add_layer","(","new_layer",")","return","preferred_name"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/framework\/symbols\/generic\/__init__.py#L14-L49"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/schemas\/__init__.py","language":"python","identifier":"load_cached_validations","parameters":"()","argument_list":"","return_statement":"return validhashes","docstring":"Loads up the list of successfully cached json objects, so we don't need\n to revalidate them.","docstring_summary":"Loads up the list of successfully cached json objects, so we don't need\n to revalidate them.","docstring_tokens":["Loads","up","the","list","of","successfully","cached","json","objects","so","we","don","t","need","to","revalidate","them","."],"function":"def load_cached_validations() -> Set[str]:\n \"\"\"Loads up the list of successfully cached json objects, so we don't need\n to revalidate them.\"\"\"\n validhashes = set() # type: Set\n if os.path.exists(cached_validation_filepath):\n with open(cached_validation_filepath, \"r\") as f:\n validhashes.update(json.load(f))\n return validhashes","function_tokens":["def","load_cached_validations","(",")","->","Set","[","str","]",":","validhashes","=","set","(",")","# type: Set","if","os",".","path",".","exists","(","cached_validation_filepath",")",":","with","open","(","cached_validation_filepath",",","\"r\"",")","as","f",":","validhashes",".","update","(","json",".","load","(","f",")",")","return","validhashes"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/schemas\/__init__.py#L18-L25"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/schemas\/__init__.py","language":"python","identifier":"record_cached_validations","parameters":"(validations)","argument_list":"","return_statement":"","docstring":"Record the cached validations, so we don't need to revalidate them in\n future.","docstring_summary":"Record the cached validations, so we don't need to revalidate them in\n future.","docstring_tokens":["Record","the","cached","validations","so","we","don","t","need","to","revalidate","them","in","future","."],"function":"def record_cached_validations(validations):\n \"\"\"Record the cached validations, so we don't need to revalidate them in\n future.\"\"\"\n with open(cached_validation_filepath, \"w\") as f:\n json.dump(list(validations), f)","function_tokens":["def","record_cached_validations","(","validations",")",":","with","open","(","cached_validation_filepath",",","\"w\"",")","as","f",":","json",".","dump","(","list","(","validations",")",",","f",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/schemas\/__init__.py#L28-L32"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/schemas\/__init__.py","language":"python","identifier":"validate","parameters":"(input: Dict[str, Any], use_cache: bool = True)","argument_list":"","return_statement":"return valid(input, schema, use_cache)","docstring":"Validates an input JSON file based upon.","docstring_summary":"Validates an input JSON file based upon.","docstring_tokens":["Validates","an","input","JSON","file","based","upon","."],"function":"def validate(input: Dict[str, Any], use_cache: bool = True) -> bool:\n \"\"\"Validates an input JSON file based upon.\"\"\"\n format = input.get('metadata', {}).get('format', None)\n if not format:\n vollog.debug(\"No schema format defined\")\n return False\n basepath = os.path.abspath(os.path.dirname(__file__))\n schema_path = os.path.join(basepath, 'schema-' + format + '.json')\n if not os.path.exists(schema_path):\n vollog.debug(\"Schema for format not found: {}\".format(schema_path))\n return False\n with open(schema_path, 'r') as s:\n schema = json.load(s)\n return valid(input, schema, use_cache)","function_tokens":["def","validate","(","input",":","Dict","[","str",",","Any","]",",","use_cache",":","bool","=","True",")","->","bool",":","format","=","input",".","get","(","'metadata'",",","{","}",")",".","get","(","'format'",",","None",")","if","not","format",":","vollog",".","debug","(","\"No schema format defined\"",")","return","False","basepath","=","os",".","path",".","abspath","(","os",".","path",".","dirname","(","__file__",")",")","schema_path","=","os",".","path",".","join","(","basepath",",","'schema-'","+","format","+","'.json'",")","if","not","os",".","path",".","exists","(","schema_path",")",":","vollog",".","debug","(","\"Schema for format not found: {}\"",".","format","(","schema_path",")",")","return","False","with","open","(","schema_path",",","'r'",")","as","s",":","schema","=","json",".","load","(","s",")","return","valid","(","input",",","schema",",","use_cache",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/schemas\/__init__.py#L38-L51"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/schemas\/__init__.py","language":"python","identifier":"create_json_hash","parameters":"(input: Dict[str, Any], schema: Dict[str, Any])","argument_list":"","return_statement":"return hashlib.sha1(bytes(json.dumps((input, schema), sort_keys = True), 'utf-8')).hexdigest()","docstring":"Constructs the hash of the input and schema to create a unique\n indentifier for a particular JSON file.","docstring_summary":"Constructs the hash of the input and schema to create a unique\n indentifier for a particular JSON file.","docstring_tokens":["Constructs","the","hash","of","the","input","and","schema","to","create","a","unique","indentifier","for","a","particular","JSON","file","."],"function":"def create_json_hash(input: Dict[str, Any], schema: Dict[str, Any]) -> str:\n \"\"\"Constructs the hash of the input and schema to create a unique\n indentifier for a particular JSON file.\"\"\"\n return hashlib.sha1(bytes(json.dumps((input, schema), sort_keys = True), 'utf-8')).hexdigest()","function_tokens":["def","create_json_hash","(","input",":","Dict","[","str",",","Any","]",",","schema",":","Dict","[","str",",","Any","]",")","->","str",":","return","hashlib",".","sha1","(","bytes","(","json",".","dumps","(","(","input",",","schema",")",",","sort_keys","=","True",")",",","'utf-8'",")",")",".","hexdigest","(",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/schemas\/__init__.py#L54-L57"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/volatility\/schemas\/__init__.py","language":"python","identifier":"valid","parameters":"(input: Dict[str, Any], schema: Dict[str, Any], use_cache: bool = True)","argument_list":"","return_statement":"return True","docstring":"Validates a json schema.","docstring_summary":"Validates a json schema.","docstring_tokens":["Validates","a","json","schema","."],"function":"def valid(input: Dict[str, Any], schema: Dict[str, Any], use_cache: bool = True) -> bool:\n \"\"\"Validates a json schema.\"\"\"\n input_hash = create_json_hash(input, schema)\n if input_hash in cached_validations and use_cache:\n return True\n try:\n import jsonschema\n except ImportError:\n vollog.info(\"Dependency for validation unavailable: jsonschema\")\n vollog.debug(\"All validations will report success, even with malformed input\")\n return True\n\n try:\n vollog.debug(\"Validating JSON against schema...\")\n jsonschema.validate(input, schema)\n cached_validations.add(input_hash)\n vollog.debug(\"JSON validated against schema (result cached)\")\n except jsonschema.exceptions.SchemaError:\n vollog.debug(\"Schema validation error\", exc_info = True)\n return False\n\n record_cached_validations(cached_validations)\n return True","function_tokens":["def","valid","(","input",":","Dict","[","str",",","Any","]",",","schema",":","Dict","[","str",",","Any","]",",","use_cache",":","bool","=","True",")","->","bool",":","input_hash","=","create_json_hash","(","input",",","schema",")","if","input_hash","in","cached_validations","and","use_cache",":","return","True","try",":","import","jsonschema","except","ImportError",":","vollog",".","info","(","\"Dependency for validation unavailable: jsonschema\"",")","vollog",".","debug","(","\"All validations will report success, even with malformed input\"",")","return","True","try",":","vollog",".","debug","(","\"Validating JSON against schema...\"",")","jsonschema",".","validate","(","input",",","schema",")","cached_validations",".","add","(","input_hash",")","vollog",".","debug","(","\"JSON validated against schema (result cached)\"",")","except","jsonschema",".","exceptions",".","SchemaError",":","vollog",".","debug","(","\"Schema validation error\"",",","exc_info","=","True",")","return","False","record_cached_validations","(","cached_validations",")","return","True"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/volatility\/schemas\/__init__.py#L60-L82"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/development\/stock-linux-json.py","language":"python","identifier":"Downloader.process_files","parameters":"(self, named_files: Dict[str, str])","argument_list":"","return_statement":"","docstring":"Runs the dwarf2json binary across the files","docstring_summary":"Runs the dwarf2json binary across the files","docstring_tokens":["Runs","the","dwarf2json","binary","across","the","files"],"function":"def process_files(self, named_files: Dict[str, str]):\n \"\"\"Runs the dwarf2json binary across the files\"\"\"\n print(\"Processing Files...\")\n for i in named_files:\n if named_files[i] is None:\n print(\"FAILURE: None encountered for {}\".format(i))\n return\n args = [DWARF2JSON, 'linux']\n output_filename = 'unknown-kernel.json'\n for named_file in named_files:\n prefix = '--system-map'\n if not 'System' in named_files[named_file]:\n prefix = '--elf'\n output_filename = '.\/' + '-'.join((named_file.split('\/')[-1]).split('-')[2:])[:-4] + '.json.xz'\n args += [prefix, named_files[named_file]]\n print(\" - Running {}\".format(args))\n proc = subprocess.run(args, capture_output = True)\n\n print(\" - Writing to {}\".format(output_filename))\n with lzma.open(output_filename, 'w') as f:\n f.write(proc.stdout)","function_tokens":["def","process_files","(","self",",","named_files",":","Dict","[","str",",","str","]",")",":","print","(","\"Processing Files...\"",")","for","i","in","named_files",":","if","named_files","[","i","]","is","None",":","print","(","\"FAILURE: None encountered for {}\"",".","format","(","i",")",")","return","args","=","[","DWARF2JSON",",","'linux'","]","output_filename","=","'unknown-kernel.json'","for","named_file","in","named_files",":","prefix","=","'--system-map'","if","not","'System'","in","named_files","[","named_file","]",":","prefix","=","'--elf'","output_filename","=","'.\/'","+","'-'",".","join","(","(","named_file",".","split","(","'\/'",")","[","-","1","]",")",".","split","(","'-'",")","[","2",":","]",")","[",":","-","4","]","+","'.json.xz'","args","+=","[","prefix",",","named_files","[","named_file","]","]","print","(","\" - Running {}\"",".","format","(","args",")",")","proc","=","subprocess",".","run","(","args",",","capture_output","=","True",")","print","(","\" - Writing to {}\"",".","format","(","output_filename",")",")","with","lzma",".","open","(","output_filename",",","'w'",")","as","f",":","f",".","write","(","proc",".","stdout",")"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/development\/stock-linux-json.py#L79-L99"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py","language":"python","identifier":"PDBConvertor.read_pdb","parameters":"(self)","argument_list":"","return_statement":"return output","docstring":"Reads in the PDB file and forms essentially a python dictionary of necessary data","docstring_summary":"Reads in the PDB file and forms essentially a python dictionary of necessary data","docstring_tokens":["Reads","in","the","PDB","file","and","forms","essentially","a","python","dictionary","of","necessary","data"],"function":"def read_pdb(self) -> Dict:\n \"\"\"Reads in the PDB file and forms essentially a python dictionary of necessary data\"\"\"\n output = {\n \"user_types\": self.read_usertypes(),\n \"enums\": self.read_enums(),\n \"metadata\": self.generate_metadata(),\n \"symbols\": self.read_symbols(),\n \"base_types\": self.read_basetypes()\n }\n return output","function_tokens":["def","read_pdb","(","self",")","->","Dict",":","output","=","{","\"user_types\"",":","self",".","read_usertypes","(",")",",","\"enums\"",":","self",".","read_enums","(",")",",","\"metadata\"",":","self",".","generate_metadata","(",")",",","\"symbols\"",":","self",".","read_symbols","(",")",",","\"base_types\"",":","self",".","read_basetypes","(",")","}","return","output"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py#L133-L142"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py","language":"python","identifier":"PDBConvertor.generate_metadata","parameters":"(self)","argument_list":"","return_statement":"return result","docstring":"Generates the metadata necessary for this object","docstring_summary":"Generates the metadata necessary for this object","docstring_tokens":["Generates","the","metadata","necessary","for","this","object"],"function":"def generate_metadata(self) -> Dict[str, Any]:\n \"\"\"Generates the metadata necessary for this object\"\"\"\n dbg = self._pdb.STREAM_DBI\n last_bytes = str(binascii.hexlify(self._pdb.STREAM_PDB.GUID.Data4), 'ascii')[-16:]\n guidstr = u'{:08x}{:04x}{:04x}{}'.format(self._pdb.STREAM_PDB.GUID.Data1, self._pdb.STREAM_PDB.GUID.Data2,\n self._pdb.STREAM_PDB.GUID.Data3, last_bytes)\n pdb_data = {\n \"GUID\": guidstr.upper(),\n \"age\": self._pdb.STREAM_PDB.Age,\n \"database\": \"ntkrnlmp.pdb\",\n \"machine_type\": int(dbg.machine)\n }\n result = {\n \"format\": \"6.0.0\",\n \"producer\": {\n \"datetime\": datetime.datetime.now().isoformat(),\n \"name\": \"pdbconv\",\n \"version\": \"0.1.0\"\n },\n \"windows\": {\n \"pdb\": pdb_data\n }\n }\n return result","function_tokens":["def","generate_metadata","(","self",")","->","Dict","[","str",",","Any","]",":","dbg","=","self",".","_pdb",".","STREAM_DBI","last_bytes","=","str","(","binascii",".","hexlify","(","self",".","_pdb",".","STREAM_PDB",".","GUID",".","Data4",")",",","'ascii'",")","[","-","16",":","]","guidstr","=","u'{:08x}{:04x}{:04x}{}'",".","format","(","self",".","_pdb",".","STREAM_PDB",".","GUID",".","Data1",",","self",".","_pdb",".","STREAM_PDB",".","GUID",".","Data2",",","self",".","_pdb",".","STREAM_PDB",".","GUID",".","Data3",",","last_bytes",")","pdb_data","=","{","\"GUID\"",":","guidstr",".","upper","(",")",",","\"age\"",":","self",".","_pdb",".","STREAM_PDB",".","Age",",","\"database\"",":","\"ntkrnlmp.pdb\"",",","\"machine_type\"",":","int","(","dbg",".","machine",")","}","result","=","{","\"format\"",":","\"6.0.0\"",",","\"producer\"",":","{","\"datetime\"",":","datetime",".","datetime",".","now","(",")",".","isoformat","(",")",",","\"name\"",":","\"pdbconv\"",",","\"version\"",":","\"0.1.0\"","}",",","\"windows\"",":","{","\"pdb\"",":","pdb_data","}","}","return","result"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py#L144-L167"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py","language":"python","identifier":"PDBConvertor.read_enums","parameters":"(self)","argument_list":"","return_statement":"return output","docstring":"Reads the Enumerations from the PDB file","docstring_summary":"Reads the Enumerations from the PDB file","docstring_tokens":["Reads","the","Enumerations","from","the","PDB","file"],"function":"def read_enums(self) -> Dict:\n \"\"\"Reads the Enumerations from the PDB file\"\"\"\n logger.info(\"Reading enums...\")\n output = {} # type: Dict[str, Any]\n stream = self._pdb.STREAM_TPI\n for type_index in stream.types:\n user_type = stream.types[type_index]\n if (user_type.leaf_type == \"LF_ENUM\" and not user_type.prop.fwdref):\n output.update(self._format_enum(user_type))\n return output","function_tokens":["def","read_enums","(","self",")","->","Dict",":","logger",".","info","(","\"Reading enums...\"",")","output","=","{","}","# type: Dict[str, Any]","stream","=","self",".","_pdb",".","STREAM_TPI","for","type_index","in","stream",".","types",":","user_type","=","stream",".","types","[","type_index","]","if","(","user_type",".","leaf_type","==","\"LF_ENUM\"","and","not","user_type",".","prop",".","fwdref",")",":","output",".","update","(","self",".","_format_enum","(","user_type",")",")","return","output"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py#L169-L178"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py","language":"python","identifier":"PDBConvertor.read_symbols","parameters":"(self)","argument_list":"","return_statement":"return output","docstring":"Reads the symbols from the PDB file","docstring_summary":"Reads the symbols from the PDB file","docstring_tokens":["Reads","the","symbols","from","the","PDB","file"],"function":"def read_symbols(self) -> Dict:\n \"\"\"Reads the symbols from the PDB file\"\"\"\n logger.info(\"Reading symbols...\")\n output = {}\n\n try:\n sects = self._pdb.STREAM_SECT_HDR_ORIG.sections\n omap = self._pdb.STREAM_OMAP_FROM_SRC\n except AttributeError as e:\n # In this case there is no OMAP, so we use the given section\n # headers and use the identity function for omap.remap\n sects = self._pdb.STREAM_SECT_HDR.sections\n omap = None\n\n for sym in self._pdb.STREAM_GSYM.globals:\n if not hasattr(sym, 'offset'):\n continue\n try:\n virt_base = sects[sym.segment - 1].VirtualAddress\n except IndexError:\n continue\n name, _, _ = pdbparse.undecorate.undecorate(sym.name)\n if omap:\n output[name] = {\"address\": omap.remap(sym.offset + virt_base)}\n else:\n output[name] = {\"address\": sym.offset + virt_base}\n\n return output","function_tokens":["def","read_symbols","(","self",")","->","Dict",":","logger",".","info","(","\"Reading symbols...\"",")","output","=","{","}","try",":","sects","=","self",".","_pdb",".","STREAM_SECT_HDR_ORIG",".","sections","omap","=","self",".","_pdb",".","STREAM_OMAP_FROM_SRC","except","AttributeError","as","e",":","# In this case there is no OMAP, so we use the given section","# headers and use the identity function for omap.remap","sects","=","self",".","_pdb",".","STREAM_SECT_HDR",".","sections","omap","=","None","for","sym","in","self",".","_pdb",".","STREAM_GSYM",".","globals",":","if","not","hasattr","(","sym",",","'offset'",")",":","continue","try",":","virt_base","=","sects","[","sym",".","segment","-","1","]",".","VirtualAddress","except","IndexError",":","continue","name",",","_",",","_","=","pdbparse",".","undecorate",".","undecorate","(","sym",".","name",")","if","omap",":","output","[","name","]","=","{","\"address\"",":","omap",".","remap","(","sym",".","offset","+","virt_base",")","}","else",":","output","[","name","]","=","{","\"address\"",":","sym",".","offset","+","virt_base","}","return","output"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py#L190-L217"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py","language":"python","identifier":"PDBConvertor.read_usertypes","parameters":"(self)","argument_list":"","return_statement":"return output","docstring":"Reads the user types from the PDB file","docstring_summary":"Reads the user types from the PDB file","docstring_tokens":["Reads","the","user","types","from","the","PDB","file"],"function":"def read_usertypes(self) -> Dict:\n \"\"\"Reads the user types from the PDB file\"\"\"\n logger.info(\"Reading usertypes...\")\n output = {}\n stream = self._pdb.STREAM_TPI\n for type_index in stream.types:\n user_type = stream.types[type_index]\n if (user_type.leaf_type == \"LF_STRUCTURE\" and not user_type.prop.fwdref):\n output.update(self._format_usertype(user_type, \"struct\"))\n elif (user_type.leaf_type == \"LF_UNION\" and not user_type.prop.fwdref):\n output.update(self._format_usertype(user_type, \"union\"))\n return output","function_tokens":["def","read_usertypes","(","self",")","->","Dict",":","logger",".","info","(","\"Reading usertypes...\"",")","output","=","{","}","stream","=","self",".","_pdb",".","STREAM_TPI","for","type_index","in","stream",".","types",":","user_type","=","stream",".","types","[","type_index","]","if","(","user_type",".","leaf_type","==","\"LF_STRUCTURE\"","and","not","user_type",".","prop",".","fwdref",")",":","output",".","update","(","self",".","_format_usertype","(","user_type",",","\"struct\"",")",")","elif","(","user_type",".","leaf_type","==","\"LF_UNION\"","and","not","user_type",".","prop",".","fwdref",")",":","output",".","update","(","self",".","_format_usertype","(","user_type",",","\"union\"",")",")","return","output"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py#L219-L230"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py","language":"python","identifier":"PDBConvertor._format_usertype","parameters":"(self, usertype, kind)","argument_list":"","return_statement":"return {usertype.name: {'fields': fields, 'kind': kind, 'size': usertype.size}}","docstring":"Produces a single usertype","docstring_summary":"Produces a single usertype","docstring_tokens":["Produces","a","single","usertype"],"function":"def _format_usertype(self, usertype, kind) -> Dict:\n \"\"\"Produces a single usertype\"\"\"\n fields = {} # type: Dict[str, Dict[str, Any]]\n [fields.update(self._format_field(s)) for s in usertype.fieldlist.substructs]\n return {usertype.name: {'fields': fields, 'kind': kind, 'size': usertype.size}}","function_tokens":["def","_format_usertype","(","self",",","usertype",",","kind",")","->","Dict",":","fields","=","{","}","# type: Dict[str, Dict[str, Any]]","[","fields",".","update","(","self",".","_format_field","(","s",")",")","for","s","in","usertype",".","fieldlist",".","substructs","]","return","{","usertype",".","name",":","{","'fields'",":","fields",",","'kind'",":","kind",",","'size'",":","usertype",".","size","}","}"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py#L232-L236"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py","language":"python","identifier":"PDBConvertor.read_basetypes","parameters":"(self)","argument_list":"","return_statement":"return output","docstring":"Reads the base types from the PDB file","docstring_summary":"Reads the base types from the PDB file","docstring_tokens":["Reads","the","base","types","from","the","PDB","file"],"function":"def read_basetypes(self) -> Dict:\n \"\"\"Reads the base types from the PDB file\"\"\"\n ptr_size = 4\n if \"64\" in self._pdb.STREAM_DBI.machine:\n ptr_size = 8\n\n output = {\"pointer\": {\"endian\": \"little\", \"kind\": \"int\", \"signed\": False, \"size\": ptr_size}}\n for index in self._seen_ctypes:\n output[self.ctype[index]] = {\n \"endian\": \"little\",\n \"kind\": self.ctype_python_types.get(self.ctype[index], \"int\"),\n \"signed\": False if \"_U\" in index else True,\n \"size\": self.base_type_size[index]\n }\n return output","function_tokens":["def","read_basetypes","(","self",")","->","Dict",":","ptr_size","=","4","if","\"64\"","in","self",".","_pdb",".","STREAM_DBI",".","machine",":","ptr_size","=","8","output","=","{","\"pointer\"",":","{","\"endian\"",":","\"little\"",",","\"kind\"",":","\"int\"",",","\"signed\"",":","False",",","\"size\"",":","ptr_size","}","}","for","index","in","self",".","_seen_ctypes",":","output","[","self",".","ctype","[","index","]","]","=","{","\"endian\"",":","\"little\"",",","\"kind\"",":","self",".","ctype_python_types",".","get","(","self",".","ctype","[","index","]",",","\"int\"",")",",","\"signed\"",":","False","if","\"_U\"","in","index","else","True",",","\"size\"",":","self",".","base_type_size","[","index","]","}","return","output"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/vol_Parser\/development\/pdbparse-to-json.py#L303-L317"} {"nwo":"DFIRKuiper\/Kuiper","sha":"c5b4cb3d535287c360b239b7596e82731954fc77","path":"kuiper\/app\/parsers\/PyWMIPersistenceFinder\/PyWMIPersistenceFinder.py","language":"python","identifier":"main","parameters":"(file)","argument_list":"","return_statement":"return res","docstring":"Main function for everything!","docstring_summary":"Main function for everything!","docstring_tokens":["Main","function","for","everything!"],"function":"def main(file):\n \"\"\"Main function for everything!\"\"\"\n\n #print(\"\\n Enumerating FilterToConsumerBindings...\")\n\n #Read objects.data 4 lines at a time to look for bindings\n objects_file = open(file , \"rb\")\n current_line = objects_file.readline()\n lines_list = [current_line]\n current_line = objects_file.readline()\n lines_list.append(current_line)\n current_line = objects_file.readline()\n lines_list.append(current_line)\n current_line = objects_file.readline()\n lines_list.append(current_line)\n\n #Precompiled match objects to search each line with\n event_consumer_mo = re.compile(r\"([\\w\\_]*EventConsumer\\.Name\\=\\\")([\\w\\s]*)(\\\")\")\n event_filter_mo = re.compile(r\"(_EventFilter\\.Name\\=\\\")([\\w\\s]*)(\\\")\")\n\n #Dictionaries that will store bindings, consumers, and filters\n bindings_dict = {}\n consumer_dict = {}\n filter_dict = {}\n\n while current_line:\n # Join all the read lines together (should always be 4) to look for bindings spread over\n # multiple lines that may have been one page\n potential_page = \" \".join(lines_list)\n\n # Look for FilterToConsumerBindings\n if \"_FilterToConsumerBinding\" in potential_page:\n if (\n re.search(event_consumer_mo, potential_page) and\n re.search(event_filter_mo, potential_page)):\n event_consumer_name = re.search(event_consumer_mo, potential_page).groups(0)[1]\n event_filter_name = re.search(event_filter_mo, potential_page).groups(0)[1]\n\n #Add the consumers and filters to their dicts if they don't already exist\n #set() is used to avoid duplicates as we go through the lines\n if event_consumer_name not in consumer_dict:\n consumer_dict[event_consumer_name] = set()\n if event_filter_name not in filter_dict:\n filter_dict[event_filter_name] = set()\n\n #Give the binding a name and add it to the dict\n binding_id = \"{}-{}\".format(event_consumer_name, event_filter_name)\n if binding_id not in bindings_dict:\n bindings_dict[binding_id] = {\n \"event_consumer_name\":event_consumer_name,\n \"event_filter_name\":event_filter_name}\n\n # Increment lines and look again\n current_line = objects_file.readline()\n lines_list.append(current_line)\n lines_list.pop(0)\n\n # Close the file and look for consumers and filters\n objects_file.close()\n #print(\" {} FilterToConsumerBinding(s) Found. Enumerating Filters and Consumers...\"\n # .format(len(bindings_dict)))\n\n #print( bindings_dict )\n # Read objects.data 4 lines at a time to look for filters and consumers\n objects_file = open(file, \"rb\")\n current_line = objects_file.readline()\n lines_list = [current_line]\n current_line = objects_file.readline()\n lines_list.append(current_line)\n current_line = objects_file.readline()\n lines_list.append(current_line)\n current_line = objects_file.readline()\n lines_list.append(current_line)\n\n while current_line:\n potential_page = \" \".join(lines_list).replace(\"\\n\", \"\")\n\n # Check each potential page for the consumers we are looking for\n if \"EventConsumer\" in potential_page:\n for event_consumer_name, event_consumer_details in consumer_dict.iteritems():\n # Can't precompile regex because it is dynamically created with each consumer name\n if \"CommandLineEventConsumer\" in potential_page:\n consumer_mo = re.compile(\"(CommandLineEventConsumer)(\\x00\\x00)(.*?)(\\x00)(.*?)\"\n \"({})(\\x00\\x00)?([^\\x00]*)?\"\n .format(event_consumer_name))\n consumer_match = re.search(consumer_mo, potential_page)\n if consumer_match:\n noisy_string = consumer_match.groups()[2]\n consumer_details = \"\\n\\t\\tConsumer Type: {}\\n\\t\\tArguments: {}\".format(\n consumer_match.groups()[0],\n filter(lambda event_consumer_name: event_consumer_name in\n PRINTABLE_CHARS, noisy_string))\n if consumer_match.groups()[5]:\n consumer_details += \"\\n\\t\\tConsumer Name: {}\".format(consumer_match.groups()[5])\n if consumer_match.groups()[7]:\n consumer_details += \"\\n\\t\\tOther: {}\".format(consumer_match.groups()[7])\n consumer_dict[event_consumer_name].add(consumer_details)\n\n else:\n consumer_mo = re.compile(\n r\"(\\w*EventConsumer)(.*?)({})(\\x00\\x00)([^\\x00]*)(\\x00\\x00)([^\\x00]*)\"\n .format(event_consumer_name))\n consumer_match = re.search(consumer_mo, potential_page)\n if consumer_match:\n consumer_details = \"{} ~ {} ~ {} ~ {}\".format(\n consumer_match.groups()[0],\n consumer_match.groups()[2],\n consumer_match.groups()[4],\n consumer_match.groups()[6])\n consumer_dict[event_consumer_name].add(consumer_details)\n\n # Check each potential page for the filters we are looking for\n for event_filter_name, event_filter_details in filter_dict.iteritems():\n if event_filter_name in potential_page:\n # Can't precompile regex because it is dynamically created with each filter name\n filter_mo = re.compile(\n r\"({})(\\x00\\x00)([^\\x00]*)(\\x00\\x00)\".format(event_filter_name))\n filter_match = re.search(filter_mo, potential_page)\n if filter_match:\n filter_details = \"\\n\\t\\tFilter name: {}\\n\\t\\tFilter Query: {}\".format(\n filter_match.groups()[0],\n filter_match.groups()[2])\n filter_dict[event_filter_name].add(filter_details)\n\n current_line = objects_file.readline()\n lines_list.append(current_line)\n lines_list.pop(0)\n objects_file.close()\n \n # Print results to stdout. CSV will be in future version.\n #print(\"\\n Bindings:\\n\")\n res = [ ]\n\n for binding_name, binding_details in bindings_dict.iteritems():\n temp_res = {}\n temp_res['binding_name'] = binding_name\n\n event_filter_name = binding_details[\"event_filter_name\"]\n event_consumer_name = binding_details[\"event_consumer_name\"]\n\n temp_res['filter_name'] = event_filter_name\n temp_res['consumer_name'] = event_consumer_name\n \n # Print binding details if available\n if consumer_dict[event_consumer_name]:\n for event_consumer_details in consumer_dict[event_consumer_name]:\n #print(\" Consumer: {}\".format(event_consumer_details))\n temp_res['consumer_dict'] = event_consumer_details\n\n temp_consumer_dict = {}\n for i in temp_res['consumer_dict'].split('\\n\\t'):\n v = ':'.join( i.split(':')[1:]).strip()\n k = i.split(':')[0]\n if k == \"\":\n continue\n if v == \"\":\n temp_consumer_dict['Consumer'] = k\n else:\n temp_consumer_dict[k.strip('\\t').replace(' ' , '_')] = v\n temp_res['consumer_dict'] = temp_consumer_dict\n #print(temp_res['consumer_dict'])\n\n else:\n #print(\" Consumer: {}\".format(event_consumer_name))\n temp_res['consumer_dict'] = event_consumer_name\n\n\n # Print details for each filter found for this filter name\n for event_filter_details in filter_dict[event_filter_name]:\n #print(\"\\n Filter: {}\".format(event_filter_details))\n #print()\n temp_res['filter_details'] = event_filter_details\n\n temp_filter_details = {}\n for i in temp_res['filter_details'].split('\\n\\t'):\n k = i.split(':')[0].strip('\\t').replace(' ' , '_')\n if k == \"\":\n continue\n temp_filter_details[k] = ':'.join( i.split(':')[1:]).strip()\n temp_res['filter_details'] = temp_filter_details\n\n\n res.append(temp_res)\n # Print closing message\n #print(\"\\n Thanks for using PyWMIPersistenceFinder! Please contact @DavidPany with \"\n # \"questions, bugs, or suggestions.\\n\\n Please review FireEye's whitepaper \"\n # \"for additional WMI persistence details:\\n https:\/\/www.fireeye.com\/content\/dam\"\n # \"\/fireeye-www\/global\/en\/current-threats\/pdfs\/wp-windows-management-instrumentation.pdf\")\n\n\n #for i in res:\n # print(str(i))\n return res","function_tokens":["def","main","(","file",")",":","#print(\"\\n Enumerating FilterToConsumerBindings...\")","#Read objects.data 4 lines at a time to look for bindings","objects_file","=","open","(","file",",","\"rb\"",")","current_line","=","objects_file",".","readline","(",")","lines_list","=","[","current_line","]","current_line","=","objects_file",".","readline","(",")","lines_list",".","append","(","current_line",")","current_line","=","objects_file",".","readline","(",")","lines_list",".","append","(","current_line",")","current_line","=","objects_file",".","readline","(",")","lines_list",".","append","(","current_line",")","#Precompiled match objects to search each line with","event_consumer_mo","=","re",".","compile","(","r\"([\\w\\_]*EventConsumer\\.Name\\=\\\")([\\w\\s]*)(\\\")\"",")","event_filter_mo","=","re",".","compile","(","r\"(_EventFilter\\.Name\\=\\\")([\\w\\s]*)(\\\")\"",")","#Dictionaries that will store bindings, consumers, and filters","bindings_dict","=","{","}","consumer_dict","=","{","}","filter_dict","=","{","}","while","current_line",":","# Join all the read lines together (should always be 4) to look for bindings spread over","# multiple lines that may have been one page","potential_page","=","\" \"",".","join","(","lines_list",")","# Look for FilterToConsumerBindings","if","\"_FilterToConsumerBinding\"","in","potential_page",":","if","(","re",".","search","(","event_consumer_mo",",","potential_page",")","and","re",".","search","(","event_filter_mo",",","potential_page",")",")",":","event_consumer_name","=","re",".","search","(","event_consumer_mo",",","potential_page",")",".","groups","(","0",")","[","1","]","event_filter_name","=","re",".","search","(","event_filter_mo",",","potential_page",")",".","groups","(","0",")","[","1","]","#Add the consumers and filters to their dicts if they don't already exist","#set() is used to avoid duplicates as we go through the lines","if","event_consumer_name","not","in","consumer_dict",":","consumer_dict","[","event_consumer_name","]","=","set","(",")","if","event_filter_name","not","in","filter_dict",":","filter_dict","[","event_filter_name","]","=","set","(",")","#Give the binding a name and add it to the dict","binding_id","=","\"{}-{}\"",".","format","(","event_consumer_name",",","event_filter_name",")","if","binding_id","not","in","bindings_dict",":","bindings_dict","[","binding_id","]","=","{","\"event_consumer_name\"",":","event_consumer_name",",","\"event_filter_name\"",":","event_filter_name","}","# Increment lines and look again","current_line","=","objects_file",".","readline","(",")","lines_list",".","append","(","current_line",")","lines_list",".","pop","(","0",")","# Close the file and look for consumers and filters","objects_file",".","close","(",")","#print(\" {} FilterToConsumerBinding(s) Found. Enumerating Filters and Consumers...\"","# .format(len(bindings_dict)))","#print( bindings_dict )","# Read objects.data 4 lines at a time to look for filters and consumers","objects_file","=","open","(","file",",","\"rb\"",")","current_line","=","objects_file",".","readline","(",")","lines_list","=","[","current_line","]","current_line","=","objects_file",".","readline","(",")","lines_list",".","append","(","current_line",")","current_line","=","objects_file",".","readline","(",")","lines_list",".","append","(","current_line",")","current_line","=","objects_file",".","readline","(",")","lines_list",".","append","(","current_line",")","while","current_line",":","potential_page","=","\" \"",".","join","(","lines_list",")",".","replace","(","\"\\n\"",",","\"\"",")","# Check each potential page for the consumers we are looking for","if","\"EventConsumer\"","in","potential_page",":","for","event_consumer_name",",","event_consumer_details","in","consumer_dict",".","iteritems","(",")",":","# Can't precompile regex because it is dynamically created with each consumer name","if","\"CommandLineEventConsumer\"","in","potential_page",":","consumer_mo","=","re",".","compile","(","\"(CommandLineEventConsumer)(\\x00\\x00)(.*?)(\\x00)(.*?)\"","\"({})(\\x00\\x00)?([^\\x00]*)?\"",".","format","(","event_consumer_name",")",")","consumer_match","=","re",".","search","(","consumer_mo",",","potential_page",")","if","consumer_match",":","noisy_string","=","consumer_match",".","groups","(",")","[","2","]","consumer_details","=","\"\\n\\t\\tConsumer Type: {}\\n\\t\\tArguments: {}\"",".","format","(","consumer_match",".","groups","(",")","[","0","]",",","filter","(","lambda","event_consumer_name",":","event_consumer_name","in","PRINTABLE_CHARS",",","noisy_string",")",")","if","consumer_match",".","groups","(",")","[","5","]",":","consumer_details","+=","\"\\n\\t\\tConsumer Name: {}\"",".","format","(","consumer_match",".","groups","(",")","[","5","]",")","if","consumer_match",".","groups","(",")","[","7","]",":","consumer_details","+=","\"\\n\\t\\tOther: {}\"",".","format","(","consumer_match",".","groups","(",")","[","7","]",")","consumer_dict","[","event_consumer_name","]",".","add","(","consumer_details",")","else",":","consumer_mo","=","re",".","compile","(","r\"(\\w*EventConsumer)(.*?)({})(\\x00\\x00)([^\\x00]*)(\\x00\\x00)([^\\x00]*)\"",".","format","(","event_consumer_name",")",")","consumer_match","=","re",".","search","(","consumer_mo",",","potential_page",")","if","consumer_match",":","consumer_details","=","\"{} ~ {} ~ {} ~ {}\"",".","format","(","consumer_match",".","groups","(",")","[","0","]",",","consumer_match",".","groups","(",")","[","2","]",",","consumer_match",".","groups","(",")","[","4","]",",","consumer_match",".","groups","(",")","[","6","]",")","consumer_dict","[","event_consumer_name","]",".","add","(","consumer_details",")","# Check each potential page for the filters we are looking for","for","event_filter_name",",","event_filter_details","in","filter_dict",".","iteritems","(",")",":","if","event_filter_name","in","potential_page",":","# Can't precompile regex because it is dynamically created with each filter name","filter_mo","=","re",".","compile","(","r\"({})(\\x00\\x00)([^\\x00]*)(\\x00\\x00)\"",".","format","(","event_filter_name",")",")","filter_match","=","re",".","search","(","filter_mo",",","potential_page",")","if","filter_match",":","filter_details","=","\"\\n\\t\\tFilter name: {}\\n\\t\\tFilter Query: {}\"",".","format","(","filter_match",".","groups","(",")","[","0","]",",","filter_match",".","groups","(",")","[","2","]",")","filter_dict","[","event_filter_name","]",".","add","(","filter_details",")","current_line","=","objects_file",".","readline","(",")","lines_list",".","append","(","current_line",")","lines_list",".","pop","(","0",")","objects_file",".","close","(",")","# Print results to stdout. CSV will be in future version.","#print(\"\\n Bindings:\\n\")","res","=","[","]","for","binding_name",",","binding_details","in","bindings_dict",".","iteritems","(",")",":","temp_res","=","{","}","temp_res","[","'binding_name'","]","=","binding_name","event_filter_name","=","binding_details","[","\"event_filter_name\"","]","event_consumer_name","=","binding_details","[","\"event_consumer_name\"","]","temp_res","[","'filter_name'","]","=","event_filter_name","temp_res","[","'consumer_name'","]","=","event_consumer_name","# Print binding details if available","if","consumer_dict","[","event_consumer_name","]",":","for","event_consumer_details","in","consumer_dict","[","event_consumer_name","]",":","#print(\" Consumer: {}\".format(event_consumer_details))","temp_res","[","'consumer_dict'","]","=","event_consumer_details","temp_consumer_dict","=","{","}","for","i","in","temp_res","[","'consumer_dict'","]",".","split","(","'\\n\\t'",")",":","v","=","':'",".","join","(","i",".","split","(","':'",")","[","1",":","]",")",".","strip","(",")","k","=","i",".","split","(","':'",")","[","0","]","if","k","==","\"\"",":","continue","if","v","==","\"\"",":","temp_consumer_dict","[","'Consumer'","]","=","k","else",":","temp_consumer_dict","[","k",".","strip","(","'\\t'",")",".","replace","(","' '",",","'_'",")","]","=","v","temp_res","[","'consumer_dict'","]","=","temp_consumer_dict","#print(temp_res['consumer_dict'])","else",":","#print(\" Consumer: {}\".format(event_consumer_name))","temp_res","[","'consumer_dict'","]","=","event_consumer_name","# Print details for each filter found for this filter name","for","event_filter_details","in","filter_dict","[","event_filter_name","]",":","#print(\"\\n Filter: {}\".format(event_filter_details))","#print()","temp_res","[","'filter_details'","]","=","event_filter_details","temp_filter_details","=","{","}","for","i","in","temp_res","[","'filter_details'","]",".","split","(","'\\n\\t'",")",":","k","=","i",".","split","(","':'",")","[","0","]",".","strip","(","'\\t'",")",".","replace","(","' '",",","'_'",")","if","k","==","\"\"",":","continue","temp_filter_details","[","k","]","=","':'",".","join","(","i",".","split","(","':'",")","[","1",":","]",")",".","strip","(",")","temp_res","[","'filter_details'","]","=","temp_filter_details","res",".","append","(","temp_res",")","# Print closing message","#print(\"\\n Thanks for using PyWMIPersistenceFinder! Please contact @DavidPany with \"","# \"questions, bugs, or suggestions.\\n\\n Please review FireEye's whitepaper \"","# \"for additional WMI persistence details:\\n https:\/\/www.fireeye.com\/content\/dam\"","# \"\/fireeye-www\/global\/en\/current-threats\/pdfs\/wp-windows-management-instrumentation.pdf\")","#for i in res:","# print(str(i))","return","res"],"url":"https:\/\/github.com\/DFIRKuiper\/Kuiper\/blob\/c5b4cb3d535287c360b239b7596e82731954fc77\/kuiper\/app\/parsers\/PyWMIPersistenceFinder\/PyWMIPersistenceFinder.py#L87-L279"}