hardsploit_gui 2.0 → 2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/lib/Firmware/FPGA/I2C/I2C_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_I2C_INTERACT.rpd +0 -0
  3. data/lib/HardsploitAPI/HardsploitAPI.rb +5 -6
  4. data/lib/HardsploitAPI/HardsploitAPI_CONSTANT.rb +1 -1
  5. data/lib/HardsploitAPI/HardsploitAPI_ERROR.rb +38 -0
  6. data/lib/HardsploitAPI/HardsploitAPI_FIRMWARE.rb +3 -3
  7. data/lib/HardsploitAPI/HardsploitAPI_I2C.rb +145 -3
  8. data/lib/HardsploitAPI/HardsploitAPI_PROGRESS.rb +28 -0
  9. data/lib/HardsploitAPI/HardsploitAPI_SPI.rb +195 -5
  10. data/lib/HardsploitAPI/HardsploitAPI_USB_COMMUNICATION.rb +0 -1
  11. data/lib/HardsploitAPI/SWD/HardsploitAPI_SWD.rb +1 -1
  12. data/lib/class/Generic_commands.rb +31 -36
  13. data/lib/class/HardsploitGUI.rb +5 -4
  14. data/lib/class/I2C/I2c_export.rb +6 -9
  15. data/lib/class/I2C/I2c_import.rb +15 -28
  16. data/lib/class/I2C/I2c_settings.rb +20 -8
  17. data/lib/class/Progress_bar.rb +31 -0
  18. data/lib/class/SPI/Spi_export.rb +6 -9
  19. data/lib/class/SPI/Spi_import.rb +33 -32
  20. data/lib/class/SPI/Spi_settings.rb +50 -4
  21. data/lib/db/hs.db +0 -0
  22. data/lib/gui/gui_chip_editor.rb +120 -127
  23. data/lib/gui/gui_i2c_settings.rb +34 -5
  24. data/lib/gui/gui_progress_bar.rb +84 -0
  25. data/lib/gui/gui_spi_settings.rb +175 -49
  26. data/lib/gui_designer/gui_chip_editor.ui +134 -141
  27. data/lib/gui_designer/gui_i2c_settings.ui +35 -4
  28. data/lib/gui_designer/gui_progress_bar.ui +83 -0
  29. data/lib/gui_designer/gui_spi_settings.ui +159 -34
  30. data/lib/hardsploit.rb +12 -3
  31. data/lib/logs/error.log +1 -0
  32. data/lib/startHardsploit.rb +10 -0
  33. metadata +8 -3
  34. data/lib/gui_designer/gui_processing.ui +0 -81
@@ -109,34 +109,65 @@
109
109
  </item>
110
110
  </widget>
111
111
  </item>
112
- <item row="4" column="0">
112
+ <item row="6" column="0">
113
113
  <widget class="QLabel" name="lbl_full_size">
114
114
  <property name="text">
115
115
  <string>Total size:</string>
116
116
  </property>
117
117
  </widget>
118
118
  </item>
119
- <item row="4" column="1">
119
+ <item row="6" column="1">
120
120
  <widget class="QLineEdit" name="lie_total_size">
121
121
  <property name="placeholderText">
122
122
  <string>in octet, to a maximum of 4Go</string>
123
123
  </property>
124
124
  </widget>
125
125
  </item>
126
- <item row="5" column="0">
126
+ <item row="7" column="0">
127
127
  <widget class="QLabel" name="lbl_bus_scan">
128
128
  <property name="text">
129
129
  <string>Bus scan:</string>
130
130
  </property>
131
131
  </widget>
132
132
  </item>
133
- <item row="5" column="1">
133
+ <item row="7" column="1">
134
134
  <widget class="QPushButton" name="btn_bus_scan">
135
135
  <property name="text">
136
136
  <string>Launch</string>
137
137
  </property>
138
138
  </widget>
139
139
  </item>
140
+ <item row="5" column="1">
141
+ <widget class="QLineEdit" name="lie_page_size">
142
+ <property name="text">
143
+ <string/>
144
+ </property>
145
+ <property name="placeholderText">
146
+ <string>in octet</string>
147
+ </property>
148
+ </widget>
149
+ </item>
150
+ <item row="5" column="0">
151
+ <widget class="QLabel" name="lbl_page_size">
152
+ <property name="text">
153
+ <string>Page size:</string>
154
+ </property>
155
+ </widget>
156
+ </item>
157
+ <item row="4" column="0">
158
+ <widget class="QLabel" name="lbl_write_page_latency">
159
+ <property name="text">
160
+ <string>Write page latency:</string>
161
+ </property>
162
+ </widget>
163
+ </item>
164
+ <item row="4" column="1">
165
+ <widget class="QLineEdit" name="lie_write_page_latency">
166
+ <property name="placeholderText">
167
+ <string>in miliseconds</string>
168
+ </property>
169
+ </widget>
170
+ </item>
140
171
  </layout>
