From 044d29220eef42be5091f3b48bfb8a4f22f61dc7 Mon Sep 17 00:00:00 2001 From: CATALPA <2209799148@qq.com> Date: Sat, 7 Oct 2023 20:47:47 +0800 Subject: [PATCH] Update v1.1 Add support for 7.4.1 VM64 --- gen_lic.py => main.py | 52 ++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 25 deletions(-) rename gen_lic.py => main.py (74%) diff --git a/gen_lic.py b/main.py similarity index 74% rename from gen_lic.py rename to main.py index 859d33d..9ab9540 100644 --- a/gen_lic.py +++ b/main.py @@ -1,5 +1,5 @@ """ -FortiGate license generator +FortiGate keygen v1.1 Copyright (C) 2023 CataLpa This program is free software: you can redistribute it and/or modify @@ -36,17 +36,25 @@ lic_key_array = { } class License: - aes_key_iv_length = 32 # 4 bytes - aes_key = b"\x61" * 32 # 32 bytes, contains iv(16 bytes) and key(16 bytes) - enc_data_length = None # 4 bytes - enc_data = None # length = enc_data_length + fixed_aes_key = b"\x4C\x7A\xD1\x3C\x95\x3E\xB5\xC1\x06\xDA\xFC\xC3\x90\xAE\x3E\xCB" + fixed_aes_iv = b"\x4C\x7A\xD1\x3C\x95\x3E\xB5\xC1\x06\xDA\xFC\xC3\x90\xAE\x3E\xCB" + fixed_rsa_header = b"\x78\x99\xBF\xA5\xEF\x56\xAA\x98\xC1\x0B\x87\x2E\x30\x8E\x54\xF9\x71\xAD\x13\xEA\xAA\xBC\xE2\x0C\xB3\xAE\x65\xAE\xF9\x0E\x9B\xD1\x88\xC7\xFE\xBC\x86\x65\xFE\xE7\x62\xDE\x43\x0B\x02\x15\x36\xC8\xC5\xCD\x0E\xB9\x01\x97\xCE\x82\x27\x0F\x69\x7F\x6A\x29\xEC\x1C" + + rsa_header_length = len(fixed_rsa_header) # 4 bytes + aes_key = fixed_aes_iv + fixed_aes_key # 32 bytes iv + key + enc_data_length = None + enc_data = None license_data = None - + + license_header = "-----BEGIN FGT VM LICENSE-----\r\n" + license_tail = "-----END FGT VM LICENSE-----\r\n" + def __init__(self, licensedata): self.license_data = licensedata def encrypt_data(self): tmp_buf = b"\x00" * 4 + struct.pack("