Add the logsize option

Add -S or --logsize to define a maximum size for the logs.
This commit is contained in:
Pg 2019-03-30 21:28:51 +01:00
parent 83a59b3584
commit 96ac35104f
12 changed files with 165 additions and 119 deletions

View file

@ -9,6 +9,8 @@ from structure import Structure
from aes import AES
from formatText import shell_message, justify, byterize
logger = logging.getLogger('root')
# v4 AES Key
key = bytearray([0x05, 0x3D, 0x83, 0x07, 0xF9, 0xE5, 0xF0, 0x88, 0xEB, 0x5E, 0xA6, 0x68, 0x6C, 0xF0, 0x37, 0xC7, 0xE4, 0xEF, 0xD2, 0xD6])
@ -103,8 +105,8 @@ class kmsRequestV4(kmsBase):
## Debug stuff.
shell_message(nshell = 16)
response = byterize(response)
logging.debug("KMS V4 Response: \n%s\n" % justify(response.dump(print_to_stdout = False)))
logging.debug("KMS V4 Response Bytes: \n%s\n" % justify(binascii.b2a_hex(str(response).encode('latin-1')).decode('utf-8')))
logger.debug("KMS V4 Response: \n%s\n" % justify(response.dump(print_to_stdout = False)))
logger.debug("KMS V4 Response Bytes: \n%s\n" % justify(binascii.b2a_hex(str(response).encode('latin-1')).decode('utf-8')))
return str(response)
@ -122,7 +124,7 @@ class kmsRequestV4(kmsBase):
## Debug stuff.
shell_message(nshell = 10)
request = byterize(request)
logging.debug("Request V4 Data: \n%s\n" % justify(request.dump(print_to_stdout = False)))
logging.debug("Request V4: \n%s\n" % justify(binascii.b2a_hex(str(request).encode('latin-1')).decode('utf-8')))
logger.debug("Request V4 Data: \n%s\n" % justify(request.dump(print_to_stdout = False)))
logger.debug("Request V4: \n%s\n" % justify(binascii.b2a_hex(str(request).encode('latin-1')).decode('utf-8')))
return request