|
Nugget
Bare-metal libraries and examples for the original PlayStation
|
Variables | |
| int | FLASH_BASE = 0xBFC00000 |
| int | CAVE_BASE = 0xBFC40000 |
| int | CAVE_SIZE = 0x20000 |
| int | ENTRY_JUMP = 0xBFC00414 |
| int | STOCK_JUMP = 0x0BF01C60 |
| stock_path | |
| elf_path | |
| out_path | |
| int | objcopy = sys.argv[4] if len(sys.argv) > 4 else "mipsel-none-elf-objcopy" |
| stock = open(stock_path, "rb").read() | |
| int | off = ENTRY_JUMP - FLASH_BASE |
| check | |
| cave = open(tmp.name, "rb").read() | |
| int | readelf = objcopy.rsplit("objcopy", 1)[0] + "readelf" |
| header = subprocess.run([readelf, "-hlW", elf_path], capture_output=True, text=True, check=True).stdout | |
| entry = int(re.search(r"Entry point address:\s+0x([0-9a-f]+)", header).group(1), 16) | |
| list | loads |
| lo = min(p for p, s in loads) | |
| hi = max(p + s for p, s in loads) | |
| img = bytearray(stock) | |
| mkimage.cave = open(tmp.name, "rb").read() |
| int mkimage.CAVE_BASE = 0xBFC40000 |
| int mkimage.CAVE_SIZE = 0x20000 |
| mkimage.check |
| mkimage.elf_path |
| mkimage.entry = int(re.search(r"Entry point address:\s+0x([0-9a-f]+)", header).group(1), 16) |
| int mkimage.ENTRY_JUMP = 0xBFC00414 |
| int mkimage.FLASH_BASE = 0xBFC00000 |
| mkimage.header = subprocess.run([readelf, "-hlW", elf_path], capture_output=True, text=True, check=True).stdout |
| mkimage.img = bytearray(stock) |
| list mkimage.loads |
| int mkimage.off = ENTRY_JUMP - FLASH_BASE |
| mkimage.out_path |
| int mkimage.readelf = objcopy.rsplit("objcopy", 1)[0] + "readelf" |
| mkimage.stock = open(stock_path, "rb").read() |
| int mkimage.STOCK_JUMP = 0x0BF01C60 |
| mkimage.stock_path |