mirror of
https://github.com/Mas0nShi/typoraCracker.git
synced 2023-07-10 13:41:20 +08:00
dev commits.
This commit is contained in:
@@ -44,13 +44,15 @@ def extract_file(from_path, to_path):
|
||||
subprocess.check_call(["innoextract", from_path, "-d", to_path])
|
||||
|
||||
|
||||
def patch_file(_key, _iv):
|
||||
patch_file_path = os.path.join(BASE_DIR, "../typora.py")
|
||||
fd = open(patch_file_path, "a+")
|
||||
content = fd.read()
|
||||
def patch_file(_key, _iv, to_dir):
|
||||
patch_file_path = os.path.join(BASE_DIR, "../exports/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}')")
|
||||
fd.write(content)
|
||||
save_dir = os.path.join(to_dir, "build")
|
||||
os.makedirs()
|
||||
open(os.path.join(to_dir, "typora.py"), "w").write(content)
|
||||
|
||||
|
||||
|
||||
def win_x64_run():
|
||||
@@ -68,7 +70,7 @@ def win_x64_run():
|
||||
key, iv = analysis.get_aes_key_and_iv(main_node_path)
|
||||
log.success("analysis done")
|
||||
|
||||
patch_file(key.hex(), iv.hex())
|
||||
patch_file(key.hex(), iv.hex(), basedir)
|
||||
log.success("patch done")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user