mirror of
https://github.com/Mas0nShi/typoraCracker.git
synced 2023-07-10 13:41:20 +08:00
Compare commits
59 Commits
auto-analy
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ac472a198 | ||
|
|
c3ed1499cc | ||
|
|
637bc99b44 | ||
|
|
d294746a36 | ||
|
|
db41e7942c | ||
|
|
d8f253e0c8 | ||
|
|
19e73b6c79 | ||
|
|
e6b6d7a9e1 | ||
|
|
ea2e2b479c | ||
|
|
e562f37282 | ||
|
|
b8726b62ae | ||
|
|
e6d3d5aaff | ||
|
|
2e5bfcfb50 | ||
|
|
bab9df1f5f | ||
|
|
1c701eb7ae | ||
|
|
df4320c481 | ||
|
|
37cb084073 | ||
|
|
ce93881acd | ||
|
|
8659ad77d8 | ||
|
|
591853fd67 | ||
|
|
8df8b7f18e | ||
|
|
6968976033 | ||
|
|
b582671923 | ||
|
|
ff414f6d79 | ||
|
|
3643ec2de3 | ||
|
|
a312537aa2 | ||
|
|
97a4f578b6 | ||
|
|
df5bb4473f | ||
|
|
facaed285a | ||
|
|
c984fd06c0 | ||
|
|
b8f870e55f | ||
|
|
4d635ec11f | ||
|
|
2d106c7e48 | ||
|
|
8f070902e0 | ||
|
|
f9bb673a51 | ||
|
|
8ee3a91b18 | ||
|
|
c262491d67 | ||
|
|
2ff0a25c1f | ||
|
|
785b3bcd49 | ||
|
|
40a95424b0 | ||
|
|
cd28ff03d9 | ||
|
|
7aaba1739a | ||
|
|
7d73c08257 | ||
|
|
d2fd9f12bf | ||
|
|
142367e963 | ||
|
|
7e1916e8e9 | ||
|
|
fe77785833 | ||
|
|
53a9057a2c | ||
|
|
1df0199b91 | ||
|
|
9b298bc024 | ||
|
|
029a4a344f | ||
|
|
3e690f077d | ||
|
|
5c518c7ab8 | ||
|
|
fc578afd40 | ||
|
|
4b3cfee43f | ||
|
|
9369288989 | ||
|
|
d90f36ba80 | ||
|
|
6c5039c632 | ||
|
|
f44e9355fb |
22
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
22
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
- OS: [e.g. Ubuntu]
|
||||||
|
- Version [e.g. 1.1.2]
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
166
.github/workflows/manual.yml
vendored
Normal file
166
.github/workflows/manual.yml
vendored
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
# This is a basic workflow that is manually triggered
|
||||||
|
|
||||||
|
name: Automatic analysis
|
||||||
|
|
||||||
|
# Controls when the action will run. Workflow runs when manually triggered using the UI
|
||||||
|
# or API.
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '23 21 * * 1'
|
||||||
|
|
||||||
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
jobs:
|
||||||
|
# This workflow contains a single job called "greet"
|
||||||
|
check_version:
|
||||||
|
name: check the latest version
|
||||||
|
# The type of runner that the job will run on
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
outputs:
|
||||||
|
RELEASE_VERSION: ${{ steps.getLatestRelease.outputs.RELEASE_VERSION }}
|
||||||
|
LATEST_VERSION: ${{ steps.checkVersion.outputs.LATEST_VERSION }}
|
||||||
|
steps:
|
||||||
|
- name: Get Latest Release
|
||||||
|
id: getLatestRelease
|
||||||
|
uses: actions/github-script@v3.1.0
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
const releaseResponse = await github.repos.getLatestRelease({
|
||||||
|
owner: 'Mas0nShi',
|
||||||
|
repo: 'typoraCracker',
|
||||||
|
})
|
||||||
|
const {
|
||||||
|
data: { tag_name: ver }
|
||||||
|
} = releaseResponse;
|
||||||
|
core.setOutput('RELEASE_VERSION', ver);
|
||||||
|
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: '3.8' # Version range or exact version of a Python version to use, using SemVer's version range syntax
|
||||||
|
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 -y
|
||||||
|
python3 -m pip install loguru
|
||||||
|
|
||||||
|
- name: Check Latest Version (use win-x64)
|
||||||
|
id: checkVersion
|
||||||
|
run: |
|
||||||
|
python3 auto-analysis/check_version.py
|
||||||
|
output="$(cat auto-analysis/win/x64/LATEST_VERSION)"
|
||||||
|
echo "$output"
|
||||||
|
echo "::set-output name=LATEST_VERSION::$output"
|
||||||
|
|
||||||
|
create_release:
|
||||||
|
needs: check_version
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
if: needs.check_version.outputs.RELEASE_VERSION != needs.check_version.outputs.LATEST_VERSION
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- run: echo '${{ needs.check_version.outputs.LATEST_VERSION }}'
|
||||||
|
|
||||||
|
- name: Create Runner Release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
id: createRelease
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: '${{ needs.check_version.outputs.LATEST_VERSION }}'
|
||||||
|
release_name: '${{ needs.check_version.outputs.LATEST_VERSION }}'
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
|
||||||
|
patch_file:
|
||||||
|
needs: [check_version, create_release]
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
if: needs.check_version.outputs.RELEASE_VERSION != needs.check_version.outputs.LATEST_VERSION
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: '3.8'
|
||||||
|
architecture: 'x64'
|
||||||
|
- name: install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install innoextract zip -y
|
||||||
|
python3 -m pip install r2pipe loguru
|
||||||
|
- name: build radare2
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/radareorg/radare2
|
||||||
|
radare2/sys/install.sh
|
||||||
|
- name: patch version
|
||||||
|
run: |
|
||||||
|
python3 auto-analysis/patch.py
|
||||||
|
|
||||||
|
zip -rjq auto-analysis/win/x64/build/typoraCracker.zip auto-analysis/win/x64/build/*
|
||||||
|
zip -rjq auto-analysis/win/x86/build/typoraCracker.zip auto-analysis/win/x86/build/*
|
||||||
|
zip -rjq auto-analysis/linux/x64/build/typoraCracker.zip auto-analysis/linux/x64/build/*
|
||||||
|
|
||||||
|
- name: Check release version
|
||||||
|
id: checkReleaseVersion
|
||||||
|
uses: actions/github-script@v3.1.0
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
try {
|
||||||
|
const releaseVersion = '${{ needs.check_version.outputs.LATEST_VERSION }}'
|
||||||
|
const releaseResponse = await github.repos.getReleaseByTag({
|
||||||
|
owner: 'Mas0nShi',
|
||||||
|
repo: 'typoraCracker',
|
||||||
|
tag: releaseVersion
|
||||||
|
})
|
||||||
|
const {
|
||||||
|
data: { id: releaseId, html_url: htmlUrl, upload_url: uploadUrl }
|
||||||
|
} = releaseResponse;
|
||||||
|
core.setOutput('id', releaseId);
|
||||||
|
core.setOutput('html_url', htmlUrl);
|
||||||
|
core.setOutput('upload_url', uploadUrl);
|
||||||
|
core.setOutput('version', releaseVersion);
|
||||||
|
} catch (e) {
|
||||||
|
core.setFailed(e.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
- 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.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
|
||||||
|
|
||||||
|
- name: Upload linux-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/linux/x64/build/typoraCracker.zip'
|
||||||
|
asset_name: 'typoraCracker-${{ needs.check_version.outputs.LATEST_VERSION }}-linux-x64.zip'
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: verify scripts
|
||||||
|
run: |
|
||||||
|
python3 -m pip install -r auto-analysis/win/x64/build/requirements.txt
|
||||||
|
|
||||||
|
python3 auto-analysis/win/x64/build/typora.py auto-analysis/win/x64/app/resources/app.asar auto-analysis/win/x64
|
||||||
|
echo "win x64 test completed"
|
||||||
|
python3 auto-analysis/win/x86/build/typora.py auto-analysis/win/x86/app/resources/app.asar auto-analysis/win/x86
|
||||||
|
echo "win x86 test completed"
|
||||||
|
python3 auto-analysis/linux/x64/build/typora.py auto-analysis/linux/x64/bin/Typora-linux-x64/resources/app.asar auto-analysis/linux/x64
|
||||||
|
echo "linux x64 test completed"
|
||||||
11
README.md
11
README.md
@@ -3,10 +3,19 @@
|
|||||||
|
|
||||||
# typora Cracker
|
# typora Cracker
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
[](https://github.com/Mas0nShi/typoraCracker/actions/workflows/manual.yml)
|
[](https://github.com/Mas0nShi/typoraCracker/actions/workflows/manual.yml)
|
||||||
|
|
||||||
|
|
||||||
A extract & decryption and pack & encryption tools for typora.
|
A extract & decryption and pack & encryption tools for typora.
|
||||||
|
|
||||||
中文说明请戳[这里](README_CN.md)
|
中文说明请戳[这里](README_CN.md)
|
||||||
@@ -30,7 +39,7 @@ ANY PROBLEMS ARISING FROM THIS WILL BE BORNE BY THE USER (YOU).
|
|||||||
| OS / ARCH | x86 | x64 | arm64 |
|
| OS / ARCH | x86 | x64 | arm64 |
|
||||||
|:---------:|:---:|:---:|:-----:|
|
|:---------:|:---:|:---:|:-----:|
|
||||||
| win | ✅ | ✅ | ❌ |
|
| win | ✅ | ✅ | ❌ |
|
||||||
| linux | ❌ | ❌ | ❌ |
|
| linux | ⛔ | ✅ | ❌ |
|
||||||
| macOS | ❌ | ❌ | ❌ |
|
| macOS | ❌ | ❌ | ❌ |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
| OS / ARCH | x86 | x64 | arm64 |
|
| OS / ARCH | x86 | x64 | arm64 |
|
||||||
|:---------:|:---:|:---:|:-----:|
|
|:---------:|:---:|:---:|:-----:|
|
||||||
| win | ✅ | ✅ | ❌ |
|
| win | ✅ | ✅ | ❌ |
|
||||||
| linux | ❌ | ❌ | ❌ |
|
| linux | ⛔ | ✅ | ❌ |
|
||||||
| macOS | ❌ | ❌ | ❌ |
|
| macOS | ❌ | ❌ | ❌ |
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,4 +17,9 @@ DOWNLOAD_LINK = {
|
|||||||
"x64": "https://download.typora.io/linux/Typora-linux-x64.tar.gz",
|
"x64": "https://download.typora.io/linux/Typora-linux-x64.tar.gz",
|
||||||
"arm64": "https://download.typora.io/linux/Typora-linux-arm64.tar.gz",
|
"arm64": "https://download.typora.io/linux/Typora-linux-arm64.tar.gz",
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
EXTRACT_ROOT_PATH = {
|
||||||
|
"win": "app",
|
||||||
|
"linux": "bin/Typora-linux-x64"
|
||||||
}
|
}
|
||||||
@@ -6,12 +6,11 @@
|
|||||||
@Desc: It's all about getting better.
|
@Desc: It's all about getting better.
|
||||||
"""
|
"""
|
||||||
from loguru import logger as log
|
from loguru import logger as log
|
||||||
from config import DOWNLOAD_LINK
|
from config import DOWNLOAD_LINK, EXTRACT_ROOT_PATH
|
||||||
import subprocess
|
import subprocess
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
BASE_DIR = os.path.dirname(__file__)
|
BASE_DIR = os.path.dirname(__file__)
|
||||||
|
|
||||||
|
|
||||||
@@ -23,11 +22,14 @@ def get_version(to_path):
|
|||||||
|
|
||||||
|
|
||||||
def download_file(from_link, to_path):
|
def download_file(from_link, to_path):
|
||||||
subprocess.check_call(["wget", from_link, "-O", to_path])
|
subprocess.check_call(["wget", "-q", from_link, "-O", to_path])
|
||||||
|
|
||||||
|
|
||||||
def extract_file(from_path, to_path):
|
def extract_file(from_path, to_path):
|
||||||
subprocess.check_call(["innoextract", from_path, "-d", to_path])
|
if from_path.endswith(".exe"):
|
||||||
|
subprocess.check_call(["innoextract", "-q", from_path, "-d", to_path])
|
||||||
|
elif from_path.endswith(".tar.gz"):
|
||||||
|
subprocess.check_call(["tar", "-zxvf", from_path, "-C", to_path])
|
||||||
|
|
||||||
|
|
||||||
def patch_file(_key, _iv, to_dir):
|
def patch_file(_key, _iv, to_dir):
|
||||||
@@ -44,8 +46,7 @@ def patch_file(_key, _iv, to_dir):
|
|||||||
open(patch_file_path, "w").write(content)
|
open(patch_file_path, "w").write(content)
|
||||||
|
|
||||||
|
|
||||||
def scheduler(func, basedir, link):
|
def scheduler(func, basedir, link, root_path):
|
||||||
|
|
||||||
download_path = os.path.join(basedir, os.path.basename(link))
|
download_path = os.path.join(basedir, os.path.basename(link))
|
||||||
log.info(f"downloading from {link}")
|
log.info(f"downloading from {link}")
|
||||||
download_file(link, download_path)
|
download_file(link, download_path)
|
||||||
@@ -53,7 +54,8 @@ def scheduler(func, basedir, link):
|
|||||||
|
|
||||||
extract_file(download_path, basedir)
|
extract_file(download_path, basedir)
|
||||||
log.info("preparation stage completed")
|
log.info("preparation stage completed")
|
||||||
main_node_path = os.path.join(basedir, "app/resources/app.asar.unpacked/main.node")
|
|
||||||
|
main_node_path = os.path.join(basedir, os.path.join(root_path, "resources/app.asar.unpacked/main.node"))
|
||||||
log.info("auto analysis start")
|
log.info("auto analysis start")
|
||||||
key, iv = func.get_aes_key_and_iv(main_node_path)
|
key, iv = func.get_aes_key_and_iv(main_node_path)
|
||||||
log.success("analysis done")
|
log.success("analysis done")
|
||||||
@@ -66,21 +68,21 @@ def win_x64_run():
|
|||||||
from win.x64 import analysis
|
from win.x64 import analysis
|
||||||
dirs = os.path.join(BASE_DIR, "win/x64")
|
dirs = os.path.join(BASE_DIR, "win/x64")
|
||||||
url = DOWNLOAD_LINK["win"]["x64"]
|
url = DOWNLOAD_LINK["win"]["x64"]
|
||||||
scheduler(func=analysis, basedir=dirs, link=url)
|
scheduler(func=analysis, basedir=dirs, link=url, root_path=EXTRACT_ROOT_PATH["win"])
|
||||||
|
|
||||||
|
|
||||||
def win_x86_run():
|
def win_x86_run():
|
||||||
from win.x86 import analysis
|
from win.x86 import analysis
|
||||||
dirs = os.path.join(BASE_DIR, "win/x86")
|
dirs = os.path.join(BASE_DIR, "win/x86")
|
||||||
url = DOWNLOAD_LINK["win"]["x86"]
|
url = DOWNLOAD_LINK["win"]["x86"]
|
||||||
scheduler(func=analysis, basedir=dirs, link=url)
|
scheduler(func=analysis, basedir=dirs, link=url, root_path=EXTRACT_ROOT_PATH["win"])
|
||||||
|
|
||||||
|
|
||||||
def linux_x64_run():
|
def linux_x64_run():
|
||||||
from linux.x64 import analysis
|
from linux.x64 import analysis
|
||||||
dirs = os.path.join(BASE_DIR, "linux/x64")
|
dirs = os.path.join(BASE_DIR, "linux/x64")
|
||||||
url = DOWNLOAD_LINK["linux"]["x64"]
|
url = DOWNLOAD_LINK["linux"]["x64"]
|
||||||
scheduler(func=analysis, basedir=dirs, link=url)
|
scheduler(func=analysis, basedir=dirs, link=url, root_path=EXTRACT_ROOT_PATH["linux"])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
BIN
exports.tar.gz
BIN
exports.tar.gz
Binary file not shown.
Reference in New Issue
Block a user