Revert "Extend LoadExecForKernel with real VSH loadexec/exit syscalls"

This reverts commit 510cfb421c.
This commit is contained in:
Henrik Rydgård
2026-08-07 16:01:27 +02:00
parent 9d61a82671
commit bb3862b37e
5 changed files with 19 additions and 135 deletions
+14 -22
View File
@@ -1776,10 +1776,7 @@ void __KernelLoadReset() {
__KernelInit();
}
// Shared by __KernelLoadExec (loading from a file) and __KernelLoadExecFromBuffer (loading
// from a buffer already in RAM, as used by the VSH's USB/WLAN game-push feature) - everything
// past the point where we have the executable's bytes in hand.
bool __KernelLoadExecFromPtr(const u8 *data, size_t size, const char *filename, u32 paramPtr, std::string *error_string) {
bool __KernelLoadExec(const char *filename, u32 paramPtr, std::string *error_string) {
SceKernelLoadExecParam param{};
auto paramData = PSPPointer<SceKernelLoadExecParam>::Create(paramPtr);
@@ -1804,7 +1801,18 @@ bool __KernelLoadExecFromPtr(const u8 *data, size_t size, const char *filename,
__KernelLoadReset();
PSPModule *module = __KernelLoadModule((u8 *)data, size, 0, filename, error_string);
std::vector<uint8_t> fileData;
if (pspFileSystem.ReadEntireFile(filename, fileData) < 0) {
ERROR_LOG(Log::Loader, "Failed to load executable %s - file doesn't exist", filename);
*error_string = StringFromFormat("Could not find executable %s", filename);
delete[] param_argp;
delete[] param_key;
__KernelShutdown();
return false;
}
size_t size = fileData.size();
PSPModule *module = __KernelLoadModule(fileData.data(), size, 0, filename, error_string);
if (!module || module->isFake) {
if (module) {
@@ -1864,22 +1872,6 @@ bool __KernelLoadExecFromPtr(const u8 *data, size_t size, const char *filename,
return true;
}
bool __KernelLoadExec(const char *filename, u32 paramPtr, std::string *error_string) {
std::vector<uint8_t> fileData;
if (pspFileSystem.ReadEntireFile(filename, fileData) < 0) {
ERROR_LOG(Log::Loader, "Failed to load executable %s - file doesn't exist", filename);
*error_string = StringFromFormat("Could not find executable %s", filename);
__KernelShutdown();
return false;
}
return __KernelLoadExecFromPtr(fileData.data(), fileData.size(), filename, paramPtr, error_string);
}
bool __KernelLoadExecFromBuffer(const u8 *data, size_t size, u32 paramPtr, std::string *error_string) {
return __KernelLoadExecFromPtr(data, size, "vshbuffer", paramPtr, error_string);
}
bool __KernelLoadGEDump(std::string_view base_filename, std::string *error_string) {
__KernelLoadReset();
@@ -2546,7 +2538,7 @@ static u32 sceKernelLoadModuleDNAS(const char *name, u32 flags)
return hleNoLog(0);
}
// Suspecting this is a badly brute-forced function name... Although, it's not entirely implausible. Buffer makes sense.
// Pretty sure this is a badly brute-forced function name...
SceUID sceKernelLoadModuleBufferUsbWlan(u32 size, u32 bufPtr, u32 flags, u32 lmoptionPtr)
{
if (flags != 0) {