Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomiejduda committed Sep 6, 2022
1 parent 9cca666 commit e27adbf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
3 changes: 1 addition & 2 deletions DECRYPT_ALL.BAT
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo.

setlocal enabledelayedexpansion

set ENCRYPTION_KEY="431FEWJOTe-gecTW"
set ENCRYPTION_KEY="967d48e5-4124-4e"

echo Activating venv...
CALL .\venv\Scripts\activate.bat
Expand All @@ -32,4 +32,3 @@ python ".\jsc_pydecrypt_tool.py" "-d" !input_file! !ENCRYPTION_KEY! !output_file

echo Program has finished!
pause

18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Info

**JSC-PyDecrypt-Tool** is a Python program for decrypting and encrypting Cocos2d JSC files.
**JSC-PyDecrypt-Tool** is a Python program for decrypting Cocos2d JSC files.

# Building on Windows

1. Install **[Python 3.10.0](https://www.python.org/downloads/)**
2. Install **[PyCharm 2022.1 (Community Edition)](https://www.jetbrains.com/pycharm/download/#section=windows)**
3. Create virtualenv and activate it
- python3 -m venv \path\to\new\virtual\environment
- .\venv\Scripts\activate.bat
4. Install all libraries from requirements.txt
- pip3 install -r requirements.txt
5. Run the jsc_pydecrypt_tool.py file with proper command line arguments

NOTE: There is also "DECRYPT_ALL.BAT" script which can
be used for batch processing. Just set correct
encryption key, put your files inside "INPUT"
directory and run the script.
11 changes: 1 addition & 10 deletions jsc_pydecrypt_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import zlib
from typing import Optional
from zipfile import ZipFile, BadZipFile
from zipfile import BadZipFile, ZipFile

import xxtea
from reversebox.io_files.check_file import check_file
Expand Down Expand Up @@ -59,8 +59,6 @@ def export_data(
except BadZipFile as error:
logger.info("It is NOT a ZIP archive.")

# output_data = json.dumps(output_data, indent=4)

js_file = open(output_file_path, "wb")
js_file.write(output_data)

Expand All @@ -78,8 +76,6 @@ def main():
parser.add_argument("-d", "--decrypt", metavar=("<jsc_file_path>", "<encryption_key>", "<output_file_path>"),
type=str, nargs=3, required=False, help="Decrypt data")

# parser.add_argument("-e", "--encrypt", metavar=("<xml_file_path>", "<encryption_key>", "<eco_file_path>"),
# type=str, nargs=3, required=False, help="Encrypt data")
# fmt: on

if len(sys.argv) == 1:
Expand All @@ -93,11 +89,6 @@ def main():
if code != "OK":
logger.error(f"{code}: {status}")
sys.exit(-1)
# elif args.encrypt is not None:
# code, status = import_data(args.encrypt[0], args.encrypt[1], args.encrypt[2])
# if code != "OK":
# logger.error(f"{code}: {status}")
# sys.exit(-2)

logger.info("End of main... Program has been executed successfully!")
sys.exit(0)
Expand Down

0 comments on commit e27adbf

Please sign in to comment.