smcutil 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +231 -71
- data/exe/smcutil +11 -0
- data/lib/smcutil/file_reader.rb +14 -9
- data/lib/smcutil/file_validator.rb +63 -2
- data/lib/smcutil/region.rb +14 -0
- data/lib/smcutil/version.rb +1 -1
- data/lib/smcutil.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22dac277b295c249d4a65cf2d6cdd927eb5cd6af
|
4
|
+
data.tar.gz: 134a4432c89c15bcd8d000d4cf75dd0dc9095674
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 299820337a4af80d7cb9d8603504685565f6184e24e6e6de42e71baa2b070cf48995b84cbe15c1b1d2929632280c67e76cca7a5ae43929eba6be2c84da52ae4a
|
7
|
+
data.tar.gz: df1a9c7d5a313bfeaaedf65ad539934d92004e18049688dcc659915bcf8f1d91ae86c6f50cbe81960aba164a3d6a9f70e2371080fae03e2dd26398ac8354e56b
|
data/.idea/workspace.xml
CHANGED
@@ -7,11 +7,13 @@
|
|
7
7
|
</component>
|
8
8
|
<component name="ChangeListManager">
|
9
9
|
<list default="true" id="79f8e064-6b6b-45b7-a43f-11c6b4aaa82e" name="Default" comment="">
|
10
|
+
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/smcutil/region.rb" />
|
10
11
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
11
12
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/exe/smcutil" afterPath="$PROJECT_DIR$/exe/smcutil" />
|
12
|
-
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/smcutil
|
13
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/smcutil.rb" afterPath="$PROJECT_DIR$/lib/smcutil.rb" />
|
14
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/smcutil/file_reader.rb" afterPath="$PROJECT_DIR$/lib/smcutil/file_reader.rb" />
|
15
|
+
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/smcutil/file_validator.rb" afterPath="$PROJECT_DIR$/lib/smcutil/file_validator.rb" />
|
13
16
|
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/smcutil/version.rb" afterPath="$PROJECT_DIR$/lib/smcutil/version.rb" />
|
14
|
-
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/spec/smcutil/file_extractor_spec.rb" afterPath="$PROJECT_DIR$/spec/smcutil/file_extractor_spec.rb" />
|
15
17
|
</list>
|
16
18
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
17
19
|
<option name="TRACKING_ENABLED" value="true" />
|
@@ -28,8 +30,8 @@
|
|
28
30
|
<file leaf-file-name="smcutil" pinned="false" current-in-tab="false">
|
29
31
|
<entry file="file://$PROJECT_DIR$/exe/smcutil">
|
30
32
|
<provider selected="true" editor-type-id="text-editor">
|
31
|
-
<state relative-caret-position="
|
32
|
-
<caret line="
|
33
|
+
<state relative-caret-position="357">
|
34
|
+
<caret line="44" column="23" lean-forward="false" selection-start-line="44" selection-start-column="23" selection-end-line="44" selection-end-column="23" />
|
33
35
|
<folding />
|
34
36
|
</state>
|
35
37
|
</provider>
|
@@ -38,18 +40,18 @@
|
|
38
40
|
<file leaf-file-name="smcutil.gemspec" pinned="false" current-in-tab="false">
|
39
41
|
<entry file="file://$PROJECT_DIR$/smcutil.gemspec">
|
40
42
|
<provider selected="true" editor-type-id="text-editor">
|
41
|
-
<state relative-caret-position="
|
43
|
+
<state relative-caret-position="285">
|
42
44
|
<caret line="19" column="62" lean-forward="false" selection-start-line="19" selection-start-column="62" selection-end-line="19" selection-end-column="62" />
|
43
45
|
<folding />
|
44
46
|
</state>
|
45
47
|
</provider>
|
46
48
|
</entry>
|
47
49
|
</file>
|
48
|
-
<file leaf-file-name="version.rb" pinned="false" current-in-tab="
|
50
|
+
<file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
|
49
51
|
<entry file="file://$PROJECT_DIR$/lib/smcutil/version.rb">
|
50
52
|
<provider selected="true" editor-type-id="text-editor">
|
51
|
-
<state relative-caret-position="
|
52
|
-
<caret line="
|
53
|
+
<state relative-caret-position="15">
|
54
|
+
<caret line="1" column="18" lean-forward="false" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
53
55
|
<folding />
|
54
56
|
</state>
|
55
57
|
</provider>
|
@@ -58,23 +60,13 @@
|
|
58
60
|
<file leaf-file-name="flasher_base.smc" pinned="false" current-in-tab="false">
|
59
61
|
<entry file="file://$PROJECT_DIR$/spec/fixtures/flasher_base.smc">
|
60
62
|
<provider selected="true" editor-type-id="text-editor">
|
61
|
-
<state relative-caret-position="
|
63
|
+
<state relative-caret-position="0">
|
62
64
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
63
65
|
<folding />
|
64
66
|
</state>
|
65
67
|
</provider>
|
66
68
|
</entry>
|
67
69
|
</file>
|
68
|
-
<file leaf-file-name="file_validator_spec.rb" pinned="false" current-in-tab="false">
|
69
|
-
<entry file="file://$PROJECT_DIR$/spec/smcutil/file_validator_spec.rb">
|
70
|
-
<provider selected="true" editor-type-id="text-editor">
|
71
|
-
<state relative-caret-position="240">
|
72
|
-
<caret line="16" column="0" lean-forward="false" selection-start-line="16" selection-start-column="0" selection-end-line="16" selection-end-column="0" />
|
73
|
-
<folding />
|
74
|
-
</state>
|
75
|
-
</provider>
|
76
|
-
</entry>
|
77
|
-
</file>
|
78
70
|
<file leaf-file-name="file_extractor_spec.rb" pinned="false" current-in-tab="false">
|
79
71
|
<entry file="file://$PROJECT_DIR$/spec/smcutil/file_extractor_spec.rb">
|
80
72
|
<provider selected="true" editor-type-id="text-editor">
|
@@ -88,18 +80,28 @@
|
|
88
80
|
<file leaf-file-name="file_reader.rb" pinned="false" current-in-tab="false">
|
89
81
|
<entry file="file://$PROJECT_DIR$/lib/smcutil/file_reader.rb">
|
90
82
|
<provider selected="true" editor-type-id="text-editor">
|
91
|
-
<state relative-caret-position="
|
92
|
-
<caret line="
|
83
|
+
<state relative-caret-position="672">
|
84
|
+
<caret line="55" column="32" lean-forward="false" selection-start-line="55" selection-start-column="32" selection-end-line="55" selection-end-column="32" />
|
85
|
+
<folding />
|
86
|
+
</state>
|
87
|
+
</provider>
|
88
|
+
</entry>
|
89
|
+
</file>
|
90
|
+
<file leaf-file-name="file_extractor.rb" pinned="false" current-in-tab="false">
|
91
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/file_extractor.rb">
|
92
|
+
<provider selected="true" editor-type-id="text-editor">
|
93
|
+
<state relative-caret-position="255">
|
94
|
+
<caret line="17" column="3" lean-forward="true" selection-start-line="17" selection-start-column="3" selection-end-line="17" selection-end-column="3" />
|
93
95
|
<folding />
|
94
96
|
</state>
|
95
97
|
</provider>
|
96
98
|
</entry>
|
97
99
|
</file>
|
98
|
-
<file leaf-file-name="smcutil.rb" pinned="false" current-in-tab="
|
100
|
+
<file leaf-file-name="smcutil.rb" pinned="false" current-in-tab="true">
|
99
101
|
<entry file="file://$PROJECT_DIR$/lib/smcutil.rb">
|
100
102
|
<provider selected="true" editor-type-id="text-editor">
|
101
|
-
<state relative-caret-position="
|
102
|
-
<caret line="
|
103
|
+
<state relative-caret-position="30">
|
104
|
+
<caret line="2" column="14" lean-forward="false" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" />
|
103
105
|
<folding />
|
104
106
|
</state>
|
105
107
|
</provider>
|
@@ -108,8 +110,18 @@
|
|
108
110
|
<file leaf-file-name="file_validator.rb" pinned="false" current-in-tab="false">
|
109
111
|
<entry file="file://$PROJECT_DIR$/lib/smcutil/file_validator.rb">
|
110
112
|
<provider selected="true" editor-type-id="text-editor">
|
111
|
-
<state relative-caret-position="
|
112
|
-
<caret line="
|
113
|
+
<state relative-caret-position="567">
|
114
|
+
<caret line="54" column="55" lean-forward="false" selection-start-line="54" selection-start-column="55" selection-end-line="54" selection-end-column="55" />
|
115
|
+
<folding />
|
116
|
+
</state>
|
117
|
+
</provider>
|
118
|
+
</entry>
|
119
|
+
</file>
|
120
|
+
<file leaf-file-name="region.rb" pinned="false" current-in-tab="false">
|
121
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/region.rb">
|
122
|
+
<provider selected="true" editor-type-id="text-editor">
|
123
|
+
<state relative-caret-position="150">
|
124
|
+
<caret line="10" column="45" lean-forward="false" selection-start-line="10" selection-start-column="45" selection-end-line="10" selection-end-column="45" />
|
113
125
|
<folding />
|
114
126
|
</state>
|
115
127
|
</provider>
|
@@ -117,6 +129,11 @@
|
|
117
129
|
</file>
|
118
130
|
</leaf>
|
119
131
|
</component>
|
132
|
+
<component name="FindInProjectRecents">
|
133
|
+
<findStrings>
|
134
|
+
<find><</find>
|
135
|
+
</findStrings>
|
136
|
+
</component>
|
120
137
|
<component name="Git.Settings">
|
121
138
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
122
139
|
</component>
|
@@ -126,7 +143,6 @@
|
|
126
143
|
<option value="$PROJECT_DIR$/smcutil.gemspec" />
|
127
144
|
<option value="$PROJECT_DIR$/lib/smcutil/file_parser.rb" />
|
128
145
|
<option value="$PROJECT_DIR$/spec/smcutil_spec.rb" />
|
129
|
-
<option value="$PROJECT_DIR$/lib/smcutil/file_validator.rb" />
|
130
146
|
<option value="$PROJECT_DIR$/spec/smcutil/file_spec.rb" />
|
131
147
|
<option value="$PROJECT_DIR$/lib/smcutil/file.rb" />
|
132
148
|
<option value="$PROJECT_DIR$/spec/smcutil/file_reader_spec.rb" />
|
@@ -134,13 +150,15 @@
|
|
134
150
|
<option value="$PROJECT_DIR$/spec/fixtures/flasher_base_lenth.smc" />
|
135
151
|
<option value="$PROJECT_DIR$/spec/smcutil/file_validator_spec.rb" />
|
136
152
|
<option value="$PROJECT_DIR$/spec/fixtures/flasher_base_checksum.smc" />
|
137
|
-
<option value="$PROJECT_DIR$/lib/smcutil.rb" />
|
138
|
-
<option value="$PROJECT_DIR$/lib/smcutil/file_reader.rb" />
|
139
153
|
<option value="$PROJECT_DIR$/README.md" />
|
140
154
|
<option value="$PROJECT_DIR$/lib/smcutil/file_extractor.rb" />
|
141
155
|
<option value="$PROJECT_DIR$/spec/smcutil/file_extractor_spec.rb" />
|
142
|
-
<option value="$PROJECT_DIR$/exe/smcutil" />
|
143
156
|
<option value="$PROJECT_DIR$/lib/smcutil/version.rb" />
|
157
|
+
<option value="$PROJECT_DIR$/exe/smcutil" />
|
158
|
+
<option value="$PROJECT_DIR$/lib/smcutil/file_validator.rb" />
|
159
|
+
<option value="$PROJECT_DIR$/lib/smcutil/region.rb" />
|
160
|
+
<option value="$PROJECT_DIR$/lib/smcutil/file_reader.rb" />
|
161
|
+
<option value="$PROJECT_DIR$/lib/smcutil.rb" />
|
144
162
|
</list>
|
145
163
|
</option>
|
146
164
|
</component>
|
@@ -150,8 +168,9 @@
|
|
150
168
|
<detection-done>true</detection-done>
|
151
169
|
<sorting>DEFINITION_ORDER</sorting>
|
152
170
|
</component>
|
153
|
-
<component name="ProjectFrameBounds"
|
154
|
-
<option name="
|
171
|
+
<component name="ProjectFrameBounds">
|
172
|
+
<option name="x" value="178" />
|
173
|
+
<option name="y" value="78" />
|
155
174
|
<option name="width" value="1680" />
|
156
175
|
<option name="height" value="983" />
|
157
176
|
</component>
|
@@ -171,7 +190,6 @@
|
|
171
190
|
<foldersAlwaysOnTop value="true" />
|
172
191
|
</navigator>
|
173
192
|
<panes>
|
174
|
-
<pane id="Scope" />
|
175
193
|
<pane id="Scratches" />
|
176
194
|
<pane id="ProjectPane">
|
177
195
|
<subPane>
|
@@ -222,6 +240,7 @@
|
|
222
240
|
<select />
|
223
241
|
</subPane>
|
224
242
|
</pane>
|
243
|
+
<pane id="Scope" />
|
225
244
|
</panes>
|
226
245
|
</component>
|
227
246
|
<component name="PropertiesComponent">
|
@@ -285,7 +304,10 @@
|
|
285
304
|
<updated>1507637323942</updated>
|
286
305
|
<workItem from="1507637325399" duration="2380000" />
|
287
306
|
<workItem from="1507706458195" duration="11326000" />
|
288
|
-
<workItem from="1507771477082" duration="
|
307
|
+
<workItem from="1507771477082" duration="2652000" />
|
308
|
+
<workItem from="1508047031062" duration="10000" />
|
309
|
+
<workItem from="1508047051136" duration="509000" />
|
310
|
+
<workItem from="1508048226512" duration="5433000" />
|
289
311
|
</task>
|
290
312
|
<servers />
|
291
313
|
</component>
|
@@ -322,18 +344,19 @@
|
|
322
344
|
</history-entry>
|
323
345
|
</component>
|
324
346
|
<component name="TimeTrackingManager">
|
325
|
-
<option name="totallyTimeSpent" value="
|
347
|
+
<option name="totallyTimeSpent" value="22310000" />
|
326
348
|
</component>
|
327
349
|
<component name="ToolWindowManager">
|
328
|
-
<frame x="
|
350
|
+
<frame x="178" y="78" width="1680" height="983" extended-state="0" />
|
329
351
|
<editor active="true" />
|
330
352
|
<layout>
|
331
|
-
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.
|
353
|
+
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.20634921" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
332
354
|
<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" />
|
333
355
|
<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="7" side_tool="true" content_ui="tabs" />
|
334
356
|
<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="3" side_tool="false" content_ui="tabs" />
|
357
|
+
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32934782" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
335
358
|
<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="7" side_tool="false" content_ui="tabs" />
|
336
|
-
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="
|
359
|
+
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33151582" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
337
360
|
<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" />
|
338
361
|
<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="7" side_tool="false" content_ui="tabs" />
|
339
362
|
<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="2" side_tool="true" content_ui="tabs" />
|
@@ -343,7 +366,6 @@
|
|
343
366
|
<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" />
|
344
367
|
<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" />
|
345
368
|
<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" />
|
346
|
-
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32934782" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
347
369
|
<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" />
|
348
370
|
</layout>
|
349
371
|
</component>
|
@@ -358,11 +380,146 @@
|
|
358
380
|
<watches-manager />
|
359
381
|
</component>
|
360
382
|
<component name="editorHistoryManager">
|
383
|
+
<entry file="file://$PROJECT_DIR$/smcutil.gemspec">
|
384
|
+
<provider selected="true" editor-type-id="text-editor">
|
385
|
+
<state relative-caret-position="285">
|
386
|
+
<caret line="19" column="62" lean-forward="false" selection-start-line="19" selection-start-column="62" selection-end-line="19" selection-end-column="62" />
|
387
|
+
<folding />
|
388
|
+
</state>
|
389
|
+
</provider>
|
390
|
+
</entry>
|
391
|
+
<entry file="file://$PROJECT_DIR$/spec/fixtures/flasher_base.smc">
|
392
|
+
<provider selected="true" editor-type-id="text-editor">
|
393
|
+
<state relative-caret-position="0">
|
394
|
+
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
395
|
+
<folding />
|
396
|
+
</state>
|
397
|
+
</provider>
|
398
|
+
</entry>
|
399
|
+
<entry file="file://$PROJECT_DIR$/spec/smcutil/file_validator_spec.rb">
|
400
|
+
<provider selected="true" editor-type-id="text-editor">
|
401
|
+
<state relative-caret-position="240">
|
402
|
+
<caret line="16" column="0" lean-forward="false" selection-start-line="16" selection-start-column="0" selection-end-line="16" selection-end-column="0" />
|
403
|
+
<folding />
|
404
|
+
</state>
|
405
|
+
</provider>
|
406
|
+
</entry>
|
407
|
+
<entry file="file://$PROJECT_DIR$/spec/smcutil/file_extractor_spec.rb">
|
408
|
+
<provider selected="true" editor-type-id="text-editor">
|
409
|
+
<state relative-caret-position="270">
|
410
|
+
<caret line="18" column="3" lean-forward="true" selection-start-line="18" selection-start-column="3" selection-end-line="18" selection-end-column="3" />
|
411
|
+
<folding />
|
412
|
+
</state>
|
413
|
+
</provider>
|
414
|
+
</entry>
|
415
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/file_reader.rb">
|
416
|
+
<provider selected="true" editor-type-id="text-editor">
|
417
|
+
<state relative-caret-position="120">
|
418
|
+
<caret line="8" column="0" lean-forward="false" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
|
419
|
+
<folding />
|
420
|
+
</state>
|
421
|
+
</provider>
|
422
|
+
</entry>
|
423
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil.rb">
|
424
|
+
<provider selected="true" editor-type-id="text-editor">
|
425
|
+
<state relative-caret-position="75">
|
426
|
+
<caret line="5" column="51" lean-forward="false" selection-start-line="5" selection-start-column="51" selection-end-line="5" selection-end-column="51" />
|
427
|
+
<folding />
|
428
|
+
</state>
|
429
|
+
</provider>
|
430
|
+
</entry>
|
431
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/file_validator.rb">
|
432
|
+
<provider selected="true" editor-type-id="text-editor">
|
433
|
+
<state relative-caret-position="45">
|
434
|
+
<caret line="3" column="21" lean-forward="false" selection-start-line="3" selection-start-column="21" selection-end-line="3" selection-end-column="21" />
|
435
|
+
<folding />
|
436
|
+
</state>
|
437
|
+
</provider>
|
438
|
+
</entry>
|
439
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/version.rb">
|
440
|
+
<provider selected="true" editor-type-id="text-editor">
|
441
|
+
<state relative-caret-position="45">
|
442
|
+
<caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
|
443
|
+
<folding />
|
444
|
+
</state>
|
445
|
+
</provider>
|
446
|
+
</entry>
|
447
|
+
<entry file="file://$PROJECT_DIR$/exe/smcutil">
|
448
|
+
<provider selected="true" editor-type-id="text-editor">
|
449
|
+
<state relative-caret-position="780">
|
450
|
+
<caret line="52" column="44" lean-forward="false" selection-start-line="52" selection-start-column="44" selection-end-line="52" selection-end-column="44" />
|
451
|
+
<folding />
|
452
|
+
</state>
|
453
|
+
</provider>
|
454
|
+
</entry>
|
455
|
+
<entry file="file://$PROJECT_DIR$/smcutil.gemspec">
|
456
|
+
<provider selected="true" editor-type-id="text-editor">
|
457
|
+
<state relative-caret-position="285">
|
458
|
+
<caret line="19" column="62" lean-forward="false" selection-start-line="19" selection-start-column="62" selection-end-line="19" selection-end-column="62" />
|
459
|
+
<folding />
|
460
|
+
</state>
|
461
|
+
</provider>
|
462
|
+
</entry>
|
463
|
+
<entry file="file://$PROJECT_DIR$/spec/fixtures/flasher_base.smc">
|
464
|
+
<provider selected="true" editor-type-id="text-editor">
|
465
|
+
<state relative-caret-position="0">
|
466
|
+
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
467
|
+
<folding />
|
468
|
+
</state>
|
469
|
+
</provider>
|
470
|
+
</entry>
|
471
|
+
<entry file="file://$PROJECT_DIR$/spec/smcutil/file_validator_spec.rb">
|
472
|
+
<provider selected="true" editor-type-id="text-editor">
|
473
|
+
<state relative-caret-position="240">
|
474
|
+
<caret line="16" column="0" lean-forward="false" selection-start-line="16" selection-start-column="0" selection-end-line="16" selection-end-column="0" />
|
475
|
+
<folding />
|
476
|
+
</state>
|
477
|
+
</provider>
|
478
|
+
</entry>
|
479
|
+
<entry file="file://$PROJECT_DIR$/spec/smcutil/file_extractor_spec.rb">
|
480
|
+
<provider selected="true" editor-type-id="text-editor">
|
481
|
+
<state relative-caret-position="270">
|
482
|
+
<caret line="18" column="3" lean-forward="true" selection-start-line="18" selection-start-column="3" selection-end-line="18" selection-end-column="3" />
|
483
|
+
<folding />
|
484
|
+
</state>
|
485
|
+
</provider>
|
486
|
+
</entry>
|
487
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/file_reader.rb">
|
488
|
+
<provider selected="true" editor-type-id="text-editor">
|
489
|
+
<state relative-caret-position="120">
|
490
|
+
<caret line="8" column="0" lean-forward="false" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
|
491
|
+
<folding />
|
492
|
+
</state>
|
493
|
+
</provider>
|
494
|
+
</entry>
|
495
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil.rb">
|
496
|
+
<provider selected="true" editor-type-id="text-editor">
|
497
|
+
<state relative-caret-position="75">
|
498
|
+
<caret line="5" column="51" lean-forward="false" selection-start-line="5" selection-start-column="51" selection-end-line="5" selection-end-column="51" />
|
499
|
+
<folding />
|
500
|
+
</state>
|
501
|
+
</provider>
|
502
|
+
</entry>
|
503
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/file_validator.rb">
|
504
|
+
<provider selected="true" editor-type-id="text-editor">
|
505
|
+
<state relative-caret-position="45">
|
506
|
+
<caret line="3" column="21" lean-forward="false" selection-start-line="3" selection-start-column="21" selection-end-line="3" selection-end-column="21" />
|
507
|
+
<folding />
|
508
|
+
</state>
|
509
|
+
</provider>
|
510
|
+
</entry>
|
511
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/version.rb">
|
512
|
+
<provider selected="true" editor-type-id="text-editor">
|
513
|
+
<state relative-caret-position="45">
|
514
|
+
<caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
|
515
|
+
<folding />
|
516
|
+
</state>
|
517
|
+
</provider>
|
518
|
+
</entry>
|
361
519
|
<entry file="file://$PROJECT_DIR$/lib/smcutil/file_extractor.rb">
|
362
520
|
<provider selected="true" editor-type-id="text-editor">
|
363
521
|
<state relative-caret-position="360">
|
364
522
|
<caret line="24" column="3" lean-forward="false" selection-start-line="24" selection-start-column="3" selection-end-line="24" selection-end-column="3" />
|
365
|
-
<folding />
|
366
523
|
</state>
|
367
524
|
</provider>
|
368
525
|
</entry>
|
@@ -378,7 +535,6 @@
|
|
378
535
|
<provider selected="true" editor-type-id="text-editor">
|
379
536
|
<state relative-caret-position="75">
|
380
537
|
<caret line="5" column="0" lean-forward="false" selection-start-line="4" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
|
381
|
-
<folding />
|
382
538
|
</state>
|
383
539
|
</provider>
|
384
540
|
</entry>
|
@@ -411,7 +567,6 @@
|
|
411
567
|
<state split_layout="SPLIT">
|
412
568
|
<first_editor relative-caret-position="210">
|
413
569
|
<caret line="14" column="37" lean-forward="true" selection-start-line="14" selection-start-column="37" selection-end-line="14" selection-end-column="37" />
|
414
|
-
<folding />
|
415
570
|
</first_editor>
|
416
571
|
<second_editor />
|
417
572
|
</state>
|
@@ -513,7 +668,6 @@
|
|
513
668
|
<provider selected="true" editor-type-id="text-editor">
|
514
669
|
<state relative-caret-position="75">
|
515
670
|
<caret line="5" column="0" lean-forward="false" selection-start-line="4" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
|
516
|
-
<folding />
|
517
671
|
</state>
|
518
672
|
</provider>
|
519
673
|
</entry>
|
@@ -530,23 +684,14 @@
|
|
530
684
|
<state split_layout="SPLIT">
|
531
685
|
<first_editor relative-caret-position="210">
|
532
686
|
<caret line="14" column="37" lean-forward="false" selection-start-line="14" selection-start-column="37" selection-end-line="14" selection-end-column="37" />
|
533
|
-
<folding />
|
534
687
|
</first_editor>
|
535
688
|
<second_editor />
|
536
689
|
</state>
|
537
690
|
</provider>
|
538
691
|
</entry>
|
539
|
-
<entry file="file://$PROJECT_DIR$/smcutil.gemspec">
|
540
|
-
<provider selected="true" editor-type-id="text-editor">
|
541
|
-
<state relative-caret-position="283">
|
542
|
-
<caret line="19" column="62" lean-forward="false" selection-start-line="19" selection-start-column="62" selection-end-line="19" selection-end-column="62" />
|
543
|
-
<folding />
|
544
|
-
</state>
|
545
|
-
</provider>
|
546
|
-
</entry>
|
547
692
|
<entry file="file://$PROJECT_DIR$/spec/fixtures/flasher_base.smc">
|
548
693
|
<provider selected="true" editor-type-id="text-editor">
|
549
|
-
<state relative-caret-position="
|
694
|
+
<state relative-caret-position="0">
|
550
695
|
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
551
696
|
<folding />
|
552
697
|
</state>
|
@@ -556,22 +701,21 @@
|
|
556
701
|
<provider selected="true" editor-type-id="text-editor">
|
557
702
|
<state relative-caret-position="105">
|
558
703
|
<caret line="7" column="0" lean-forward="true" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
|
559
|
-
<folding />
|
560
704
|
</state>
|
561
705
|
</provider>
|
562
706
|
</entry>
|
563
|
-
<entry file="file://$PROJECT_DIR$/
|
707
|
+
<entry file="file://$PROJECT_DIR$/spec/smcutil/file_extractor_spec.rb">
|
564
708
|
<provider selected="true" editor-type-id="text-editor">
|
565
|
-
<state relative-caret-position="
|
566
|
-
<caret line="
|
709
|
+
<state relative-caret-position="270">
|
710
|
+
<caret line="18" column="3" lean-forward="true" selection-start-line="18" selection-start-column="3" selection-end-line="18" selection-end-column="3" />
|
567
711
|
<folding />
|
568
712
|
</state>
|
569
713
|
</provider>
|
570
714
|
</entry>
|
571
|
-
<entry file="file://$PROJECT_DIR$/
|
715
|
+
<entry file="file://$PROJECT_DIR$/smcutil.gemspec">
|
572
716
|
<provider selected="true" editor-type-id="text-editor">
|
573
|
-
<state relative-caret-position="
|
574
|
-
<caret line="
|
717
|
+
<state relative-caret-position="285">
|
718
|
+
<caret line="19" column="62" lean-forward="false" selection-start-line="19" selection-start-column="62" selection-end-line="19" selection-end-column="62" />
|
575
719
|
<folding />
|
576
720
|
</state>
|
577
721
|
</provider>
|
@@ -584,34 +728,50 @@
|
|
584
728
|
</state>
|
585
729
|
</provider>
|
586
730
|
</entry>
|
587
|
-
<entry file="file://$PROJECT_DIR$/
|
731
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/version.rb">
|
588
732
|
<provider selected="true" editor-type-id="text-editor">
|
589
|
-
<state relative-caret-position="
|
590
|
-
<caret line="
|
733
|
+
<state relative-caret-position="15">
|
734
|
+
<caret line="1" column="18" lean-forward="false" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
591
735
|
<folding />
|
592
736
|
</state>
|
593
737
|
</provider>
|
594
738
|
</entry>
|
595
739
|
<entry file="file://$PROJECT_DIR$/exe/smcutil">
|
596
740
|
<provider selected="true" editor-type-id="text-editor">
|
597
|
-
<state relative-caret-position="
|
598
|
-
<caret line="
|
741
|
+
<state relative-caret-position="357">
|
742
|
+
<caret line="44" column="23" lean-forward="false" selection-start-line="44" selection-start-column="23" selection-end-line="44" selection-end-column="23" />
|
599
743
|
<folding />
|
600
744
|
</state>
|
601
745
|
</provider>
|
602
746
|
</entry>
|
603
|
-
<entry file="file://$PROJECT_DIR$/lib/smcutil.rb">
|
747
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/file_validator.rb">
|
604
748
|
<provider selected="true" editor-type-id="text-editor">
|
605
|
-
<state relative-caret-position="
|
606
|
-
<caret line="
|
749
|
+
<state relative-caret-position="567">
|
750
|
+
<caret line="54" column="55" lean-forward="false" selection-start-line="54" selection-start-column="55" selection-end-line="54" selection-end-column="55" />
|
607
751
|
<folding />
|
608
752
|
</state>
|
609
753
|
</provider>
|
610
754
|
</entry>
|
611
|
-
<entry file="file://$PROJECT_DIR$/lib/smcutil/
|
755
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/region.rb">
|
612
756
|
<provider selected="true" editor-type-id="text-editor">
|
613
|
-
<state relative-caret-position="
|
614
|
-
<caret line="
|
757
|
+
<state relative-caret-position="150">
|
758
|
+
<caret line="10" column="45" lean-forward="false" selection-start-line="10" selection-start-column="45" selection-end-line="10" selection-end-column="45" />
|
759
|
+
<folding />
|
760
|
+
</state>
|
761
|
+
</provider>
|
762
|
+
</entry>
|
763
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil/file_reader.rb">
|
764
|
+
<provider selected="true" editor-type-id="text-editor">
|
765
|
+
<state relative-caret-position="672">
|
766
|
+
<caret line="55" column="32" lean-forward="false" selection-start-line="55" selection-start-column="32" selection-end-line="55" selection-end-column="32" />
|
767
|
+
<folding />
|
768
|
+
</state>
|
769
|
+
</provider>
|
770
|
+
</entry>
|
771
|
+
<entry file="file://$PROJECT_DIR$/lib/smcutil.rb">
|
772
|
+
<provider selected="true" editor-type-id="text-editor">
|
773
|
+
<state relative-caret-position="30">
|
774
|
+
<caret line="2" column="14" lean-forward="false" selection-start-line="2" selection-start-column="14" selection-end-line="2" selection-end-column="14" />
|
615
775
|
<folding />
|
616
776
|
</state>
|
617
777
|
</provider>
|
data/exe/smcutil
CHANGED
@@ -39,9 +39,19 @@ case command
|
|
39
39
|
file = ARGV.shift
|
40
40
|
show_usage unless file
|
41
41
|
reader = SmcUtil::FileReader.parse file
|
42
|
+
|
43
|
+
validator = SmcUtil::FileValidator.new reader
|
44
|
+
|
45
|
+
if validator.valid?
|
42
46
|
puts "The file '#{file}' is valid."
|
47
|
+
else
|
48
|
+
validator.errors.each do |error|
|
49
|
+
puts "ERROR: #{error}"
|
50
|
+
end
|
51
|
+
end
|
43
52
|
rescue => ex
|
44
53
|
puts ex
|
54
|
+
puts ex.backtrace
|
45
55
|
end
|
46
56
|
when :decode
|
47
57
|
begin
|
@@ -54,6 +64,7 @@ case command
|
|
54
64
|
extractor.extract_to output
|
55
65
|
rescue => ex
|
56
66
|
puts ex
|
67
|
+
puts ex.backtrace
|
57
68
|
end
|
58
69
|
when :info
|
59
70
|
|
data/lib/smcutil/file_reader.rb
CHANGED
@@ -2,7 +2,7 @@ module SmcUtil
|
|
2
2
|
LINE_COMMAND = /((?<type>[[:upper:]]):(?<offset>([[:xdigit:]]{2})+:)?|(?<continue>\+\s+:))(?<length>\d+):(?<data>([[:xdigit:]]{2})+):(?<check>[[:xdigit:]]{2})/
|
3
3
|
|
4
4
|
class FileReader
|
5
|
-
attr_reader :
|
5
|
+
attr_reader :headers
|
6
6
|
attr_reader :signature
|
7
7
|
attr_reader :regions
|
8
8
|
|
@@ -10,9 +10,9 @@ module SmcUtil
|
|
10
10
|
def initialize(data)
|
11
11
|
|
12
12
|
# Setup the collected data
|
13
|
-
@
|
14
|
-
@signature =
|
15
|
-
@regions =
|
13
|
+
@headers = []
|
14
|
+
@signature = ''
|
15
|
+
@regions = []
|
16
16
|
|
17
17
|
current_region = nil
|
18
18
|
|
@@ -37,18 +37,23 @@ module SmcUtil
|
|
37
37
|
|
38
38
|
case match[:type]
|
39
39
|
when 'H'
|
40
|
-
@
|
40
|
+
@headers << data
|
41
41
|
when 'S'
|
42
42
|
@signature += data
|
43
43
|
when 'D'
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
if match[:offset]
|
45
|
+
current_offset = match[:offset].scan(/../).map { |x| x.hex.chr }.join.bytes.inject {|a, b| (a << 8) + b }
|
46
|
+
|
47
|
+
current_region = SmcUtil::Region.new current_offset, ''
|
48
|
+
@regions << current_region
|
49
|
+
end
|
50
|
+
|
51
|
+
current_region.data += data
|
47
52
|
else
|
48
53
|
raise "LINE #{index}: Command #{match[:type]} not recognised" unless match[:continue]
|
49
54
|
raise "LINE #{index}: Continuation row with no data region set" unless current_region
|
50
55
|
|
51
|
-
|
56
|
+
current_region.data += data
|
52
57
|
end
|
53
58
|
end
|
54
59
|
end
|
@@ -1,7 +1,68 @@
|
|
1
|
-
|
1
|
+
require 'openssl'
|
2
2
|
|
3
3
|
module SmcUtil
|
4
4
|
class FileValidator
|
5
|
+
attr_reader :file, :errors
|
6
|
+
|
7
|
+
def initialize(file)
|
8
|
+
@file = file
|
9
|
+
end
|
10
|
+
|
11
|
+
def validate!
|
12
|
+
@errors = []
|
13
|
+
|
14
|
+
validate_regions!
|
15
|
+
validate_headers!
|
16
|
+
validate_signature!
|
17
|
+
end
|
18
|
+
|
19
|
+
def valid?
|
20
|
+
validate!
|
21
|
+
|
22
|
+
!@errors.any?
|
23
|
+
end
|
24
|
+
|
25
|
+
def validate_regions!
|
26
|
+
@file.regions.any?
|
27
|
+
end
|
28
|
+
|
29
|
+
def validate_headers!
|
30
|
+
return false unless @file.headers.any? || (@file.headers.count != @file.regions.count)
|
31
|
+
|
32
|
+
hash_algorithm = nil
|
33
|
+
|
34
|
+
case @file.headers[0].length
|
35
|
+
when 20
|
36
|
+
hash_algorithm = OpenSSL::Digest::SHA1
|
37
|
+
when 32
|
38
|
+
hash_algorithm = OpenSSL::Digest::SHA256
|
39
|
+
when 64
|
40
|
+
hash_algorithm = OpenSSL::Digest::SHA512
|
41
|
+
else
|
42
|
+
@errors << "ERROR: Digest of header row with length #{@file.headers[0].count} bytes is unsupported. (But pull requests are accepted)" and return
|
43
|
+
end
|
44
|
+
|
45
|
+
zipped_regions = @file.regions.zip(@file.headers)
|
46
|
+
zipped_regions.each do |region, header|
|
47
|
+
begin
|
48
|
+
hash = hash_algorithm.new
|
49
|
+
|
50
|
+
hash << region.data
|
51
|
+
|
52
|
+
if hash.digest == header
|
53
|
+
puts "DEBUG: Validated hash for region #{region}" if SmcUtil::DEBUG
|
54
|
+
else
|
55
|
+
@errors << "Header hash for region #{region} does not match expected"
|
56
|
+
end
|
57
|
+
rescue => ex
|
58
|
+
puts "ERROR: #{ex}"
|
59
|
+
puts ex.backtrace
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
5
63
|
|
64
|
+
def validate_signature!
|
65
|
+
# TODO: Find the RSA 2048 bit key that signs this
|
66
|
+
end
|
6
67
|
end
|
7
|
-
end
|
68
|
+
end
|
data/lib/smcutil/version.rb
CHANGED
data/lib/smcutil.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smcutil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rick Mark
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- lib/smcutil/file_extractor.rb
|
83
83
|
- lib/smcutil/file_reader.rb
|
84
84
|
- lib/smcutil/file_validator.rb
|
85
|
+
- lib/smcutil/region.rb
|
85
86
|
- lib/smcutil/version.rb
|
86
87
|
- smcutil.gemspec
|
87
88
|
homepage: https://github.com/rickmark/smcutil
|