mirror of
https://github.com/Mas0nShi/typoraCracker.git
synced 2023-07-10 13:41:20 +08:00
Merge remote-tracking branch 'origin/master'
# Conflicts: # auto-analysis/utils.py
This commit is contained in:
24
.github/workflows/manual.yml
vendored
24
.github/workflows/manual.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install innoextract -y
|
||||
python3 -m pip install loguru
|
||||
|
||||
- name: Check Latest Version
|
||||
- name: Check Latest Version (use win-x64)
|
||||
id: checkVersion
|
||||
run: |
|
||||
python3 auto-analysis/check_version.py
|
||||
@@ -84,7 +84,7 @@ jobs:
|
||||
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install innoextract cmake -y
|
||||
sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install innoextract cmake zip -y
|
||||
python3 -m pip install r2pipe loguru
|
||||
|
||||
- name: build radare2
|
||||
@@ -97,7 +97,8 @@ jobs:
|
||||
|
||||
run: |
|
||||
python3 auto-analysis/patch.py
|
||||
tar -zcvf auto-analysis/win/x64/build/typoraCracker.tar.gz auto-analysis/win/x64/build/*
|
||||
zip -rj auto-analysis/win/x64/build/typoraCracker.zip auto-analysis/win/x64/build/*
|
||||
zip -rj auto-analysis/win/x86/build/typoraCracker.zip auto-analysis/win/x86/build/*
|
||||
|
||||
- name: Check release version
|
||||
id: checkReleaseVersion
|
||||
@@ -123,13 +124,22 @@ jobs:
|
||||
core.setFailed(e.message);
|
||||
}
|
||||
|
||||
- name: Upload win x64 typora.py for typoraCracker
|
||||
- name: Upload win-x64
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: '${{ steps.checkReleaseVersion.outputs.upload_url }}'
|
||||
asset_path: '${{ github.workspace }}/auto-analysis/win/x64/build/typoraCracker.tar.gz'
|
||||
asset_name: 'typoraCracker-${{ needs.check_version.outputs.LATEST_VERSION }}-win-x64.tar.gz'
|
||||
asset_content_type: application/x-tgz
|
||||
asset_path: '${{ github.workspace }}/auto-analysis/win/x64/build/typoraCracker.zip'
|
||||
asset_name: 'typoraCracker-${{ needs.check_version.outputs.LATEST_VERSION }}-win-x64.zip'
|
||||
asset_content_type: application/zip
|
||||
|
||||
- name: Upload win-x86
|
||||
uses: actions/upload-release-asset@v1.0.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: '${{ steps.checkReleaseVersion.outputs.upload_url }}'
|
||||
asset_path: '${{ github.workspace }}/auto-analysis/win/x86/build/typoraCracker.zip'
|
||||
asset_name: 'typoraCracker-${{ needs.check_version.outputs.LATEST_VERSION }}-win-x86.zip'
|
||||
asset_content_type: application/zip
|
||||
|
||||
@@ -10,8 +10,11 @@ import subprocess
|
||||
import json
|
||||
import os
|
||||
|
||||
|
||||
# Usage:
|
||||
# innoextract
|
||||
#
|
||||
BASE_DIR = os.path.dirname(__file__)
|
||||
|
||||
DOWNLOAD_LINK = {
|
||||
"win": {
|
||||
"x86": "https://typora.io/windows/typora-setup-ia32.exe",
|
||||
@@ -54,7 +57,10 @@ def patch_file(_key, _iv, to_dir):
|
||||
open(patch_file_path, "w").write(content)
|
||||
|
||||
|
||||
def scheduler(func, basedir, link):
|
||||
def win_x64_run():
|
||||
from win.x64 import analysis
|
||||
basedir = os.path.join(BASE_DIR, "win/x64")
|
||||
link = DOWNLOAD_LINK["win"]["x64"]
|
||||
|
||||
download_path = os.path.join(basedir, os.path.basename(link))
|
||||
log.info(f"downloading from {link}")
|
||||
@@ -65,26 +71,24 @@ def scheduler(func, basedir, link):
|
||||
log.info("preparation stage completed")
|
||||
main_node_path = os.path.join(basedir, "app/resources/app.asar.unpacked/main.node")
|
||||
log.info("auto analysis start")
|
||||
key, iv = func.get_aes_key_and_iv(main_node_path)
|
||||
key, iv = analysis.get_aes_key_and_iv(main_node_path)
|
||||
log.success("analysis done")
|
||||
|
||||
patch_file(key.hex(), iv.hex(), basedir)
|
||||
log.success("patch done")
|
||||
|
||||
|
||||
def win_x64_run():
|
||||
from win.x64 import analysis
|
||||
dirs = os.path.join(BASE_DIR, "win/x64")
|
||||
url = DOWNLOAD_LINK["win"]["x64"]
|
||||
scheduler(func=analysis, basedir=dirs, link=url)
|
||||
|
||||
|
||||
def win_x86_run():
|
||||
from win.x86 import analysis
|
||||
dirs = os.path.join(BASE_DIR, "win/x86")
|
||||
url = DOWNLOAD_LINK["win"]["x86"]
|
||||
scheduler(func=analysis, basedir=dirs, link=url)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pass
|
||||
win_x64_run()
|
||||
|
||||
# hashString = open("LATEST_VERSION", "r").read()
|
||||
# if hashString == "":
|
||||
# log.info("not history for typora version")
|
||||
# exit()
|
||||
|
||||
# basedir = os.path.dirname(__file__)
|
||||
# for h1 in DOWNLOAD_LINK.keys():
|
||||
# h1dir = os.path.join(basedir, h1)
|
||||
# for h2 in DOWNLOAD_LINK.get(h1).keys():
|
||||
# h2dir = os.path.join(h1dir, h2)
|
||||
# print(h2dir)
|
||||
|
||||
Reference in New Issue
Block a user