Commit a20c041f3ed6b6a5bef0b9a83a10340a617042ba
1 parent
521d9059
winreg module implemented. winvol var implemented. mount python module implement…
…ed. FAT volume listing implemented. NTFS volume listing improved.
Showing
20 changed files
with
448 additions
and
137 deletions
.idea/workspace.xml
... | ... | @@ -2,12 +2,17 @@ |
2 | 2 | <project version="4"> |
3 | 3 | <component name="ChangeListManager"> |
4 | 4 | <list default="true" id="33419617-7da8-422e-9ac6-68e0b317ebf8" name="Default" comment=""> |
5 | - <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/modules/info.py" /> | |
6 | - <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/modules/winreg.py" /> | |
5 | + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/README.md" /> | |
6 | + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/mount.py" /> | |
7 | + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/scripts/list_fat.sh" /> | |
8 | + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/vars/winvol.py" /> | |
9 | + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/winver.py" /> | |
7 | 10 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> |
8 | 11 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/digger.py" afterPath="$PROJECT_DIR$/digger.py" /> |
9 | - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/modules/mft.py" afterPath="$PROJECT_DIR$/modules/mft.py" /> | |
12 | + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/modules/info.py" afterPath="$PROJECT_DIR$/modules/info.py" /> | |
13 | + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/modules/winreg.py" afterPath="$PROJECT_DIR$/modules/winreg.py" /> | |
10 | 14 | <change type="MODIFICATION" beforePath="$PROJECT_DIR$/tomb.py" afterPath="$PROJECT_DIR$/tomb.py" /> |
15 | + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/vars/ntfsvol.py" afterPath="$PROJECT_DIR$/vars/ntfsvol.py" /> | |
11 | 16 | </list> |
12 | 17 | <ignored path="gravedigger.iws" /> |
13 | 18 | <ignored path=".idea/workspace.xml" /> |
... | ... | @@ -32,112 +37,114 @@ |
32 | 37 | </component> |
33 | 38 | <component name="FileEditorManager"> |
34 | 39 | <leaf> |
35 | - <file leaf-file-name="digger.py" pinned="false" current-in-tab="true"> | |
36 | - <entry file="file://$PROJECT_DIR$/digger.py"> | |
40 | + <file leaf-file-name="winreg.py" pinned="false" current-in-tab="true"> | |
41 | + <entry file="file://$PROJECT_DIR$/modules/winreg.py"> | |
37 | 42 | <provider selected="true" editor-type-id="text-editor"> |
38 | - <state relative-caret-position="446"> | |
39 | - <caret line="75" column="13" selection-start-line="75" selection-start-column="13" selection-end-line="75" selection-end-column="13" /> | |
43 | + <state relative-caret-position="485"> | |
44 | + <caret line="56" column="49" selection-start-line="56" selection-start-column="49" selection-end-line="56" selection-end-column="49" /> | |
40 | 45 | <folding> |
41 | - <element signature="e#25#38#0" expanded="true" /> | |
46 | + <element signature="e#0#25#0" expanded="true" /> | |
42 | 47 | </folding> |
43 | 48 | </state> |
44 | 49 | </provider> |
45 | 50 | </entry> |
46 | 51 | </file> |
47 | - <file leaf-file-name="runcmd.py" pinned="false" current-in-tab="false"> | |
48 | - <entry file="file://$PROJECT_DIR$/runcmd.py"> | |
52 | + <file leaf-file-name="winvol.py" pinned="false" current-in-tab="false"> | |
53 | + <entry file="file://$PROJECT_DIR$/vars/winvol.py"> | |
49 | 54 | <provider selected="true" editor-type-id="text-editor"> |
50 | - <state relative-caret-position="76"> | |
51 | - <caret line="4" column="22" selection-start-line="4" selection-start-column="22" selection-end-line="4" selection-end-column="22" /> | |
55 | + <state relative-caret-position="222"> | |
56 | + <caret line="42" column="33" selection-start-line="42" selection-start-column="22" selection-end-line="42" selection-end-column="33" /> | |
57 | + <folding> | |
58 | + <element signature="e#0#31#0" expanded="true" /> | |
59 | + </folding> | |
60 | + </state> | |
61 | + </provider> | |
62 | + </entry> | |
63 | + </file> | |
64 | + <file leaf-file-name="README.md" pinned="false" current-in-tab="false"> | |
65 | + <entry file="file://$PROJECT_DIR$/README.md"> | |
66 | + <provider selected="true" editor-type-id="text-editor"> | |
67 | + <state relative-caret-position="133"> | |
68 | + <caret line="7" column="9" selection-start-line="7" selection-start-column="9" selection-end-line="7" selection-end-column="9" /> | |
52 | 69 | <folding /> |
53 | 70 | </state> |
54 | 71 | </provider> |
55 | 72 | </entry> |
56 | 73 | </file> |
57 | - <file leaf-file-name="module.py" pinned="false" current-in-tab="false"> | |
58 | - <entry file="file://$PROJECT_DIR$/module.py"> | |
74 | + <file leaf-file-name="list_fat.sh" pinned="false" current-in-tab="false"> | |
75 | + <entry file="file://$PROJECT_DIR$/scripts/list_fat.sh"> | |
59 | 76 | <provider selected="true" editor-type-id="text-editor"> |
60 | - <state relative-caret-position="152"> | |
61 | - <caret line="8" column="21" selection-start-line="8" selection-start-column="21" selection-end-line="8" selection-end-column="21" /> | |
77 | + <state relative-caret-position="133"> | |
78 | + <caret line="7" column="18" selection-start-line="7" selection-start-column="18" selection-end-line="7" selection-end-column="18" /> | |
62 | 79 | <folding /> |
63 | 80 | </state> |
64 | 81 | </provider> |
65 | 82 | </entry> |
66 | 83 | </file> |
67 | - <file leaf-file-name="ntfsvol.py" pinned="false" current-in-tab="false"> | |
68 | - <entry file="file://$PROJECT_DIR$/vars/ntfsvol.py"> | |
84 | + <file leaf-file-name="mount.py" pinned="false" current-in-tab="false"> | |
85 | + <entry file="file://$PROJECT_DIR$/mount.py"> | |
69 | 86 | <provider selected="true" editor-type-id="text-editor"> |
70 | - <state relative-caret-position="608"> | |
71 | - <caret line="32" column="29" selection-start-line="32" selection-start-column="29" selection-end-line="32" selection-end-column="29" /> | |
87 | + <state relative-caret-position="190"> | |
88 | + <caret line="10" column="18" selection-start-line="10" selection-start-column="18" selection-end-line="10" selection-end-column="18" /> | |
72 | 89 | <folding> |
73 | - <element signature="e#0#31#0" expanded="true" /> | |
90 | + <element signature="e#0#11#0" expanded="true" /> | |
74 | 91 | </folding> |
75 | 92 | </state> |
76 | 93 | </provider> |
77 | 94 | </entry> |
78 | 95 | </file> |
79 | - <file leaf-file-name="list_ntfs.sh" pinned="false" current-in-tab="false"> | |
80 | - <entry file="file://$PROJECT_DIR$/scripts/list_ntfs.sh"> | |
96 | + <file leaf-file-name="runcmd.py" pinned="false" current-in-tab="false"> | |
97 | + <entry file="file://$PROJECT_DIR$/runcmd.py"> | |
81 | 98 | <provider selected="true" editor-type-id="text-editor"> |
82 | 99 | <state relative-caret-position="38"> |
83 | - <caret line="2" column="83" selection-start-line="2" selection-start-column="83" selection-end-line="2" selection-end-column="83" /> | |
100 | + <caret line="2" column="20" selection-start-line="2" selection-start-column="20" selection-end-line="2" selection-end-column="20" /> | |
84 | 101 | <folding /> |
85 | 102 | </state> |
86 | 103 | </provider> |
87 | 104 | </entry> |
88 | 105 | </file> |
89 | - <file leaf-file-name="mft.py" pinned="false" current-in-tab="false"> | |
90 | - <entry file="file://$PROJECT_DIR$/modules/mft.py"> | |
106 | + <file leaf-file-name="module.py" pinned="false" current-in-tab="false"> | |
107 | + <entry file="file://$PROJECT_DIR$/module.py"> | |
91 | 108 | <provider selected="true" editor-type-id="text-editor"> |
92 | - <state relative-caret-position="0"> | |
93 | - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="25" selection-end-column="0" /> | |
94 | - <folding> | |
95 | - <element signature="e#0#25#0" expanded="true" /> | |
96 | - </folding> | |
109 | + <state relative-caret-position="76"> | |
110 | + <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" /> | |
111 | + <folding /> | |
97 | 112 | </state> |
98 | 113 | </provider> |
99 | 114 | </entry> |
100 | 115 | </file> |
101 | - <file leaf-file-name="winreg.py" pinned="false" current-in-tab="false"> | |
102 | - <entry file="file://$PROJECT_DIR$/modules/winreg.py"> | |
116 | + <file leaf-file-name="digger.py" pinned="false" current-in-tab="false"> | |
117 | + <entry file="file://$PROJECT_DIR$/digger.py"> | |
103 | 118 | <provider selected="true" editor-type-id="text-editor"> |
104 | - <state relative-caret-position="323"> | |
105 | - <caret line="17" column="12" selection-start-line="17" selection-start-column="12" selection-end-line="18" selection-end-column="10" /> | |
119 | + <state relative-caret-position="276"> | |
120 | + <caret line="71" column="41" selection-start-line="71" selection-start-column="41" selection-end-line="71" selection-end-column="41" /> | |
106 | 121 | <folding> |
107 | - <element signature="e#0#25#0" expanded="true" /> | |
122 | + <element signature="e#25#38#0" expanded="true" /> | |
108 | 123 | </folding> |
109 | 124 | </state> |
110 | 125 | </provider> |
111 | 126 | </entry> |
112 | 127 | </file> |
113 | - <file leaf-file-name="info.py" pinned="false" current-in-tab="false"> | |
114 | - <entry file="file://$PROJECT_DIR$/modules/info.py"> | |
128 | + <file leaf-file-name="winver.py" pinned="false" current-in-tab="false"> | |
129 | + <entry file="file://$PROJECT_DIR$/winver.py"> | |
115 | 130 | <provider selected="true" editor-type-id="text-editor"> |
116 | - <state relative-caret-position="266"> | |
117 | - <caret line="14" column="22" selection-start-line="14" selection-start-column="22" selection-end-line="14" selection-end-column="22" /> | |
131 | + <state relative-caret-position="447"> | |
132 | + <caret line="69" column="17" selection-start-line="69" selection-start-column="17" selection-end-line="69" selection-end-column="17" /> | |
118 | 133 | <folding> |
119 | - <element signature="e#0#25#0" expanded="true" /> | |
134 | + <element signature="e#0#9#0" expanded="true" /> | |
120 | 135 | </folding> |
121 | 136 | </state> |
122 | 137 | </provider> |
123 | 138 | </entry> |
124 | 139 | </file> |
125 | - <file leaf-file-name="tomb.py" pinned="false" current-in-tab="false"> | |
126 | - <entry file="file://$PROJECT_DIR$/tomb.py"> | |
127 | - <provider selected="true" editor-type-id="text-editor"> | |
128 | - <state relative-caret-position="114"> | |
129 | - <caret line="6" column="27" selection-start-line="6" selection-start-column="27" selection-end-line="6" selection-end-column="27" /> | |
130 | - <folding /> | |
131 | - </state> | |
132 | - </provider> | |
133 | - </entry> | |
134 | - </file> | |
135 | - <file leaf-file-name="modulevar.py" pinned="false" current-in-tab="false"> | |
136 | - <entry file="file://$PROJECT_DIR$/modulevar.py"> | |
140 | + <file leaf-file-name="ntfsvol.py" pinned="false" current-in-tab="false"> | |
141 | + <entry file="file://$PROJECT_DIR$/vars/ntfsvol.py"> | |
137 | 142 | <provider selected="true" editor-type-id="text-editor"> |
138 | - <state relative-caret-position="114"> | |
139 | - <caret line="6" column="21" selection-start-line="6" selection-start-column="21" selection-end-line="6" selection-end-column="21" /> | |
140 | - <folding /> | |
143 | + <state relative-caret-position="295"> | |
144 | + <caret line="21" column="56" selection-start-line="21" selection-start-column="56" selection-end-line="21" selection-end-column="56" /> | |
145 | + <folding> | |
146 | + <element signature="e#0#31#0" expanded="true" /> | |
147 | + </folding> | |
141 | 148 | </state> |
142 | 149 | </provider> |
143 | 150 | </entry> |
... | ... | @@ -163,14 +170,20 @@ |
163 | 170 | <option value="$PROJECT_DIR$/modulevar.py" /> |
164 | 171 | <option value="$PROJECT_DIR$/module.py" /> |
165 | 172 | <option value="$PROJECT_DIR$/scripts/digger.sh" /> |
166 | - <option value="$PROJECT_DIR$/runcmd.py" /> | |
167 | - <option value="$PROJECT_DIR$/vars/ntfsvol.py" /> | |
168 | - <option value="$PROJECT_DIR$/scripts/list_ntfs.sh" /> | |
169 | 173 | <option value="$PROJECT_DIR$/tomb.py" /> |
174 | + <option value="$PROJECT_DIR$/scripts/list_ntfs.sh" /> | |
170 | 175 | <option value="$PROJECT_DIR$/modules/mft.py" /> |
171 | 176 | <option value="$PROJECT_DIR$/modules/info.py" /> |
172 | - <option value="$PROJECT_DIR$/modules/winreg.py" /> | |
177 | + <option value="$PROJECT_DIR$/modules/mount.py" /> | |
178 | + <option value="$PROJECT_DIR$/scripts/list_fat.sh" /> | |
173 | 179 | <option value="$PROJECT_DIR$/digger.py" /> |
180 | + <option value="$PROJECT_DIR$/runcmd.py" /> | |
181 | + <option value="$PROJECT_DIR$/mount.py" /> | |
182 | + <option value="$PROJECT_DIR$/README.md" /> | |
183 | + <option value="$PROJECT_DIR$/vars/ntfsvol.py" /> | |
184 | + <option value="$PROJECT_DIR$/vars/winvol.py" /> | |
185 | + <option value="$PROJECT_DIR$/winver.py" /> | |
186 | + <option value="$PROJECT_DIR$/modules/winreg.py" /> | |
174 | 187 | </list> |
175 | 188 | </option> |
176 | 189 | </component> |
... | ... | @@ -181,10 +194,10 @@ |
181 | 194 | <sorting>DEFINITION_ORDER</sorting> |
182 | 195 | </component> |
183 | 196 | <component name="ProjectFrameBounds"> |
184 | - <option name="x" value="2113" /> | |
185 | - <option name="y" value="215" /> | |
197 | + <option name="x" value="1915" /> | |
198 | + <option name="y" value="31" /> | |
186 | 199 | <option name="width" value="1930" /> |
187 | - <option name="height" value="1173" /> | |
200 | + <option name="height" value="1174" /> | |
188 | 201 | </component> |
189 | 202 | <component name="ProjectLevelVcsManager" settingsEditedManually="false"> |
190 | 203 | <OptionsSetting value="true" id="Add" /> |
... | ... | @@ -255,6 +268,20 @@ |
255 | 268 | <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> |
256 | 269 | </PATH_ELEMENT> |
257 | 270 | <PATH_ELEMENT> |
271 | + <option name="myItemId" value="scripts" /> | |
272 | + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | |
273 | + </PATH_ELEMENT> | |
274 | + </PATH> | |
275 | + <PATH> | |
276 | + <PATH_ELEMENT> | |
277 | + <option name="myItemId" value="gravedigger" /> | |
278 | + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | |
279 | + </PATH_ELEMENT> | |
280 | + <PATH_ELEMENT> | |
281 | + <option name="myItemId" value="gravedigger" /> | |
282 | + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | |
283 | + </PATH_ELEMENT> | |
284 | + <PATH_ELEMENT> | |
258 | 285 | <option name="myItemId" value="modules" /> |
259 | 286 | <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> |
260 | 287 | </PATH_ELEMENT> |
... | ... | @@ -267,6 +294,9 @@ |
267 | 294 | <property name="WebServerToolWindowFactoryState" value="false" /> |
268 | 295 | </component> |
269 | 296 | <component name="RecentsManager"> |
297 | + <key name="CopyFile.RECENT_KEYS"> | |
298 | + <recent name="$PROJECT_DIR$/vars" /> | |
299 | + </key> | |
270 | 300 | <key name="MoveFile.RECENT_KEYS"> |
271 | 301 | <recent name="$PROJECT_DIR$" /> |
272 | 302 | <recent name="$PROJECT_DIR$/scripts" /> |
... | ... | @@ -519,27 +549,27 @@ |
519 | 549 | <servers /> |
520 | 550 | </component> |
521 | 551 | <component name="ToolWindowManager"> |
522 | - <frame x="2113" y="215" width="1930" height="1173" extended-state="0" /> | |
552 | + <frame x="1915" y="31" width="1930" height="1174" extended-state="6" /> | |
523 | 553 | <editor active="true" /> |
524 | 554 | <layout> |
525 | - <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> | |
526 | - <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> | |
527 | - <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" /> | |
528 | - <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> | |
529 | - <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> | |
530 | - <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> | |
531 | - <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.33023256" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> | |
532 | - <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | |
533 | - <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> | |
534 | - <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" /> | |
535 | - <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> | |
536 | - <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> | |
537 | - <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> | |
538 | - <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | |
539 | - <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | |
540 | - <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | |
541 | - <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> | |
542 | - <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | |
555 | + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" /> | |
556 | + <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" /> | |
557 | + <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" /> | |
558 | + <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | |
559 | + <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | |
560 | + <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> | |
561 | + <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32992566" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> | |
562 | + <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> | |
563 | + <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> | |
564 | + <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" /> | |
565 | + <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | |
566 | + <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" /> | |
567 | + <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="3" side_tool="false" content_ui="combo" /> | |
568 | + <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> | |
569 | + <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | |
570 | + <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> | |
571 | + <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" /> | |
572 | + <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> | |
543 | 573 | </layout> |
544 | 574 | </component> |
545 | 575 | <component name="Vcs.Log.UiProperties"> |
... | ... | @@ -582,92 +612,138 @@ |
582 | 612 | </state> |
583 | 613 | </provider> |
584 | 614 | </entry> |
585 | - <entry file="file://$PROJECT_DIR$/runcmd.py"> | |
615 | + <entry file="file://$PROJECT_DIR$/modules/mft.py"> | |
586 | 616 | <provider selected="true" editor-type-id="text-editor"> |
587 | - <state relative-caret-position="76"> | |
588 | - <caret line="4" column="22" selection-start-line="4" selection-start-column="22" selection-end-line="4" selection-end-column="22" /> | |
617 | + <state relative-caret-position="399"> | |
618 | + <caret line="21" column="37" selection-start-line="21" selection-start-column="37" selection-end-line="21" selection-end-column="37" /> | |
619 | + <folding> | |
620 | + <element signature="e#0#25#0" expanded="true" /> | |
621 | + </folding> | |
622 | + </state> | |
623 | + </provider> | |
624 | + </entry> | |
625 | + <entry file="file://$PROJECT_DIR$/tomb.py"> | |
626 | + <provider selected="true" editor-type-id="text-editor"> | |
627 | + <state relative-caret-position="228"> | |
628 | + <caret line="12" column="15" selection-start-line="12" selection-start-column="15" selection-end-line="12" selection-end-column="15" /> | |
589 | 629 | <folding /> |
590 | 630 | </state> |
591 | 631 | </provider> |
592 | 632 | </entry> |
593 | - <entry file="file://$PROJECT_DIR$/module.py"> | |
633 | + <entry file="file://$PROJECT_DIR$/modulevar.py"> | |
594 | 634 | <provider selected="true" editor-type-id="text-editor"> |
595 | - <state relative-caret-position="152"> | |
596 | - <caret line="8" column="21" selection-start-line="8" selection-start-column="21" selection-end-line="8" selection-end-column="21" /> | |
635 | + <state relative-caret-position="114"> | |
636 | + <caret line="6" column="21" selection-start-line="6" selection-start-column="21" selection-end-line="6" selection-end-column="21" /> | |
597 | 637 | <folding /> |
598 | 638 | </state> |
599 | 639 | </provider> |
600 | 640 | </entry> |
601 | - <entry file="file://$PROJECT_DIR$/vars/ntfsvol.py"> | |
641 | + <entry file="file://$PROJECT_DIR$/modules/info.py"> | |
602 | 642 | <provider selected="true" editor-type-id="text-editor"> |
603 | - <state relative-caret-position="608"> | |
604 | - <caret line="32" column="29" selection-start-line="32" selection-start-column="29" selection-end-line="32" selection-end-column="29" /> | |
643 | + <state relative-caret-position="228"> | |
644 | + <caret line="12" column="3" selection-start-line="12" selection-start-column="3" selection-end-line="12" selection-end-column="3" /> | |
605 | 645 | <folding> |
606 | - <element signature="e#0#31#0" expanded="true" /> | |
646 | + <element signature="e#0#25#0" expanded="true" /> | |
607 | 647 | </folding> |
608 | 648 | </state> |
609 | 649 | </provider> |
610 | 650 | </entry> |
611 | 651 | <entry file="file://$PROJECT_DIR$/scripts/list_ntfs.sh"> |
612 | 652 | <provider selected="true" editor-type-id="text-editor"> |
613 | - <state relative-caret-position="38"> | |
614 | - <caret line="2" column="83" selection-start-line="2" selection-start-column="83" selection-end-line="2" selection-end-column="83" /> | |
653 | + <state relative-caret-position="0"> | |
654 | + <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="9" selection-end-column="4" /> | |
615 | 655 | <folding /> |
616 | 656 | </state> |
617 | 657 | </provider> |
618 | 658 | </entry> |
619 | - <entry file="file://$PROJECT_DIR$/modules/info.py"> | |
659 | + <entry file="file://$PROJECT_DIR$/scripts/list_fat.sh"> | |
660 | + <provider selected="true" editor-type-id="text-editor"> | |
661 | + <state relative-caret-position="133"> | |
662 | + <caret line="7" column="18" selection-start-line="7" selection-start-column="18" selection-end-line="7" selection-end-column="18" /> | |
663 | + <folding /> | |
664 | + </state> | |
665 | + </provider> | |
666 | + </entry> | |
667 | + <entry file="file://$PROJECT_DIR$/module.py"> | |
668 | + <provider selected="true" editor-type-id="text-editor"> | |
669 | + <state relative-caret-position="76"> | |
670 | + <caret line="4" column="0" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" /> | |
671 | + <folding /> | |
672 | + </state> | |
673 | + </provider> | |
674 | + </entry> | |
675 | + <entry file="file://$PROJECT_DIR$/digger.py"> | |
620 | 676 | <provider selected="true" editor-type-id="text-editor"> |
621 | - <state relative-caret-position="266"> | |
622 | - <caret line="14" column="22" selection-start-line="14" selection-start-column="22" selection-end-line="14" selection-end-column="22" /> | |
677 | + <state relative-caret-position="276"> | |
678 | + <caret line="71" column="41" selection-start-line="71" selection-start-column="41" selection-end-line="71" selection-end-column="41" /> | |
623 | 679 | <folding> |
624 | - <element signature="e#0#25#0" expanded="true" /> | |
680 | + <element signature="e#25#38#0" expanded="true" /> | |
625 | 681 | </folding> |
626 | 682 | </state> |
627 | 683 | </provider> |
628 | 684 | </entry> |
629 | - <entry file="file://$PROJECT_DIR$/tomb.py"> | |
685 | + <entry file="file://$PROJECT_DIR$/runcmd.py"> | |
630 | 686 | <provider selected="true" editor-type-id="text-editor"> |
631 | - <state relative-caret-position="114"> | |
632 | - <caret line="6" column="27" selection-start-line="6" selection-start-column="27" selection-end-line="6" selection-end-column="27" /> | |
687 | + <state relative-caret-position="38"> | |
688 | + <caret line="2" column="20" selection-start-line="2" selection-start-column="20" selection-end-line="2" selection-end-column="20" /> | |
633 | 689 | <folding /> |
634 | 690 | </state> |
635 | 691 | </provider> |
636 | 692 | </entry> |
637 | - <entry file="file://$PROJECT_DIR$/modulevar.py"> | |
693 | + <entry file="file://$PROJECT_DIR$/mount.py"> | |
638 | 694 | <provider selected="true" editor-type-id="text-editor"> |
639 | - <state relative-caret-position="114"> | |
640 | - <caret line="6" column="21" selection-start-line="6" selection-start-column="21" selection-end-line="6" selection-end-column="21" /> | |
695 | + <state relative-caret-position="190"> | |
696 | + <caret line="10" column="18" selection-start-line="10" selection-start-column="18" selection-end-line="10" selection-end-column="18" /> | |
697 | + <folding> | |
698 | + <element signature="e#0#11#0" expanded="true" /> | |
699 | + </folding> | |
700 | + </state> | |
701 | + </provider> | |
702 | + </entry> | |
703 | + <entry file="file://$PROJECT_DIR$/README.md"> | |
704 | + <provider selected="true" editor-type-id="text-editor"> | |
705 | + <state relative-caret-position="133"> | |
706 | + <caret line="7" column="9" selection-start-line="7" selection-start-column="9" selection-end-line="7" selection-end-column="9" /> | |
641 | 707 | <folding /> |
642 | 708 | </state> |
643 | 709 | </provider> |
644 | 710 | </entry> |
645 | - <entry file="file://$PROJECT_DIR$/modules/mft.py"> | |
711 | + <entry file="file://$PROJECT_DIR$/vars/ntfsvol.py"> | |
646 | 712 | <provider selected="true" editor-type-id="text-editor"> |
647 | - <state relative-caret-position="0"> | |
648 | - <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="25" selection-end-column="0" /> | |
713 | + <state relative-caret-position="295"> | |
714 | + <caret line="21" column="56" selection-start-line="21" selection-start-column="56" selection-end-line="21" selection-end-column="56" /> | |
649 | 715 | <folding> |
650 | - <element signature="e#0#25#0" expanded="true" /> | |
716 | + <element signature="e#0#31#0" expanded="true" /> | |
651 | 717 | </folding> |
652 | 718 | </state> |
653 | 719 | </provider> |
654 | 720 | </entry> |
655 | - <entry file="file://$PROJECT_DIR$/modules/winreg.py"> | |
721 | + <entry file="file://$PROJECT_DIR$/vars/winvol.py"> | |
656 | 722 | <provider selected="true" editor-type-id="text-editor"> |
657 | - <state relative-caret-position="323"> | |
658 | - <caret line="17" column="12" selection-start-line="17" selection-start-column="12" selection-end-line="18" selection-end-column="10" /> | |
723 | + <state relative-caret-position="222"> | |
724 | + <caret line="42" column="33" selection-start-line="42" selection-start-column="22" selection-end-line="42" selection-end-column="33" /> | |
659 | 725 | <folding> |
660 | - <element signature="e#0#25#0" expanded="true" /> | |
726 | + <element signature="e#0#31#0" expanded="true" /> | |
661 | 727 | </folding> |
662 | 728 | </state> |
663 | 729 | </provider> |
664 | 730 | </entry> |
665 | - <entry file="file://$PROJECT_DIR$/digger.py"> | |
731 | + <entry file="file://$PROJECT_DIR$/winver.py"> | |
666 | 732 | <provider selected="true" editor-type-id="text-editor"> |
667 | - <state relative-caret-position="446"> | |
668 | - <caret line="75" column="13" selection-start-line="75" selection-start-column="13" selection-end-line="75" selection-end-column="13" /> | |
733 | + <state relative-caret-position="447"> | |
734 | + <caret line="69" column="17" selection-start-line="69" selection-start-column="17" selection-end-line="69" selection-end-column="17" /> | |
669 | 735 | <folding> |
670 | - <element signature="e#25#38#0" expanded="true" /> | |
736 | + <element signature="e#0#9#0" expanded="true" /> | |
737 | + </folding> | |
738 | + </state> | |
739 | + </provider> | |
740 | + </entry> | |
741 | + <entry file="file://$PROJECT_DIR$/modules/winreg.py"> | |
742 | + <provider selected="true" editor-type-id="text-editor"> | |
743 | + <state relative-caret-position="485"> | |
744 | + <caret line="56" column="49" selection-start-line="56" selection-start-column="49" selection-end-line="56" selection-end-column="49" /> | |
745 | + <folding> | |
746 | + <element signature="e#0#25#0" expanded="true" /> | |
671 | 747 | </folding> |
672 | 748 | </state> |
673 | 749 | </provider> | ... | ... |
README.md
0 → 100644
__pycache__/mount.cpython-34.pyc
0 → 100644
No preview for this file type
__pycache__/runcmd.cpython-34.pyc
No preview for this file type
__pycache__/tomb.cpython-34.pyc
No preview for this file type
__pycache__/winver.cpython-34.pyc
0 → 100644
No preview for this file type
digger.py
... | ... | @@ -7,6 +7,7 @@ import os |
7 | 7 | import sys |
8 | 8 | import subprocess as sp |
9 | 9 | import tomb |
10 | +import traceback | |
10 | 11 | |
11 | 12 | sys.path.append('modules') |
12 | 13 | sys.path.append('vars') |
... | ... | @@ -31,9 +32,12 @@ def getModules(): |
31 | 32 | return choiceList |
32 | 33 | |
33 | 34 | def prepareModule(moduleName): |
34 | - module = __import__(moduleName).getInstance() | |
35 | - module.getVars() | |
36 | - return module | |
35 | + try: | |
36 | + module = __import__(moduleName).getInstance() | |
37 | + module.getVars() | |
38 | + return module | |
39 | + except Exception as e: | |
40 | + raise Exception("[" + moduleName + "] " + str(e)) | |
37 | 41 | |
38 | 42 | locale.setlocale(locale.LC_ALL, '') |
39 | 43 | d = Dialog(dialog="dialog",autowidgetsize=True) |
... | ... | @@ -42,7 +46,7 @@ d.set_background_title("Gravedigger") |
42 | 46 | moduleList = getModules() |
43 | 47 | code,value = d.inputbox("Input computer's name") |
44 | 48 | if code == d.OK: |
45 | - tomb.__MACHINE_NAME__ = value | |
49 | + tomb._MACHINE_NAME= value | |
46 | 50 | d.set_background_title("Gravedigger - " + value) |
47 | 51 | code, tags = d.checklist("Select modules to execute", |
48 | 52 | choices=moduleList + [("all","Execute all modules",False)], |
... | ... | @@ -65,6 +69,7 @@ if code == d.OK: |
65 | 69 | module.run() |
66 | 70 | except Exception as e: |
67 | 71 | print("Exception raised while running " + module.name + ": " + str(e)) |
72 | + traceback.print_exc() | |
68 | 73 | |
69 | 74 | code, tag = d.menu("All modules finished execution",choices=[("Poweroff","Shutdown the computer"), |
70 | 75 | ("Reboot","Reboot the computer"), |
... | ... | @@ -78,5 +83,6 @@ if code == d.OK: |
78 | 83 | |
79 | 84 | except Exception as e: |
80 | 85 | print("Exception raised while preparing module: " + str(e)) |
86 | + traceback.print_exc() | |
81 | 87 | |
82 | 88 | ... | ... |
modules/__pycache__/info.cpython-34.pyc
No preview for this file type
modules/__pycache__/mft.cpython-34.pyc
No preview for this file type
modules/__pycache__/winreg.cpython-34.pyc
No preview for this file type
modules/info.py
modules/winreg.py
1 | 1 | from module import Module |
2 | -from runcmd import runProcess | |
3 | 2 | import tomb |
4 | 3 | import os |
4 | +import winver | |
5 | +from runcmd import runProcess | |
6 | +from mount import mount,umount | |
5 | 7 | |
6 | 8 | def getInstance(): |
7 | 9 | return RegistryModule() |
... | ... | @@ -11,13 +13,49 @@ class RegistryModule(Module): |
11 | 13 | def __init__(self): |
12 | 14 | self.name = "winreg" |
13 | 15 | self.description = "Extracts Windows Registry files" |
14 | - self.requiredVars = ["ntfsvol"] | |
16 | + self.requiredVars = ["winvol"] | |
15 | 17 | self.vars = {} |
16 | 18 | |
17 | 19 | def run(self): |
18 | 20 | path = tomb.getPath() + self.name + "/" |
19 | 21 | os.mkdir(path) |
20 | - for vol in self.vars['ntfsvol'].value: | |
21 | - pass | |
22 | - #runstuff | |
22 | + for vol in self.vars['winvol'].value: | |
23 | + mntpoint = "/mnt/" | |
24 | + mntid = mount("/dev/" + vol) | |
25 | + mntpoint += mntid | |
26 | + files = [] | |
27 | + windir = winver.getWindowsDirectory(mntpoint) | |
28 | + if windir == None: | |
29 | + raise Exception("No Windows installation present") | |
30 | + version = winver.getWindowsVersion(mntpoint) | |
31 | + profiles = winver.getUserProfiles(mntpoint) | |
32 | + if version <= winver._WIN_ME: | |
33 | + #9x | |
34 | + files = [windir + "USER.DAT",windir + "SYSTEM.DAT"] | |
35 | + if(len(profiles) > 0): | |
36 | + for profile in profiles: | |
37 | + if(os.path.isfile(profile + "USER.DAT")): | |
38 | + files += [profile + "USER.DAT"] | |
39 | + if version == winver._WIN_ME: | |
40 | + #ME | |
41 | + files += [windir + "CLASSES.DAT"] | |
42 | + | |
43 | + elif version > winver._WIN_ME: | |
44 | + #NT | |
45 | + files += [windir + "/System32/config/SAM" ] | |
46 | + files += [windir + "/System32/config/SECURITY"] | |
47 | + files += [windir + "/System32/config/SOFTWARE"] | |
48 | + files += [windir + "/System32/config/SYSTEM"] | |
49 | + files += [windir + "/System32/config/DEFAULT"] | |
50 | + for profile in profiles: | |
51 | + files += [profile + "/NTUSER.DAT"] | |
52 | + if version > winver._WIN_NT and version < winver._WIN_VISTA: | |
53 | + #2k XP 2k3 | |
54 | + files += [profile + "/Local Settings/Application Data/Microsoft/Windows/UsrClass.dat"] | |
55 | + else: | |
56 | + #Vista+ | |
57 | + files += [profile + "/AppData/Local/Microsoft/Windows/UsrClass.dat"] | |
23 | 58 | |
59 | + print(files) | |
60 | + runProcess(["tar","-czvf",path + "winreg_" + vol + ".tar.gz"] + files) | |
61 | + umount(mntid) | ... | ... |
mount.py
0 → 100644
1 | +import uuid | |
2 | +import os | |
3 | +from runcmd import runProcess | |
4 | + | |
5 | +def mount(device): | |
6 | + mountID = str(uuid.uuid4()) | |
7 | + os.mkdir("/mnt/" + mountID) | |
8 | + output, code = runProcess(["mount","-o","ro",device,"/mnt/" + mountID]) | |
9 | + if code != 0: | |
10 | + raise Exception("Unable to mount " + device) | |
11 | + return mountID | |
12 | + | |
13 | + | |
14 | +def umount(mountID): | |
15 | + output, code = runProcess(["umount","/mnt/" + mountID]) | |
16 | + if code != 0: | |
17 | + raise Exception("Unable to umount " + mountID) | |
18 | + os.rmdir("/mnt/" + mountID) | |
0 | 19 | \ No newline at end of file | ... | ... |
scripts/list_fat.sh
0 → 100755
1 | +#!/bin/bash | |
2 | + | |
3 | +# Outputs, separated by newlines, the list of FAT volumes present on this computer | |
4 | + | |
5 | +for disk in $(cat /proc/partitions | awk -F " " '{print $NF}' | tail -n+3); do | |
6 | + HEADER=$(dd if="/dev/$disk" bs=1 skip=82 count=5 2> /dev/null) | |
7 | + if [[ $HEADER == "FAT32" ]]; then | |
8 | + echo $disk | |
9 | + else | |
10 | + HEADER=$(dd if="/dev/$disk" bs=1 skip=54 count=5 2> /dev/null) | |
11 | + if [[ $HEADER == "FAT16" || $HEADER == "FAT12" ]]; then | |
12 | + echo $disk | |
13 | + fi | |
14 | + fi | |
15 | +done | |
0 | 16 | \ No newline at end of file | ... | ... |
tomb.py
1 | 1 | import os |
2 | 2 | |
3 | -__ROOT_PATH__ = "/bones/" | |
4 | -__MACHINE_NAME__ = "JOHN_DOE" | |
3 | +_ROOT_PATH = "/bones/" | |
4 | +_MACHINE_NAME = "JOHN_DOE" | |
5 | 5 | |
6 | 6 | def __getTomb__(): |
7 | - return __MACHINE_NAME__ | |
7 | + return _MACHINE_NAME | |
8 | 8 | |
9 | 9 | def getPath(): |
10 | - path = __ROOT_PATH__ + __getTomb__() + "/" | |
10 | + path = _ROOT_PATH + __getTomb__() + "/" | |
11 | 11 | if not os.path.exists(path): |
12 | 12 | os.makedirs(path) |
13 | 13 | return path |
14 | 14 | \ No newline at end of file | ... | ... |
vars/__pycache__/ntfsvol.cpython-34.pyc
No preview for this file type
vars/__pycache__/winvol.cpython-34.pyc
0 → 100644
No preview for this file type
vars/ntfsvol.py
... | ... | @@ -15,18 +15,23 @@ class NTFSVol(Modulevar): |
15 | 15 | |
16 | 16 | def getNTFSVolumes(self): |
17 | 17 | result = runProcess("scripts/list_ntfs.sh") |
18 | - volumes = result[0].decode("utf-8").splitlines() | |
19 | - print(volumes) | |
20 | - choices = [] | |
21 | - for vol in volumes: | |
22 | - choices.append((vol,"",False)) | |
23 | - return choices | |
18 | + resultlst =result[0].decode("utf-8").splitlines() | |
19 | + volumes = [] | |
20 | + for res in resultlst: | |
21 | + output,code = runProcess(["ntfslabel","/dev/" + res]) | |
22 | + volumes.append((res,output.decode("utf-8"))) | |
23 | + return volumes | |
24 | 24 | |
25 | 25 | def query(self): |
26 | 26 | d = Dialog(dialog="dialog", autowidgetsize=True) |
27 | 27 | d.set_background_title("[" + self.parentModule + "] Setting variable: ntfsvol") |
28 | - volumeList = self.getNTFSVolumes() | |
29 | - code, vols = d.checklist("Select NTFS volumes to extract the MFT", | |
28 | + volumes = self.getNTFSVolumes() | |
29 | + if(len(volumes) == 0): | |
30 | + raise Exception("[" + self.name + "] No Windows Volumes found") | |
31 | + volumeList = [] | |
32 | + for vol in volumes: | |
33 | + volumeList.append((vol[0],vol[1], False)) | |
34 | + code, vols = d.checklist("Select NTFS volumes", | |
30 | 35 | choices=volumeList, |
31 | 36 | title="Module selection") |
32 | 37 | if code == d.OK: | ... | ... |
vars/winvol.py
0 → 100644
1 | +from modulevar import Modulevar | |
2 | +from dialog import Dialog | |
3 | +from runcmd import runProcess | |
4 | +import winver | |
5 | +from mount import mount,umount | |
6 | + | |
7 | +def getInstance(modname): | |
8 | + return WinVol(modname) | |
9 | + | |
10 | +class WinVol(Modulevar): | |
11 | + | |
12 | + def __init__(self,modname): | |
13 | + self.name = "winvol" | |
14 | + self.parentModule = modname | |
15 | + self.description = "Windows Volume" | |
16 | + self.value = None | |
17 | + | |
18 | + def getNTFSVolumes(self): | |
19 | + result = runProcess("scripts/list_ntfs.sh") | |
20 | + resultlst =result[0].decode("utf-8").splitlines() | |
21 | + volumes = [] | |
22 | + for res in resultlst: | |
23 | + output,code = runProcess(["ntfslabel","/dev/" + res]) | |
24 | + volumes.append((res,output.decode("utf-8"))) | |
25 | + return volumes | |
26 | + | |
27 | + def getFATVolumes(self): | |
28 | + result = runProcess("scripts/list_fat.sh") | |
29 | + resultlst =result[0].decode("utf-8").splitlines() | |
30 | + volumes = [] | |
31 | + for res in resultlst: | |
32 | + output,code = runProcess(["dosfslabel","/dev/" + res]) | |
33 | + volumes.append((res,output.decode("utf-8"))) | |
34 | + return volumes | |
35 | + | |
36 | + def getWindowsVolumes(self): | |
37 | + volumes = self.getNTFSVolumes() + self.getFATVolumes() | |
38 | + winvols = [] | |
39 | + for volume in volumes: | |
40 | + mntpoint = "/mnt/" | |
41 | + mntid = mount("/dev/" + volume[0]) | |
42 | + mntpoint += mntid | |
43 | + if(winver.getWindowsDirectory(mntpoint) != None): | |
44 | + winvols.append(volume) | |
45 | + umount(mntid) | |
46 | + return winvols | |
47 | + | |
48 | + def query(self): | |
49 | + d = Dialog(dialog="dialog", autowidgetsize=True) | |
50 | + d.set_background_title("[" + self.parentModule + "] Setting variable: winvol") | |
51 | + volumes = self.getWindowsVolumes() | |
52 | + if(len(volumes) == 0): | |
53 | + raise Exception("[" + self.name + "] No Windows Volumes found") | |
54 | + volumeList = [] | |
55 | + for vol in volumes: | |
56 | + volumeList.append((vol[0],vol[1], False)) | |
57 | + code, vols = d.checklist("Select Windows volumes", | |
58 | + choices=volumeList, | |
59 | + title="Module selection") | |
60 | + if code == d.OK: | |
61 | + self.value = vols | |
62 | + else: | |
63 | + raise Exception("[" + self.name + "] Operation Cancelled") | |
0 | 64 | \ No newline at end of file | ... | ... |
winver.py
0 → 100644
1 | +import os | |
2 | +from runcmd import runProcess | |
3 | +import re | |
4 | + | |
5 | +_WIN_9x = 0 | |
6 | +_WIN_ME = 1 | |
7 | +_WIN_NT = 2 | |
8 | +_WIN_2k = 3 | |
9 | +_WIN_XP = 4 | |
10 | +_WIN_2k3 = 5 | |
11 | +_WIN_VISTA = 6 | |
12 | +_WIN_2k8 = 6 | |
13 | +_WIN_7 = 7 | |
14 | +_WIN_2k8R2 = 7 | |
15 | +_WIN_8 = 8 | |
16 | +_WIN_2k12 = 8 | |
17 | +_WIN_81 = 9 | |
18 | +_WIN_2k12R2 = 9 | |
19 | +_WIN_10 = 10 | |
20 | + | |
21 | + | |
22 | + | |
23 | +def getWindowsVersion(path): | |
24 | + if(os.path.isfile(getWindowsDirectory(path) + "/System32/ntdll.dll")): | |
25 | + output,code = runProcess(["pev","-p",getWindowsDirectory(path) + "/System32/ntdll.dll"]) | |
26 | + version = output.decode("utf-8") | |
27 | + if re.match("(3|4)\.",version) != None: | |
28 | + return _WIN_NT | |
29 | + elif re.match("5\.0",version) != None: | |
30 | + return _WIN_2k | |
31 | + elif re.match("5\.1", version) != None: | |
32 | + return _WIN_XP | |
33 | + elif re.match("5\.2", version) != None: | |
34 | + return _WIN_2k3 | |
35 | + elif re.match("6\.0", version) != None: | |
36 | + return _WIN_VISTA | |
37 | + elif re.match("6\.1", version) != None: | |
38 | + return _WIN_7 | |
39 | + elif re.match("6\.2", version) != None: | |
40 | + return _WIN_8 | |
41 | + elif re.match("6\.3", version) != None: | |
42 | + return _WIN_81 | |
43 | + elif re.match("10\.", version) != None: | |
44 | + return _WIN_10 | |
45 | + else: | |
46 | + if(os.path.isfile(getWindowsDirectory(path) + "/CLASSES.DAT")): | |
47 | + return _WIN_ME | |
48 | + return _WIN_9x | |
49 | + | |
50 | +def getWindowsDirectory(path): | |
51 | + result,code = runProcess(["find",path,"-xdev","-iname","explorer.exe","-print","-quit"]) | |
52 | + if(result.decode("utf-8") == ""): | |
53 | + return None | |
54 | + matches = result.decode("utf-8").splitlines() | |
55 | + #WARNING: ONLY CONSIDERING FIRST MATCH | |
56 | + #TODO: Improve | |
57 | + return os.path.dirname(os.path.realpath(matches[0])) | |
58 | + | |
59 | +def getUserProfiles(path): | |
60 | + version = getWindowsVersion(path) | |
61 | + if version < _WIN_XP: | |
62 | + profilepath = getWindowsDirectory(path) + "/Profiles" | |
63 | + if (os.path.exists(profilepath)): | |
64 | + return [profilepath + prof for prof in os.listdir(profilepath)] | |
65 | + return [] | |
66 | + elif version == _WIN_XP: | |
67 | + profilepath = path + "/Documents and Settings" | |
68 | + if (os.path.exists(profilepath)): | |
69 | + return [profilepath + prof for prof in os.listdir(profilepath)] | |
70 | + return [] | |
71 | + else: | |
72 | + profiles = [] | |
73 | + profilepath = path + "/Users" | |
74 | + print(profilepath) | |
75 | + if (os.path.exists(profilepath)): | |
76 | + for elem in os.listdir(profilepath): | |
77 | + if(os.path.isdir(profilepath + "/" + elem)): | |
78 | + profiles.append(profilepath + "/" + elem) | |
79 | + | |
80 | + return profiles | |
81 | + pass | |
0 | 82 | \ No newline at end of file | ... | ... |