hardsploit_gui 2.3 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -22
  3. data/Rakefile +1 -1
  4. data/bin/hardsploit_gui +3 -3
  5. data/lib/Firmwares/FPGA/I2C/I2C_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_I2C_INTERACT.rpd +0 -0
  6. data/lib/Firmwares/FPGA/PARALLEL/NO_MUX_PARALLEL_MEMORY/HARDSPLOIT_FIRMWARE_FPGA_NO_MUX_PARALLEL_MEMORY.rpd +0 -0
  7. data/lib/Firmwares/FPGA/SPI/SPI_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_SPI_INTERACT.rpd +0 -0
  8. data/lib/Firmwares/FPGA/SPI/SPI_SNIFFER/HARDSPLOIT_FIRMWARE_FPGA_SPI_SNIFFER.rpd +0 -0
  9. data/lib/Firmwares/FPGA/SWD/SWD_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_SWD_INTERACT.rpd +0 -0
  10. data/lib/Firmwares/FPGA/UART/UART_INTERACT/HARDSPLOIT_FIRMWARE_FPGA_UART_INTERACT.rpd +0 -0
  11. data/lib/Firmwares/FPGA/VersionFPGA.rb +5 -5
  12. data/lib/Firmwares/UC/VersionUC.rb +12 -12
  13. data/lib/HardsploitAPI/Core/HardsploitAPI.rb +210 -210
  14. data/lib/HardsploitAPI/Core/HardsploitAPI_CONSTANT.rb +150 -150
  15. data/lib/HardsploitAPI/Core/HardsploitAPI_ERROR.rb +109 -109
  16. data/lib/HardsploitAPI/Core/HardsploitAPI_FIRMWARE.rb +305 -305
  17. data/lib/HardsploitAPI/Core/HardsploitAPI_PROGRESS.rb +28 -28
  18. data/lib/HardsploitAPI/Core/HardsploitAPI_USB_COMMUNICATION.rb +166 -166
  19. data/lib/HardsploitAPI/Modules/I2C/HardsploitAPI_I2C.rb +356 -356
  20. data/lib/HardsploitAPI/Modules/NO_MUX_PARALLEL_MEMORY/HardsploitAPI_NO_MUX_PARALLEL_MEMORY.rb +206 -206
  21. data/lib/HardsploitAPI/Modules/NRF24L01/HardsploitAPI_NRF24L01.rb +306 -306
  22. data/lib/HardsploitAPI/Modules/SPI/HardsploitAPI_SPI.rb +340 -340
  23. data/lib/HardsploitAPI/Modules/SPI_SNIFFER/HardsploitAPI_SPI_SNIFFER.rb +83 -83
  24. data/lib/HardsploitAPI/Modules/SWD/HardsploitAPI_SWD.rb +367 -367
  25. data/lib/HardsploitAPI/Modules/SWD/HardsploitAPI_SWD_DEBUG.rb +89 -89
  26. data/lib/HardsploitAPI/Modules/SWD/HardsploitAPI_SWD_MEM_AP.rb +61 -61
  27. data/lib/HardsploitAPI/Modules/SWD/HardsploitAPI_SWD_STM32.rb +121 -121
  28. data/lib/HardsploitAPI/Modules/TEST/HardsploitAPI_TEST_INTERACT.rb +98 -98
  29. data/lib/HardsploitAPI/Modules/UART/HardsploitAPI_UART.rb +196 -196
  30. data/lib/Hardsploit_gui.rb +96 -96
  31. data/lib/LICENSE.txt +674 -674
  32. data/lib/README.md +22 -22
  33. data/lib/TRADEMARK +2 -2
  34. data/lib/class/Chip_editor.rb +304 -304
  35. data/lib/class/Chip_management.rb +496 -496
  36. data/lib/class/Command_editor.rb +216 -216
  37. data/lib/class/Command_table.rb +233 -233
  38. data/lib/class/Console.rb +26 -26
  39. data/lib/class/ErrorMsg.rb +312 -312
  40. data/lib/class/Export.rb +140 -140
  41. data/lib/class/Export_manager.rb +124 -124
  42. data/lib/class/Firmware.rb +70 -70
  43. data/lib/class/Generic_commands.rb +260 -260
  44. data/lib/class/{i2c → I2C}/I2c_command.rb +51 -51
  45. data/lib/class/{i2c → I2C}/I2c_export.rb +95 -95
  46. data/lib/class/{i2c → I2C}/I2c_import.rb +117 -117
  47. data/lib/class/{i2c → I2C}/I2c_scanner.rb +114 -114
  48. data/lib/class/{i2c → I2C}/I2c_settings.rb +148 -148
  49. data/lib/class/Import.rb +193 -193
  50. data/lib/class/{parallel → PARALLEL}/Parallel_export.rb +118 -118
  51. data/lib/class/{parallel → PARALLEL}/Parallel_import.rb +113 -113
  52. data/lib/class/{parallel → PARALLEL}/Parallel_settings.rb +81 -81
  53. data/lib/class/Progress_bar.rb +32 -32
  54. data/lib/class/{spi → SPI}/Spi_export.rb +108 -108
  55. data/lib/class/{spi → SPI}/Spi_import.rb +159 -159
  56. data/lib/class/{spi → SPI}/Spi_settings.rb +108 -108
  57. data/lib/class/{spi → SPI}/Spi_sniffer.rb +101 -101
  58. data/lib/class/Signal_mapper.rb +120 -120
  59. data/lib/class/Wire_helper.rb +230 -230
  60. data/lib/class/swd/Swd.rb +125 -125
  61. data/lib/class/swd/Swd_scanner.rb +121 -121
  62. data/lib/class/swd/Swd_settings.rb +76 -76
  63. data/lib/class/uart/Uart_baudrate.rb +62 -62
  64. data/lib/class/uart/Uart_console.rb +115 -115
  65. data/lib/class/uart/Uart_settings.rb +102 -102
  66. data/lib/db/associations.rb +138 -138
  67. data/lib/db/database.rb +4 -4
  68. data/lib/db/development.sqlite3 +0 -0
  69. data/lib/db/migrate/004_create_manufacturers.rb +13 -13
  70. data/lib/db/migrate/005_create_packages.rb +13 -13
  71. data/lib/db/migrate/006_create_chip_types.rb +11 -11
  72. data/lib/db/migrate/007_create_buses.rb +11 -11
  73. data/lib/db/migrate/008_create_signals.rb +14 -14
  74. data/lib/db/migrate/009_create_chips.rb +25 -25
  75. data/lib/db/migrate/010_create_commands.rb +21 -21
  76. data/lib/db/migrate/011_create_bytes.rb +19 -19
  77. data/lib/db/migrate/012_create_i2c_settings.rb +21 -21
  78. data/lib/db/migrate/013_create_spi_settings.rb +26 -26
  79. data/lib/db/migrate/014_create_parallel_settings.rb +21 -21
  80. data/lib/db/migrate/015_create_pins.rb +19 -19
  81. data/lib/db/migrate/016_create_uses.rb +17 -17
  82. data/lib/db/migrate/017_create_swd_settings.rb +19 -19
  83. data/lib/db/migrate/018_create_uart_settings.rb +22 -22
  84. data/lib/db/schema.rb +157 -157
  85. data/lib/db/seeds.rb +161 -161
  86. data/lib/gui/gui_chip_editor.rb +349 -349
  87. data/lib/gui/gui_chip_management.rb +377 -377
  88. data/lib/gui/gui_command_editor.rb +219 -219
  89. data/lib/gui/gui_export.rb +132 -132
  90. data/lib/gui/gui_export_manager.rb +93 -93
  91. data/lib/gui/gui_generic_commands.rb +202 -202
  92. data/lib/gui/gui_generic_export.rb +164 -164
  93. data/lib/gui/gui_generic_import.rb +142 -142
  94. data/lib/gui/gui_i2c_command.rb +116 -116
  95. data/lib/gui/gui_i2c_settings.rb +230 -230
  96. data/lib/gui/gui_import.rb +131 -131
  97. data/lib/gui/gui_parallel_settings.rb +195 -195
  98. data/lib/gui/gui_progress_bar.rb +85 -85
  99. data/lib/gui/gui_signal_mapper.rb +121 -121
  100. data/lib/gui/gui_signal_scanner.rb +146 -146
  101. data/lib/gui/gui_spi_import.rb +126 -126
  102. data/lib/gui/gui_spi_settings.rb +313 -313
  103. data/lib/gui/gui_spi_sniffer.rb +112 -112
  104. data/lib/gui/gui_swd_settings.rb +166 -166
  105. data/lib/gui/gui_uart_baudrate.rb +114 -114
  106. data/lib/gui/gui_uart_console.rb +164 -164
  107. data/lib/gui/gui_uart_settings.rb +243 -243
  108. data/lib/gui/gui_wire_helper.rb +99 -99
  109. data/lib/gui_designer/gui_chip_editor.ui +549 -549
  110. data/lib/gui_designer/gui_chip_management.ui +886 -886
  111. data/lib/gui_designer/gui_command_editor.ui +350 -350
  112. data/lib/gui_designer/gui_export.ui +171 -171
  113. data/lib/gui_designer/gui_export_manager.ui +115 -115
  114. data/lib/gui_designer/gui_generic_commands.ui +342 -342
  115. data/lib/gui_designer/gui_generic_export.ui +202 -202
  116. data/lib/gui_designer/gui_generic_import.ui +165 -165
  117. data/lib/gui_designer/gui_i2c_command.ui +148 -148
  118. data/lib/gui_designer/gui_i2c_settings.ui +292 -292
  119. data/lib/gui_designer/gui_import.ui +168 -168
  120. data/lib/gui_designer/gui_parallel_settings.ui +247 -247
  121. data/lib/gui_designer/gui_progress_bar.ui +86 -86
  122. data/lib/gui_designer/gui_signal_mapper.ui +179 -179
  123. data/lib/gui_designer/gui_signal_scanner.ui +261 -261
  124. data/lib/gui_designer/gui_spi_settings.ui +446 -446
  125. data/lib/gui_designer/gui_spi_sniffer.ui +156 -156
  126. data/lib/gui_designer/gui_swd_settings.ui +189 -189
  127. data/lib/gui_designer/gui_uart_baudrate.ui +161 -161
  128. data/lib/gui_designer/gui_uart_console.ui +284 -284
  129. data/lib/gui_designer/gui_uart_settings.ui +280 -280
  130. data/lib/gui_designer/gui_wire_helper.ui +117 -117
  131. data/lib/images/search.png +0 -0
  132. data/lib/logs/error.log +0 -63
  133. data/lib/models/bus.rb +19 -19
  134. data/lib/models/byte.rb +29 -29
  135. data/lib/models/chip.rb +41 -41
  136. data/lib/models/chip_type.rb +14 -14
  137. data/lib/models/command.rb +20 -20
  138. data/lib/models/i2c_setting.rb +41 -41
  139. data/lib/models/manufacturer.rb +14 -14
  140. data/lib/models/package.rb +26 -26
  141. data/lib/models/parallel_setting.rb +37 -37
  142. data/lib/models/pin.rb +14 -14
  143. data/lib/models/signall.rb +20 -20
  144. data/lib/models/spi_setting.rb +67 -67
  145. data/lib/models/swd_setting.rb +25 -25
  146. data/lib/models/uart_setting.rb +52 -52
  147. data/lib/models/use.rb +6 -6
  148. data/lib/startHardsploit.rb +10 -10
  149. metadata +14 -14
