(self, config_prefix: str = None, preferred_name: str = None)
return self._add_process_layer(self._context, dtb, config_prefix, preferred_name)
Constructs a new layer based on the process's DirectoryTableBase.
Constructs a new layer based on the process's DirectoryTableBase.
Constructs a new layer based on the process s DirectoryTableBase .
def add_process_layer(self, config_prefix: str = None, preferred_name: str = None):
        """Constructs a new layer based on the process's DirectoryTableBase."""

        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)
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 )