Changeset 253 for trunk/python
- Timestamp:
- 06/12/11 22:27:42 (13 years ago)
- Location:
- trunk/python/pyregfi
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/pyregfi/__init__.py
r252 r253 295 295 296 296 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 # 299 300 class 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 301 335 302 336 ## Abstract class for ValueList and SubkeyList … … 1038 1072 del Key.name,Key.name_raw,Key.offset,Key.modified,Key.flags 1039 1073 del Hive.root,Hive.modified,Hive.sequence1,Hive.sequence2,Hive.major_version,Hive.minor_version 1074 del Security.ref_count,Security.offset,Security.descriptor -
trunk/python/pyregfi/structures.py
r252 r253 21 21 REGFI_DATA_TYPE = c_uint32 22 22 REGFI_NTTIME = c_uint64 23 24 REGFI_REGF_SIZE = 0x1000 23 25 24 26 # Prototype everything first so we don't have to worry about reference order … … 94 96 read_cb_type = CB_FACTORY(c_int64, POINTER(REGFI_RAW_FILE), POINTER(c_char), c_size_t, use_errno=True) 95 97 98 99 from winsec import * 96 100 97 101 REGFI_VK._fields_ = [('offset', c_uint32), … … 113 117 REGFI_SK._fields_ = [('offset', c_uint32), 114 118 ('cell_size', c_uint32), 115 ('sec_desc', c_void_p), #XXX119 ('sec_desc', POINTER(WINSEC_DESC)), 116 120 ('hbin_off', c_uint32), 117 121 ('prev_sk_off', c_uint32), … … 261 265 regfi.regfi_fetch_sk.restype = POINTER(REGFI_SK) 262 266 267 regfi.regfi_next_sk.argtypes = [POINTER(REGFI_FILE), POINTER(REGFI_SK)] 268 regfi.regfi_next_sk.restype = POINTER(REGFI_SK) 269 270 regfi.regfi_prev_sk.argtypes = [POINTER(REGFI_FILE), POINTER(REGFI_SK)] 271 regfi.regfi_prev_sk.restype = POINTER(REGFI_SK) 272 263 273 regfi.regfi_fetch_data.argtypes = [POINTER(REGFI_FILE), POINTER(REGFI_VK)] 264 274 regfi.regfi_fetch_data.restype = POINTER(REGFI_DATA) … … 283 293 regfi.regfi_get_parentkey.restype = POINTER(REGFI_NK) 284 294 285 regfi.regfi_nt2unix_time.argtypes = [ POINTER(REGFI_NTTIME)]295 regfi.regfi_nt2unix_time.argtypes = [REGFI_NTTIME] 286 296 regfi.regfi_nt2unix_time.restype = c_double 287 297
Note: See TracChangeset
for help on using the changeset viewer.