aboutsummaryrefslogtreecommitdiff
path: root/projects/hsm/cryptech_upload
diff options
context:
space:
mode:
Diffstat (limited to 'projects/hsm/cryptech_upload')
-rwxr-xr-xprojects/hsm/cryptech_upload7
1 files changed, 5 insertions, 2 deletions
diff --git a/projects/hsm/cryptech_upload b/projects/hsm/cryptech_upload
index 0c18f25..aaa0f1c 100755
--- a/projects/hsm/cryptech_upload
+++ b/projects/hsm/cryptech_upload
@@ -44,7 +44,7 @@ import tarfile
import argparse
import platform
-from binascii import crc32
+from binascii import crc32, hexlify
FIRMWARE_CHUNK_SIZE = 4096
FPGA_CHUNK_SIZE = 4096
@@ -147,7 +147,10 @@ class ManagementPortAbstract(object):
data = struct.pack("<I", data)
self.send(data)
if self.args.debug:
- print("Wrote {!r}".format(data))
+ if numeric:
+ print("Wrote 0x{}".format(hexlify(data).decode("ascii")))
+ else:
+ print("Wrote {!r}".format(data))
def read(self):
res = b""