Changeset 170


Ignore:
Timestamp:
03/05/10 23:40:25 (14 years ago)
Author:
tim
Message:

merged Tobias Mueller's patch with some changes
updated version number

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/reglookup-timeline

    r91 r170  
    55# timelines for investigations.
    66#
    7 # Copyright (C) 2005-2007 Timothy D. Morgan
     7# Copyright (C) 2005-2007,2010 Timothy D. Morgan
    88#
    99# This program is free software; you can redistribute it and/or modify
     
    2525usage()
    2626{
    27   echo "Usage: $0 [-H] <REGISTRY_FILE> [<REGISTRY_FILE> ...]" 1>&2
     27  echo "Usage: $0 [-H] [-V] <REGISTRY_FILE> [<REGISTRY_FILE> ...]" 1>&2
    2828  echo "   -H  Omit header line" 1>&2
     29  echo "   -V  Include values with parent timestamps" 1>&2
    2930}
    3031
     
    4142fi
    4243
     44OPTS='-t KEY'
     45if [ "$1" = "-V" ]; then
     46  OPTS='-i'
     47  shift
     48fi
     49
    4350if [ "$PRINT_HEADER" = "true" ]; then
    4451  echo "MTIME,FILE,PATH"
     
    4653
    4754for 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; }'
    4956done | sort
  • trunk/doc/reglookup.1.docbook

    r138 r170  
    1 <?xml version="1.0" encoding="UTF-8"?>
     1???<?xml version="1.0" encoding="UTF-8"?>
    22<refentry id='reglookup.1'>
    33  <!--  $Id$ -->
     
    8282          <para>
    8383            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.
    84102          </para>
    85103        </listitem>
  • trunk/src/common.c

    r168 r170  
    2929const char* common_special_chars = ",\"\\";
    3030
    31 #define REGLOOKUP_VERSION "0.11.0"
     31#define REGLOOKUP_VERSION "0.12.0"
    3232
    3333#define REGLOOKUP_EXIT_OK       0
  • trunk/src/reglookup.c

    r168 r170  
    22 * A utility to read a Windows NT and later registry files.
    33 *
    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)
    56 * Copyright (C) 2002 Richard Sharpe, rsharpe@richardsharpe.com
    67 *
     
    3132
    3233/* Globals, influenced by command line parameters */
     34bool print_value_mtime = false;
    3335bool print_verbose = false;
    3436bool print_security = false;
     
    5759  char* conv_error = NULL;
    5860  const char* str_type = NULL;
     61  char mtime[20];
     62  time_t tmp_time[1];
     63  struct tm* tmp_time_s = NULL;
    5964
    6065  if(vk->valuename == NULL)
     
    97102  }
    98103
     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
    99113  str_type = regfi_type_val2str(vk->type);
    100114  if(print_security)
    101115  {
    102116    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);
    108122  }
    109123  else
    110124  {
    111125    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);
    117131  }
    118132
     
    548562  fprintf(stderr, "\t-p\t restrict output to elements below this path.\n");
    549563  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");
    550565  fprintf(stderr, "\n");
    551566}
     
    605620    else if (strcmp("-v", argv[argi]) == 0)
    606621      print_verbose = true;
     622    else if (strcmp("-i", argv[argi]) == 0)
     623      print_value_mtime = true;
    607624    else
    608625    {
Note: See TracChangeset for help on using the changeset viewer.