141
172
  </item>
142
173
  <item>
@@ -0,0 +1,83 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ui version="4.0">
3
+ <class>Progress_bar</class>
4
+ <widget class="QWidget" name="Progress_bar">
5
+ <property name="geometry">
6
+ <rect>
7
+ <x>0</x>
8
+ <y>0</y>
9
+ <width>358</width>
10
+ <height>90</height>
11
+ </rect>
12
+ </property>
13
+ <property name="windowTitle">
14
+ <string>Processing...</string>
15
+ </property>
16
+ <layout class="QGridLayout" name="gridLayout">
17
+ <item row="0" column="0">
18
+ <widget class="QLabel" name="lbl_status">
19
+ <property name="text">
20
+ <string>[STATUS]</string>
21
+ </property>
22
+ </widget>
23
+ </item>
24
+ <item row="1" column="0">
25
+ <widget class="QProgressBar" name="pgb">
26
+ <property name="value">
27
+ <number>0</number>
28
+ </property>
29
+ </widget>
30
+ </item>
31
+ <item row="3" column="0">
32
+ <layout class="QHBoxLayout" name="horizontalLayout">
33
+ <item>
34
+ <widget class="QLabel" name="lbl_time">
35
+ <property name="text">
36
+ <string>[TIME]</string>
37
+ </property>
38
+ </widget>
39
+ </item>
40
+ <item>
41
+ <spacer name="horizontalSpacer">
42
+ <property name="orientation">
43
+ <enum>Qt::Horizontal</enum>
44
+ </property>
45
+ <property name="sizeHint" stdset="0">
46
+ <size>
47
+ <width>40</width>
48
+ <height>20</height>
49
+ </size>
50
+ </property>
51
+ </spacer>
52
+ </item>
53
+ <item>
54
+ <widget class="QPushButton" name="lbl_close">
55
+ <property name="text">
56
+ <string>Close</string>
57
+ </property>
58
+ </widget>
59
+ </item>
60
+ </layout>
61
+ </item>
62
+ </layout>
63
+ </widget>
64
+ <resources/>
65
+ <connections>
66
+ <connection>
67
+ <sender>lbl_close</sender>
68
+ <signal>clicked()</signal>
69
+ <receiver>Progress_bar</receiver>
70
+ <slot>close()</slot>
71
+ <hints>
72
+ <hint type="sourcelabel">
73
+ <x>329</x>
74
+ <y>65</y>
75
+ </hint>
76
+ <hint type="destinationlabel">
77
+ <x>352</x>
78
+ <y>6</y>
79
+ </hint>
80
+ </hints>
81
+ </connection>
82
+ </connections>
83
+ </ui>
@@ -6,8 +6,8 @@
6
6
  <rect>
7
7
  <x>0</x>
8
8
  <y>0</y>
9
- <width>531</width>
10
- <height>154</height>
9
+ <width>528</width>
10
+ <height>237</height>
11
11
  </rect>
12
12
  </property>
13
13
  <property name="windowTitle">
@@ -49,14 +49,14 @@
49
49
  <layout class="QHBoxLayout" name="hl2">
50
50
  <item>
51
51
  <layout class="QFormLayout" name="fl">
52
- <item row="1" column="0">
52
+ <item row="2" column="0">
53
53
  <widget class="QLabel" name="lbl_frequency">
54
54
  <property name="text">
55
55
  <string>Frequency (Mhz):</string>
56
56
  </property>
57
57
  </widget>
58
58
  </item>
59
- <item row="1" column="1">
59
+ <item row="2" column="1">
60
60
  <widget class="QComboBox" name="cbx_frequency">
61
61
  <property name="maximumSize">
62
62
  <size>
@@ -136,14 +136,14 @@
136
136
  </item>
137
137
  </widget>
138
138
  </item>
139
- <item row="2" column="0">
139
+ <item row="3" column="0">
140
140
  <widget class="QLabel" name="lbl_cmd_read">
141
141
  <property name="text">
142
- <string>SPI command read:</string>
142
+ <string>Read command:</string>
143
143
  </property>
144
144
  </widget>
145
145
  </item>
146
- <item row="2" column="1">
146
+ <item row="3" column="1">
147
147
  <widget class="QLineEdit" name="lie_cmd_read">