@@ -1,150 +1,150 @@
1
- #!/usr/bin/ruby
2
- #===================================================
3
- # Hardsploit API - By Opale Security
4
- # www.opale-security.com || www.hardsploit.io
5
- # License: GNU General Public License v3
6
- # License URI: http://www.gnu.org/licenses/gpl.txt
7
- #===================================================
8
-
9
- class HardsploitAPI
10
- public
11
-
12
- # Obtain signal Id
13
- # Params:
14
- # +signal+:: Name of signal you want obtain ud
15
- def self.getSignalId(signal:)
16
- wires = Hash.new
17
-
18
- #Parallel module
19
- wires["A0"] = 0
20
- wires["A1"] = 1
21
- wires["A2"] = 2
22
- wires["A3"] = 3
23
- wires["A4"] = 4
24
- wires["A5"] = 5
25
- wires["A6"] = 6
26
- wires["A7"] = 7
27
- wires["A8"] = 8
28
- wires["A9"] = 9
29
- wires["A10"] = 10
30
- wires["A11"] = 11
31
- wires["A12"] = 12
32
- wires["A13"] = 13
33
- wires["A14"] = 14
34
- wires["A15"] = 15
35
- wires["A16"] = 16
36
- wires["A17"] = 17
37
- wires["A18"] = 18
38
- wires["A19"] = 19
39
- wires["A20"] = 20
40
- wires["A21"] = 21
41
- wires["A22"] = 22
42
- wires["A23"] = 23
43
- wires["A24"] = 24
44
- wires["A25"] = 25
45
- wires["A26"] = 26
46
- wires["A27"] = 27
47
- wires["A28"] = 28
48
- wires["A29"] = 29
49
- wires["A30"] = 30
50
- wires["A31"] = 31
51
-
52
- wires["D0"] = 32
53
- wires["D1"] = 33
54
- wires["D2"] = 34
55
- wires["D3"] = 35
56
- wires["D4"] = 36
57
- wires["D5"] = 37
58
- wires["D6"] = 38
59
- wires["D7"] = 39
60
- wires["D8"] = 40
61
- wires["D9"] = 41
62
- wires["D10"] = 42
63
- wires["D11"] = 43
64
- wires["D12"] = 44
65
- wires["D13"] = 45
66
- wires["D14"] = 46
67
- wires["D15"] = 47
68
-
69
- wires["RST"] = 48
70
- wires["CE"] = 49
71
- wires["OE"] = 50
72
- wires["WE"] = 51
73
- wires["PARA_CLK"] = 52
74
- wires["WP"] = 53
75
- wires["ADV"] = 54
76
-
77
- #SPI module
78
- wires["SPI_CLK"] = 0
79
- wires["CS"] = 1
80
- wires["MOSI"] = 2
81
- wires["MISO"] = 3
82
- wires["PULSE"] = 4
83
-
84
- #I2C module
85
- wires["I2C_CLK"] = 0
86
- wires["SDA"] = 1
87
-
88
- #UART module
89
- wires["TX"] = 0
90
- wires["RX"] = 1
91
-
92
- #SWD module
93
- wires["SWD_CLK"] = 0
94
- wires["SWD_IO"] = 1
95
-
96
- return wires[signal]
97
- end
98
-
99
- # Power on the led for each signal specified
100
- # Params:
101
- # +signal+:: Name of signal you want visual help (set the led)
102
- def signalHelpingWiring(signal:)
103
- begin
104
- HardsploitAPI.instance.setWiringLeds(value:2**HardsploitAPI.crossWiringValue.index(HardsploitAPI.getSignalId(signal:signal)))
105
- rescue
106
- raise 'UNKNOWN SIGNAL'
107
- end
108
- end
109
-
110
- module USB_COMMAND
111
- GREEN_LED = 0
112
- RED_LED = 1
113
- LOOPBACK = 2
114
- ERASE_FIRMWARE = 3
115
- WRITE_PAGE_FIRMWARE = 4
116
- READ_PAGE_FIRMWARE = 5
117
- READ_ID_FLASH = 6
118
- START_FPGA = 7
119
- STOP_FPGA = 8
120
- FPGA_COMMAND = 9
121
- FPGA_DATA = 10
122
- STOP_FPGA_DATA = 11
123
- START_FPGA_DATA = 12
124
- GET_SERIAL_NUMBER = 13
125
- GET_VERSION_NUMBER = 14
126
- VCP_ERROR = 0xFFFF
127
- end
128
-
129
- module I2C
130
- KHZ_100 = 0
131
- KHZ_400 = 1
132
- KHZ_1000 = 2
133
- KHZ_40 = 3
134
- end
135
-
136
- module SPISniffer
137
- MOSI = 1
138
- MISO = 2
139
- MISO_MOSI = 3
140
- end
141
-
142
- module USB
143
- OUT_ENDPOINT = 0X02
144
- IN_ENDPOINT = 0X81
145
- USB_TRAME_SIZE = 8192
146
- end
147
- module VERSION
148
- API = "2.0.0"
149
- end
150
- end
1
+ #!/usr/bin/ruby
2
+ #===================================================
3
+ # Hardsploit API - By Opale Security
4
+ # www.opale-security.com || www.hardsploit.io
5
+ # License: GNU General Public License v3
6
+ # License URI: http://www.gnu.org/licenses/gpl.txt
7
+ #===================================================
8
+
9
+ class HardsploitAPI
10
+ public
11
+
12
+ # Obtain signal Id
13
+ # Params:
14
+ # +signal+:: Name of signal you want obtain ud
15
+ def self.getSignalId(signal:)
16
+ wires = Hash.new
17
+
18
+ #Parallel module
19
+ wires["A0"] = 0
20
+ wires["A1"] = 1
21
+ wires["A2"] = 2
22
+ wires["A3"] = 3
23
+ wires["A4"] = 4
24
+ wires["A5"] = 5
25
+ wires["A6"] = 6
26
+ wires["A7"] = 7
27
+ wires["A8"] = 8
28
+ wires["A9"] = 9
29
+ wires["A10"] = 10
30
+ wires["A11"] = 11
31
+ wires["A12"] = 12
32
+ wires["A13"] = 13
33
+ wires["A14"] = 14
34
+ wires["A15"] = 15
35
+ wires["A16"] = 16
36
+ wires["A17"] = 17
37
+ wires["A18"] = 18
38
+ wires["A19"] = 19
39
+ wires["A20"] = 20
40
+ wires["A21"] = 21
41
+ wires["A22"] = 22
42
+ wires["A23"] = 23
43
+ wires["A24"] = 24
44
+ wires["A25"] = 25
45
+ wires["A26"] = 26
46
+ wires["A27"] = 27
47
+ wires["A28"] = 28
48
+ wires["A29"] = 29
49
+ wires["A30"] = 30
50
+ wires["A31"] = 31
51
+
52
+ wires["D0"] = 32
53
+ wires["D1"] = 33
54
+ wires["D2"] = 34
55
+ wires["D3"] = 35
56
+ wires["D4"] = 36
57
+ wires["D5"] = 37
58
+ wires["D6"] = 38
59
+ wires["D7"] = 39
60
+ wires["D8"] = 40
61
+ wires["D9"] = 41
62
+ wires["D10"] = 42
63
+ wires["D11"] = 43
64
+ wires["D12"] = 44
65
+ wires["D13"] = 45
66
+ wires["D14"] = 46
67
+ wires["D15"] = 47
68
+
69
+ wires["RST"] = 48
70
+ wires["CE"] = 49
71
+ wires["OE"] = 50
72
+ wires["WE"] = 51
73
+ wires["PARA_CLK"] = 52
74
+ wires["WP"] = 53
75
+ wires["ADV"] = 54
76
+
77
+ #SPI module
78
+ wires["SPI_CLK"] = 0
79
+ wires["CS"] = 1
80
+ wires["MOSI"] = 2
81
+ wires["MISO"] = 3
82
+ wires["PULSE"] = 4
83
+
84
+ #I2C module
85
+ wires["I2C_CLK"] = 0
86
+ wires["SDA"] = 1
87
+
88
+ #UART module
89
+ wires["TX"] = 0
90
+ wires["RX"] = 1
91
+
92
+ #SWD module
93
+ wires["SWD_CLK"] = 0
94
+ wires["SWD_IO"] = 1
95
+
96
+ return wires[signal]
97
+ end
98
+
99
+ # Power on the led for each signal specified
100
+ # Params:
101
+ # +signal+:: Name of signal you want visual help (set the led)
102
+ def signalHelpingWiring(signal:)
103
+ begin
104
+ HardsploitAPI.instance.setWiringLeds(value:2**HardsploitAPI.crossWiringValue.index(HardsploitAPI.getSignalId(signal:signal)))
105
+ rescue
106
+ raise 'UNKNOWN SIGNAL'
107
+ end
108
+ end
109
+
110
+ module USB_COMMAND
111
+ GREEN_LED = 0
112
+ RED_LED = 1
113
+ LOOPBACK = 2
114
+ ERASE_FIRMWARE = 3
115
+ WRITE_PAGE_FIRMWARE = 4
116
+ READ_PAGE_FIRMWARE = 5
117
+ READ_ID_FLASH = 6
118
+ START_FPGA = 7
119
+ STOP_FPGA = 8
120
+ FPGA_COMMAND = 9
121
+ FPGA_DATA = 10
122
+ STOP_FPGA_DATA = 11
123
+ START_FPGA_DATA = 12
124
+ GET_SERIAL_NUMBER = 13
125
+ GET_VERSION_NUMBER = 14
126
+ VCP_ERROR = 0xFFFF
127
+ end
128
+
129
+ module I2C
130
+ KHZ_100 = 0
131
+ KHZ_400 = 1
132
+ KHZ_1000 = 2
133
+ KHZ_40 = 3
134
+ end
135
+
136
+ module SPISniffer
137
+ MOSI = 1
138
+ MISO = 2
139
+ MISO_MOSI = 3
140
+ end
141
+
142
+ module USB
143
+ OUT_ENDPOINT = 0X02
144
+ IN_ENDPOINT = 0X81
145
+ USB_TRAME_SIZE = 8192
146
+ end
147
+ module VERSION
148
+ API = "2.0.0"
149
+ end
150
+ end
@@ -1,109 +1,109 @@
1
- #!/usr/bin/ruby
2
- #===================================================
3
- # Hardsploit API - By Opale Security
4
- # www.opale-security.com || www.hardsploit.io
5
- # License: GNU General Public License v3
6
- # License URI: http://www.gnu.org/licenses/gpl.txt
7
- #===================================================
8
-
9
- class HardsploitAPI
10
- module ERROR
11
- class Standard < StandardError; end
12
-
13
- class HARDSPLOIT_NOT_FOUND < Standard
14
- def initialize(msg="HARDSPLOIT NOT FOUND")
15
- super(msg)
16
- end
17
- end
18
- class API_CROSS_WIRING < Standard
19
- def initialize(msg="The crossWiring array must be a 64 items array")
20
- super(msg)
21
- end
22
- end
23
- class API_SCANNER_WRONG_PIN_NUMBER < Standard
24
- def initialize(msg="You need to connect more thant pins needed by the module 2 for swd, 2 for I2C etc")
25
- super(msg)
26
- end
27
- end
28
- class FileIssue < Standard
29
- def initialize(msg="Issue with file")
30
- super(msg)
31
- end
32
- end
33
-
34
- class I2CWrongSpeed < Standard
35
- def initialize(msg="Uknown speed, speed must be KHZ_100 = 0, KHZ_400 = 1,KHZ_1000 = 2")
36
- super(msg)
37
- end
38
- end
39
- class SPIWrongPulse < Standard
40
- def initialize(msg="Wrong, Pulse must be 0 or 1")
41
- super(msg)
42
- end
43
- end
44
- class SPIWrongSpeed < Standard
45
- def initialize(msg="Speed must be between 3 and 255")
46
- super(msg)
47
- end
48
- end
49
- class SPIWrongMode < Standard
50
- def initialize(msg="Mode must be between 0 and 3")
51
- super(msg)
52
- end
53
- end
54
-
55
- class SPIWrongPayloadSize < Standard
56
- def initialize(msg="Size of the data need to be less than 4000")
57
- super(msg)
58
- end
59
- end
60
-
61
- class WrongStartAddress < Standard
62
- def initialize(msg="Start address can't be negative and not more than size max - 1")
63
- super(msg)
64
- end
65
- end
66
-
67
- class SpiError < Standard
68
- def initialize(msg="Error during SPI processing")
69
- super(msg)
70
- end
71
- end
72
-
73
- class USB_PACKET_IS_TOO_LARGE < Standard
74
- def initialize(msg="USB_PACKET_IS_TOO_LARGE")
75
- super(msg)
76
- end
77
- end
78
-
79
- class USB_ERROR < Standard
80
- def initialize(msg="USB ERROR")
81
- super(msg)
82
- end
83
- end
84
-
85
- class SWD_ERROR < Standard
86
- def initialize(msg="SWD ERROR, WAIT, FAUL, ACK or something like that")
87
- super(msg)
88
- end
89
- end
90
-
91
- class UART_WrongSettings < Standard
92
- def initialize(msg="Wrong UART settings")
93
- super(msg)
94
- end
95
- end
96
-
97
- class UART_WrongTxPayloadSize < Standard
98
- def initialize(msg="Wrong TX payload size")
99
- super(msg)
100
- end
101
- end
102
-
103
- class UART_WrongPayloadSize < Standard
104
- def initialize(msg="Size of the data need to be less than 4000")
105
- super(msg)
106
- end
107
- end
108
- end
109
- end
1
+ #!/usr/bin/ruby
2
+ #===================================================
3
+ # Hardsploit API - By Opale Security
4
+ # www.opale-security.com || www.hardsploit.io
5
+ # License: GNU General Public License v3
6
+ # License URI: http://www.gnu.org/licenses/gpl.txt
7
+ #===================================================
8
+
9
+ class HardsploitAPI
10
+ module ERROR
11
+ class Standard < StandardError; end
12
+
13
+ class HARDSPLOIT_NOT_FOUND < Standard
14
+ def initialize(msg="HARDSPLOIT NOT FOUND")
15
+ super(msg)
16
+ end
17
+ end
18
+ class API_CROSS_WIRING < Standard
19
+ def initialize(msg="The crossWiring array must be a 64 items array")
20
+ super(msg)
21
+ end
22
+ end
23
+ class API_SCANNER_WRONG_PIN_NUMBER < Standard
24
+ def initialize(msg="You need to connect more thant pins needed by the module 2 for swd, 2 for I2C etc")
25
+ super(msg)
26
+ end
27
+ end
28
+ class FileIssue < Standard
29
+ def initialize(msg="Issue with file")
30
+ super(msg)
31
+ end
32
+ end
33
+
34
+ class I2CWrongSpeed < Standard
35
+ def initialize(msg="Uknown speed, speed must be KHZ_100 = 0, KHZ_400 = 1,KHZ_1000 = 2")
36
+ super(msg)
37
+ end
38
+ end
39
+ class SPIWrongPulse < Standard
40
+ def initialize(msg="Wrong, Pulse must be 0 or 1")
41
+ super(msg)
42
+ end
43
+ end
44
+ class SPIWrongSpeed < Standard
45
+ def initialize(msg="Speed must be between 3 and 255")
46
+ super(msg)
47
+ end
48
+ end
49
+ class SPIWrongMode < Standard
50
+ def initialize(msg="Mode must be between 0 and 3")
51
+ super(msg)
52
+ end
53
+ end
54
+
55
+ class SPIWrongPayloadSize < Standard
56
+ def initialize(msg="Size of the data need to be less than 4000")
57
+ super(msg)
58
+ end
59
+ end
60
+
61
+ class WrongStartAddress < Standard
62
+ def initialize(msg="Start address can't be negative and not more than size max - 1")
63
+ super(msg)
64
+ end
65
+ end
66
+
67
+ class SpiError < Standard
68
+ def initialize(msg="Error during SPI processing")
69
+ super(msg)
70
+ end
71
+ end
72
+
73
+ class USB_PACKET_IS_TOO_LARGE < Standard
74
+ def initialize(msg="USB_PACKET_IS_TOO_LARGE")
75
+ super(msg)
76
+ end
77
+ end
78
+
79
+ class USB_ERROR < Standard
80
+ def initialize(msg="USB ERROR")
81
+ super(msg)
82
+ end
83
+ end
84
+
85
+ class SWD_ERROR < Standard
86
+ def initialize(msg="SWD ERROR, WAIT, FAUL, ACK or something like that")
87
+ super(msg)
88
+ end
89
+ end
90
+
91
+ class UART_WrongSettings < Standard
92
+ def initialize(msg="Wrong UART settings")
93
+ super(msg)
94
+ end
95
+ end
96
+
97
+ class UART_WrongTxPayloadSize < Standard
98
+ def initialize(msg="Wrong TX payload size")
99
+ super(msg)
100
+ end
101
+ end
102
+
103
+ class UART_WrongPayloadSize < Standard
104
+ def initialize(msg="Size of the data need to be less than 4000")
105
+ super(msg)
106
+ end
107
+ end
108
+ end
109
+ end