mirror of
https://github.com/Mas0nShi/typoraCracker.git
synced 2023-07-10 13:41:20 +08:00
dev commits.
This commit is contained in:
@@ -45,14 +45,17 @@ def extract_file(from_path, to_path):
|
||||
|
||||
|
||||
def patch_file(_key, _iv, to_dir):
|
||||
patch_file_path = os.path.join(BASE_DIR, "../exports/typora.py")
|
||||
exports_path = os.path.join(BASE_DIR, "../exports")
|
||||
save_dir = os.path.join(to_dir, "build")
|
||||
if not os.path.exists(save_dir):
|
||||
os.makedirs(save_dir)
|
||||
|
||||
subprocess.check_call(["cp", f"{exports_path}/*", save_dir])
|
||||
patch_file_path = os.path.join(save_dir, "typora.py")
|
||||
content = open(patch_file_path, "r").read()
|
||||
content = content.replace("{AES_KEY}", f"b''.fromhex('{_key}')")
|
||||
content = content.replace("{AES_IV}", f"b''.fromhex('{_iv}')")
|
||||
save_dir = os.path.join(to_dir, "build")
|
||||
os.makedirs()
|
||||
open(os.path.join(to_dir, "typora.py"), "w").write(content)
|
||||
|
||||
open(patch_file_path, "w").write(content)
|
||||
|
||||
|
||||
def win_x64_run():
|
||||
|
||||
Reference in New Issue
Block a user