Nugget
Bare-metal libraries and examples for the original PlayStation
Loading...
Searching...
No Matches
Namespaces | Variables
mkimage.py File Reference

Namespaces

namespace  mkimage
 

Variables

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