diff --git a/stratosphere/loader/source/ldr_debug_monitor.cpp b/stratosphere/loader/source/ldr_debug_monitor.cpp index c614e04a5..2bdebbb80 100644 --- a/stratosphere/loader/source/ldr_debug_monitor.cpp +++ b/stratosphere/loader/source/ldr_debug_monitor.cpp @@ -18,6 +18,11 @@ Result DebugMonitorService::dispatch(IpcParsedCommand *r, IpcCommand *out_c, u32 break; } + if (r->Statics[0] == NULL) { + rc = 0xCE01; + break; + } + rc = add_title_to_launch_queue(((u64 *)in_rawdata)[0], (const char *)r->Statics[0], r->StaticSizes[0]); *out_raw_data_count = 4; diff --git a/stratosphere/loader/source/servicesession.hpp b/stratosphere/loader/source/servicesession.hpp index 19c1a522b..5f0aeb959 100644 --- a/stratosphere/loader/source/servicesession.hpp +++ b/stratosphere/loader/source/servicesession.hpp @@ -18,6 +18,7 @@ class ServiceSession : public IWaitable { ServiceServer *server; Handle server_handle; Handle client_handle; + char pointer_buffer[0x400]; public: ServiceSession(ServiceServer *s, Handle s_h, Handle c_h) : server(s), server_handle(s_h), client_handle(c_h) { this->service_object = new T(); @@ -57,6 +58,13 @@ class ServiceSession : public IWaitable { virtual Result handle_signaled(u64 timeout) { Result rc; int handle_index; + + /* Prepare pointer buffer... */ + IpcCommand c_for_reply; + ipcInitialize(&c_for_reply); + ipcAddRecvStatic(&c_for_reply, this->pointer_buffer, sizeof(this->pointer_buffer), 0); + ipcPrepareHeader(&c_for_reply, 0); + if (R_SUCCEEDED(rc = svcReplyAndReceive(&handle_index, &this->server_handle, 1, 0, timeout))) { if (handle_index != 0) { /* TODO: Panic? */ @@ -67,7 +75,7 @@ class ServiceSession : public IWaitable { u32 wordcount = 0; Result retval = 0; u32 *rawdata_start = cmdbuf; - + IpcParsedCommand r; IpcCommand c; @@ -76,7 +84,7 @@ class ServiceSession : public IWaitable { ipcInitialize(&c); retval = ipcParse(&r); - + if (R_SUCCEEDED(retval)) { rawdata_start = (u32 *)r.Raw; wordcount = r.RawSize;