Skip to content

Commit

Permalink
Linux-based pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
krystalgamer committed Nov 3, 2023
1 parent 7c2b690 commit 4b7f93e
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 20 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/c-cpp.yml
@@ -0,0 +1,53 @@
name: C/C++ CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install deps
run: sudo apt install gcc-mingw-w64-i686 nasm libz-mingw-w64-dev
- name: Build texture loader
working-directory: ./texture_loader
run: make
- name: Build pkr extractor
working-directory: ./pkr_extractor
run: make
- name: Build psx extractor
working-directory: ./psx_extractor
run: make
- name: Build save editor
working-directory: ./save_editor
run: make
- name: Build texture repacker
working-directory: ./texture_repacker
run: make
- name: Arrange files
run: |
mkdir output
cd output
cp ../INSTRUCTIONS.txt .
cp ../THANKS.txt .
mkdir texture_loader
cp ../texture_loader/texture.dll texture_loader/binkw32.dll
cp ../texture_loader/sm2000.json texture_loader/.
mkdir pkr_extractor
cp ../pkr_extractor/pkr.exe pkr_extractor/.
mkdir psx_extractor
cp ../psx_extractor/psx.exe psx_extractor/.
mkdir save_editor
cp ../save_editor/save.exe save_editor/.
mkdir texture_repacker
cp ../texture_repacker/texture.exe texture_repacker/.
- uses: actions/upload-artifact@v3
with:
path: output

11 changes: 11 additions & 0 deletions INSTRUCTIONS.txt
@@ -0,0 +1,11 @@
Thanks for downloading this spidey-tools release!


To install the custom texture loader:
- Go to your Spider-Man installation
- Rename binkw32.dll to binkw32_.dll
- Copy the content of texture_loader/ into the directory



Other tools are Command Line Utilities so run then from Command Prompt or Powershell and inspect their output to learn more!
20 changes: 19 additions & 1 deletion README.md
@@ -1,8 +1,26 @@
# spidey-tools

## Introduction

These repository contains a set of tools and modifications for the Spider-Man video-game created by Neversoft.

## Repository structure

- `texture_loader` - started as just the custom texture loader but now contains all modifications
- `pkr_extractor` - extracts PKR files, CLI-based
- `psx_extractor` - extracts some PSX files, CLI-based
- `save_editor` - edits save files, CLI-based
- `texture_repacker` - repacks extracted textures from PSX files, CLI-based
- `texture_dat_vulnerability` - exploitation of buffer overflow in the game

- `load_from_disk` - original version of custom texture loader
- `gui` - TBA
- `trg`, `trg_disasm`, `trg_disassembler`, `trg_dumper` - attempts at writing a TRG dumper/disassembler




## Contributors

* krystalgamer - owner of the project
* ZedekThePlagueDoctor - added unsupported extraction palletes to psx_extractor, fixed wrong extraction of certain textures
* ZedekThePlagueDoctor - added unsupported extraction palletes to psx\_extractor, fixed wrong extraction of certain textures
8 changes: 8 additions & 0 deletions THANKS.txt
@@ -0,0 +1,8 @@
Here's a non extensive list of people that were part in a way or another of the community and supported my work during these years:

- Anganoff
- SolidSnake11
- Zedek
- amethystwraith / T.C Kral-Yusuf
- Xamer
- MegaStick
15 changes: 10 additions & 5 deletions pkr_extractor/Makefile
@@ -1,14 +1,19 @@
CC= gcc
CC=i686-w64-mingw32-gcc
STRIP=i686-w64-mingw32-strip
LIBS = -lz
OBJ = pkr.o walk.o extract.o
CFLAGS = -std=c11 -g -static
all: pkr
CFLAGS = -std=c11 -O2 -static

all: strip

strip: pkr
$(STRIP) pkr.exe

%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS) $(LIBS)

pkr: $(OBJ)
gcc -o $@ $^ $(CFLAGS) $(LIBS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

clean:
rm -rf *.o
rm -rf $(OBJ) pkr.exe
15 changes: 10 additions & 5 deletions psx_extractor/Makefile
@@ -1,14 +1,19 @@
CC= gcc
CC=i686-w64-mingw32-gcc
STRIP=i686-w64-mingw32-strip
LIBS =
OBJ = psx.o bmp.o
CFLAGS = -std=c11 -g -mno-ms-bitfields
all: psx
CFLAGS = -std=c11 -O2 -static -g -mno-ms-bitfields

all: strip

strip: psx
$(STRIP) psx.exe

%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS) $(LIBS)

psx: $(OBJ)
gcc -o $@ $^ $(CFLAGS) $(LIBS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

clean:
rm -rf *.o
rm -rf $(OBJ) psx.exe
15 changes: 10 additions & 5 deletions save_editor/Makefile
@@ -1,14 +1,19 @@
CC= gcc
CC=i686-w64-mingw32-gcc
STRIP=i686-w64-mingw32-strip
LIBS =
OBJ = save.o
CFLAGS = -std=c11 -g
all: save
CFLAGS = -std=c11 -g -O2 -static

all: strip

strip: save
$(STRIP) save.exe

%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS) $(LIBS)

save: $(OBJ)
gcc -o $@ $^ $(CFLAGS) $(LIBS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

clean:
rm -rf *.o
rm -rf $(OBJ) save.exe
13 changes: 9 additions & 4 deletions texture_repacker/Makefile
@@ -1,14 +1,19 @@
CC= gcc
CC=i686-w64-mingw32-gcc
STRIP=i686-w64-mingw32-strip
LIBS =
OBJ = texture.o bmp.o psx.o
CFLAGS = -std=c11 -g -mno-ms-bitfields
all: texture

all: strip

strip: texture
$(STRIP) texture.exe

%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS) $(LIBS)

texture: $(OBJ)
gcc -o $@ $^ $(CFLAGS) $(LIBS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

clean:
rm -rf *.o
rm -rf $(OBJ) texture.exe

0 comments on commit 4b7f93e

Please sign in to comment.