Ignore:
Timestamp:
06/12/11 22:27:42 (13 years ago)
Author:
tim
Message:

added preliminary interface to security descriptors in pyregfi
misc bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/pyregfi/__init__.py

    r252 r253  
    295295
    296296
    297 ## Registry security record and descriptor
    298 # XXX: Access to security descriptors not yet implemented
     297
     298## Represents a registry SK record which contains a security descriptor
     299#
    299300class Security(_StructureWrapper):
    300     pass
     301    ## Number of keys referencing this SK record
     302    ref_count = 1
     303
     304    ## The absolute file offset of the SK record's cell in the Hive file
     305    offset = 0xCAFEBABE
     306
     307    ## The @ref SecurityDescriptor for this SK record
     308    descriptor = object()
     309
     310    def __init__(self, hive, base):
     311        super(Security, self).__init__(hive, base)
     312        # XXX: add checks for NULL pointers
     313        self.descriptor = winsec.SecurityDescriptor(base.contents.sec_desc.contents)
     314
     315    ## Loads the "previous" Security record in the hive
     316    #
     317    # @note
     318    # SK records are included in a circular, doubly-linked list.
     319    # To iterate over all SK records, be sure to check for the repetition of
     320    # the SK record you started with to determine when all have been traversed.
     321    def next_security(self):
     322        return Security(self._hive,
     323                        regfi.regfi_next_sk(self._hive.file, self._base))
     324
     325    ## Loads the "previous" Security record in the hive
     326    #
     327    # @note
     328    # SK records are included in a circular, doubly-linked list.
     329    # To iterate over all SK records, be sure to check for the repetition of
     330    # the SK record you started with to determine when all have been traversed.
     331    def prev_security(self):
     332        return Security(self._hive,
     333                        regfi.regfi_prev_sk(self._hive.file, self._base))
     334
    301335
    302336## Abstract class for ValueList and SubkeyList
     
    10381072del Key.name,Key.name_raw,Key.offset,Key.modified,Key.flags
    10391073del Hive.root,Hive.modified,Hive.sequence1,Hive.sequence2,Hive.major_version,Hive.minor_version
     1074del Security.ref_count,Security.offset,Security.descriptor
Note: See TracChangeset for help on using the changeset viewer.