diff --git a/code/fillmem/fillmem.hexproj b/code/fillmem/fillmem.hexproj new file mode 100644 index 0000000..60fa908 Binary files /dev/null and b/code/fillmem/fillmem.hexproj differ diff --git a/readme.md b/readme.md index 3194f31..a33b00d 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,7 @@ A rest from the usual. ```ps1 scoop bucket add extras scoop install armips +scoop install lua ``` [pscx-redux](https://github.com/grumpycoders/pcsx-redux/): A collection of tools, research, hardware design, and libraries aiming at development and reverse engineering on the PlayStation 1. diff --git a/scripts/bin2exe.py b/scripts/bin2exe.py new file mode 100644 index 0000000..da6412c --- /dev/null +++ b/scripts/bin2exe.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python +from __future__ import print_function +import os +import sys +import struct +import math + +usage = ''' +python bin2exe.py infile outfile +''' + +def main(argv): + if len(argv) != 2: + print(usage, file=sys.stderr) + sys.exit(1) + + max_size = 0x200000 + infile_size = os.path.getsize(argv[0]) + if infile_size > max_size: + print("Error: Input file %s longer than %d bytes" % (argv[0], max_size), file=sys.stderr) + sys.exit(1) + + ofile = open(argv[1], 'wb') + + with open(argv[0], 'rb') as ifile: + # Write header + if sys.version_info >= (3, 0): + ofile.write(bytes('PS-X EXE', 'ascii')) + else: + ofile.write('PS-X EXE') + # Entry point + ofile.seek(0x10) + ofile.write(struct.pack('