hardsploit_gui 2.3 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -22
- data/Rakefile +1 -1
- data/bin/hardsploit_gui +3 -3
- data/lib/Firmwares/FPGA/I2C/I2C_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_I2C_INTERACT.rpd +0 -0
- data/lib/Firmwares/FPGA/PARALLEL/NO_MUX_PARALLEL_MEMORY/HARDSPLOIT_FIRMWARE_FPGA_NO_MUX_PARALLEL_MEMORY.rpd +0 -0
- data/lib/Firmwares/FPGA/SPI/SPI_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_SPI_INTERACT.rpd +0 -0
- data/lib/Firmwares/FPGA/SPI/SPI_SNIFFER/HARDSPLOIT_FIRMWARE_FPGA_SPI_SNIFFER.rpd +0 -0
- data/lib/Firmwares/FPGA/SWD/SWD_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_SWD_INTERACT.rpd +0 -0
- data/lib/Firmwares/FPGA/UART/UART_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_UART_INTERACT.rpd +0 -0
- data/lib/Firmwares/FPGA/VersionFPGA.rb +5 -5
- data/lib/Firmwares/UC/VersionUC.rb +12 -12
- data/lib/HardsploitAPI/Core/HardsploitAPI.rb +210 -210
- data/lib/HardsploitAPI/Core/HardsploitAPI_CONSTANT.rb +150 -150
- data/lib/HardsploitAPI/Core/HardsploitAPI_ERROR.rb +109 -109
- data/lib/HardsploitAPI/Core/HardsploitAPI_FIRMWARE.rb +305 -305
- data/lib/HardsploitAPI/Core/HardsploitAPI_PROGRESS.rb +28 -28
- data/lib/HardsploitAPI/Core/HardsploitAPI_USB_COMMUNICATION.rb +166 -166
- data/lib/HardsploitAPI/Modules/I2C/HardsploitAPI_I2C.rb +356 -356
- data/lib/HardsploitAPI/Modules/NO_MUX_PARALLEL_MEMORY/HardsploitAPI_NO_MUX_PARALLEL_MEMORY.rb +206 -206
- data/lib/HardsploitAPI/Modules/NRF24L01/HardsploitAPI_NRF24L01.rb +306 -306
- data/lib/HardsploitAPI/Modules/SPI/HardsploitAPI_SPI.rb +340 -340
- data/lib/HardsploitAPI/Modules/SPI_SNIFFER/HardsploitAPI_SPI_SNIFFER.rb +83 -83
- data/lib/HardsploitAPI/Modules/SWD/HardsploitAPI_SWD.rb +367 -367
- data/lib/HardsploitAPI/Modules/SWD/HardsploitAPI_SWD_DEBUG.rb +89 -89
- data/lib/HardsploitAPI/Modules/SWD/HardsploitAPI_SWD_MEM_AP.rb +61 -61
- data/lib/HardsploitAPI/Modules/SWD/HardsploitAPI_SWD_STM32.rb +121 -121
- data/lib/HardsploitAPI/Modules/TEST/HardsploitAPI_TEST_INTERACT.rb +98 -98
- data/lib/HardsploitAPI/Modules/UART/HardsploitAPI_UART.rb +196 -196
- data/lib/Hardsploit_gui.rb +96 -96
- data/lib/LICENSE.txt +674 -674
- data/lib/README.md +22 -22
- data/lib/TRADEMARK +2 -2
- data/lib/class/Chip_editor.rb +304 -304
- data/lib/class/Chip_management.rb +496 -496
- data/lib/class/Command_editor.rb +216 -216
- data/lib/class/Command_table.rb +233 -233
- data/lib/class/Console.rb +26 -26
- data/lib/class/ErrorMsg.rb +312 -312
- data/lib/class/Export.rb +140 -140
- data/lib/class/Export_manager.rb +124 -124
- data/lib/class/Firmware.rb +70 -70
- data/lib/class/Generic_commands.rb +260 -260
- data/lib/class/{i2c → I2C}/I2c_command.rb +51 -51
- data/lib/class/{i2c → I2C}/I2c_export.rb +95 -95
- data/lib/class/{i2c → I2C}/I2c_import.rb +117 -117
- data/lib/class/{i2c → I2C}/I2c_scanner.rb +114 -114
- data/lib/class/{i2c → I2C}/I2c_settings.rb +148 -148
- data/lib/class/Import.rb +193 -193
- data/lib/class/{parallel → PARALLEL}/Parallel_export.rb +118 -118
- data/lib/class/{parallel → PARALLEL}/Parallel_import.rb +113 -113
- data/lib/class/{parallel → PARALLEL}/Parallel_settings.rb +81 -81
- data/lib/class/Progress_bar.rb +32 -32
- data/lib/class/{spi → SPI}/Spi_export.rb +108 -108
- data/lib/class/{spi → SPI}/Spi_import.rb +159 -159
- data/lib/class/{spi → SPI}/Spi_settings.rb +108 -108
- data/lib/class/{spi → SPI}/Spi_sniffer.rb +101 -101
- data/lib/class/Signal_mapper.rb +120 -120
- data/lib/class/Wire_helper.rb +230 -230
- data/lib/class/swd/Swd.rb +125 -125
- data/lib/class/swd/Swd_scanner.rb +121 -121
- data/lib/class/swd/Swd_settings.rb +76 -76
- data/lib/class/uart/Uart_baudrate.rb +62 -62
- data/lib/class/uart/Uart_console.rb +115 -115
- data/lib/class/uart/Uart_settings.rb +102 -102
- data/lib/db/associations.rb +138 -138
- data/lib/db/database.rb +4 -4
- data/lib/db/development.sqlite3 +0 -0
- data/lib/db/migrate/004_create_manufacturers.rb +13 -13
- data/lib/db/migrate/005_create_packages.rb +13 -13
- data/lib/db/migrate/006_create_chip_types.rb +11 -11
- data/lib/db/migrate/007_create_buses.rb +11 -11
- data/lib/db/migrate/008_create_signals.rb +14 -14
- data/lib/db/migrate/009_create_chips.rb +25 -25
- data/lib/db/migrate/010_create_commands.rb +21 -21
- data/lib/db/migrate/011_create_bytes.rb +19 -19
- data/lib/db/migrate/012_create_i2c_settings.rb +21 -21
- data/lib/db/migrate/013_create_spi_settings.rb +26 -26
- data/lib/db/migrate/014_create_parallel_settings.rb +21 -21
- data/lib/db/migrate/015_create_pins.rb +19 -19
- data/lib/db/migrate/016_create_uses.rb +17 -17
- data/lib/db/migrate/017_create_swd_settings.rb +19 -19
- data/lib/db/migrate/018_create_uart_settings.rb +22 -22
- data/lib/db/schema.rb +157 -157
- data/lib/db/seeds.rb +161 -161
- data/lib/gui/gui_chip_editor.rb +349 -349
- data/lib/gui/gui_chip_management.rb +377 -377
- data/lib/gui/gui_command_editor.rb +219 -219
- data/lib/gui/gui_export.rb +132 -132
- data/lib/gui/gui_export_manager.rb +93 -93
- data/lib/gui/gui_generic_commands.rb +202 -202
- data/lib/gui/gui_generic_export.rb +164 -164
- data/lib/gui/gui_generic_import.rb +142 -142
- data/lib/gui/gui_i2c_command.rb +116 -116
- data/lib/gui/gui_i2c_settings.rb +230 -230
- data/lib/gui/gui_import.rb +131 -131
- data/lib/gui/gui_parallel_settings.rb +195 -195
- data/lib/gui/gui_progress_bar.rb +85 -85
- data/lib/gui/gui_signal_mapper.rb +121 -121
- data/lib/gui/gui_signal_scanner.rb +146 -146
- data/lib/gui/gui_spi_import.rb +126 -126
- data/lib/gui/gui_spi_settings.rb +313 -313
- data/lib/gui/gui_spi_sniffer.rb +112 -112
- data/lib/gui/gui_swd_settings.rb +166 -166
- data/lib/gui/gui_uart_baudrate.rb +114 -114
- data/lib/gui/gui_uart_console.rb +164 -164
- data/lib/gui/gui_uart_settings.rb +243 -243
- data/lib/gui/gui_wire_helper.rb +99 -99
- data/lib/gui_designer/gui_chip_editor.ui +549 -549
- data/lib/gui_designer/gui_chip_management.ui +886 -886
- data/lib/gui_designer/gui_command_editor.ui +350 -350
- data/lib/gui_designer/gui_export.ui +171 -171
- data/lib/gui_designer/gui_export_manager.ui +115 -115
- data/lib/gui_designer/gui_generic_commands.ui +342 -342
- data/lib/gui_designer/gui_generic_export.ui +202 -202
- data/lib/gui_designer/gui_generic_import.ui +165 -165
- data/lib/gui_designer/gui_i2c_command.ui +148 -148
- data/lib/gui_designer/gui_i2c_settings.ui +292 -292
- data/lib/gui_designer/gui_import.ui +168 -168
- data/lib/gui_designer/gui_parallel_settings.ui +247 -247
- data/lib/gui_designer/gui_progress_bar.ui +86 -86
- data/lib/gui_designer/gui_signal_mapper.ui +179 -179
- data/lib/gui_designer/gui_signal_scanner.ui +261 -261
- data/lib/gui_designer/gui_spi_settings.ui +446 -446
- data/lib/gui_designer/gui_spi_sniffer.ui +156 -156
- data/lib/gui_designer/gui_swd_settings.ui +189 -189
- data/lib/gui_designer/gui_uart_baudrate.ui +161 -161
- data/lib/gui_designer/gui_uart_console.ui +284 -284
- data/lib/gui_designer/gui_uart_settings.ui +280 -280
- data/lib/gui_designer/gui_wire_helper.ui +117 -117
- data/lib/images/search.png +0 -0
- data/lib/logs/error.log +0 -63
- data/lib/models/bus.rb +19 -19
- data/lib/models/byte.rb +29 -29
- data/lib/models/chip.rb +41 -41
- data/lib/models/chip_type.rb +14 -14
- data/lib/models/command.rb +20 -20
- data/lib/models/i2c_setting.rb +41 -41
- data/lib/models/manufacturer.rb +14 -14
- data/lib/models/package.rb +26 -26
- data/lib/models/parallel_setting.rb +37 -37
- data/lib/models/pin.rb +14 -14
- data/lib/models/signall.rb +20 -20
- data/lib/models/spi_setting.rb +67 -67
- data/lib/models/swd_setting.rb +25 -25
- data/lib/models/uart_setting.rb +52 -52
- data/lib/models/use.rb +6 -6
- data/lib/startHardsploit.rb +10 -10
- metadata +14 -14
data/lib/class/Console.rb
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
#===================================================
|
2
|
-
# Hardsploit GUI - By Opale Security
|
3
|
-
# www.opale-security.com || www.hardsploit.io
|
4
|
-
# License: GNU General Public License v3
|
5
|
-
# License URI: http://www.gnu.org/licenses/gpl.txt
|
6
|
-
#===================================================
|
7
|
-
require 'date'
|
8
|
-
require_relative '../gui/gui_command_editor'
|
9
|
-
class Console < Qt::TableWidget
|
10
|
-
|
11
|
-
def initialize(console)
|
12
|
-
super()
|
13
|
-
@console = console
|
14
|
-
end
|
15
|
-
|
16
|
-
def print(msg)
|
17
|
-
@console.insertRow(@console.rowCount)
|
18
|
-
time = Qt::TableWidgetItem.new("#{Time.now.strftime("%d/%m %H:%M")}")
|
19
|
-
time.setFlags(Qt::ItemIsEnabled)
|
20
|
-
msg = Qt::TableWidgetItem.new(msg)
|
21
|
-
msg.setFlags(Qt::ItemIsEnabled)
|
22
|
-
@console.setItem(@console.rowCount - 1, 0, time)
|
23
|
-
@console.setItem(@console.rowCount - 1, 1, msg)
|
24
|
-
@console.scrollToItem(time, Qt::AbstractItemView::EnsureVisible)
|
25
|
-
end
|
26
|
-
end
|
1
|
+
#===================================================
|
2
|
+
# Hardsploit GUI - By Opale Security
|
3
|
+
# www.opale-security.com || www.hardsploit.io
|
4
|
+
# License: GNU General Public License v3
|
5
|
+
# License URI: http://www.gnu.org/licenses/gpl.txt
|
6
|
+
#===================================================
|
7
|
+
require 'date'
|
8
|
+
require_relative '../gui/gui_command_editor'
|
9
|
+
class Console < Qt::TableWidget
|
10
|
+
|
11
|
+
def initialize(console)
|
12
|
+
super()
|
13
|
+
@console = console
|
14
|
+
end
|
15
|
+
|
16
|
+
def print(msg)
|
17
|
+
@console.insertRow(@console.rowCount)
|
18
|
+
time = Qt::TableWidgetItem.new("#{Time.now.strftime("%d/%m %H:%M")}")
|
19
|
+
time.setFlags(Qt::ItemIsEnabled)
|
20
|
+
msg = Qt::TableWidgetItem.new(msg)
|
21
|
+
msg.setFlags(Qt::ItemIsEnabled)
|
22
|
+
@console.setItem(@console.rowCount - 1, 0, time)
|
23
|
+
@console.setItem(@console.rowCount - 1, 1, msg)
|
24
|
+
@console.scrollToItem(time, Qt::AbstractItemView::EnsureVisible)
|
25
|
+
end
|
26
|
+
end
|
data/lib/class/ErrorMsg.rb
CHANGED
@@ -1,312 +1,312 @@
|
|
1
|
-
class ErrorMsg
|
2
|
-
|
3
|
-
def hardsploit_not_found
|
4
|
-
Qt::MessageBox.new(
|
5
|
-
Qt::MessageBox::Critical,
|
6
|
-
'Hardsploit Connectivity',
|
7
|
-
'Hardsploit not detected. Please check the USB connection'
|
8
|
-
).exec
|
9
|
-
return true
|
10
|
-
end
|
11
|
-
|
12
|
-
def usb_error
|
13
|
-
Qt::MessageBox.new(
|
14
|
-
Qt::MessageBox::Critical,
|
15
|
-
'Hardsploit USB error',
|
16
|
-
'USB error occured'
|
17
|
-
).exec
|
18
|
-
end
|
19
|
-
|
20
|
-
def no_chip_loaded
|
21
|
-
Qt::MessageBox.new(
|
22
|
-
Qt::MessageBox::Information,
|
23
|
-
"Wire chip",
|
24
|
-
"You need to load a chip first"
|
25
|
-
).exec
|
26
|
-
return true
|
27
|
-
end
|
28
|
-
|
29
|
-
def invalid_pin_nbr
|
30
|
-
Qt::MessageBox.new(
|
31
|
-
Qt::MessageBox::Warning,
|
32
|
-
'Invalid pin number value',
|
33
|
-
'Pin number needs to be between 4 and 144'
|
34
|
-
).exec
|
35
|
-
end
|
36
|
-
|
37
|
-
def filesize_error
|
38
|
-
Qt::MessageBox.new(
|
39
|
-
Qt::MessageBox::Critical,
|
40
|
-
'Error',
|
41
|
-
'Dump error: The file size does not match with the given parameters'
|
42
|
-
).exec
|
43
|
-
end
|
44
|
-
|
45
|
-
def swd_not_found
|
46
|
-
Qt::MessageBox.new(
|
47
|
-
Qt::MessageBox::Information,
|
48
|
-
'SWD Action',
|
49
|
-
'No return from the SWD'
|
50
|
-
).exec
|
51
|
-
end
|
52
|
-
|
53
|
-
def swd_error
|
54
|
-
Qt::MessageBox.new(
|
55
|
-
Qt::MessageBox::Critical,
|
56
|
-
'SWD Action',
|
57
|
-
'An error occured while processing the SWD scan'
|
58
|
-
).exec
|
59
|
-
return false
|
60
|
-
end
|
61
|
-
|
62
|
-
def spi_error
|
63
|
-
Qt::MessageBox.new(
|
64
|
-
Qt::MessageBox::Critical,
|
65
|
-
'SPI Action',
|
66
|
-
'An error occured while processing the SPI command'
|
67
|
-
).exec
|
68
|
-
end
|
69
|
-
|
70
|
-
def spi_mode_missing
|
71
|
-
Qt::MessageBox.new(
|
72
|
-
Qt::MessageBox::Warning,
|
73
|
-
'SPI mode missing',
|
74
|
-
'Mode setting is missing for this chip'
|
75
|
-
).exec
|
76
|
-
return false
|
77
|
-
end
|
78
|
-
|
79
|
-
def spi_cmd_too_long
|
80
|
-
Qt::MessageBox.new(
|
81
|
-
Qt::MessageBox::Warning,
|
82
|
-
'SPI command invalid',
|
83
|
-
'SPI command size is to big (> 4000)'
|
84
|
-
).exec
|
85
|
-
return false
|
86
|
-
end
|
87
|
-
|
88
|
-
def i2c_error
|
89
|
-
Qt::MessageBox.new(
|
90
|
-
Qt::MessageBox::Critical,
|
91
|
-
'I²C Action',
|
92
|
-
'An error occured while processing the I²C command (I²C wrong speed)'
|
93
|
-
).exec
|
94
|
-
return false
|
95
|
-
end
|
96
|
-
|
97
|
-
def parallel_error
|
98
|
-
Qt::MessageBox.new(
|
99
|
-
Qt::MessageBox::Critical,
|
100
|
-
'Parallel Action',
|
101
|
-
'An error occured while processing the parallel command'
|
102
|
-
).exec
|
103
|
-
end
|
104
|
-
# Commands
|
105
|
-
|
106
|
-
def no_cmd_selected
|
107
|
-
Qt::MessageBox.new(
|
108
|
-
Qt::MessageBox::Warning,
|
109
|
-
'Missing command',
|
110
|
-
'Select a command in the array first'
|
111
|
-
).exec
|
112
|
-
return true
|
113
|
-
end
|
114
|
-
|
115
|
-
def concat_nbr
|
116
|
-
Qt::MessageBox.new(
|
117
|
-
Qt::MessageBox::Warning,
|
118
|
-
'Wrong selection',
|
119
|
-
'Select two commands in the table to concatenate them'
|
120
|
-
).exec
|
121
|
-
return true
|
122
|
-
end
|
123
|
-
|
124
|
-
def concat_disallow
|
125
|
-
Qt::MessageBox.new(
|
126
|
-
Qt::MessageBox::Warning,
|
127
|
-
'Concatenation option',
|
128
|
-
'This option can be used only with I2C bus commands'
|
129
|
-
).exec
|
130
|
-
return false
|
131
|
-
end
|
132
|
-
|
133
|
-
def lowbyte_missing
|
134
|
-
Qt::MessageBox.new(
|
135
|
-
Qt::MessageBox::Critical,
|
136
|
-
'Command error',
|
137
|
-
'Payload size invalid or payload size (low) missing'
|
138
|
-
).exec
|
139
|
-
return false
|
140
|
-
end
|
141
|
-
|
142
|
-
def highbyte_missing
|
143
|
-
Qt::MessageBox.new(
|
144
|
-
Qt::MessageBox::Critical,
|
145
|
-
'Command error',
|
146
|
-
'Payload size invalid or payload size (high) missing'
|
147
|
-
).exec
|
148
|
-
return false
|
149
|
-
end
|
150
|
-
|
151
|
-
def mode_missing
|
152
|
-
Qt::MessageBox.new(
|
153
|
-
Qt::MessageBox::Critical,
|
154
|
-
'Command error',
|
155
|
-
'Payload size invalid or Read / Write address missing'
|
156
|
-
).exec
|
157
|
-
return false
|
158
|
-
end
|
159
|
-
|
160
|
-
def size_neq_row_number
|
161
|
-
Qt::MessageBox.new(
|
162
|
-
Qt::MessageBox::Critical,
|
163
|
-
'Command error',
|
164
|
-
'The payload size does not match with the row number'
|
165
|
-
).exec
|
166
|
-
return false
|
167
|
-
end
|
168
|
-
|
169
|
-
def i2c_cmd_too_long
|
170
|
-
Qt::MessageBox.new(
|
171
|
-
Qt::MessageBox::Critical,
|
172
|
-
'I2C command invalid',
|
173
|
-
'Your payload is too big (> 2000)'
|
174
|
-
).exec
|
175
|
-
return false
|
176
|
-
end
|
177
|
-
|
178
|
-
def positive_cell_value
|
179
|
-
Qt::MessageBox.new(
|
180
|
-
Qt::MessageBox::Warning,
|
181
|
-
'Wrong data',
|
182
|
-
'Only positive values are accepted in this cell'
|
183
|
-
).exec
|
184
|
-
end
|
185
|
-
|
186
|
-
def hexa_cell_value
|
187
|
-
Qt::MessageBox.new(
|
188
|
-
Qt::MessageBox::Warning,
|
189
|
-
'Wrong data',
|
190
|
-
'Only hexadecimal values are accepted in this cell'
|
191
|
-
).exec
|
192
|
-
end
|
193
|
-
|
194
|
-
def char_cell_value
|
195
|
-
Qt::MessageBox.new(
|
196
|
-
Qt::MessageBox::Warning,
|
197
|
-
'Wrong data',
|
198
|
-
'Wrong characters in this cell'
|
199
|
-
).exec
|
200
|
-
end
|
201
|
-
|
202
|
-
def ascii_only
|
203
|
-
Qt::MessageBox.new(
|
204
|
-
Qt::MessageBox::Warning,
|
205
|
-
'String error',
|
206
|
-
'Only ASCII characters can be specified'
|
207
|
-
).exec
|
208
|
-
return false
|
209
|
-
end
|
210
|
-
|
211
|
-
# Global Settings
|
212
|
-
|
213
|
-
def settings_missing
|
214
|
-
Qt::MessageBox.new(
|
215
|
-
Qt::MessageBox::Warning,
|
216
|
-
'Missing settings',
|
217
|
-
'No settings saved for this chip'
|
218
|
-
).exec
|
219
|
-
return false
|
220
|
-
end
|
221
|
-
|
222
|
-
def frequency_missing
|
223
|
-
Qt::MessageBox.new(
|
224
|
-
Qt::MessageBox::Warning,
|
225
|
-
'Missing settings',
|
226
|
-
'Frequency setting missing'
|
227
|
-
).exec
|
228
|
-
return false
|
229
|
-
end
|
230
|
-
|
231
|
-
def mode_missing
|
232
|
-
Qt::MessageBox.new(
|
233
|
-
Qt::MessageBox::Warning,
|
234
|
-
'Missing settings',
|
235
|
-
'Missing write base address (I²C) or read command (SPI)'
|
236
|
-
).exec
|
237
|
-
return false
|
238
|
-
end
|
239
|
-
|
240
|
-
def full_size_error
|
241
|
-
Qt::MessageBox.new(
|
242
|
-
Qt::MessageBox::Warning,
|
243
|
-
'Empty field',
|
244
|
-
'Full size setting missing or equal 0'
|
245
|
-
).exec
|
246
|
-
return false
|
247
|
-
end
|
248
|
-
|
249
|
-
def start_stop_missing
|
250
|
-
Qt::MessageBox.new(
|
251
|
-
Qt::MessageBox::Warning,
|
252
|
-
'Empty field',
|
253
|
-
'Start and stop address must be filled'
|
254
|
-
).exec
|
255
|
-
return false
|
256
|
-
end
|
257
|
-
|
258
|
-
def start_neq_stop
|
259
|
-
Qt::MessageBox.new(
|
260
|
-
Qt::MessageBox::Warning,
|
261
|
-
'Wrong value',
|
262
|
-
'Start address must not be equal to the stop address'
|
263
|
-
).exec
|
264
|
-
return false
|
265
|
-
end
|
266
|
-
|
267
|
-
def start_inf_to_stop
|
268
|
-
Qt::MessageBox.new(
|
269
|
-
Qt::MessageBox::Warning,
|
270
|
-
'Wrong value',
|
271
|
-
'Start address must be inforior to the stop address'
|
272
|
-
).exec
|
273
|
-
return false
|
274
|
-
end
|
275
|
-
|
276
|
-
def inf_to_total_size
|
277
|
-
Qt::MessageBox.new(
|
278
|
-
Qt::MessageBox::Warning,
|
279
|
-
'Wrong value',
|
280
|
-
'Start and stop address must be inforior to the chip total size'
|
281
|
-
).exec
|
282
|
-
return false
|
283
|
-
end
|
284
|
-
|
285
|
-
def para_read_latency
|
286
|
-
Qt::MessageBox.new(
|
287
|
-
Qt::MessageBox::Warning,
|
288
|
-
'Missing parallel settings',
|
289
|
-
'Read latency setting missing'
|
290
|
-
).exec
|
291
|
-
return false
|
292
|
-
end
|
293
|
-
|
294
|
-
def para_word_size
|
295
|
-
Qt::MessageBox.new(
|
296
|
-
Qt::MessageBox::Warning,
|
297
|
-
'Missing parallel settings',
|
298
|
-
'Word size setting missing'
|
299
|
-
).exec
|
300
|
-
return false
|
301
|
-
end
|
302
|
-
|
303
|
-
# Unknown
|
304
|
-
def unknown(msg)
|
305
|
-
Logger.new($logFilePath).error(msg)
|
306
|
-
Qt::MessageBox.new(
|
307
|
-
Qt::MessageBox::Critical,
|
308
|
-
'Hardsploit unknown error',
|
309
|
-
'An unknown error has been detected. Check the log for more details.'
|
310
|
-
).exec
|
311
|
-
end
|
312
|
-
end
|
1
|
+
class ErrorMsg
|
2
|
+
|
3
|
+
def hardsploit_not_found
|
4
|
+
Qt::MessageBox.new(
|
5
|
+
Qt::MessageBox::Critical,
|
6
|
+
'Hardsploit Connectivity',
|
7
|
+
'Hardsploit not detected. Please check the USB connection'
|
8
|
+
).exec
|
9
|
+
return true
|
10
|
+
end
|
11
|
+
|
12
|
+
def usb_error
|
13
|
+
Qt::MessageBox.new(
|
14
|
+
Qt::MessageBox::Critical,
|
15
|
+
'Hardsploit USB error',
|
16
|
+
'USB error occured'
|
17
|
+
).exec
|
18
|
+
end
|
19
|
+
|
20
|
+
def no_chip_loaded
|
21
|
+
Qt::MessageBox.new(
|
22
|
+
Qt::MessageBox::Information,
|
23
|
+
"Wire chip",
|
24
|
+
"You need to load a chip first"
|
25
|
+
).exec
|
26
|
+
return true
|
27
|
+
end
|
28
|
+
|
29
|
+
def invalid_pin_nbr
|
30
|
+
Qt::MessageBox.new(
|
31
|
+
Qt::MessageBox::Warning,
|
32
|
+
'Invalid pin number value',
|
33
|
+
'Pin number needs to be between 4 and 144'
|
34
|
+
).exec
|
35
|
+
end
|
36
|
+
|
37
|
+
def filesize_error
|
38
|
+
Qt::MessageBox.new(
|
39
|
+
Qt::MessageBox::Critical,
|
40
|
+
'Error',
|
41
|
+
'Dump error: The file size does not match with the given parameters'
|
42
|
+
).exec
|
43
|
+
end
|
44
|
+
|
45
|
+
def swd_not_found
|
46
|
+
Qt::MessageBox.new(
|
47
|
+
Qt::MessageBox::Information,
|
48
|
+
'SWD Action',
|
49
|
+
'No return from the SWD'
|
50
|
+
).exec
|
51
|
+
end
|
52
|
+
|
53
|
+
def swd_error
|
54
|
+
Qt::MessageBox.new(
|
55
|
+
Qt::MessageBox::Critical,
|
56
|
+
'SWD Action',
|
57
|
+
'An error occured while processing the SWD scan'
|
58
|
+
).exec
|
59
|
+
return false
|
60
|
+
end
|
61
|
+
|
62
|
+
def spi_error
|
63
|
+
Qt::MessageBox.new(
|
64
|
+
Qt::MessageBox::Critical,
|
65
|
+
'SPI Action',
|
66
|
+
'An error occured while processing the SPI command'
|
67
|
+
).exec
|
68
|
+
end
|
69
|
+
|
70
|
+
def spi_mode_missing
|
71
|
+
Qt::MessageBox.new(
|
72
|
+
Qt::MessageBox::Warning,
|
73
|
+
'SPI mode missing',
|
74
|
+
'Mode setting is missing for this chip'
|
75
|
+
).exec
|
76
|
+
return false
|
77
|
+
end
|
78
|
+
|
79
|
+
def spi_cmd_too_long
|
80
|
+
Qt::MessageBox.new(
|
81
|
+
Qt::MessageBox::Warning,
|
82
|
+
'SPI command invalid',
|
83
|
+
'SPI command size is to big (> 4000)'
|
84
|
+
).exec
|
85
|
+
return false
|
86
|
+
end
|
87
|
+
|
88
|
+
def i2c_error
|
89
|
+
Qt::MessageBox.new(
|
90
|
+
Qt::MessageBox::Critical,
|
91
|
+
'I²C Action',
|
92
|
+
'An error occured while processing the I²C command (I²C wrong speed)'
|
93
|
+
).exec
|
94
|
+
return false
|
95
|
+
end
|
96
|
+
|
97
|
+
def parallel_error
|
98
|
+
Qt::MessageBox.new(
|
99
|
+
Qt::MessageBox::Critical,
|
100
|
+
'Parallel Action',
|
101
|
+
'An error occured while processing the parallel command'
|
102
|
+
).exec
|
103
|
+
end
|
104
|
+
# Commands
|
105
|
+
|
106
|
+
def no_cmd_selected
|
107
|
+
Qt::MessageBox.new(
|
108
|
+
Qt::MessageBox::Warning,
|
109
|
+
'Missing command',
|
110
|
+
'Select a command in the array first'
|
111
|
+
).exec
|
112
|
+
return true
|
113
|
+
end
|
114
|
+
|
115
|
+
def concat_nbr
|
116
|
+
Qt::MessageBox.new(
|
117
|
+
Qt::MessageBox::Warning,
|
118
|
+
'Wrong selection',
|
119
|
+
'Select two commands in the table to concatenate them'
|
120
|
+
).exec
|
121
|
+
return true
|
122
|
+
end
|
123
|
+
|
124
|
+
def concat_disallow
|
125
|
+
Qt::MessageBox.new(
|
126
|
+
Qt::MessageBox::Warning,
|
127
|
+
'Concatenation option',
|
128
|
+
'This option can be used only with I2C bus commands'
|
129
|
+
).exec
|
130
|
+
return false
|
131
|
+
end
|
132
|
+
|
133
|
+
def lowbyte_missing
|
134
|
+
Qt::MessageBox.new(
|
135
|
+
Qt::MessageBox::Critical,
|
136
|
+
'Command error',
|
137
|
+
'Payload size invalid or payload size (low) missing'
|
138
|
+
).exec
|
139
|
+
return false
|
140
|
+
end
|
141
|
+
|
142
|
+
def highbyte_missing
|
143
|
+
Qt::MessageBox.new(
|
144
|
+
Qt::MessageBox::Critical,
|
145
|
+
'Command error',
|
146
|
+
'Payload size invalid or payload size (high) missing'
|
147
|
+
).exec
|
148
|
+
return false
|
149
|
+
end
|
150
|
+
|
151
|
+
def mode_missing
|
152
|
+
Qt::MessageBox.new(
|
153
|
+
Qt::MessageBox::Critical,
|
154
|
+
'Command error',
|
155
|
+
'Payload size invalid or Read / Write address missing'
|
156
|
+
).exec
|
157
|
+
return false
|
158
|
+
end
|
159
|
+
|
160
|
+
def size_neq_row_number
|
161
|
+
Qt::MessageBox.new(
|
162
|
+
Qt::MessageBox::Critical,
|
163
|
+
'Command error',
|
164
|
+
'The payload size does not match with the row number'
|
165
|
+
).exec
|
166
|
+
return false
|
167
|
+
end
|
168
|
+
|
169
|
+
def i2c_cmd_too_long
|
170
|
+
Qt::MessageBox.new(
|
171
|
+
Qt::MessageBox::Critical,
|
172
|
+
'I2C command invalid',
|
173
|
+
'Your payload is too big (> 2000)'
|
174
|
+
).exec
|
175
|
+
return false
|
176
|
+
end
|
177
|
+
|
178
|
+
def positive_cell_value
|
179
|
+
Qt::MessageBox.new(
|
180
|
+
Qt::MessageBox::Warning,
|
181
|
+
'Wrong data',
|
182
|
+
'Only positive values are accepted in this cell'
|
183
|
+
).exec
|
184
|
+
end
|
185
|
+
|
186
|
+
def hexa_cell_value
|
187
|
+
Qt::MessageBox.new(
|
188
|
+
Qt::MessageBox::Warning,
|
189
|
+
'Wrong data',
|
190
|
+
'Only hexadecimal values are accepted in this cell'
|
191
|
+
).exec
|
192
|
+
end
|
193
|
+
|
194
|
+
def char_cell_value
|
195
|
+
Qt::MessageBox.new(
|
196
|
+
Qt::MessageBox::Warning,
|
197
|
+
'Wrong data',
|
198
|
+
'Wrong characters in this cell'
|
199
|
+
).exec
|
200
|
+
end
|
201
|
+
|
202
|
+
def ascii_only
|
203
|
+
Qt::MessageBox.new(
|
204
|
+
Qt::MessageBox::Warning,
|
205
|
+
'String error',
|
206
|
+
'Only ASCII characters can be specified'
|
207
|
+
).exec
|
208
|
+
return false
|
209
|
+
end
|
210
|
+
|
211
|
+
# Global Settings
|
212
|
+
|
213
|
+
def settings_missing
|
214
|
+
Qt::MessageBox.new(
|
215
|
+
Qt::MessageBox::Warning,
|
216
|
+
'Missing settings',
|
217
|
+
'No settings saved for this chip'
|
218
|
+
).exec
|
219
|
+
return false
|
220
|
+
end
|
221
|
+
|
222
|
+
def frequency_missing
|
223
|
+
Qt::MessageBox.new(
|
224
|
+
Qt::MessageBox::Warning,
|
225
|
+
'Missing settings',
|
226
|
+
'Frequency setting missing'
|
227
|
+
).exec
|
228
|
+
return false
|
229
|
+
end
|
230
|
+
|
231
|
+
def mode_missing
|
232
|
+
Qt::MessageBox.new(
|
233
|
+
Qt::MessageBox::Warning,
|
234
|
+
'Missing settings',
|
235
|
+
'Missing write base address (I²C) or read command (SPI)'
|
236
|
+
).exec
|
237
|
+
return false
|
238
|
+
end
|
239
|
+
|
240
|
+
def full_size_error
|
241
|
+
Qt::MessageBox.new(
|
242
|
+
Qt::MessageBox::Warning,
|
243
|
+
'Empty field',
|
244
|
+
'Full size setting missing or equal 0'
|
245
|
+
).exec
|
246
|
+
return false
|
247
|
+
end
|
248
|
+
|
249
|
+
def start_stop_missing
|
250
|
+
Qt::MessageBox.new(
|
251
|
+
Qt::MessageBox::Warning,
|
252
|
+
'Empty field',
|
253
|
+
'Start and stop address must be filled'
|
254
|
+
).exec
|
255
|
+
return false
|
256
|
+
end
|
257
|
+
|
258
|
+
def start_neq_stop
|
259
|
+
Qt::MessageBox.new(
|
260
|
+
Qt::MessageBox::Warning,
|
261
|
+
'Wrong value',
|
262
|
+
'Start address must not be equal to the stop address'
|
263
|
+
).exec
|
264
|
+
return false
|
265
|
+
end
|
266
|
+
|
267
|
+
def start_inf_to_stop
|
268
|
+
Qt::MessageBox.new(
|
269
|
+
Qt::MessageBox::Warning,
|
270
|
+
'Wrong value',
|
271
|
+
'Start address must be inforior to the stop address'
|
272
|
+
).exec
|
273
|
+
return false
|
274
|
+
end
|
275
|
+
|
276
|
+
def inf_to_total_size
|
277
|
+
Qt::MessageBox.new(
|
278
|
+
Qt::MessageBox::Warning,
|
279
|
+
'Wrong value',
|
280
|
+
'Start and stop address must be inforior to the chip total size'
|
281
|
+
).exec
|
282
|
+
return false
|
283
|
+
end
|
284
|
+
|
285
|
+
def para_read_latency
|
286
|
+
Qt::MessageBox.new(
|
287
|
+
Qt::MessageBox::Warning,
|
288
|
+
'Missing parallel settings',
|
289
|
+
'Read latency setting missing'
|
290
|
+
).exec
|
291
|
+
return false
|
292
|
+
end
|
293
|
+
|
294
|
+
def para_word_size
|
295
|
+
Qt::MessageBox.new(
|
296
|
+
Qt::MessageBox::Warning,
|
297
|
+
'Missing parallel settings',
|
298
|
+
'Word size setting missing'
|
299
|
+
).exec
|
300
|
+
return false
|
301
|
+
end
|
302
|
+
|
303
|
+
# Unknown
|
304
|
+
def unknown(msg)
|
305
|
+
Logger.new($logFilePath).error(msg)
|
306
|
+
Qt::MessageBox.new(
|
307
|
+
Qt::MessageBox::Critical,
|
308
|
+
'Hardsploit unknown error',
|
309
|
+
'An unknown error has been detected. Check the log for more details.'
|
310
|
+
).exec
|
311
|
+
end
|
312
|
+
end
|