diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ff63621..8434d906 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,15 +70,14 @@ jobs: path: legobin key: legobin - - name: Build isledecomp library + - name: Install python packages shell: bash run: | - pip install tools/isledecomp + pip install -r tools/requirements.txt - name: Summarize Accuracy shell: bash run: | - pip install -r tools/reccmp/requirements.txt python3 tools/reccmp/reccmp.py -S ISLEPROGRESS.SVG --svg-icon tools/reccmp/isle.png -H ISLEPROGRESS.HTML legobin/ISLE.EXE build/ISLE.EXE build/ISLE.PDB . | tee ISLEPROGRESS.TXT python3 tools/reccmp/reccmp.py -S LEGO1PROGRESS.SVG -T 1929 --svg-icon tools/reccmp/lego1.png -H LEGO1PROGRESS.HTML legobin/LEGO1.DLL build/LEGO1.DLL build/LEGO1.PDB . | tee LEGO1PROGRESS.TXT diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 614317ab..1e6bd769 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -27,14 +27,13 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Build isledecomp library + - name: Install python libraries shell: bash run: | - pip install black pylint tools/isledecomp + pip install black pylint -r tools/requirements.txt - name: Run pylint and black shell: bash run: | - pip install -r tools/reccmp/requirements.txt pylint tools --ignore=build,tests black --check tools diff --git a/.github/workflows/order.yml b/.github/workflows/order.yml index 6a0ee029..d7ae315c 100644 --- a/.github/workflows/order.yml +++ b/.github/workflows/order.yml @@ -9,12 +9,11 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Build isledecomp library + - name: Install python libraries run: | - pip install tools/isledecomp + pip install -r tools/requirements.txt - name: Run checkorder.py run: | - pip install -r tools/checkorder/requirements.txt python3 tools/checkorder/checkorder.py --verbose --enforce ISLE python3 tools/checkorder/checkorder.py --verbose --enforce LEGO1 diff --git a/.gitignore b/.gitignore index 4e1970c2..72d6fef6 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,6 @@ ISLE.EXE LEGO1.DLL build/ *.swp -LEGO1PROGRESS.HTML -LEGO1PROGRESS.SVG +LEGO1PROGRESS.* +ISLEPROGRESS.* *.pyc diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 00000000..a5062a3f --- /dev/null +++ b/tools/README.md @@ -0,0 +1,39 @@ +# LEGO Island Decompilation Tools + +These are a set of Python tools for helping with the decomp project + +## Installing +Use pip to install the required packages: + +``` +pip install -r tools/requirements.txt +``` + +## reccmp +This is a script to compare the original EXE or DLL with a recpmpiled EXE or DLL, provided a .PDB file + +## verexp +This verifies exports by comparing the exports of an original DLL and the recompiled DLL + +## checkorder +This checks the order of C++ source and header files to make sure the functions are in order + +## Development +In order to keep the code clean and consistent, we use `pylint` and `black`: + +``` +pip install black pylint +``` +### To run pylint: +``` +pylint tools/ --ignore=build,tests,bin,lib +``` + +### To check code formatting without rewriting files: +``` +black --check tools/ +``` +### To apply code formatting: +``` +black tools/ +``` \ No newline at end of file diff --git a/tools/checkorder/checkorder.py b/tools/checkorder/checkorder.py index 0ca1d102..1ac8391f 100644 --- a/tools/checkorder/checkorder.py +++ b/tools/checkorder/checkorder.py @@ -67,7 +67,9 @@ def check_file(filename: str, verbose: bool = False) -> bool: def parse_args(test_args: list | None = None) -> dict: - p = argparse.ArgumentParser() + p = argparse.ArgumentParser( + description="Checks the source files to make sure the function offset comments are in order", + ) p.add_argument("target", help="The file or directory to check.") p.add_argument( "--enforce", diff --git a/tools/checkorder/requirements.txt b/tools/checkorder/requirements.txt deleted file mode 100644 index 176352a6..00000000 --- a/tools/checkorder/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -isledecomp \ No newline at end of file diff --git a/tools/reccmp/requirements.txt b/tools/requirements.txt similarity index 52% rename from tools/reccmp/requirements.txt rename to tools/requirements.txt index c7de0d0c..06c0bed3 100644 --- a/tools/reccmp/requirements.txt +++ b/tools/requirements.txt @@ -1,4 +1,5 @@ +tools/isledecomp capstone colorama isledecomp -pystache \ No newline at end of file +pystache