From 969db768ae1b853c4c4ca27934851c6b7e8cbfad Mon Sep 17 00:00:00 2001 From: seiya-git Date: Mon, 1 Jan 2024 12:45:02 +0300 Subject: [PATCH] remove duplicate script --- py/nstools/lib/Hex.py | 39 ----------------------------------- py/nstools/lib/VerifyTools.py | 2 +- 2 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 py/nstools/lib/Hex.py diff --git a/py/nstools/lib/Hex.py b/py/nstools/lib/Hex.py deleted file mode 100644 index 16e766fe..00000000 --- a/py/nstools/lib/Hex.py +++ /dev/null @@ -1,39 +0,0 @@ -from string import ascii_letters, digits, punctuation - -def bufferToHex(buffer, start, count): - accumulator = '' - for item in range(count): - accumulator += '%02X' % buffer[start + item] + ' ' - return accumulator - -def bufferToAscii(buffer, start, count): - accumulator = '' - for item in range(count): - char = chr(buffer[start + item]) - if char in ascii_letters or \ - char in digits or \ - char in punctuation or \ - char == ' ': - accumulator += char - else: - accumulator += '.' - return accumulator - -def dump(data, size = 16): - bytesRead = len(data) - index = 0 - hexFormat = '{:'+str(size*3)+'}' - asciiFormat = '{:'+str(size)+'}' - - print() - while index < bytesRead: - - hex = bufferToHex(data, index, size) - ascii = bufferToAscii(data, index, size) - - print(hexFormat.format(hex), end='') - print('|',asciiFormat.format(ascii),'|') - - index += size - if bytesRead - index < size: - size = bytesRead - index diff --git a/py/nstools/lib/VerifyTools.py b/py/nstools/lib/VerifyTools.py index 1944e5bb..231c710e 100644 --- a/py/nstools/lib/VerifyTools.py +++ b/py/nstools/lib/VerifyTools.py @@ -9,10 +9,10 @@ import io +from nstools.nut import Hex from nstools.nut import Keys from nstools.nut import aes128 -from . import Hex from . import FsTools from . import Header, BlockDecompressorReader from .NcaKeys import getNcaModulusKey