set.mitm: mitm everything
We still only lie about firmware version to qlaunch/maintenance. This is to prepare for loading settings off of the SD card.
This commit is contained in:
@@ -18,9 +18,17 @@
|
||||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
#include "setsys_shim.h"
|
||||
|
||||
enum SetSysCmd : u32 {
|
||||
SetSysCmd_GetFirmwareVersion = 3,
|
||||
SetSysCmd_GetFirmwareVersion2 = 4,
|
||||
SetSysCmd_GetSettingsItemValueSize = 37,
|
||||
SetSysCmd_GetSettingsItemValue = 38,
|
||||
|
||||
/* Commands for which set:sys *must* act as a passthrough. */
|
||||
/* TODO: Solve the relevant IPC detection problem. */
|
||||
SetSysCmd_GetEdid = 41,
|
||||
};
|
||||
|
||||
class SetSysMitmService : public IMitmServiceObject {
|
||||
@@ -30,8 +38,8 @@ class SetSysMitmService : public IMitmServiceObject {
|
||||
}
|
||||
|
||||
static bool ShouldMitm(u64 pid, u64 tid) {
|
||||
/* Only MitM qlaunch, maintenance. */
|
||||
return tid == 0x0100000000001000ULL || tid == 0x0100000000001015ULL;
|
||||
/* Mitm everything. */
|
||||
return true;
|
||||
}
|
||||
|
||||
static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx);
|
||||
@@ -40,9 +48,18 @@ class SetSysMitmService : public IMitmServiceObject {
|
||||
/* Overridden commands. */
|
||||
Result GetFirmwareVersion(OutPointerWithServerSize<SetSysFirmwareVersion, 0x1> out);
|
||||
Result GetFirmwareVersion2(OutPointerWithServerSize<SetSysFirmwareVersion, 0x1> out);
|
||||
Result GetSettingsItemValueSize(Out<u64> out_size, InPointer<char> name, InPointer<char> key);
|
||||
Result GetSettingsItemValue(Out<u64> out_size, OutBuffer<u8> out_value, InPointer<char> name, InPointer<char> key);
|
||||
|
||||
/* Forced passthrough commands. */
|
||||
Result GetEdid(OutPointerWithServerSize<SetSysEdid, 0x1> out);
|
||||
public:
|
||||
DEFINE_SERVICE_DISPATCH_TABLE {
|
||||
MakeServiceCommandMeta<SetSysCmd_GetFirmwareVersion, &SetSysMitmService::GetFirmwareVersion>(),
|
||||
MakeServiceCommandMeta<SetSysCmd_GetFirmwareVersion2, &SetSysMitmService::GetFirmwareVersion2>(),
|
||||
MakeServiceCommandMeta<SetSysCmd_GetSettingsItemValueSize, &SetSysMitmService::GetSettingsItemValueSize>(),
|
||||
MakeServiceCommandMeta<SetSysCmd_GetSettingsItemValue, &SetSysMitmService::GetSettingsItemValue>(),
|
||||
|
||||
MakeServiceCommandMeta<SetSysCmd_GetEdid, &SetSysMitmService::GetEdid>(),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user