148
148
  <property name="maximumSize">
149
149
  <size>
@@ -152,51 +152,47 @@
152
152
  </size>
153
153
  </property>
154
154
  <property name="text">
155
- <string>3</string>
155
+ <string/>
156
156
  </property>
157
157
  <property name="maxLength">
158
158
  <number>5</number>
159
159
  </property>
160
+ <property name="placeholderText">
161
+ <string>in decimals</string>
162
+ </property>
160
163
  </widget>
161
164
  </item>
162
- <item row="0" column="0">
163
- <widget class="QLabel" name="lbl_page_size">
165
+ <item row="5" column="0">
166
+ <widget class="QLabel" name="lbl_cmd_erase">
164
167
  <property name="text">
165
- <string>Page size:</string>
168
+ <string>Erase command:</string>
166
169
  </property>
167
170
  </widget>
168
171
  </item>
169
- <item row="0" column="1">
170
- <widget class="QLineEdit" name="lie_page_size">
171
- <property name="maximumSize">
172
- <size>
173
- <width>100</width>
174
- <height>16777215</height>
175
- </size>
172
+ <item row="5" column="1">
173
+ <widget class="QLineEdit" name="lie_cmd_erase">
174
+ <property name="maxLength">
175
+ <number>5</number>
176
+ </property>
177
+ <property name="placeholderText">
178
+ <string>in decimals</string>
176
179
  </property>
177
180
  </widget>
178
181
  </item>
179
- </layout>
180
- </item>
181
- <item>
182
- <layout class="QFormLayout" name="fl2">
183
- <item row="0" column="0">
184
- <widget class="QLabel" name="lbl_total_size">
182
+ <item row="6" column="0">
183
+ <widget class="QLabel" name="lbl_cmd_write">
185
184
  <property name="text">
186
- <string>Total size (8 bits word):</string>
185
+ <string>Enable write command:</string>
187
186
  </property>
188
187
  </widget>
189
188
  </item>
190
- <item row="0" column="1">
191
- <widget class="QLineEdit" name="lie_total_size">
192
- <property name="maximumSize">
193
- <size>
194
- <width>100</width>
195
- <height>16777215</height>
196
- </size>
197
- </property>
189
+ <item row="6" column="1">
190
+ <widget class="QLineEdit" name="lie_cmd_write_enable">
198
191
  <property name="maxLength">
199
- <number>20</number>
192
+ <number>5</number>
193
+ </property>
194
+ <property name="placeholderText">
195
+ <string>in decimals</string>
200
196
  </property>
201
197
  </widget>
202
198
  </item>
@@ -237,6 +233,135 @@
237
233
  </item>
238
234
  </widget>
239
235
  </item>
