ReactOS  0.4.12-dev-919-gfc3b8d5
regdump.c File Reference
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "regdump.h"
Include dependency graph for regdump.c:

Go to the source code of this file.

Macros

#define dprintf   printf
 

Functions

void RegKeyPrint (int which)
 
void usage (const char *appName)
 
void show_menu (void)
 
int regdump (int argc, char *argv[])
 

Variables

const chardefault_cmd_line1 = "/E HKLM_EXPORT.TXT HKEY_LOCAL_MACHINE"
 
const chardefault_cmd_line2 = "TEST_IMPORT.TXT"
 
const chardefault_cmd_line3 = "/P HKEY_LOCAL_MACHINE\\SYSTEM"
 
const chardefault_cmd_line4 = "/P HKEY_LOCAL_MACHINE\\SOFTWARE"
 
const chardefault_cmd_line5 = "/P HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes"
 
const chardefault_cmd_line6 = "/E HKCR_EXPORT.TXT HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes"
 
const chardefault_cmd_line7 = "/D HKEY_LOCAL_MACHINE\\SYSTEM"
 
const chardefault_cmd_line8 = "/D HKEY_LOCAL_MACHINE\\SOFTWARE"
 
const chardefault_cmd_line9 = "/D HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes"
 

Macro Definition Documentation

◆ dprintf

#define dprintf   printf

Definition at line 33 of file regdump.c.

Function Documentation

◆ regdump()

int regdump ( int  argc,
char argv[] 
)

Definition at line 89 of file regdump.c.

90 {
91  char Buffer[500];
92 
93  if (argc > 1) {
94 // if (0 == _tcsstr(argv[1], _T("HKLM"))) {
95  if (strstr(argv[1], "help")) {
96  usage(argv[0]);
97  } else if (strstr(argv[1], "HKCR")) {
98  RegKeyPrint('1');
99  } else if (strstr(argv[1], "HKCU")) {
100  RegKeyPrint('2');
101  } else if (strstr(argv[1], "HKLM")) {
102  RegKeyPrint('3');
103  } else if (strstr(argv[1], "HKU")) {
104  RegKeyPrint('4');
105  } else if (strstr(argv[1], "HKCC")) {
106  RegKeyPrint('5');
107  } else if (strstr(argv[1], "HKRR")) {
108  RegKeyPrint('6');
109  } else {
110  dprintf("started with argc = %d, argv[1] = %s (unknown?)\n", argc, argv[1]);
111  }
112  return 0;
113  }
114  show_menu();
115  while (1) {
116  GetInput(Buffer, sizeof(Buffer));
117  switch (toupper(Buffer[0])) {
118  case '0':
119  return(0);
120  case '1':
122  goto doit;
123  case '2':
125  goto doit;
126  case '3':
128  goto doit;
129  case '4':
131  goto doit;
132  case '5':
134  goto doit;
135  case '6':
137  goto doit;
138  case '7':
140  goto doit;
141  case '8':
143  goto doit;
144  case '9':
146  goto doit;
147  case 'A':
148  case 'B':
149  case 'C':
150  case 'D':
151  case 'E':
152  case 'F':
153  RegKeyPrint(toupper(Buffer[0]) - 'A' + 1);
154  break;
155  default: doit:
156  if (!ProcessCmdLine(Buffer)) {
157  dprintf("invalid input.\n");
158  show_menu();
159  } else {
160  dprintf("done.\n");
161  }
162  break;
163  }
164  }
165  return 0;
166 }
void RegKeyPrint(int which)
static int argc
Definition: ServiceArgs.c:12
const char * default_cmd_line6
Definition: regdump.c:45
BOOL ProcessCmdLine(IN LPWSTR lpCmdLine)
Definition: eventvwr.c:201
void usage(const char *appName)
Definition: regdump.c:51
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
DWORD GetInput(char *Buffer, int buflen)
Definition: main.c:12
#define argv
Definition: mplay32.c:18
const char * default_cmd_line1
Definition: regdump.c:40
#define dprintf
Definition: regdump.c:33
Definition: bufpool.h:45
void show_menu(void)
Definition: regdump.c:57
int toupper(int c)
Definition: utclib.c:881
const char * default_cmd_line5
Definition: regdump.c:44
#define doit(a, b)
Definition: fieldoff.c:4
const char * default_cmd_line2
Definition: regdump.c:41
const char * default_cmd_line9
Definition: regdump.c:48
const char * default_cmd_line7
Definition: regdump.c:46
const char * default_cmd_line3
Definition: regdump.c:42
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
const char * default_cmd_line8
Definition: regdump.c:47
const char * default_cmd_line4
Definition: regdump.c:43

Referenced by main().

◆ RegKeyPrint()

void RegKeyPrint ( int  which)

Referenced by regdump().

◆ show_menu()

void show_menu ( void  )

Definition at line 57 of file regdump.c.

