CrackNuts 0.0.3__tar.gz → 0.0.3.dev0__tar.gz
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.
- {cracknuts-0.0.3/src/cracknuts.egg-info → cracknuts-0.0.3.dev0}/PKG-INFO +1 -1
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/__init__.py +1 -1
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/cracker/basic_cracker.py +6 -28
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/cracker/cracker.py +9 -33
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/cracker/protocol.py +3 -3
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/cracker/stateful_cracker.py +2 -14
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0/src/cracknuts.egg-info}/PKG-INFO +1 -1
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/LICENSE +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/README.md +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/pyproject.toml +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/setup.cfg +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/__main__.py +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/acquisition/__init__.py +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/acquisition/acquisition.py +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/cracker/__init__.py +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/cracker/mock_cracker.py +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/logger.py +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/solver/__init__.py +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/solver/trace.py +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/utils/__init__.py +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts/utils/hex_util.py +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts.egg-info/SOURCES.txt +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts.egg-info/dependency_links.txt +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts.egg-info/entry_points.txt +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts.egg-info/requires.txt +0 -0
- {cracknuts-0.0.3 → cracknuts-0.0.3.dev0}/src/cracknuts.egg-info/top_level.txt +0 -0
|
@@ -337,34 +337,12 @@ class CrackerS1(AbsCnpCracker):
|
|
|
337
337
|
self._logger.debug(f"scrat_force payload: {payload}")
|
|
338
338
|
return self.send_with_command(Commands.OSC_FORCE, payload=payload)
|
|
339
339
|
|
|
340
|
-
def
|
|
341
|
-
payload = struct.pack(">
|
|
342
|
-
self._logger.debug(f"
|
|
343
|
-
return self.send_with_command(Commands.
|
|
344
|
-
|
|
345
|
-
def osc_set_sample_divisor(self, div_int: int, div_frac: int):
|
|
346
|
-
payload = struct.pack(">BH", div_int, div_frac)
|
|
347
|
-
self._logger.debug(f"osc_set_sample_divisor payload: {payload.hex()}")
|
|
348
|
-
return self.send_with_command(Commands.OSC_CLOCK_SAMPLE_DIVISOR, payload=payload)
|
|
340
|
+
def osc_set_sample_clock(self, clock: int):
|
|
341
|
+
payload = struct.pack(">I", clock)
|
|
342
|
+
self._logger.debug(f"scrat_sample_clock payload: {payload.hex()}")
|
|
343
|
+
return self.send_with_command(Commands.OSC_SAMPLE_CLOCK, payload=payload)
|
|
349
344
|
|
|
350
345
|
def osc_set_sample_phase(self, phase: int):
|
|
351
346
|
payload = struct.pack(">I", phase)
|
|
352
|
-
self._logger.debug(f"
|
|
353
|
-
return self.send_with_command(Commands.
|
|
354
|
-
|
|
355
|
-
def set_clock_nut_divisor(self, div: int):
|
|
356
|
-
payload = struct.pack(">B", div)
|
|
357
|
-
self._logger.debug(f"set_clock_nut_divisor payload: {payload.hex()}")
|
|
358
|
-
return self.send_with_command(Commands.OSC_CLOCK_NUT_DIVISOR, payload=payload)
|
|
359
|
-
|
|
360
|
-
# def osc_set_sample_clock(self, clock: int):
|
|
361
|
-
# # payload = struct.pack(">I", clock)
|
|
362
|
-
# # self._logger.debug(f"scrat_sample_clock payload: {payload.hex()}")
|
|
363
|
-
# # return self.send_with_command(Commands.OSC_SAMPLE_CLOCK, payload=payload)
|
|
364
|
-
# ...
|
|
365
|
-
#
|
|
366
|
-
# def osc_set_sample_phase(self, phase: int):
|
|
367
|
-
# # payload = struct.pack(">I", phase)
|
|
368
|
-
# # self._logger.debug(f"scrat_sample_phase payload: {payload.hex()}")
|
|
369
|
-
# # return self.send_with_command(Commands.OSC_SAMPLE_PHASE, payload=payload)
|
|
370
|
-
# ...
|
|
347
|
+
self._logger.debug(f"scrat_sample_phase payload: {payload.hex()}")
|
|
348
|
+
return self.send_with_command(Commands.OSC_SAMPLE_PHASE, payload=payload)
|
|
@@ -85,14 +85,6 @@ class Cracker(typing.Protocol):
|
|
|
85
85
|
|
|
86
86
|
def osc_set_sample_len(self, length: int): ...
|
|
87
87
|
|
|
88
|
-
def osc_set_clock_base_freq_mul_div(self, mult_int: int, mult_fra: int, div: int): ...
|
|
89
|
-
|
|
90
|
-
def osc_set_sample_divisor(self, div_int: int, div_frac: int): ...
|
|
91
|
-
|
|
92
|
-
def osc_set_sample_phase(self, phase: int): ...
|
|
93
|
-
|
|
94
|
-
def set_clock_nut_divisor(self, div: int): ...
|
|
95
|
-
|
|
96
88
|
def osc_single(self): ...
|
|
97
89
|
|
|
98
90
|
def osc_force(self): ...
|
|
@@ -107,9 +99,9 @@ class Cracker(typing.Protocol):
|
|
|
107
99
|
|
|
108
100
|
def osc_set_analog_gain_raw(self, channel: int, gain: int): ...
|
|
109
101
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
102
|
+
def osc_set_sample_clock(self, clock: int): ...
|
|
103
|
+
|
|
104
|
+
def osc_set_sample_phase(self, phase: int): ...
|
|
113
105
|
|
|
114
106
|
def nut_enable(self, enable: int): ...
|
|
115
107
|
|
|
@@ -175,14 +167,10 @@ class Commands:
|
|
|
175
167
|
OSC_ANALOG_VOLTAGE = 0x0102
|
|
176
168
|
OSC_ANALOG_BIAS_VOLTAGE = 0x0103
|
|
177
169
|
OSC_ANALOG_GAIN = 0x0104
|
|
178
|
-
OSC_ANALOG_GAIN_RAW =
|
|
179
|
-
OSC_CLOCK_BASE_FREQ_MUL_DIV = 0x0106
|
|
180
|
-
OSC_CLOCK_SAMPLE_DIVISOR = 0x0107
|
|
181
|
-
OSC_CLOCK_SAMPLE_PHASE = 0x0108
|
|
182
|
-
OSC_CLOCK_NUT_DIVISOR = 0x0109
|
|
170
|
+
OSC_ANALOG_GAIN_RAW = 0x0107
|
|
183
171
|
|
|
184
|
-
|
|
185
|
-
|
|
172
|
+
OSC_SAMPLE_CLOCK = 0x0105
|
|
173
|
+
OSC_SAMPLE_PHASE = 0x0106
|
|
186
174
|
|
|
187
175
|
OSC_DIGITAL_CHANNEL_ENABLE = 0x0110
|
|
188
176
|
OSC_DIGITAL_VOLTAGE = 0x0111
|
|
@@ -399,11 +387,11 @@ class AbsCnpCracker(ABC, Cracker):
|
|
|
399
387
|
resp_payload = self._recv(length)
|
|
400
388
|
if status >= protocol.STATUS_ERROR:
|
|
401
389
|
self._logger.error(
|
|
402
|
-
|
|
390
|
+
"Receive payload from {self._server_address}: \n{hex_util.get_bytes_matrix(resp_payload)}"
|
|
403
391
|
)
|
|
404
392
|
else:
|
|
405
393
|
self._logger.debug(
|
|
406
|
-
|
|
394
|
+
"Receive payload from {self._server_address}: \n{hex_util.get_bytes_matrix(resp_payload)}"
|
|
407
395
|
)
|
|
408
396
|
return status, resp_payload
|
|
409
397
|
except OSError as e:
|
|
@@ -517,23 +505,11 @@ class AbsCnpCracker(ABC, Cracker):
|
|
|
517
505
|
def osc_set_analog_gain_raw(self, channel: int, gain: int): ...
|
|
518
506
|
|
|
519
507
|
@abc.abstractmethod
|
|
520
|
-
def
|
|
521
|
-
|
|
522
|
-
@abc.abstractmethod
|
|
523
|
-
def osc_set_sample_divisor(self, div_int: int, div_frac: int): ...
|
|
508
|
+
def osc_set_sample_clock(self, clock: int): ...
|
|
524
509
|
|
|
525
510
|
@abc.abstractmethod
|
|
526
511
|
def osc_set_sample_phase(self, phase: int): ...
|
|
527
512
|
|
|
528
|
-
@abc.abstractmethod
|
|
529
|
-
def set_clock_nut_divisor(self, div: int): ...
|
|
530
|
-
|
|
531
|
-
# @abc.abstractmethod
|
|
532
|
-
# def osc_set_sample_clock(self, clock: int): ...
|
|
533
|
-
#
|
|
534
|
-
# @abc.abstractmethod
|
|
535
|
-
# def osc_set_sample_phase(self, phase: int): ...
|
|
536
|
-
|
|
537
513
|
@abc.abstractmethod
|
|
538
514
|
def nut_enable(self, enable: int): ...
|
|
539
515
|
|
|
@@ -4,7 +4,7 @@ __version__ = "1.0.0"
|
|
|
4
4
|
|
|
5
5
|
DEFAULT_PORT = 9761
|
|
6
6
|
|
|
7
|
-
MAGIC_STR = b"
|
|
7
|
+
MAGIC_STR = b"AHCC"
|
|
8
8
|
|
|
9
9
|
# ┌───────────────────────────────────────────┬───────┐
|
|
10
10
|
# │--------------Request Header---------------│-------│
|
|
@@ -12,7 +12,7 @@ MAGIC_STR = b"CRAK"
|
|
|
12
12
|
# │-------------------------------------------│-------│
|
|
13
13
|
# │ 4B │ 2B │ 1B │ 2B │2B │ 4B │$Length│
|
|
14
14
|
# │-------------------------------------------│-------│
|
|
15
|
-
# │'
|
|
15
|
+
# │'AHCC'│ 1 │ 'S' │ │ │ │ │
|
|
16
16
|
# └───────────────────────────────────────────┴───────┘
|
|
17
17
|
|
|
18
18
|
REQ_HEADER_FORMAT = ">4sH1sHHI"
|
|
@@ -24,7 +24,7 @@ REQ_HEADER_SIZE = struct.calcsize(REQ_HEADER_FORMAT)
|
|
|
24
24
|
# │--------------------------------------│-------│
|
|
25
25
|
# │ 4B │ 2B │ 1B │ 2B │ 4B │$Length│
|
|
26
26
|
# │--------------------------------------│-------│
|
|
27
|
-
# │'
|
|
27
|
+
# │'AHCC'│ 1 │ 'R' │ │ │ │
|
|
28
28
|
# └──────────────────────────────────────┴───────┘
|
|
29
29
|
|
|
30
30
|
RES_HEADER_FORMAT = ">4sH1sHI"
|
|
@@ -123,24 +123,12 @@ class StatefulCracker(Cracker):
|
|
|
123
123
|
def osc_force(self):
|
|
124
124
|
return self._cracker.osc_force()
|
|
125
125
|
|
|
126
|
-
def
|
|
127
|
-
return self._cracker.
|
|
128
|
-
|
|
129
|
-
def osc_set_sample_divisor(self, div_int: int, div_frac: int):
|
|
130
|
-
return self._cracker.osc_set_sample_divisor(div_int, div_frac)
|
|
126
|
+
def osc_set_sample_clock(self, clock: int):
|
|
127
|
+
return self._cracker.osc_set_sample_clock(clock)
|
|
131
128
|
|
|
132
129
|
def osc_set_sample_phase(self, phase: int):
|
|
133
130
|
return self._cracker.osc_set_sample_phase(phase)
|
|
134
131
|
|
|
135
|
-
def set_clock_nut_divisor(self, div: int):
|
|
136
|
-
return self._cracker.set_clock_nut_divisor(div)
|
|
137
|
-
|
|
138
|
-
# def osc_set_sample_clock(self, clock: int):
|
|
139
|
-
# return self._cracker.osc_set_sample_clock(clock)
|
|
140
|
-
#
|
|
141
|
-
# def osc_set_sample_phase(self, phase: int):
|
|
142
|
-
# return self._cracker.osc_set_sample_phase(phase)
|
|
143
|
-
|
|
144
132
|
def osc_single(self):
|
|
145
133
|
return self._cracker.osc_single()
|
|
146
134
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|