236
+ <item row="4" column="0">
237
+ <widget class="QLabel" name="label">
238
+ <property name="text">
239
+ <string>Write command:</string>
240
+ </property>
241
+ </widget>
242
+ </item>
243
+ <item row="4" column="1">
244
+ <widget class="QLineEdit" name="lie_cmd_write">
245
+ <property name="placeholderText">
246
+ <string>in decimals</string>
247
+ </property>
248
+ </widget>
249
+ </item>
250
+ </layout>
251
+ </item>
252
+ <item>
253
+ <layout class="QFormLayout" name="fl2">
254
+ <item row="0" column="0">
255
+ <widget class="QLabel" name="lbl_total_size">
256
+ <property name="text">
257
+ <string>Total size:</string>
258
+ </property>
259
+ </widget>
260
+ </item>
261
+ <item row="0" column="1">
262
+ <widget class="QLineEdit" name="lie_total_size">
263
+ <property name="maximumSize">
264
+ <size>
265
+ <width>100</width>
266
+ <height>16777215</height>
267
+ </size>
268
+ </property>
269
+ <property name="maxLength">
270
+ <number>20</number>
271
+ </property>
272
+ <property name="placeholderText">
273
+ <string>8 bits word</string>
274
+ </property>
275
+ </widget>
276
+ </item>
277
+ <item row="1" column="0">
278
+ <widget class="QLabel" name="lbl_page_size">
279
+ <property name="text">
280
+ <string>Page size:</string>
281
+ </property>
282
+ </widget>
283
+ </item>
284
+ <item row="1" column="1">
285
+ <widget class="QLineEdit" name="lie_page_size">
286
+ <property name="maximumSize">
287
+ <size>
288
+ <width>100</width>
289
+ <height>16777215</height>
290
+ </size>
291
+ </property>
292
+ <property name="maxLength">
293
+ <number>10</number>
294
+ </property>
295
+ <property name="placeholderText">
296
+ <string>in octet</string>
297
+ </property>
298
+ </widget>
299
+ </item>
300
+ <item row="2" column="0">
301
+ <widget class="QLabel" name="label_2">
302
+ <property name="text">
303
+ <string>Write page latency:</string>
304
+ </property>
305
+ </widget>
306
+ </item>
307
+ <item row="2" column="1">
308
+ <widget class="QLineEdit" name="lie_write_page_latency">
309
+ <property name="maxLength">
310
+ <number>10</number>
311
+ </property>
312
+ <property name="placeholderText">
313
+ <string>in miliseconds</string>
314
+ </property>
315
+ </widget>
316
+ </item>
317
+ <item row="3" column="0">
318
+ <widget class="QLabel" name="label_3">
319
+ <property name="text">
320
+ <string>Clear chip time:</string>
321
+ </property>
322
+ </widget>
323
+ </item>
324
+ <item row="3" column="1">
325
+ <widget class="QLineEdit" name="lie_erase_time">
326
+ <property name="maxLength">
327
+ <number>10</number>
328
+ </property>
329
+ <property name="placeholderText">
330
+ <string>in seconds</string>
331
+ </property>
332
+ </widget>
333
+ </item>
334
+ <item row="4" column="0">
335
+ <widget class="QLabel" name="label_4">
336
+ <property name="text">
337
+ <string>Flash memory:</string>
338
+ </property>
339
+ </widget>
340
+ </item>
341
+ <item row="4" column="1">
342
+ <widget class="QRadioButton" name="rbn_yes">
343
+ <property name="text">
344
+ <string>Yes</string>
345
+ </property>
346
+ <property name="checked">
347
+ <bool>true</bool>
348
+ </property>
349
+ </widget>
350
+ </item>
351
+ <item row="5" column="0">
352
+ <widget class="QLabel" name="label_5">
353
+ <property name="text">
354
+ <string/>
355
+ </property>
356
+ </widget>
357
+ </item>
358
+ <item row="5" column="1">
359
+ <widget class="QRadioButton" name="rbn_no">
360
+ <property name="text">
361
+ <string>No</string>
362
+ </property>
363
+ </widget>
364
+ </item>
240
365
  </layout>
241
366
  </item>
242
367
  </layout>
@@ -9,6 +9,7 @@ require 'Qt4'
9
9
  require_relative 'gui/gui_chip_management'
10
10
  require_relative 'class/HardsploitGUI'
11
11
  require_relative 'class/Console'
12
+ require_relative 'class/Progress_bar'
12
13
  require_relative 'class/Wire_helper'
13
14
  require_relative 'class/Chip_editor'
14
15
  require_relative 'class/Generic_commands'
@@ -32,7 +33,7 @@ include VersionUC::VERSION_UC
32
33
  class Hardsploit_GUI
33
34
  def initialize
34
35
  # Launch API
35
- hardAPI = HardsploitAPI.new(method(:callbackData),method(:callbackInfo),method(:callbackError),method(:callbackSpeedOfTransfert))
36
+ hardAPI = HardsploitAPI.new(method(:callbackData),method(:callbackInfo),method(:callbackProgress),method(:callbackSpeedOfTransfert))
36
37
  $file = nil
37
38
  $currentFirmware = nil
38
39
  $usbConnected = nil
@@ -41,6 +42,7 @@ class Hardsploit_GUI
41
42
 
42
43
  # Launch GUI
43
44
  Qt::Application.new(ARGV) do
45
+ $app = self
44
46
  w = HardsploitGUI.new(hardAPI)
45
47
  centerWindow(w)
46
48
  w.show
@@ -55,8 +57,15 @@ class Hardsploit_GUI
55
57
  print receiveData + "\n"
56
58
  end
57
59
 
58
- def callbackError(receiveData)
59
- print receiveData + "\n"
60
+ def callbackProgress(percent:,startTime:,endTime:)
61
+ $pgb.update_value(percent) unless $pgb.nil?
62
+ $app.processEvents
63
+ if percent == 100
64
+ duration = (endTime-startTime).round(2)
65
+ $pgb.display_time("Total duration: #{duration} second(s)")
66
+ end
67
+ #puts "Progress : #{percent}% Start@ #{startTime} Stop@ #{endTime}"
68
+ #puts "Elasped time #{(endTime-startTime).round(4)} sec"
60
69
  end
61
70
 
62
71
  def callbackSpeedOfTransfert(receiveData)