ps2pack stub: pass the launch arguments to the payload #4
Loading…
Reference in a new issue
No description provided.
Delete branch "stub-forward-args"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The packed program lost its launch arguments. The stub calls
SetupThreadon its own stack, so the kernel stores the launch arguments in the stub's buffer; the payload's ownSetupThreadthen gets nothing usable andargv[0]reads as garbage. For ps2link that meant the working directory fell back tohost:/andIPCONFIG.DATwas never found next to the ELF.The stub now keeps the arguments in its own buffer (behind a pid word, laid out as
struct sargs_start) and, after unpacking, starts the payload withExecPS2using them, like the stock ps2-packer stub.Checked in PCSX2 by printing the bytes of
argv[0]: unpackedhost:unpacked.elf; packed with the old stub01 00 00 ...; packed with this stubhost:packed-exec2.elf. On hardware, ps2link launched frommc0:/ABCnow getscwd=mc0:/ABCand passes the network tests.🤖 Generated with Claude Code