mirror of
				https://github.com/SystemRage/py-kms.git
				synced 2025-11-01 02:59:19 +08:00 
			
		
		
		
	Add the logsize option
Add -S or --logsize to define a maximum size for the logs.
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user