Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
5.7 KiB

4 years ago
  1. Regdiff is a tool that allows you to snapshot the registry, compare the
  2. snapshot to the current state, look at what the differences are using the
  3. registry editor, save the differences to a file, and later merge or unmerge
  4. the changes back into/from the registry. Such a tool is useful for quick
  5. resetup of applications you frequently have to reload after updating your
  6. NT system. Its also useful for simply finding out what any particular
  7. operation changes in the registry.
  8. Here's how you would use regdiff to help you quickly reinstall excel:
  9. 1) load your new NT with fresh hives.
  10. 2) run
  11. regdiff -s c:\cleansnp
  12. this will save the current registry state into c:\cleansnp
  13. 3) now do your typical excel installation routine
  14. 4) Now that excel is all set run
  15. regdiff -d c:\cleansnp
  16. this finds out what differences there are between the current registry
  17. contents and your snapshot file c:\cleansnp.
  18. 5) Now, check out your changes using regedt32.exe and look at the
  19. HKEY_LOCAL_MACHINE\regdiff node. You will probably find "Add"
  20. and "Del" subkeys off of this node. The "Add" node shows all keys
  21. and values that were added to the registry since your snapshot and
  22. the "Del" node shows what has been removed. If the same value or
  23. key is in both nodes it means these parts have changed.
  24. At this point you may notice some random changes that took place
  25. in the registry since you last took your snapshot that have nothing
  26. to do with your installation actions. You can use regedt32.exe to
  27. edit the regdiff tree as needed so your diff information just
  28. contains what is pertinent.
  29. 6) Now save the diff information to a file. run:
  30. regdiff -w c:\exceldif
  31. 7) You may notice that you cannot delete this file. This is because it
  32. is loaded into the registry at this time. To unload it from the registry
  33. run:
  34. regdiff -r
  35. 8) Now you have a record of the exact changes that were made to the registry
  36. during your installation. Lets say you want to remove these changes
  37. from the registry. Run:
  38. regdiff -l c:\exceldif -u -r
  39. This just loaded the c:\exceldif diff info from the file into the registry
  40. and used that information to unmerge the changes from the registry. regdiff
  41. then removed/unloaded the diff information from the registry. An inspection of
  42. the registry will show all changes you made during installation have been
  43. removed. You may also see the progman group it created disappear.
  44. 9) Lets say you have now picked up a new NT with clean hives and you need
  45. to use excel via your email. You have the excel files on your disk but
  46. the registry is not set up so your double click on an email excel
  47. spreadsheet doesn't work. Run:
  48. regdiff -l c:\exceldif -m -r
  49. This replaces the changes referenced in the c:\exceldif file into the
  50. registry and then removes the diff information from the registry.
  51. 10)At this point you might want to install other apps. To get an
  52. accurate diff that is not dependent on your previous install do this:
  53. regdiff -l c:\exceldif -u // to remove your excel instalation changes
  54. install another app (say VC++)
  55. regdiff -d c:\cleansnp -w c:\vcppdif
  56. regdiff -l c:\exceldif -m // restores the excel changes.
  57. 11) Using this tool you can literally build up a batch file of all the
  58. diffs you want to have installed into your registry each time you
  59. pick up a new NT build.
  60. 12) If you want a little feedback from regdiff on what its doing during
  61. operation, you can specify the -v flag. If you think
  62. there is a bug, you can use the -@ flag to get extensive information
  63. on what regdiff is doing.
  64. 13) regdiff employs an inclusion and exclusion list to allow finer control
  65. over its operation. The default lists are set up to work well for
  66. general use but you may have some particular things you want to explore.
  67. To alter these lists create a text file that lists all the keys or values
  68. you want included or excluded and reference them on the command line
  69. along with the -i or -x flags. BE CAREFUL here. For instance, maybe
  70. you only want to snapshot a tiny part of the registry so your snapshot
  71. file is smaller. YOU SHOULD USE THE SAME INCLUSION LIST WITH YOUR DIFFS
  72. THAT YOU USED WITH YOUR SNAPSHOT! If your lists change between your
  73. snapshots, diffs, and merges, you may come up with erroneous results.
  74. Your lists can contain '?' characters for wild character matching.
  75. (Useful for \ControlSet005 type nodes.)
  76. regdiff usage:
  77. -s <snapfile>
  78. save current registry contents to snapfile.
  79. -d <snapfile>
  80. create diff information from current registry state and <snapfile>.
  81. -l <difffile>
  82. load diff information into registry from <difffile>.
  83. -w <difffile>
  84. write diff information to <difffile> from registry when done.
  85. -e erase input file(s) after done.
  86. -m merge diff information into current registry.
  87. -u unmerge diff information from current registry.
  88. -r remove diff information from registry when done.
  89. -x <exceptions file>
  90. use <exceptions file> to bypass diff, merge or unmerge on certain keys.
  91. -i <inclusions file>
  92. use <inclusions file> to snap or diff only certain keys.
  93. -v verbose output on.
  94. -@ Debug mode.
  95. -b break on errors.
  96. -n neuter - don't really do merges/unmerges. (for safe testing)
  97. <snapfile> and <difffile> should not have extensions on FAT partitions.
  98. diff information is kept in HKEY_LOCAL_MACHINE\regdiff
  99. The default inclusions list is:
  100. HKEY_LOCAL_MACHINE\SYSTEM
  101. HKEY_LOCAL_MACHINE\SOFTWARE
  102. HKEY_CURRENT_USER
  103. The default exceptions list is:
  104. HKEY_LOCAL_MACHINE\SYSTEM\Clone
  105. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\CacheLastUpdate
  106. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
  107. HKEY_LOCAL_MACHINE\SYSTEM\ControlSet???
  108.