58 {
59  _tprintf(_T("\nchoose test :\n"));
60  _tprintf(_T(" 0 = Exit\n"));
61  printf(" 1 = %s\n", default_cmd_line1);
62  printf(" 2 = %s\n", default_cmd_line2);
63  printf(" 3 = %s\n", default_cmd_line3);
64  printf(" 4 = %s\n", default_cmd_line4);
65  printf(" 5 = %s\n", default_cmd_line5);
66  printf(" 6 = %s\n", default_cmd_line6);
67  printf(" 7 = %s\n", default_cmd_line7);
68  printf(" 8 = %s\n", default_cmd_line8);
69  printf(" 9 = %s\n", default_cmd_line9);
70 /*
71  _tprintf(_T(" 1 = %s\n"), default_cmd_line1);
72  _tprintf(_T(" 2 = %s\n"), default_cmd_line2);
73  _tprintf(_T(" 3 = %s\n"), default_cmd_line3);
74  _tprintf(_T(" 4 = %s\n"), default_cmd_line4);
75  _tprintf(_T(" 5 = %s\n"), default_cmd_line5);
76  _tprintf(_T(" 6 = %s\n"), default_cmd_line6);
77  _tprintf(_T(" 7 = %s\n"), default_cmd_line7);
78  _tprintf(_T(" 8 = %s\n"), default_cmd_line8);
79  _tprintf(_T(" 9 = %s\n"), default_cmd_line9);
80  */
81 // _tprintf(_T(" A = HKEY_CLASSES_ROOT\n"));
82 // _tprintf(_T(" B = HKEY_CURRENT_USER\n"));
83 // _tprintf(_T(" C = HKEY_LOCAL_MACHINE\n"));
84 // _tprintf(_T(" D = HKEY_USERS\n"));
85 // _tprintf(_T(" E = HKEY_CURRENT_CONFIG\n"));
86 // _tprintf(_T(" F = REGISTRY ROOT\n"));
87 }
#define _tprintf
Definition: tchar.h:506
const char * default_cmd_line6
Definition: regdump.c:45
const char * default_cmd_line1
Definition: regdump.c:40
#define _T(x)
Definition: vfdio.h:22
const char * default_cmd_line5
Definition: regdump.c:44
const char * default_cmd_line2
Definition: regdump.c:41
const char * default_cmd_line9
Definition: regdump.c:48
const char * default_cmd_line7
Definition: regdump.c:46
const char * default_cmd_line3
Definition: regdump.c:42
const char * default_cmd_line8
Definition: regdump.c:47
const char * default_cmd_line4
Definition: regdump.c:43
#define printf
Definition: config.h:203

Referenced by regdump().

◆ usage()

void usage ( const char appName)

Definition at line 51 of file regdump.c.

52 {
53  fprintf(stderr, "%s: Dump registry key to console\n", appName);
54  fprintf(stderr, "%s HKCR | HKCU | HKLM | HKU | HKCC | HKRR\n", appName);
55 }
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
FILE * stderr
const char * appName(const char *argv0)
Definition: loadlib.c:89

Referenced by regdump().

Variable Documentation

◆ default_cmd_line1

const char* default_cmd_line1 = "/E HKLM_EXPORT.TXT HKEY_LOCAL_MACHINE"

Definition at line 40 of file regdump.c.

Referenced by regdump(), and show_menu().

◆ default_cmd_line2

const char* default_cmd_line2 = "TEST_IMPORT.TXT"

Definition at line 41 of file regdump.c.

Referenced by regdump(), and show_menu().

◆ default_cmd_line3

const char* default_cmd_line3 = "/P HKEY_LOCAL_MACHINE\\SYSTEM"

Definition at line 42 of file regdump.c.

Referenced by regdump(), and show_menu().

◆ default_cmd_line4

const char* default_cmd_line4 = "/P HKEY_LOCAL_MACHINE\\SOFTWARE"

Definition at line 43 of file regdump.c.

Referenced by regdump(), and show_menu().

◆ default_cmd_line5

const char* default_cmd_line5 = "/P HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes"

Definition at line 44 of file regdump.c.

Referenced by regdump(), and show_menu().

◆ default_cmd_line6

const char* default_cmd_line6 = "/E HKCR_EXPORT.TXT HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes"

Definition at line 45 of file regdump.c.

Referenced by regdump(), and show_menu().

◆ default_cmd_line7

const char* default_cmd_line7 = "/D HKEY_LOCAL_MACHINE\\SYSTEM"

Definition at line 46 of file regdump.c.

Referenced by regdump(), and show_menu().

◆ default_cmd_line8

const char* default_cmd_line8 = "/D HKEY_LOCAL_MACHINE\\SOFTWARE"

Definition at line 47 of file regdump.c.

Referenced by regdump(), and show_menu().

◆ default_cmd_line9

const char* default_cmd_line9 = "/D HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes"

Definition at line 48 of file regdump.c.

Referenced by regdump(), and show_menu().