- Timestamp:
- 04/28/11 12:45:10 (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SConstruct
r225 r232 1 1 import sys 2 2 import os 3 from regfi_version import REGFI_VERSION 3 4 4 5 cflags = '-std=gnu99 -pedantic -Wall -D_FILE_OFFSET_BITS=64 -fvisibility=hidden' 6 cflags += ' -DREGFI_VERSION=\'"%s"\'' % REGFI_VERSION 5 7 cflags += ' -ggdb' 6 8 -
trunk/include/regfi.h
r228 r232 79 79 #include <range_list.h> 80 80 #include <lru_cache.h> 81 82 /* Library version can be overridden at build time */ 83 #ifndef REGFI_VERSION 84 #define REGFI_VERSION "trunk" 85 #endif 81 86 82 87 /* GCC-specific macro for library exports */ -
trunk/python/pyregfi/__init__.py
r228 r232 189 189 # should be reported to the user. Failure to retrieve these could result in 190 190 # excessive memory consumption. 191 def GetLogMessages():191 def getLogMessages(): 192 192 msgs = regfi.regfi_log_get_str() 193 193 if not msgs: … … 206 206 # Example: 207 207 # @code 208 # SetLogMask((LOG_TYPES.ERROR, LOG_TYPES.WARN, LOG_TYPES.INFO))208 # setLogMask((LOG_TYPES.ERROR, LOG_TYPES.WARN, LOG_TYPES.INFO)) 209 209 # @endcode 210 210 # … … 212 212 # For more information, see @ref regfi_log_set_mask. 213 213 # 214 def SetLogMask(log_types):214 def setLogMask(log_types): 215 215 mask = 0 216 216 for m in log_types: … … 219 219 220 220 221 ## Opens a file as a registry hive 222 # 223 # @param path The file path of a hive, as one would provide to the 224 # open() built-in 225 # 226 # @return A new Hive instance 227 def openHive(path): 228 fh = open(path, 'rb') 229 return Hive(fh) 230 231 221 232 ## Abstract class for most objects returned by the library 222 233 class _StructureWrapper(object): … … 228 239 raise Exception("Could not create _StructureWrapper," 229 240 + " hive is NULL. Current log:\n" 230 + GetLogMessages())241 + getLogMessages()) 231 242 if not base: 232 243 raise Exception("Could not create _StructureWrapper," 233 244 + " base is NULL. Current log:\n" 234 + GetLogMessages())245 + getLogMessages()) 235 246 self._hive = hive 236 247 self._base = base … … 297 308 if not key: 298 309 raise Exception("Could not create _GenericList; key is NULL." 299 + "Current log:\n" + GetLogMessages())310 + "Current log:\n" + getLogMessages()) 300 311 301 312 if not regfi.regfi_reference_record(key._hive.file, key._base): 302 313 raise Exception("Could not create _GenericList; memory error." 303 + "Current log:\n" + GetLogMessages())314 + "Current log:\n" + getLogMessages()) 304 315 self._key_base = key._base 305 316 self._length = self._fetch_num(self._key_base) … … 650 661 minor_version = 5 651 662 652 # XXX: Possibly add a second or factory function which opens a653 # hive file for you654 655 663 ## Constructor 664 # 665 # Initialize a new Hive based on a Python file object. To open a file by 666 # path, see @ref openHive. 656 667 # 657 668 # @param fh A Python file object. The constructor first looks for a valid … … 660 671 # access. 661 672 # 662 # @note Supplied file must be seekable 673 # @note Supplied file must be seekable. Do not perform any operation on 674 # the provided file object while a Hive is using it. Do not 675 # construct multiple Hive instances from the same file object. 676 # If a file must be accessed by separate code and pyregfi 677 # simultaneously, use a separate file descriptor. Hives are 678 # thread-safe, so multiple threads may use a single Hive object. 663 679 def __init__(self, fh): 664 680 # The fileno method may not exist, or it may throw an exception … … 678 694 # XXX: switch to non-generic exception 679 695 raise Exception("Could not open registry file. Current log:\n" 680 + GetLogMessages())696 + getLogMessages()) 681 697 else: 682 698 fh.seek(0) … … 689 705 # XXX: switch to non-generic exception 690 706 raise Exception("Could not open registry file. Current log:\n" 691 + GetLogMessages())707 + getLogMessages()) 692 708 693 709 … … 753 769 if not self._iter: 754 770 raise Exception("Could not create iterator. Current log:\n" 755 + GetLogMessages())771 + getLogMessages()) 756 772 self._hive = hive 757 773 self._lock = threading.RLock() … … 797 813 self._lock.release() 798 814 raise Exception('Error traversing iterator downward.'+ 799 ' Current log:\n'+ GetLogMessages())815 ' Current log:\n'+ getLogMessages()) 800 816 801 817 regfi.regfi_iterator_first_subkey(self._iter) … … 977 993 if not result: 978 994 # XXX: Use non-generic exception 979 raise Exception('Could not locate path.\n'+ GetLogMessages())995 raise Exception('Could not locate path.\n'+getLogMessages()) 980 996 981 997 -
trunk/regfi_version.py
r231 r232 1 2 1 SVN_REV = "$Rev$" 3 REGFI_VERSION = "svn-%s" % SVN_REV.split(' ')[ 2]2 REGFI_VERSION = "svn-%s" % SVN_REV.split(' ')[1] -
trunk/src/common.c
r219 r232 3 3 * XXX: This should be converted to a proper library. 4 4 * 5 * Copyright (C) 2005-2008 Timothy D. Morgan5 * Copyright (C) 2005-2008,2011 Timothy D. Morgan 6 6 * Copyright (C) 2002 Richard Sharpe, rsharpe@richardsharpe.com 7 7 * … … 28 28 const char* subfield_special_chars = ",\"\\|"; 29 29 const char* common_special_chars = ",\"\\"; 30 31 #define REGLOOKUP_VERSION "0.1?.0"32 30 33 31 #define REGLOOKUP_EXIT_OK 0 -
trunk/src/reglookup-recover.c
r228 r232 336 336 { 337 337 fprintf(stderr, "Usage: reglookup-recover [options] <REGISTRY_FILE>\n"); 338 fprintf(stderr, "Version: %s\n", REG LOOKUP_VERSION);338 fprintf(stderr, "Version: %s\n", REGFI_VERSION); 339 339 fprintf(stderr, "Options:\n"); 340 340 fprintf(stderr, "\t-v\t sets verbose mode.\n"); -
trunk/src/reglookup.c
r228 r232 551 551 " [-p <PATH_FILTER>] [-t <TYPE_FILTER>]" 552 552 " <REGISTRY_FILE>\n"); 553 fprintf(stderr, "Version: %s\n", REG LOOKUP_VERSION);553 fprintf(stderr, "Version: %s\n", REGFI_VERSION); 554 554 fprintf(stderr, "Options:\n"); 555 555 fprintf(stderr, "\t-v\t sets verbose mode.\n");
Note: See TracChangeset
for help on using the changeset viewer.