- Timestamp:
- 03/05/10 23:40:25 (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/reglookup-timeline
r91 r170 5 5 # timelines for investigations. 6 6 # 7 # Copyright (C) 2005-2007 Timothy D. Morgan7 # Copyright (C) 2005-2007,2010 Timothy D. Morgan 8 8 # 9 9 # This program is free software; you can redistribute it and/or modify … … 25 25 usage() 26 26 { 27 echo "Usage: $0 [-H] <REGISTRY_FILE> [<REGISTRY_FILE> ...]" 1>&227 echo "Usage: $0 [-H] [-V] <REGISTRY_FILE> [<REGISTRY_FILE> ...]" 1>&2 28 28 echo " -H Omit header line" 1>&2 29 echo " -V Include values with parent timestamps" 1>&2 29 30 } 30 31 … … 41 42 fi 42 43 44 OPTS='-t KEY' 45 if [ "$1" = "-V" ]; then 46 OPTS='-i' 47 shift 48 fi 49 43 50 if [ "$PRINT_HEADER" = "true" ]; then 44 51 echo "MTIME,FILE,PATH" … … 46 53 47 54 for F in $@; do 48 reglookup -t KEY-H "$F" | awk -F',' '{ printf "%s,'"$F"',%s\n",$4,$1; }'55 reglookup $OPTS -H "$F" | awk -F',' '{ printf "%s,'"$F"',%s\n",$4,$1; }' 49 56 done | sort -
trunk/doc/reglookup.1.docbook
r138 r170 1 <?xml version="1.0" encoding="UTF-8"?>1 ???<?xml version="1.0" encoding="UTF-8"?> 2 2 <refentry id='reglookup.1'> 3 3 <!-- $Id$ --> … … 82 82 <para> 83 83 Enables the printing of a column header row. (default) 84 </para> 85 </listitem> 86 </varlistentry> 87 </variablelist> 88 89 <variablelist remap='IP'> 90 <varlistentry> 91 <term> 92 <option>-i</option> 93 </term> 94 <listitem> 95 <para> 96 Printed values inherit the timestamp of their parent key, which is 97 printed along with them. Note that this timestamp is not 98 necessarily meaningful for any given value values because timestamps 99 are saved on keys only and you cannot tell which value has been 100 modified since a change to any value of a given key would update the 101 time stamp. 84 102 </para> 85 103 </listitem> -
trunk/src/common.c
r168 r170 29 29 const char* common_special_chars = ",\"\\"; 30 30 31 #define REGLOOKUP_VERSION "0.1 1.0"31 #define REGLOOKUP_VERSION "0.12.0" 32 32 33 33 #define REGLOOKUP_EXIT_OK 0 -
trunk/src/reglookup.c
r168 r170 2 2 * A utility to read a Windows NT and later registry files. 3 3 * 4 * Copyright (C) 2005-2009 Timothy D. Morgan 4 * Copyright (C) 2005-2010 Timothy D. Morgan 5 * Copyright (C) 2010 Tobias Mueller (portions of '-i' code) 5 6 * Copyright (C) 2002 Richard Sharpe, rsharpe@richardsharpe.com 6 7 * … … 31 32 32 33 /* Globals, influenced by command line parameters */ 34 bool print_value_mtime = false; 33 35 bool print_verbose = false; 34 36 bool print_security = false; … … 57 59 char* conv_error = NULL; 58 60 const char* str_type = NULL; 61 char mtime[20]; 62 time_t tmp_time[1]; 63 struct tm* tmp_time_s = NULL; 59 64 60 65 if(vk->valuename == NULL) … … 97 102 } 98 103 104 if(print_value_mtime) 105 { 106 *tmp_time = regfi_nt2unix_time(&iter->cur_key->mtime); 107 tmp_time_s = gmtime(tmp_time); 108 strftime(mtime, sizeof(mtime), "%Y-%m-%d %H:%M:%S", tmp_time_s); 109 } 110 else 111 mtime[0] = '\0'; 112 99 113 str_type = regfi_type_val2str(vk->type); 100 114 if(print_security) 101 115 { 102 116 if(str_type == NULL) 103 printf("%s/%s,0x%.8X,%s, ,,,,\n", prefix, quoted_name,104 vk->type, quoted_value );105 else 106 printf("%s/%s,%s,%s, ,,,,\n", prefix, quoted_name,107 str_type, quoted_value );117 printf("%s/%s,0x%.8X,%s,%s,,,,\n", prefix, quoted_name, 118 vk->type, quoted_value, mtime); 119 else 120 printf("%s/%s,%s,%s,%s,,,,\n", prefix, quoted_name, 121 str_type, quoted_value, mtime); 108 122 } 109 123 else 110 124 { 111 125 if(str_type == NULL) 112 printf("%s/%s,0x%.8X,%s, \n", prefix, quoted_name,113 vk->type, quoted_value );114 else 115 printf("%s/%s,%s,%s, \n", prefix, quoted_name,116 str_type, quoted_value );126 printf("%s/%s,0x%.8X,%s,%s\n", prefix, quoted_name, 127 vk->type, quoted_value, mtime); 128 else 129 printf("%s/%s,%s,%s,%s\n", prefix, quoted_name, 130 str_type, quoted_value, mtime); 117 131 } 118 132 … … 548 562 fprintf(stderr, "\t-p\t restrict output to elements below this path.\n"); 549 563 fprintf(stderr, "\t-t\t restrict results to this specific data type.\n"); 564 fprintf(stderr, "\t-i\t includes parent key modification times with child values.\n"); 550 565 fprintf(stderr, "\n"); 551 566 } … … 605 620 else if (strcmp("-v", argv[argi]) == 0) 606 621 print_verbose = true; 622 else if (strcmp("-i", argv[argi]) == 0) 623 print_value_mtime = true; 607 624 else 608 625 {
Note: See TracChangeset
for help on using the changeset viewer.