stratosphere: all in on enum class CommandId

This commit is contained in:
Michael Scire 2019-06-27 23:34:26 -07:00
parent 67c0f4527e
commit 18ca8aaf5b
38 changed files with 665 additions and 658 deletions

View file

@ -20,15 +20,14 @@
#include "../utils.hpp"
enum BpcAtmosphereCmd : u32 {
BpcAtmosphereCmd_RebootToFatalError = 65000,
};
class BpcAtmosphereService : public IServiceObject {
enum class CommandId {
RebootToFatalError = 65000,
};
private:
Result RebootToFatalError(InBuffer<AtmosphereFatalErrorContext> ctx);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<BpcAtmosphereCmd_RebootToFatalError, &BpcAtmosphereService::RebootToFatalError>(),
MAKE_SERVICE_COMMAND_META(BpcAtmosphereService, RebootToFatalError),
};
};

View file

@ -20,12 +20,12 @@
#include "../utils.hpp"
enum BpcCmd : u32 {
BpcCmd_ShutdownSystem = 0,
BpcCmd_RebootSystem = 1,
};
class BpcMitmService : public IMitmServiceObject {
private:
enum class CommandId {
ShutdownSystem = 0,
RebootSystem = 1,
};
public:
BpcMitmService(std::shared_ptr<Service> s, u64 pid) : IMitmServiceObject(s, pid) {
/* ... */
@ -48,7 +48,7 @@ class BpcMitmService : public IMitmServiceObject {
Result RebootSystem();
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<BpcCmd_ShutdownSystem, &BpcMitmService::ShutdownSystem>(),
MakeServiceCommandMeta<BpcCmd_RebootSystem, &BpcMitmService::RebootSystem>(),
MAKE_SERVICE_COMMAND_META(BpcMitmService, ShutdownSystem),
MAKE_SERVICE_COMMAND_META(BpcMitmService, RebootSystem),
};
};

View file

@ -18,11 +18,6 @@
#include <switch.h>
#include <stratosphere.hpp>
enum FsIDirectoryCmd : u32 {
FsIDirectoryCmd_Read = 0,
FsIDirectoryCmd_GetEntryCount = 1,
};
class IDirectory {
public:
virtual ~IDirectory() {}
@ -56,6 +51,11 @@ class IDirectory {
};
class IDirectoryInterface : public IServiceObject {
private:
enum class CommandId {
Read = 0,
GetEntryCount = 1,
};
private:
std::unique_ptr<IDirectory> base_dir;
public:
@ -77,8 +77,8 @@ class IDirectoryInterface : public IServiceObject {
public:
DEFINE_SERVICE_DISPATCH_TABLE {
/* 1.0.0- */
MakeServiceCommandMeta<FsIDirectoryCmd_Read, &IDirectoryInterface::Read>(),
MakeServiceCommandMeta<FsIDirectoryCmd_GetEntryCount, &IDirectoryInterface::GetEntryCount>(),
MAKE_SERVICE_COMMAND_META(IDirectoryInterface, Read),
MAKE_SERVICE_COMMAND_META(IDirectoryInterface, GetEntryCount),
};
};

View file

@ -20,15 +20,6 @@
#include "fs_shim.h"
enum FsIFileCmd : u32 {
FsIFileCmd_Read = 0,
FsIFileCmd_Write = 1,
FsIFileCmd_Flush = 2,
FsIFileCmd_SetSize = 3,
FsIFileCmd_GetSize = 4,
FsIFileCmd_OperateRange = 5,
};
class IFile {
public:
virtual ~IFile() {}
@ -106,6 +97,15 @@ class IFile {
};
class IFileInterface : public IServiceObject {
private:
enum class CommandId {
Read = 0,
Write = 1,
Flush = 2,
SetSize = 3,
GetSize = 4,
OperateRange = 5,
};
private:
std::unique_ptr<IFile> base_file;
public:
@ -139,14 +139,14 @@ class IFileInterface : public IServiceObject {
public:
DEFINE_SERVICE_DISPATCH_TABLE {
/* 1.0.0- */
MakeServiceCommandMeta<FsIFileCmd_Read, &IFileInterface::Read>(),
MakeServiceCommandMeta<FsIFileCmd_Write, &IFileInterface::Write>(),
MakeServiceCommandMeta<FsIFileCmd_Flush, &IFileInterface::Flush>(),
MakeServiceCommandMeta<FsIFileCmd_SetSize, &IFileInterface::SetSize>(),
MakeServiceCommandMeta<FsIFileCmd_GetSize, &IFileInterface::GetSize>(),
MAKE_SERVICE_COMMAND_META(IFileInterface, Read),
MAKE_SERVICE_COMMAND_META(IFileInterface, Write),
MAKE_SERVICE_COMMAND_META(IFileInterface, Flush),
MAKE_SERVICE_COMMAND_META(IFileInterface, SetSize),
MAKE_SERVICE_COMMAND_META(IFileInterface, GetSize),
/* 4.0.0- */
MakeServiceCommandMeta<FsIFileCmd_OperateRange, &IFileInterface::OperateRange, FirmwareVersion_400>(),
MAKE_SERVICE_COMMAND_META(IFileInterface, OperateRange, FirmwareVersion_400),
};
};

View file

@ -26,30 +26,6 @@
#include "fs_ifile.hpp"
#include "fs_idirectory.hpp"
enum FsIFileSystemCmd : u32 {
/* 1.0.0+ */
FsIFileSystemCmd_CreateFile = 0,
FsIFileSystemCmd_DeleteFile = 1,
FsIFileSystemCmd_CreateDirectory = 2,
FsIFileSystemCmd_DeleteDirectory = 3,
FsIFileSystemCmd_DeleteDirectoryRecursively = 4,
FsIFileSystemCmd_RenameFile = 5,
FsIFileSystemCmd_RenameDirectory = 6,
FsIFileSystemCmd_GetEntryType = 7,
FsIFileSystemCmd_OpenFile = 8,
FsIFileSystemCmd_OpenDirectory = 9,
FsIFileSystemCmd_Commit = 10,
FsIFileSystemCmd_GetFreeSpaceSize = 11,
FsIFileSystemCmd_GetTotalSpaceSize = 12,
/* 3.0.0+ */
FsIFileSystemCmd_CleanDirectoryRecursively = 13,
FsIFileSystemCmd_GetFileTimeStampRaw = 14,
/* 4.0.0+ */
FsIFileSystemCmd_QueryEntry = 15,
};
class IFile;
class IDirectory;
@ -197,6 +173,30 @@ class IFileSystem {
};
class IFileSystemInterface : public IServiceObject {
private:
enum class CommandId {
/* 1.0.0+ */
CreateFile = 0,
DeleteFile = 1,
CreateDirectory = 2,
DeleteDirectory = 3,
DeleteDirectoryRecursively = 4,
RenameFile = 5,
RenameDirectory = 6,
GetEntryType = 7,
OpenFile = 8,
OpenDirectory = 9,
Commit = 10,
GetFreeSpaceSize = 11,
GetTotalSpaceSize = 12,
/* 3.0.0+ */
CleanDirectoryRecursively = 13,
GetFileTimeStampRaw = 14,
/* 4.0.0+ */
QueryEntry = 15,
};
private:
std::unique_ptr<IFileSystem> unique_fs;
std::shared_ptr<IFileSystem> shared_fs;
@ -342,26 +342,26 @@ class IFileSystemInterface : public IServiceObject {
public:
DEFINE_SERVICE_DISPATCH_TABLE {
/* 1.0.0- */
MakeServiceCommandMeta<FsIFileSystemCmd_CreateFile, &IFileSystemInterface::CreateFile>(),
MakeServiceCommandMeta<FsIFileSystemCmd_DeleteFile, &IFileSystemInterface::DeleteFile>(),
MakeServiceCommandMeta<FsIFileSystemCmd_CreateDirectory, &IFileSystemInterface::CreateDirectory>(),
MakeServiceCommandMeta<FsIFileSystemCmd_DeleteDirectory, &IFileSystemInterface::DeleteDirectory>(),
MakeServiceCommandMeta<FsIFileSystemCmd_DeleteDirectoryRecursively, &IFileSystemInterface::DeleteDirectoryRecursively>(),
MakeServiceCommandMeta<FsIFileSystemCmd_RenameFile, &IFileSystemInterface::RenameFile>(),
MakeServiceCommandMeta<FsIFileSystemCmd_RenameDirectory, &IFileSystemInterface::RenameDirectory>(),
MakeServiceCommandMeta<FsIFileSystemCmd_GetEntryType, &IFileSystemInterface::GetEntryType>(),
MakeServiceCommandMeta<FsIFileSystemCmd_OpenFile, &IFileSystemInterface::OpenFile>(),
MakeServiceCommandMeta<FsIFileSystemCmd_OpenDirectory, &IFileSystemInterface::OpenDirectory>(),
MakeServiceCommandMeta<FsIFileSystemCmd_Commit, &IFileSystemInterface::Commit>(),
MakeServiceCommandMeta<FsIFileSystemCmd_GetFreeSpaceSize, &IFileSystemInterface::GetFreeSpaceSize>(),
MakeServiceCommandMeta<FsIFileSystemCmd_GetTotalSpaceSize, &IFileSystemInterface::GetTotalSpaceSize>(),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, CreateFile),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, DeleteFile),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, CreateDirectory),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, DeleteDirectory),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, DeleteDirectoryRecursively),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, RenameFile),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, RenameDirectory),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, GetEntryType),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, OpenFile),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, OpenDirectory),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, Commit),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, GetFreeSpaceSize),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, GetTotalSpaceSize),
/* 3.0.0- */
MakeServiceCommandMeta<FsIFileSystemCmd_CleanDirectoryRecursively, &IFileSystemInterface::CleanDirectoryRecursively, FirmwareVersion_300>(),
MakeServiceCommandMeta<FsIFileSystemCmd_GetFileTimeStampRaw, &IFileSystemInterface::GetFileTimeStampRaw, FirmwareVersion_300>(),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, CleanDirectoryRecursively, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, GetFileTimeStampRaw, FirmwareVersion_300),
/* 4.0.0- */
MakeServiceCommandMeta<FsIFileSystemCmd_QueryEntry, &IFileSystemInterface::QueryEntry, FirmwareVersion_400>(),
MAKE_SERVICE_COMMAND_META(IFileSystemInterface, QueryEntry, FirmwareVersion_400),
};
};

View file

@ -21,15 +21,6 @@
#include "../debug.hpp"
enum FsIStorageCmd : u32 {
FsIStorageCmd_Read = 0,
FsIStorageCmd_Write = 1,
FsIStorageCmd_Flush = 2,
FsIStorageCmd_SetSize = 3,
FsIStorageCmd_GetSize = 4,
FsIStorageCmd_OperateRange = 5,
};
class IStorage {
public:
virtual ~IStorage();
@ -47,6 +38,15 @@ class IStorage {
};
class IStorageInterface : public IServiceObject {
private:
enum class CommandId {
Read = 0,
Write = 1,
Flush = 2,
SetSize = 3,
GetSize = 4,
OperateRange = 5,
};
private:
IStorage *base_storage;
public:
@ -81,14 +81,14 @@ class IStorageInterface : public IServiceObject {
public:
DEFINE_SERVICE_DISPATCH_TABLE {
/* 1.0.0- */
MakeServiceCommandMeta<FsIStorageCmd_Read, &IStorageInterface::Read>(),
MakeServiceCommandMeta<FsIStorageCmd_Write, &IStorageInterface::Write>(),
MakeServiceCommandMeta<FsIStorageCmd_Flush, &IStorageInterface::Flush>(),
MakeServiceCommandMeta<FsIStorageCmd_SetSize, &IStorageInterface::SetSize>(),
MakeServiceCommandMeta<FsIStorageCmd_GetSize, &IStorageInterface::GetSize>(),
MAKE_SERVICE_COMMAND_META(IStorageInterface, Read),
MAKE_SERVICE_COMMAND_META(IStorageInterface, Write),
MAKE_SERVICE_COMMAND_META(IStorageInterface, Flush),
MAKE_SERVICE_COMMAND_META(IStorageInterface, SetSize),
MAKE_SERVICE_COMMAND_META(IStorageInterface, GetSize),
/* 4.0.0- */
MakeServiceCommandMeta<FsIStorageCmd_OperateRange, &IStorageInterface::OperateRange, FirmwareVersion_400>(),
MAKE_SERVICE_COMMAND_META(IStorageInterface, OperateRange, FirmwareVersion_400),
};
};

View file

@ -69,8 +69,8 @@ static void StorageCacheSetEntry(u64 title_id, std::shared_ptr<IStorageInterface
void FsMitmService::PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx) {
auto this_ptr = static_cast<FsMitmService *>(obj);
switch ((FspSrvCmd)ctx->cmd_id) {
case FspSrvCmd_SetCurrentProcess:
switch (static_cast<CommandId>(ctx->cmd_id)) {
case CommandId::SetCurrentProcess:
if (R_SUCCEEDED(ctx->rc)) {
this_ptr->has_initialized = true;
this_ptr->process_id = ctx->request.Pid;

View file

@ -21,24 +21,23 @@
#include "fs_ifilesystem.hpp"
#include "../utils.hpp"
enum FspSrvCmd : u32 {
FspSrvCmd_OpenFileSystemDeprecated = 0,
FspSrvCmd_SetCurrentProcess = 1,
FspSrvCmd_OpenFileSystemWithPatch = 7,
FspSrvCmd_OpenFileSystemWithId = 8,
FspSrvCmd_OpenSdCardFileSystem = 18,
FspSrvCmd_OpenSaveDataFileSystem = 51,
FspSrvCmd_OpenBisStorage = 12,
FspSrvCmd_OpenDataStorageByCurrentProcess = 200,
FspSrvCmd_OpenDataStorageByDataId = 202,
};
class FsMitmService : public IMitmServiceObject {
private:
enum class CommandId {
OpenFileSystemDeprecated = 0,
SetCurrentProcess = 1,
OpenFileSystemWithPatch = 7,
OpenFileSystemWithId = 8,
OpenSdCardFileSystem = 18,
OpenSaveDataFileSystem = 51,
OpenBisStorage = 12,
OpenDataStorageByCurrentProcess = 200,
OpenDataStorageByDataId = 202,
};
private:
static constexpr const char *AtmosphereHblWebContentDir = "/atmosphere/hbl_html";
private:
@ -84,13 +83,13 @@ class FsMitmService : public IMitmServiceObject {
Result OpenDataStorageByDataId(Out<std::shared_ptr<IStorageInterface>> out, u64 data_id, u8 storage_id);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
/* TODO MakeServiceCommandMeta<FspSrvCmd_OpenFileSystemDeprecated, &FsMitmService::OpenFileSystemDeprecated>(), */
MakeServiceCommandMeta<FspSrvCmd_OpenFileSystemWithPatch, &FsMitmService::OpenFileSystemWithPatch, FirmwareVersion_200>(),
MakeServiceCommandMeta<FspSrvCmd_OpenFileSystemWithId, &FsMitmService::OpenFileSystemWithId, FirmwareVersion_200>(),
MakeServiceCommandMeta<FspSrvCmd_OpenSdCardFileSystem, &FsMitmService::OpenSdCardFileSystem>(),
MakeServiceCommandMeta<FspSrvCmd_OpenSaveDataFileSystem, &FsMitmService::OpenSaveDataFileSystem>(),
MakeServiceCommandMeta<FspSrvCmd_OpenBisStorage, &FsMitmService::OpenBisStorage>(),
MakeServiceCommandMeta<FspSrvCmd_OpenDataStorageByCurrentProcess, &FsMitmService::OpenDataStorageByCurrentProcess>(),
MakeServiceCommandMeta<FspSrvCmd_OpenDataStorageByDataId, &FsMitmService::OpenDataStorageByDataId>(),
/* TODO MAKE_SERVICE_COMMAND_META(FsMitmService, OpenFileSystemDeprecated), */
MAKE_SERVICE_COMMAND_META(FsMitmService, OpenFileSystemWithPatch, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(FsMitmService, OpenFileSystemWithId, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(FsMitmService, OpenSdCardFileSystem),
MAKE_SERVICE_COMMAND_META(FsMitmService, OpenSaveDataFileSystem),
MAKE_SERVICE_COMMAND_META(FsMitmService, OpenBisStorage),
MAKE_SERVICE_COMMAND_META(FsMitmService, OpenDataStorageByCurrentProcess),
MAKE_SERVICE_COMMAND_META(FsMitmService, OpenDataStorageByDataId),
};
};

View file

@ -20,9 +20,13 @@
#include "../utils.hpp"
#include "nsmitm_service_common.hpp"
class NsAmMitmService : public IMitmServiceObject {
private:
enum class CommandId {
GetApplicationContentPath = 21,
ResolveApplicationContentPath = 23,
GetRunningApplicationProgramId = 92,
};
public:
NsAmMitmService(std::shared_ptr<Service> s, u64 pid) : IMitmServiceObject(s, pid) {
/* ... */
@ -44,8 +48,8 @@ class NsAmMitmService : public IMitmServiceObject {
Result GetRunningApplicationProgramId(Out<u64> out_tid, u64 app_id);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<NsSrvCmd_GetApplicationContentPath, &NsAmMitmService::GetApplicationContentPath>(),
MakeServiceCommandMeta<NsSrvCmd_ResolveApplicationContentPath, &NsAmMitmService::ResolveApplicationContentPath>(),
MakeServiceCommandMeta<NsSrvCmd_GetRunningApplicationProgramId, &NsAmMitmService::GetRunningApplicationProgramId, FirmwareVersion_600>(),
MAKE_SERVICE_COMMAND_META(NsAmMitmService, GetApplicationContentPath),
MAKE_SERVICE_COMMAND_META(NsAmMitmService, ResolveApplicationContentPath),
MAKE_SERVICE_COMMAND_META(NsAmMitmService, GetRunningApplicationProgramId, FirmwareVersion_600),
};
};

View file

@ -1,31 +0,0 @@
/*
* Copyright (c) 2018-2019 Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <switch.h>
#include <stratosphere.hpp>
#include "../utils.hpp"
enum NsGetterCmd : u32 {
NsGetterCmd_GetDocumentInterface = 7999,
};
enum NsSrvCmd : u32 {
NsSrvCmd_GetApplicationContentPath = 21,
NsSrvCmd_ResolveApplicationContentPath = 23,
NsSrvCmd_GetRunningApplicationProgramId = 92,
};

View file

@ -20,10 +20,15 @@
#include "../utils.hpp"
#include "nsmitm_service_common.hpp"
#include "ns_shim.h"
class NsDocumentService : public IServiceObject {
private:
enum class CommandId {
GetApplicationContentPath = 21,
ResolveApplicationContentPath = 23,
GetRunningApplicationProgramId = 92,
};
private:
u64 title_id;
std::unique_ptr<NsDocumentInterface> srv;
@ -50,13 +55,17 @@ class NsDocumentService : public IServiceObject {
Result GetRunningApplicationProgramId(Out<u64> out_tid, u64 app_id);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<NsSrvCmd_GetApplicationContentPath, &NsDocumentService::GetApplicationContentPath>(),
MakeServiceCommandMeta<NsSrvCmd_ResolveApplicationContentPath, &NsDocumentService::ResolveApplicationContentPath>(),
MakeServiceCommandMeta<NsSrvCmd_GetRunningApplicationProgramId, &NsDocumentService::GetRunningApplicationProgramId, FirmwareVersion_600>(),
MAKE_SERVICE_COMMAND_META(NsDocumentService, GetApplicationContentPath),
MAKE_SERVICE_COMMAND_META(NsDocumentService, ResolveApplicationContentPath),
MAKE_SERVICE_COMMAND_META(NsDocumentService, GetRunningApplicationProgramId, FirmwareVersion_600),
};
};
class NsWebMitmService : public IMitmServiceObject {
private:
enum class CommandId {
GetDocumentInterface = 7999,
};
public:
NsWebMitmService(std::shared_ptr<Service> s, u64 pid) : IMitmServiceObject(s, pid) {
/* ... */
@ -76,6 +85,6 @@ class NsWebMitmService : public IMitmServiceObject {
Result GetDocumentInterface(Out<std::shared_ptr<NsDocumentService>> out_intf);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<NsGetterCmd_GetDocumentInterface, &NsWebMitmService::GetDocumentInterface, FirmwareVersion_300>(),
MAKE_SERVICE_COMMAND_META(NsWebMitmService, GetDocumentInterface, FirmwareVersion_300),
};
};

View file

@ -20,16 +20,16 @@
#include "../utils.hpp"
enum SetCmd : u32 {
SetCmd_GetLanguageCode = 0,
SetCmd_GetRegionCode = 4,
/* Commands for which set:sys *must* act as a passthrough. */
/* TODO: Solve the relevant IPC detection problem. */
SetCmd_GetAvailableLanguageCodes = 1,
};
class SetMitmService : public IMitmServiceObject {
private:
enum class CommandId {
GetLanguageCode = 0,
GetRegionCode = 4,
/* Commands for which set:sys *must* act as a passthrough. */
/* TODO: Solve the relevant IPC detection problem. */
GetAvailableLanguageCodes = 1,
};
private:
HosMutex lock;
OverrideLocale locale;
@ -60,9 +60,9 @@ class SetMitmService : public IMitmServiceObject {
Result GetAvailableLanguageCodes(OutPointerWithClientSize<u64> out_language_codes, Out<s32> out_count);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<SetCmd_GetLanguageCode, &SetMitmService::GetLanguageCode>(),
MakeServiceCommandMeta<SetCmd_GetRegionCode, &SetMitmService::GetRegionCode>(),
MAKE_SERVICE_COMMAND_META(SetMitmService, GetLanguageCode),
MAKE_SERVICE_COMMAND_META(SetMitmService, GetRegionCode),
MakeServiceCommandMeta<SetCmd_GetAvailableLanguageCodes, &SetMitmService::GetAvailableLanguageCodes>(),
MAKE_SERVICE_COMMAND_META(SetMitmService, GetAvailableLanguageCodes),
};
};

View file

@ -20,18 +20,18 @@
#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 {
private:
enum class CommandId {
GetFirmwareVersion = 3,
GetFirmwareVersion2 = 4,
GetSettingsItemValueSize = 37,
GetSettingsItemValue = 38,
/* Commands for which set:sys *must* act as a passthrough. */
/* TODO: Solve the relevant IPC detection problem. */
GetEdid = 41,
};
public:
SetSysMitmService(std::shared_ptr<Service> s, u64 pid) : IMitmServiceObject(s, pid) {
/* ... */
@ -55,11 +55,11 @@ class SetSysMitmService : public IMitmServiceObject {
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>(),
MAKE_SERVICE_COMMAND_META(SetSysMitmService, GetFirmwareVersion),
MAKE_SERVICE_COMMAND_META(SetSysMitmService, GetFirmwareVersion2),
MAKE_SERVICE_COMMAND_META(SetSysMitmService, GetSettingsItemValueSize),
MAKE_SERVICE_COMMAND_META(SetSysMitmService, GetSettingsItemValue),
MakeServiceCommandMeta<SetSysCmd_GetEdid, &SetSysMitmService::GetEdid>(),
MAKE_SERVICE_COMMAND_META(SetSysMitmService, GetEdid),
};
};

View file

@ -20,37 +20,37 @@
#include "dmnt_cheat_types.hpp"
enum DmntCheatCmd {
/* Meta */
DmntCheat_Cmd_HasCheatProcess = 65000,
DmntCheat_Cmd_GetCheatProcessEvent = 65001,
DmntCheat_Cmd_GetCheatProcessMetadata = 65002,
DmntCheat_Cmd_ForceOpenCheatProcess = 65003,
/* Interact with Memory */
DmntCheat_Cmd_GetCheatProcessMappingCount = 65100,
DmntCheat_Cmd_GetCheatProcessMappings = 65101,
DmntCheat_Cmd_ReadCheatProcessMemory = 65102,
DmntCheat_Cmd_WriteCheatProcessMemory = 65103,
DmntCheat_Cmd_QueryCheatProcessMemory = 65104,
/* Interact with Cheats */
DmntCheat_Cmd_GetCheatCount = 65200,
DmntCheat_Cmd_GetCheats = 65201,
DmntCheat_Cmd_GetCheatById = 65202,
DmntCheat_Cmd_ToggleCheat = 65203,
DmntCheat_Cmd_AddCheat = 65204,
DmntCheat_Cmd_RemoveCheat = 65205,
/* Interact with Frozen Addresses */
DmntCheat_Cmd_GetFrozenAddressCount = 65300,
DmntCheat_Cmd_GetFrozenAddresses = 65301,
DmntCheat_Cmd_GetFrozenAddress = 65302,
DmntCheat_Cmd_EnableFrozenAddress = 65303,
DmntCheat_Cmd_DisableFrozenAddress = 65304,
};
class DmntCheatService final : public IServiceObject {
private:
enum class CommandId {
/* Meta */
HasCheatProcess = 65000,
GetCheatProcessEvent = 65001,
GetCheatProcessMetadata = 65002,
ForceOpenCheatProcess = 65003,
/* Interact with Memory */
GetCheatProcessMappingCount = 65100,
GetCheatProcessMappings = 65101,
ReadCheatProcessMemory = 65102,
WriteCheatProcessMemory = 65103,
QueryCheatProcessMemory = 65104,
/* Interact with Cheats */
GetCheatCount = 65200,
GetCheats = 65201,
GetCheatById = 65202,
ToggleCheat = 65203,
AddCheat = 65204,
RemoveCheat = 65205,
/* Interact with Frozen Addresses */
GetFrozenAddressCount = 65300,
GetFrozenAddresses = 65301,
GetFrozenAddress = 65302,
EnableFrozenAddress = 65303,
DisableFrozenAddress = 65304,
};
private:
void HasCheatProcess(Out<bool> out);
void GetCheatProcessEvent(Out<CopiedHandle> out_event);
@ -78,28 +78,28 @@ class DmntCheatService final : public IServiceObject {
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<DmntCheat_Cmd_HasCheatProcess, &DmntCheatService::HasCheatProcess>(),
MakeServiceCommandMeta<DmntCheat_Cmd_GetCheatProcessEvent, &DmntCheatService::GetCheatProcessEvent>(),
MakeServiceCommandMeta<DmntCheat_Cmd_GetCheatProcessMetadata, &DmntCheatService::GetCheatProcessMetadata>(),
MakeServiceCommandMeta<DmntCheat_Cmd_ForceOpenCheatProcess, &DmntCheatService::ForceOpenCheatProcess>(),
MAKE_SERVICE_COMMAND_META(DmntCheatService, HasCheatProcess),
MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatProcessEvent),
MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatProcessMetadata),
MAKE_SERVICE_COMMAND_META(DmntCheatService, ForceOpenCheatProcess),
MakeServiceCommandMeta<DmntCheat_Cmd_GetCheatProcessMappingCount, &DmntCheatService::GetCheatProcessMappingCount>(),
MakeServiceCommandMeta<DmntCheat_Cmd_GetCheatProcessMappings, &DmntCheatService::GetCheatProcessMappings>(),
MakeServiceCommandMeta<DmntCheat_Cmd_ReadCheatProcessMemory, &DmntCheatService::ReadCheatProcessMemory>(),
MakeServiceCommandMeta<DmntCheat_Cmd_WriteCheatProcessMemory, &DmntCheatService::WriteCheatProcessMemory>(),
MakeServiceCommandMeta<DmntCheat_Cmd_QueryCheatProcessMemory, &DmntCheatService::QueryCheatProcessMemory>(),
MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatProcessMappingCount),
MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatProcessMappings),
MAKE_SERVICE_COMMAND_META(DmntCheatService, ReadCheatProcessMemory),
MAKE_SERVICE_COMMAND_META(DmntCheatService, WriteCheatProcessMemory),
MAKE_SERVICE_COMMAND_META(DmntCheatService, QueryCheatProcessMemory),
MakeServiceCommandMeta<DmntCheat_Cmd_GetCheatCount, &DmntCheatService::GetCheatCount>(),
MakeServiceCommandMeta<DmntCheat_Cmd_GetCheats, &DmntCheatService::GetCheats>(),
MakeServiceCommandMeta<DmntCheat_Cmd_GetCheatById, &DmntCheatService::GetCheatById>(),
MakeServiceCommandMeta<DmntCheat_Cmd_ToggleCheat, &DmntCheatService::ToggleCheat>(),
MakeServiceCommandMeta<DmntCheat_Cmd_AddCheat, &DmntCheatService::AddCheat>(),
MakeServiceCommandMeta<DmntCheat_Cmd_RemoveCheat, &DmntCheatService::RemoveCheat>(),
MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatCount),
MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheats),
MAKE_SERVICE_COMMAND_META(DmntCheatService, GetCheatById),
MAKE_SERVICE_COMMAND_META(DmntCheatService, ToggleCheat),
MAKE_SERVICE_COMMAND_META(DmntCheatService, AddCheat),
MAKE_SERVICE_COMMAND_META(DmntCheatService, RemoveCheat),
MakeServiceCommandMeta<DmntCheat_Cmd_GetFrozenAddressCount, &DmntCheatService::GetFrozenAddressCount>(),
MakeServiceCommandMeta<DmntCheat_Cmd_GetFrozenAddresses, &DmntCheatService::GetFrozenAddresses>(),
MakeServiceCommandMeta<DmntCheat_Cmd_GetFrozenAddress, &DmntCheatService::GetFrozenAddress>(),
MakeServiceCommandMeta<DmntCheat_Cmd_EnableFrozenAddress, &DmntCheatService::EnableFrozenAddress>(),
MakeServiceCommandMeta<DmntCheat_Cmd_DisableFrozenAddress, &DmntCheatService::DisableFrozenAddress>(),
MAKE_SERVICE_COMMAND_META(DmntCheatService, GetFrozenAddressCount),
MAKE_SERVICE_COMMAND_META(DmntCheatService, GetFrozenAddresses),
MAKE_SERVICE_COMMAND_META(DmntCheatService, GetFrozenAddress),
MAKE_SERVICE_COMMAND_META(DmntCheatService, EnableFrozenAddress),
MAKE_SERVICE_COMMAND_META(DmntCheatService, DisableFrozenAddress),
};
};

View file

@ -18,62 +18,62 @@
#include <switch.h>
#include <stratosphere.hpp>
enum DmntCmd {
DebugMonitor_Cmd_BreakDebugProcess = 0,
DebugMonitor_Cmd_TerminateDebugProcess = 1,
DebugMonitor_Cmd_CloseHandle = 2,
DebugMonitor_Cmd_LoadImage = 3,
DebugMonitor_Cmd_GetProcessId = 4,
DebugMonitor_Cmd_GetProcessHandle = 5,
DebugMonitor_Cmd_WaitSynchronization = 6,
DebugMonitor_Cmd_GetDebugEvent = 7,
DebugMonitor_Cmd_GetProcessModuleInfo = 8,
DebugMonitor_Cmd_GetProcessList = 9,
DebugMonitor_Cmd_GetThreadList = 10,
DebugMonitor_Cmd_GetDebugThreadContext = 11,
DebugMonitor_Cmd_ContinueDebugEvent = 12,
DebugMonitor_Cmd_ReadDebugProcessMemory = 13,
DebugMonitor_Cmd_WriteDebugProcessMemory = 14,
DebugMonitor_Cmd_SetDebugThreadContext = 15,
DebugMonitor_Cmd_GetDebugThreadParam = 16,
DebugMonitor_Cmd_InitializeThreadInfo = 17,
DebugMonitor_Cmd_SetHardwareBreakPoint = 18,
DebugMonitor_Cmd_QueryDebugProcessMemory = 19,
DebugMonitor_Cmd_GetProcessMemoryDetails = 20,
DebugMonitor_Cmd_AttachByProgramId = 21,
DebugMonitor_Cmd_AttachOnLaunch = 22,
DebugMonitor_Cmd_GetDebugMonitorProcessId = 23,
DebugMonitor_Cmd_GetJitDebugProcessList = 25,
DebugMonitor_Cmd_CreateCoreDump = 26,
DebugMonitor_Cmd_GetAllDebugThreadInfo = 27,
DebugMonitor_Cmd_TargetIO_FileOpen = 29,
DebugMonitor_Cmd_TargetIO_FileClose = 30,
DebugMonitor_Cmd_TargetIO_FileRead = 31,
DebugMonitor_Cmd_TargetIO_FileWrite = 32,
DebugMonitor_Cmd_TargetIO_FileSetAttributes = 33,
DebugMonitor_Cmd_TargetIO_FileGetInformation = 34,
DebugMonitor_Cmd_TargetIO_FileSetTime = 35,
DebugMonitor_Cmd_TargetIO_FileSetSize = 36,
DebugMonitor_Cmd_TargetIO_FileDelete = 37,
DebugMonitor_Cmd_TargetIO_FileMove = 38,
DebugMonitor_Cmd_TargetIO_DirectoryCreate = 39,
DebugMonitor_Cmd_TargetIO_DirectoryDelete = 40,
DebugMonitor_Cmd_TargetIO_DirectoryRename = 41,
DebugMonitor_Cmd_TargetIO_DirectoryGetCount = 42,
DebugMonitor_Cmd_TargetIO_DirectoryOpen = 43,
DebugMonitor_Cmd_TargetIO_DirectoryGetNext = 44,
DebugMonitor_Cmd_TargetIO_DirectoryClose = 45,
DebugMonitor_Cmd_TargetIO_GetFreeSpace = 46,
DebugMonitor_Cmd_TargetIO_GetVolumeInformation = 47,
DebugMonitor_Cmd_InitiateCoreDump = 48,
DebugMonitor_Cmd_ContinueCoreDump = 49,
DebugMonitor_Cmd_AddTTYToCoreDump = 50,
DebugMonitor_Cmd_AddImageToCoreDump = 51,
DebugMonitor_Cmd_CloseCoreDump = 52,
DebugMonitor_Cmd_CancelAttach = 53,
};
class DebugMonitorService final : public IServiceObject {
private:
enum class CommandId {
BreakDebugProcess = 0,
TerminateDebugProcess = 1,
CloseHandle = 2,
LoadImage = 3,
GetProcessId = 4,
GetProcessHandle = 5,
WaitSynchronization = 6,
GetDebugEvent = 7,
GetProcessModuleInfo = 8,
GetProcessList = 9,
GetThreadList = 10,
GetDebugThreadContext = 11,
ContinueDebugEvent = 12,
ReadDebugProcessMemory = 13,
WriteDebugProcessMemory = 14,
SetDebugThreadContext = 15,
GetDebugThreadParam = 16,
InitializeThreadInfo = 17,
SetHardwareBreakPoint = 18,
QueryDebugProcessMemory = 19,
GetProcessMemoryDetails = 20,
AttachByProgramId = 21,
AttachOnLaunch = 22,
GetDebugMonitorProcessId = 23,
GetJitDebugProcessList = 25,
CreateCoreDump = 26,
GetAllDebugThreadInfo = 27,
TargetIO_FileOpen = 29,
TargetIO_FileClose = 30,
TargetIO_FileRead = 31,
TargetIO_FileWrite = 32,
TargetIO_FileSetAttributes = 33,
TargetIO_FileGetInformation = 34,
TargetIO_FileSetTime = 35,
TargetIO_FileSetSize = 36,
TargetIO_FileDelete = 37,
TargetIO_FileMove = 38,
TargetIO_DirectoryCreate = 39,
TargetIO_DirectoryDelete = 40,
TargetIO_DirectoryRename = 41,
TargetIO_DirectoryGetCount = 42,
TargetIO_DirectoryOpen = 43,
TargetIO_DirectoryGetNext = 44,
TargetIO_DirectoryClose = 45,
TargetIO_GetFreeSpace = 46,
TargetIO_GetVolumeInformation = 47,
InitiateCoreDump = 48,
ContinueCoreDump = 49,
AddTTYToCoreDump = 50,
AddImageToCoreDump = 51,
CloseCoreDump = 52,
CancelAttach = 53,
};
private:
Result BreakDebugProcess(Handle debug_hnd);
Result TerminateDebugProcess(Handle debug_hnd);
@ -94,57 +94,57 @@ class DebugMonitorService final : public IServiceObject {
Result TargetIO_FileMove(InBuffer<char> path0, InBuffer<char> path1);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<DebugMonitor_Cmd_BreakDebugProcess, &DebugMonitorService::BreakDebugProcess>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_TerminateDebugProcess, &DebugMonitorService::TerminateDebugProcess>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_CloseHandle, &DebugMonitorService::CloseHandle>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_LoadImage, &DebugMonitorService::LoadImage>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_GetProcessId, &DebugMonitorService::GetProcessId>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_GetProcessHandle, &DebugMonitorService::GetProcessHandle>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_WaitSynchronization, &DebugMonitorService::WaitSynchronization>(),
//MakeServiceCommandMeta<DebugMonitor_Cmd_GetDebugEvent, &DebugMonitorService::GetDebugEvent>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_GetProcessModuleInfo, &DebugMonitorService::GetProcessModuleInfo>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_GetProcessList, &DebugMonitorService::GetProcessList>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_GetThreadList, &DebugMonitorService::GetThreadList>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_GetDebugThreadContext, &DebugMonitorService::GetDebugThreadContext>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_ContinueDebugEvent, &DebugMonitorService::ContinueDebugEvent>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_ReadDebugProcessMemory, &DebugMonitorService::ReadDebugProcessMemory>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_WriteDebugProcessMemory, &DebugMonitorService::WriteDebugProcessMemory>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_SetDebugThreadContext, &DebugMonitorService::SetDebugThreadContext>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_GetDebugThreadParam, &DebugMonitorService::GetDebugThreadParam>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_InitializeThreadInfo, &DebugMonitorService::InitializeThreadInfo>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_SetHardwareBreakPoint, &DebugMonitorService::SetHardwareBreakPoint>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_QueryDebugProcessMemory, &DebugMonitorService::QueryDebugProcessMemory>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_GetProcessMemoryDetails, &DebugMonitorService::GetProcessMemoryDetails>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_AttachByProgramId, &DebugMonitorService::AttachByProgramId>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_AttachOnLaunch, &DebugMonitorService::AttachOnLaunch>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_GetDebugMonitorProcessId, &DebugMonitorService::GetDebugMonitorProcessId>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_GetJitDebugProcessList, &DebugMonitorService::GetJitDebugProcessList>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_CreateCoreDump, &DebugMonitorService::CreateCoreDump>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_GetAllDebugThreadInfo, &DebugMonitorService::GetAllDebugThreadInfo>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_FileOpen, &DebugMonitorService::TargetIO_FileOpen>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_FileClose, &DebugMonitorService::TargetIO_FileClose>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_FileRead, &DebugMonitorService::TargetIO_FileRead>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_FileWrite, &DebugMonitorService::TargetIO_FileWrite>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_FileSetAttributes, &DebugMonitorService::TargetIO_FileSetAttributes>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_FileGetInformation, &DebugMonitorService::TargetIO_FileGetInformation>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_FileSetTime, &DebugMonitorService::TargetIO_FileSetTime>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_FileSetSize, &DebugMonitorService::TargetIO_FileSetSize>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_FileDelete, &DebugMonitorService::TargetIO_FileDelete>(),
MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_FileMove, &DebugMonitorService::TargetIO_FileMove>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_DirectoryCreate, &DebugMonitorService::TargetIO_DirectoryCreate>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_DirectoryDelete, &DebugMonitorService::TargetIO_DirectoryDelete>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_DirectoryRename, &DebugMonitorService::TargetIO_DirectoryRename>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_DirectoryGetCount, &DebugMonitorService::TargetIO_DirectoryGetCount>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_DirectoryOpen, &DebugMonitorService::TargetIO_DirectoryOpen>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_DirectoryGetNext, &DebugMonitorService::TargetIO_DirectoryGetNext>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_DirectoryClose, &DebugMonitorService::TargetIO_DirectoryClose>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_GetFreeSpace, &DebugMonitorService::TargetIO_GetFreeSpace>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_TargetIO_GetVolumeInformation, &DebugMonitorService::TargetIO_GetVolumeInformation>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_InitiateCoreDump, &DebugMonitorService::InitiateCoreDump>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_ContinueCoreDump, &DebugMonitorService::ContinueCoreDump>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_AddTTYToCoreDump, &DebugMonitorService::AddTTYToCoreDump>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_AddImageToCoreDump, &DebugMonitorService::AddImageToCoreDump>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_CloseCoreDump, &DebugMonitorService::CloseCoreDump>(),
// MakeServiceCommandMeta<DebugMonitor_Cmd_CancelAttach, &DebugMonitorService::CancelAttach>(),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, BreakDebugProcess),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, TerminateDebugProcess),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, CloseHandle),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, LoadImage),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessId),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessHandle),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, WaitSynchronization),
//MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetDebugEvent),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessModuleInfo),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessList),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetThreadList),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetDebugThreadContext),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, ContinueDebugEvent),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, ReadDebugProcessMemory),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, WriteDebugProcessMemory),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, SetDebugThreadContext),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetDebugThreadParam),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, InitializeThreadInfo),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, SetHardwareBreakPoint),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, QueryDebugProcessMemory),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessMemoryDetails),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, AttachByProgramId),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, AttachOnLaunch),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetDebugMonitorProcessId),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetJitDebugProcessList),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, CreateCoreDump),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetAllDebugThreadInfo),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileOpen),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileClose),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileRead),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileWrite),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileSetAttributes),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileGetInformation),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileSetTime),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileSetSize),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileDelete),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_FileMove),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryCreate),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryDelete),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryRename),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryGetCount),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryOpen),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryGetNext),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_DirectoryClose),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_GetFreeSpace),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, TargetIO_GetVolumeInformation),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, InitiateCoreDump),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, ContinueCoreDump),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, AddTTYToCoreDump),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, AddImageToCoreDump),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, CloseCoreDump),
// MAKE_SERVICE_COMMAND_META(DebugMonitorService, CancelAttach),
};
};

View file

@ -18,16 +18,16 @@
#include <switch.h>
#include <stratosphere.hpp>
enum PrivateCmd {
Private_Cmd_GetFatalEvent = 0,
};
class PrivateService final : public IServiceObject {
private:
enum class CommandId {
GetFatalEvent = 0,
};
private:
/* Actual commands. */
Result GetFatalEvent(Out<CopiedHandle> out_h);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<Private_Cmd_GetFatalEvent, &PrivateService::GetFatalEvent>(),
MAKE_SERVICE_COMMAND_META(PrivateService, GetFatalEvent),
};
};

View file

@ -20,13 +20,13 @@
#include "fatal_types.hpp"
enum UserCmd {
User_Cmd_ThrowFatal = 0,
User_Cmd_ThrowFatalWithPolicy = 1,
User_Cmd_ThrowFatalWithCpuContext = 2,
};
class UserService final : public IServiceObject {
private:
enum class CommandId {
ThrowFatal = 0,
ThrowFatalWithPolicy = 1,
ThrowFatalWithCpuContext = 2,
};
private:
/* Actual commands. */
Result ThrowFatal(u32 error, PidDescriptor pid_desc);
@ -34,8 +34,8 @@ class UserService final : public IServiceObject {
Result ThrowFatalWithCpuContext(u32 error, PidDescriptor pid_desc, FatalType policy, InBuffer<u8> _ctx);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<User_Cmd_ThrowFatal, &UserService::ThrowFatal>(),
MakeServiceCommandMeta<User_Cmd_ThrowFatalWithPolicy, &UserService::ThrowFatalWithPolicy>(),
MakeServiceCommandMeta<User_Cmd_ThrowFatalWithCpuContext, &UserService::ThrowFatalWithCpuContext>(),
MAKE_SERVICE_COMMAND_META(UserService, ThrowFatal),
MAKE_SERVICE_COMMAND_META(UserService, ThrowFatalWithPolicy),
MAKE_SERVICE_COMMAND_META(UserService, ThrowFatalWithCpuContext),
};
};

@ -1 +1 @@
Subproject commit 403f1c7a014c47bf7e907da04df9f9b591b9f89f
Subproject commit 3f6df380c8becb4ba0a013cf0533364163a741d8

View file

@ -56,12 +56,12 @@ namespace sts::ldr {
};
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMetaEx<CommandId::CreateProcess, &ProcessManagerInterface::CreateProcess, ProcessManagerInterface>(),
MakeServiceCommandMetaEx<CommandId::GetProgramInfo, &ProcessManagerInterface::GetProgramInfo, ProcessManagerInterface>(),
MakeServiceCommandMetaEx<CommandId::PinTitle, &ProcessManagerInterface::PinTitle, ProcessManagerInterface>(),
MakeServiceCommandMetaEx<CommandId::UnpinTitle, &ProcessManagerInterface::UnpinTitle, ProcessManagerInterface>(),
MAKE_SERVICE_COMMAND_META(ProcessManagerInterface, CreateProcess),
MAKE_SERVICE_COMMAND_META(ProcessManagerInterface, GetProgramInfo),
MAKE_SERVICE_COMMAND_META(ProcessManagerInterface, PinTitle),
MAKE_SERVICE_COMMAND_META(ProcessManagerInterface, UnpinTitle),
MakeServiceCommandMetaEx<CommandId::AtmosphereHasLaunchedTitle, &ProcessManagerInterface::AtmosphereHasLaunchedTitle, ProcessManagerInterface>(),
MAKE_SERVICE_COMMAND_META(ProcessManagerInterface, AtmosphereHasLaunchedTitle),
};
};
@ -80,11 +80,11 @@ namespace sts::ldr {
};
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMetaEx<CommandId::SetTitleArguments, &DebugMonitorInterface::SetTitleArguments, DebugMonitorInterface>(),
MakeServiceCommandMetaEx<CommandId::ClearArguments, &DebugMonitorInterface::ClearArguments, DebugMonitorInterface>(),
MakeServiceCommandMetaEx<CommandId::GetProcessModuleInfo, &DebugMonitorInterface::GetProcessModuleInfo, DebugMonitorInterface>(),
MAKE_SERVICE_COMMAND_META(DebugMonitorInterface, SetTitleArguments),
MAKE_SERVICE_COMMAND_META(DebugMonitorInterface, ClearArguments),
MAKE_SERVICE_COMMAND_META(DebugMonitorInterface, GetProcessModuleInfo),
MakeServiceCommandMetaEx<CommandId::AtmosphereHasLaunchedTitle, &DebugMonitorInterface::AtmosphereHasLaunchedTitle, DebugMonitorInterface>(),
MAKE_SERVICE_COMMAND_META(DebugMonitorInterface, AtmosphereHasLaunchedTitle),
};
};
@ -103,11 +103,11 @@ namespace sts::ldr {
};
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMetaEx<CommandId::SetTitleArguments, &ShellInterface::SetTitleArguments, ShellInterface>(),
MakeServiceCommandMetaEx<CommandId::ClearArguments, &ShellInterface::ClearArguments, ShellInterface>(),
MAKE_SERVICE_COMMAND_META(ShellInterface, SetTitleArguments),
MAKE_SERVICE_COMMAND_META(ShellInterface, ClearArguments),
MakeServiceCommandMetaEx<CommandId::AtmosphereSetExternalContentSource, &ShellInterface::AtmosphereSetExternalContentSource, ShellInterface>(),
MakeServiceCommandMetaEx<CommandId::AtmosphereClearExternalContentSource, &ShellInterface::AtmosphereClearExternalContentSource, ShellInterface>(),
MAKE_SERVICE_COMMAND_META(ShellInterface, AtmosphereSetExternalContentSource),
MAKE_SERVICE_COMMAND_META(ShellInterface, AtmosphereClearExternalContentSource),
};
};

View file

@ -18,12 +18,12 @@
#include <switch.h>
#include <stratosphere.hpp>
enum BootModeCmd {
BootMode_Cmd_GetBootMode = 0,
BootMode_Cmd_SetMaintenanceBoot = 1
};
class BootModeService final : public IServiceObject {
private:
enum class CommandId {
GetBootMode = 0,
SetMaintenanceBoot = 1,
};
private:
/* Actual commands. */
void GetBootMode(Out<u32> out);
@ -32,7 +32,7 @@ class BootModeService final : public IServiceObject {
static void SetMaintenanceBootForEmbeddedBoot2();
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<BootMode_Cmd_GetBootMode, &BootModeService::GetBootMode>(),
MakeServiceCommandMeta<BootMode_Cmd_SetMaintenanceBoot, &BootModeService::SetMaintenanceBoot>(),
MAKE_SERVICE_COMMAND_META(BootModeService, GetBootMode),
MAKE_SERVICE_COMMAND_META(BootModeService, SetMaintenanceBoot),
};
};

View file

@ -20,30 +20,23 @@
#include "pm_registration.hpp"
enum DmntCmd {
Dmnt_Cmd_GetUnknownStub = 0,
Dmnt_Cmd_GetDebugProcessIds = 1,
Dmnt_Cmd_LaunchDebugProcess = 2,
Dmnt_Cmd_GetTitleProcessId = 3,
Dmnt_Cmd_EnableDebugForTitleId = 4,
Dmnt_Cmd_GetApplicationProcessId = 5,
Dmnt_Cmd_EnableDebugForApplication = 6,
Dmnt_Cmd_5X_GetDebugProcessIds = 0,
Dmnt_Cmd_5X_LaunchDebugProcess = 1,
Dmnt_Cmd_5X_GetTitleProcessId = 2,
Dmnt_Cmd_5X_EnableDebugForTitleId = 3,
Dmnt_Cmd_5X_GetApplicationProcessId = 4,
Dmnt_Cmd_5X_EnableDebugForApplication = 5,
Dmnt_Cmd_6X_DisableDebug = 6,
Dmnt_Cmd_AtmosphereGetProcessInfo = 65000,
Dmnt_Cmd_AtmosphereGetCurrentLimitInfo = 65001,
};
class DebugMonitorService final : public IServiceObject {
/* Represents modern DebugMonitorService (5.0.0+) */
class DebugMonitorService : public IServiceObject {
private:
enum class CommandId {
GetDebugProcessIds = 0,
LaunchDebugProcess = 1,
GetTitleProcessId = 2,
EnableDebugForTitleId = 3,
GetApplicationProcessId = 4,
EnableDebugForApplication = 5,
DisableDebug = 6,
AtmosphereGetProcessInfo = 65000,
AtmosphereGetCurrentLimitInfo = 65001,
};
protected:
/* Actual commands. */
Result GetUnknownStub(Out<u32> count, OutBuffer<u8> out_buf, u64 in_unk);
Result GetDebugProcessIds(Out<u32> count, OutBuffer<u64> out_pids);
@ -59,28 +52,51 @@ class DebugMonitorService final : public IServiceObject {
Result AtmosphereGetCurrentLimitInfo(Out<u64> cur_val, Out<u64> lim_val, u32 category, u32 resource);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
/* 1.0.0-4.1.0 */
MakeServiceCommandMeta<Dmnt_Cmd_GetUnknownStub, &DebugMonitorService::GetUnknownStub, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Dmnt_Cmd_GetDebugProcessIds, &DebugMonitorService::GetDebugProcessIds, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Dmnt_Cmd_LaunchDebugProcess, &DebugMonitorService::LaunchDebugProcess, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Dmnt_Cmd_GetTitleProcessId, &DebugMonitorService::GetTitleProcessId, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Dmnt_Cmd_EnableDebugForTitleId, &DebugMonitorService::EnableDebugForTitleId, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Dmnt_Cmd_GetApplicationProcessId, &DebugMonitorService::GetApplicationProcessId, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Dmnt_Cmd_EnableDebugForApplication, &DebugMonitorService::EnableDebugForApplication, FirmwareVersion_Min, FirmwareVersion_400>(),
/* 5.0.0-* */
MakeServiceCommandMeta<Dmnt_Cmd_5X_GetDebugProcessIds, &DebugMonitorService::GetDebugProcessIds, FirmwareVersion_500>(),
MakeServiceCommandMeta<Dmnt_Cmd_5X_LaunchDebugProcess, &DebugMonitorService::LaunchDebugProcess, FirmwareVersion_500>(),
MakeServiceCommandMeta<Dmnt_Cmd_5X_GetTitleProcessId, &DebugMonitorService::GetTitleProcessId, FirmwareVersion_500>(),
MakeServiceCommandMeta<Dmnt_Cmd_5X_EnableDebugForTitleId, &DebugMonitorService::EnableDebugForTitleId, FirmwareVersion_500>(),
MakeServiceCommandMeta<Dmnt_Cmd_5X_GetApplicationProcessId, &DebugMonitorService::GetApplicationProcessId, FirmwareVersion_500>(),
MakeServiceCommandMeta<Dmnt_Cmd_5X_EnableDebugForApplication, &DebugMonitorService::EnableDebugForApplication, FirmwareVersion_500>(),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetDebugProcessIds),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, LaunchDebugProcess),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetTitleProcessId),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, EnableDebugForTitleId),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetApplicationProcessId),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, EnableDebugForApplication),
/* 6.0.0-* */
MakeServiceCommandMeta<Dmnt_Cmd_6X_DisableDebug, &DebugMonitorService::DisableDebug, FirmwareVersion_600>(),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, DisableDebug, FirmwareVersion_600),
/* Atmosphere extensions. */
MakeServiceCommandMeta<Dmnt_Cmd_AtmosphereGetProcessInfo, &DebugMonitorService::AtmosphereGetProcessInfo>(),
MakeServiceCommandMeta<Dmnt_Cmd_AtmosphereGetCurrentLimitInfo, &DebugMonitorService::AtmosphereGetCurrentLimitInfo>(),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, AtmosphereGetProcessInfo),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, AtmosphereGetCurrentLimitInfo),
};
};
/* Represents deprecated DebugMonitorService (1.0.0-4.1.0). */
class DebugMonitorServiceDeprecated : public DebugMonitorService {
private:
enum class CommandId {
GetUnknownStub = 0,
GetDebugProcessIds = 1,
LaunchDebugProcess = 2,
GetTitleProcessId = 3,
EnableDebugForTitleId = 4,
GetApplicationProcessId = 5,
EnableDebugForApplication = 6,
AtmosphereGetProcessInfo = 65000,
AtmosphereGetCurrentLimitInfo = 65001,
};
public:
DEFINE_SERVICE_DISPATCH_TABLE {
/* 1.0.0-4.1.0 */
MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, GetUnknownStub),
MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, GetDebugProcessIds),
MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, LaunchDebugProcess),
MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, GetTitleProcessId),
MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, EnableDebugForTitleId),
MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, GetApplicationProcessId),
MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, EnableDebugForApplication),
/* Atmosphere extensions. */
MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, AtmosphereGetProcessInfo),
MAKE_SERVICE_COMMAND_META(DebugMonitorServiceDeprecated, AtmosphereGetCurrentLimitInfo),
};
};

View file

@ -18,14 +18,13 @@
#include <switch.h>
#include <stratosphere.hpp>
enum InformationCmd {
Information_Cmd_GetTitleId = 0,
Information_Cmd_AtmosphereGetProcessId = 65000,
Information_Cmd_AtmosphereHasCreatedTitle = 65001,
};
class InformationService final : public IServiceObject {
private:
enum class CommandId {
GetTitleId = 0,
AtmosphereGetProcessId = 65000,
AtmosphereHasLaunchedTitle = 65001,
};
private:
/* Actual commands. */
Result GetTitleId(Out<u64> tid, u64 pid);
@ -35,8 +34,8 @@ class InformationService final : public IServiceObject {
Result AtmosphereHasLaunchedTitle(Out<bool> out, u64 tid);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<Information_Cmd_GetTitleId, &InformationService::GetTitleId>(),
MakeServiceCommandMeta<Information_Cmd_AtmosphereGetProcessId, &InformationService::AtmosphereGetProcessId>(),
MakeServiceCommandMeta<Information_Cmd_AtmosphereHasCreatedTitle, &InformationService::AtmosphereHasLaunchedTitle>(),
MAKE_SERVICE_COMMAND_META(InformationService, GetTitleId),
MAKE_SERVICE_COMMAND_META(InformationService, AtmosphereGetProcessId),
MAKE_SERVICE_COMMAND_META(InformationService, AtmosphereHasLaunchedTitle),
};
};

View file

@ -142,8 +142,13 @@ int main(int argc, char **argv)
static auto s_server_manager = WaitableManager(1);
/* TODO: Create services. */
s_server_manager.AddWaitable(new ServiceServer<ShellService>("pm:shell", 3));
s_server_manager.AddWaitable(new ServiceServer<DebugMonitorService>("pm:dmnt", 3));
if (GetRuntimeFirmwareVersion() <= FirmwareVersion_400) {
s_server_manager.AddWaitable(new ServiceServer<ShellServiceDeprecated>("pm:shell", 3));
s_server_manager.AddWaitable(new ServiceServer<DebugMonitorServiceDeprecated>("pm:dmnt", 3));
} else {
s_server_manager.AddWaitable(new ServiceServer<ShellService>("pm:shell", 3));
s_server_manager.AddWaitable(new ServiceServer<DebugMonitorService>("pm:dmnt", 3));
}
s_server_manager.AddWaitable(new ServiceServer<BootModeService>("pm:bm", 6));
s_server_manager.AddWaitable(new ServiceServer<InformationService>("pm:info", 19));

View file

@ -20,35 +20,22 @@
#include "pm_registration.hpp"
enum ShellCmd {
Shell_Cmd_LaunchProcess = 0,
Shell_Cmd_TerminateProcessId = 1,
Shell_Cmd_TerminateTitleId = 2,
Shell_Cmd_GetProcessWaitEvent = 3,
Shell_Cmd_GetProcessEventType = 4,
Shell_Cmd_FinalizeExitedProcess = 5,
Shell_Cmd_ClearProcessNotificationFlag = 6,
Shell_Cmd_NotifyBootFinished = 7,
Shell_Cmd_GetApplicationProcessId = 8,
Shell_Cmd_BoostSystemMemoryResourceLimit = 9
};
enum ShellCmd_5X {
Shell_Cmd_5X_LaunchProcess = 0,
Shell_Cmd_5X_TerminateProcessId = 1,
Shell_Cmd_5X_TerminateTitleId = 2,
Shell_Cmd_5X_GetProcessWaitEvent = 3,
Shell_Cmd_5X_GetProcessEventType = 4,
Shell_Cmd_5X_NotifyBootFinished = 5,
Shell_Cmd_5X_GetApplicationProcessId = 6,
Shell_Cmd_5X_BoostSystemMemoryResourceLimit = 7,
Shell_Cmd_BoostSystemThreadsResourceLimit = 8,
Shell_Cmd_GetBootFinishedEvent = 9,
};
class ShellService final : public IServiceObject {
/* Represents modern ShellService (5.0.0+) */
class ShellService : public IServiceObject {
private:
enum class CommandId {
LaunchProcess = 0,
TerminateProcessId = 1,
TerminateTitleId = 2,
GetProcessWaitEvent = 3,
GetProcessEventType = 4,
NotifyBootFinished = 5,
GetApplicationProcessId = 6,
BoostSystemMemoryResourceLimit = 7,
BoostSystemThreadsResourceLimit = 8,
GetBootFinishedEvent = 9,
};
protected:
/* Actual commands. */
Result LaunchProcess(Out<u64> pid, Registration::TidSid tid_sid, u32 launch_flags);
Result TerminateProcessId(u64 pid);
@ -64,34 +51,53 @@ class ShellService final : public IServiceObject {
void GetBootFinishedEvent(Out<CopiedHandle> event);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
/* 1.0.0-4.0.0 */
MakeServiceCommandMeta<Shell_Cmd_LaunchProcess, &ShellService::LaunchProcess, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Shell_Cmd_TerminateProcessId, &ShellService::TerminateProcessId, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Shell_Cmd_TerminateTitleId, &ShellService::TerminateTitleId, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Shell_Cmd_GetProcessWaitEvent, &ShellService::GetProcessWaitEvent, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Shell_Cmd_GetProcessEventType, &ShellService::GetProcessEventType, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Shell_Cmd_FinalizeExitedProcess, &ShellService::FinalizeExitedProcess, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Shell_Cmd_ClearProcessNotificationFlag, &ShellService::ClearProcessNotificationFlag, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Shell_Cmd_NotifyBootFinished, &ShellService::NotifyBootFinished, FirmwareVersion_Min, FirmwareVersion_400>(),
MakeServiceCommandMeta<Shell_Cmd_GetApplicationProcessId, &ShellService::GetApplicationProcessId, FirmwareVersion_Min, FirmwareVersion_400>(),
/* 4.0.0-4.0.0 */
MakeServiceCommandMeta<Shell_Cmd_BoostSystemMemoryResourceLimit, &ShellService::BoostSystemMemoryResourceLimit, FirmwareVersion_400, FirmwareVersion_400>(),
/* 5.0.0-* */
MakeServiceCommandMeta<Shell_Cmd_5X_LaunchProcess, &ShellService::LaunchProcess, FirmwareVersion_500>(),
MakeServiceCommandMeta<Shell_Cmd_5X_TerminateProcessId, &ShellService::TerminateProcessId, FirmwareVersion_500>(),
MakeServiceCommandMeta<Shell_Cmd_5X_TerminateTitleId, &ShellService::TerminateTitleId, FirmwareVersion_500>(),
MakeServiceCommandMeta<Shell_Cmd_5X_GetProcessWaitEvent, &ShellService::GetProcessWaitEvent, FirmwareVersion_500>(),
MakeServiceCommandMeta<Shell_Cmd_5X_GetProcessEventType, &ShellService::GetProcessEventType, FirmwareVersion_500>(),
MakeServiceCommandMeta<Shell_Cmd_5X_NotifyBootFinished, &ShellService::NotifyBootFinished, FirmwareVersion_500>(),
MakeServiceCommandMeta<Shell_Cmd_5X_GetApplicationProcessId, &ShellService::GetApplicationProcessId, FirmwareVersion_500>(),
MakeServiceCommandMeta<Shell_Cmd_5X_BoostSystemMemoryResourceLimit, &ShellService::BoostSystemMemoryResourceLimit, FirmwareVersion_500>(),
MAKE_SERVICE_COMMAND_META(ShellService, LaunchProcess),
MAKE_SERVICE_COMMAND_META(ShellService, TerminateProcessId),
MAKE_SERVICE_COMMAND_META(ShellService, TerminateTitleId),
MAKE_SERVICE_COMMAND_META(ShellService, GetProcessWaitEvent),
MAKE_SERVICE_COMMAND_META(ShellService, GetProcessEventType),
MAKE_SERVICE_COMMAND_META(ShellService, NotifyBootFinished),
MAKE_SERVICE_COMMAND_META(ShellService, GetApplicationProcessId),
MAKE_SERVICE_COMMAND_META(ShellService, BoostSystemMemoryResourceLimit),
/* 7.0.0-* */
MakeServiceCommandMeta<Shell_Cmd_BoostSystemThreadsResourceLimit, &ShellService::BoostSystemThreadsResourceLimit, FirmwareVersion_700>(),
MAKE_SERVICE_COMMAND_META(ShellService, BoostSystemThreadsResourceLimit, FirmwareVersion_700),
/* 8.0.0-* */
MakeServiceCommandMeta<Shell_Cmd_GetBootFinishedEvent, &ShellService::GetBootFinishedEvent, FirmwareVersion_800>(),
MAKE_SERVICE_COMMAND_META(ShellService, GetBootFinishedEvent, FirmwareVersion_800),
};
};
/* Represents deprecated ShellService (1.0.0-4.1.0). */
class ShellServiceDeprecated : public ShellService {
private:
enum class CommandId {
LaunchProcess = 0,
TerminateProcessId = 1,
TerminateTitleId = 2,
GetProcessWaitEvent = 3,
GetProcessEventType = 4,
FinalizeExitedProcess = 5,
ClearProcessNotificationFlag = 6,
NotifyBootFinished = 7,
GetApplicationProcessId = 8,
BoostSystemMemoryResourceLimit = 9,
};
public:
DEFINE_SERVICE_DISPATCH_TABLE {
/* 1.0.0- */
MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, LaunchProcess),
MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, TerminateProcessId),
MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, TerminateTitleId),
MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, GetProcessWaitEvent),
MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, GetProcessEventType),
MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, FinalizeExitedProcess),
MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, ClearProcessNotificationFlag),
MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, NotifyBootFinished),
MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, GetApplicationProcessId),
/* 4.0.0- */
MAKE_SERVICE_COMMAND_META(ShellServiceDeprecated, BoostSystemMemoryResourceLimit, FirmwareVersion_400),
};
};

View file

@ -30,7 +30,7 @@ namespace sts::ro {
Result GetProcessModuleInfo(Out<u32> count, OutBuffer<LoaderModuleInfo> out_infos, u64 pid);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<CommandId::GetProcessModuleInfo, &DebugMonitorService::GetProcessModuleInfo>(),
MAKE_SERVICE_COMMAND_META(DebugMonitorService, GetProcessModuleInfo),
};
};

View file

@ -52,12 +52,12 @@ namespace sts::ro {
Result LoadNrrEx(PidDescriptor pid_desc, u64 nrr_address, u64 nrr_size, CopiedHandle process_h);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<CommandId::LoadNro, &Service::LoadNro>(),
MakeServiceCommandMeta<CommandId::UnloadNro, &Service::UnloadNro>(),
MakeServiceCommandMeta<CommandId::LoadNrr, &Service::LoadNrr>(),
MakeServiceCommandMeta<CommandId::UnloadNrr, &Service::UnloadNrr>(),
MakeServiceCommandMeta<CommandId::Initialize, &Service::Initialize>(),
MakeServiceCommandMeta<CommandId::LoadNrrEx, &Service::LoadNrrEx, FirmwareVersion_700>(),
MAKE_SERVICE_COMMAND_META(Service, LoadNro),
MAKE_SERVICE_COMMAND_META(Service, UnloadNro),
MAKE_SERVICE_COMMAND_META(Service, LoadNrr),
MAKE_SERVICE_COMMAND_META(Service, UnloadNrr),
MAKE_SERVICE_COMMAND_META(Service, Initialize),
MAKE_SERVICE_COMMAND_META(Service, LoadNrrEx, FirmwareVersion_700),
};
};

View file

@ -37,9 +37,9 @@ namespace sts::sm {
virtual void AtmosphereGetRecordSize(Out<u64> record_size);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<CommandId::AtmosphereGetRecord, &DmntService::AtmosphereGetRecord>(),
MakeServiceCommandMeta<CommandId::AtmosphereListRecords, &DmntService::AtmosphereListRecords>(),
MakeServiceCommandMeta<CommandId::AtmosphereGetRecordSize, &DmntService::AtmosphereGetRecordSize>(),
MAKE_SERVICE_COMMAND_META(DmntService, AtmosphereGetRecord),
MAKE_SERVICE_COMMAND_META(DmntService, AtmosphereListRecords),
MAKE_SERVICE_COMMAND_META(DmntService, AtmosphereGetRecordSize),
};
};

View file

@ -40,11 +40,11 @@ namespace sts::sm {
virtual void AtmosphereHasMitm(Out<bool> out, ServiceName service);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<CommandId::RegisterProcess, &ManagerService::RegisterProcess>(),
MakeServiceCommandMeta<CommandId::UnregisterProcess, &ManagerService::UnregisterProcess>(),
MAKE_SERVICE_COMMAND_META(ManagerService, RegisterProcess),
MAKE_SERVICE_COMMAND_META(ManagerService, UnregisterProcess),
MakeServiceCommandMeta<CommandId::AtmosphereEndInitDefers, &ManagerService::AtmosphereEndInitDefers>(),
MakeServiceCommandMeta<CommandId::AtmosphereHasMitm, &ManagerService::AtmosphereHasMitm>(),
MAKE_SERVICE_COMMAND_META(ManagerService, AtmosphereEndInitDefers),
MAKE_SERVICE_COMMAND_META(ManagerService, AtmosphereHasMitm),
};
};

View file

@ -61,18 +61,18 @@ namespace sts::sm {
virtual Result AtmosphereHasService(Out<bool> out, ServiceName service);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<CommandId::Initialize, &UserService::Initialize>(),
MakeServiceCommandMeta<CommandId::GetService, &UserService::GetService>(),
MakeServiceCommandMeta<CommandId::RegisterService, &UserService::RegisterService>(),
MakeServiceCommandMeta<CommandId::UnregisterService, &UserService::UnregisterService>(),
MAKE_SERVICE_COMMAND_META(UserService, Initialize),
MAKE_SERVICE_COMMAND_META(UserService, GetService),
MAKE_SERVICE_COMMAND_META(UserService, RegisterService),
MAKE_SERVICE_COMMAND_META(UserService, UnregisterService),
MakeServiceCommandMeta<CommandId::AtmosphereInstallMitm, &UserService::AtmosphereInstallMitm>(),
MakeServiceCommandMeta<CommandId::AtmosphereUninstallMitm, &UserService::AtmosphereUninstallMitm>(),
MakeServiceCommandMeta<CommandId::AtmosphereAssociatePidTidForMitm, &UserService::AtmosphereAssociatePidTidForMitm>(),
MakeServiceCommandMeta<CommandId::AtmosphereAcknowledgeMitmSession, &UserService::AtmosphereAcknowledgeMitmSession>(),
MakeServiceCommandMeta<CommandId::AtmosphereHasMitm, &UserService::AtmosphereHasMitm>(),
MAKE_SERVICE_COMMAND_META(UserService, AtmosphereInstallMitm),
MAKE_SERVICE_COMMAND_META(UserService, AtmosphereUninstallMitm),
MAKE_SERVICE_COMMAND_META(UserService, AtmosphereAssociatePidTidForMitm),
MAKE_SERVICE_COMMAND_META(UserService, AtmosphereAcknowledgeMitmSession),
MAKE_SERVICE_COMMAND_META(UserService, AtmosphereHasMitm),
MakeServiceCommandMeta<CommandId::AtmosphereHasService, &UserService::AtmosphereHasService>(),
MAKE_SERVICE_COMMAND_META(UserService, AtmosphereHasService),
};
};

View file

@ -40,22 +40,22 @@ namespace sts::spl {
virtual void GetAesKeyslotAvailableEvent(Out<CopiedHandle> out_hnd);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMetaEx<CommandId::GetConfig, &CryptoService::GetConfig, CryptoService>(),
MakeServiceCommandMetaEx<CommandId::ExpMod, &CryptoService::ExpMod, CryptoService>(),
MakeServiceCommandMetaEx<CommandId::SetConfig, &CryptoService::SetConfig, CryptoService>(),
MakeServiceCommandMetaEx<CommandId::GenerateRandomBytes, &CryptoService::GenerateRandomBytes, CryptoService>(),
MakeServiceCommandMetaEx<CommandId::IsDevelopment, &CryptoService::IsDevelopment, CryptoService>(),
MakeServiceCommandMetaEx<CommandId::SetBootReason, &CryptoService::SetBootReason, CryptoService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GetBootReason, &CryptoService::GetBootReason, CryptoService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKek, &CryptoService::GenerateAesKek, CryptoService>(),
MakeServiceCommandMetaEx<CommandId::LoadAesKey, &CryptoService::LoadAesKey, CryptoService>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKey, &CryptoService::GenerateAesKey, CryptoService>(),
MakeServiceCommandMetaEx<CommandId::DecryptAesKey, &CryptoService::DecryptAesKey, CryptoService>(),
MakeServiceCommandMetaEx<CommandId::CryptAesCtr, &CryptoService::CryptAesCtr, CryptoService>(),
MakeServiceCommandMetaEx<CommandId::ComputeCmac, &CryptoService::ComputeCmac, CryptoService>(),
MakeServiceCommandMetaEx<CommandId::AllocateAesKeyslot, &CryptoService::AllocateAesKeyslot, CryptoService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::FreeAesKeyslot, &CryptoService::FreeAesKeyslot, CryptoService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::GetAesKeyslotAvailableEvent, &CryptoService::GetAesKeyslotAvailableEvent, CryptoService, FirmwareVersion_200>(),
MAKE_SERVICE_COMMAND_META(CryptoService, GetConfig),
MAKE_SERVICE_COMMAND_META(CryptoService, ExpMod),
MAKE_SERVICE_COMMAND_META(CryptoService, SetConfig),
MAKE_SERVICE_COMMAND_META(CryptoService, GenerateRandomBytes),
MAKE_SERVICE_COMMAND_META(CryptoService, IsDevelopment),
MAKE_SERVICE_COMMAND_META(CryptoService, SetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(CryptoService, GetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(CryptoService, GenerateAesKek),
MAKE_SERVICE_COMMAND_META(CryptoService, LoadAesKey),
MAKE_SERVICE_COMMAND_META(CryptoService, GenerateAesKey),
MAKE_SERVICE_COMMAND_META(CryptoService, DecryptAesKey),
MAKE_SERVICE_COMMAND_META(CryptoService, CryptAesCtr),
MAKE_SERVICE_COMMAND_META(CryptoService, ComputeCmac),
MAKE_SERVICE_COMMAND_META(CryptoService, AllocateAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(CryptoService, FreeAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(CryptoService, GetAesKeyslotAvailableEvent, FirmwareVersion_200),
};
};

View file

@ -38,6 +38,7 @@ namespace sts::spl {
GenerateSpecificAesKey = 12,
DecryptRsaPrivateKey = 13,
DecryptAesKey = 14,
CryptAesCtrDeprecated = 15,
CryptAesCtr = 15,
ComputeCmac = 16,
ImportEsKey = 17,
@ -86,31 +87,31 @@ namespace sts::spl {
virtual Result GetBootReason(Out<BootReasonValue> out);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<CommandId::GetConfig, &DeprecatedService::GetConfig>(),
MakeServiceCommandMeta<CommandId::ExpMod, &DeprecatedService::ExpMod>(),
MakeServiceCommandMeta<CommandId::GenerateAesKek, &DeprecatedService::GenerateAesKek>(),
MakeServiceCommandMeta<CommandId::LoadAesKey, &DeprecatedService::LoadAesKey>(),
MakeServiceCommandMeta<CommandId::GenerateAesKey, &DeprecatedService::GenerateAesKey>(),
MakeServiceCommandMeta<CommandId::SetConfig, &DeprecatedService::SetConfig>(),
MakeServiceCommandMeta<CommandId::GenerateRandomBytes, &DeprecatedService::GenerateRandomBytes>(),
MakeServiceCommandMeta<CommandId::ImportLotusKey, &DeprecatedService::ImportLotusKey>(),
MakeServiceCommandMeta<CommandId::DecryptLotusMessage, &DeprecatedService::DecryptLotusMessage>(),
MakeServiceCommandMeta<CommandId::IsDevelopment, &DeprecatedService::IsDevelopment>(),
MakeServiceCommandMeta<CommandId::GenerateSpecificAesKey, &DeprecatedService::GenerateSpecificAesKey>(),
MakeServiceCommandMeta<CommandId::DecryptRsaPrivateKey, &DeprecatedService::DecryptRsaPrivateKey>(),
MakeServiceCommandMeta<CommandId::DecryptAesKey, &DeprecatedService::DecryptAesKey>(),
MakeServiceCommandMeta<CommandId::CryptAesCtr, &DeprecatedService::CryptAesCtrDeprecated, FirmwareVersion_100, FirmwareVersion_100>(),
MakeServiceCommandMeta<CommandId::CryptAesCtr, &DeprecatedService::CryptAesCtr, FirmwareVersion_200>(),
MakeServiceCommandMeta<CommandId::ComputeCmac, &DeprecatedService::ComputeCmac>(),
MakeServiceCommandMeta<CommandId::ImportEsKey, &DeprecatedService::ImportEsKey>(),
MakeServiceCommandMeta<CommandId::UnwrapTitleKey, &DeprecatedService::UnwrapTitleKey>(),
MakeServiceCommandMeta<CommandId::LoadTitleKey, &DeprecatedService::LoadTitleKey>(),
MakeServiceCommandMeta<CommandId::UnwrapCommonTitleKey, &DeprecatedService::UnwrapCommonTitleKey, FirmwareVersion_200>(),
MakeServiceCommandMeta<CommandId::AllocateAesKeyslot, &DeprecatedService::AllocateAesKeyslot, FirmwareVersion_200>(),
MakeServiceCommandMeta<CommandId::FreeAesKeyslot, &DeprecatedService::FreeAesKeyslot, FirmwareVersion_200>(),
MakeServiceCommandMeta<CommandId::GetAesKeyslotAvailableEvent, &DeprecatedService::GetAesKeyslotAvailableEvent, FirmwareVersion_200>(),
MakeServiceCommandMeta<CommandId::SetBootReason, &DeprecatedService::SetBootReason, FirmwareVersion_300>(),
MakeServiceCommandMeta<CommandId::GetBootReason, &DeprecatedService::GetBootReason, FirmwareVersion_300>(),
MAKE_SERVICE_COMMAND_META(DeprecatedService, GetConfig),
MAKE_SERVICE_COMMAND_META(DeprecatedService, ExpMod),
MAKE_SERVICE_COMMAND_META(DeprecatedService, GenerateAesKek),
MAKE_SERVICE_COMMAND_META(DeprecatedService, LoadAesKey),
MAKE_SERVICE_COMMAND_META(DeprecatedService, GenerateAesKey),
MAKE_SERVICE_COMMAND_META(DeprecatedService, SetConfig),
MAKE_SERVICE_COMMAND_META(DeprecatedService, GenerateRandomBytes),
MAKE_SERVICE_COMMAND_META(DeprecatedService, ImportLotusKey),
MAKE_SERVICE_COMMAND_META(DeprecatedService, DecryptLotusMessage),
MAKE_SERVICE_COMMAND_META(DeprecatedService, IsDevelopment),
MAKE_SERVICE_COMMAND_META(DeprecatedService, GenerateSpecificAesKey),
MAKE_SERVICE_COMMAND_META(DeprecatedService, DecryptRsaPrivateKey),
MAKE_SERVICE_COMMAND_META(DeprecatedService, DecryptAesKey),
MAKE_SERVICE_COMMAND_META(DeprecatedService, CryptAesCtrDeprecated, FirmwareVersion_100, FirmwareVersion_100),
MAKE_SERVICE_COMMAND_META(DeprecatedService, CryptAesCtr, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(DeprecatedService, ComputeCmac),
MAKE_SERVICE_COMMAND_META(DeprecatedService, ImportEsKey),
MAKE_SERVICE_COMMAND_META(DeprecatedService, UnwrapTitleKey),
MAKE_SERVICE_COMMAND_META(DeprecatedService, LoadTitleKey),
MAKE_SERVICE_COMMAND_META(DeprecatedService, UnwrapCommonTitleKey, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(DeprecatedService, AllocateAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(DeprecatedService, FreeAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(DeprecatedService, GetAesKeyslotAvailableEvent, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(DeprecatedService, SetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(DeprecatedService, GetBootReason, FirmwareVersion_300),
};
};

View file

@ -38,31 +38,31 @@ namespace sts::spl {
virtual Result LoadElicenseKey(u32 keyslot, AccessKey access_key);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMetaEx<CommandId::GetConfig, &EsService::GetConfig, EsService>(),
MakeServiceCommandMetaEx<CommandId::ExpMod, &EsService::ExpMod, EsService>(),
MakeServiceCommandMetaEx<CommandId::SetConfig, &EsService::SetConfig, EsService>(),
MakeServiceCommandMetaEx<CommandId::GenerateRandomBytes, &EsService::GenerateRandomBytes, EsService>(),
MakeServiceCommandMetaEx<CommandId::IsDevelopment, &EsService::IsDevelopment, EsService>(),
MakeServiceCommandMetaEx<CommandId::SetBootReason, &EsService::SetBootReason, EsService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GetBootReason, &EsService::GetBootReason, EsService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKek, &EsService::GenerateAesKek, EsService>(),
MakeServiceCommandMetaEx<CommandId::LoadAesKey, &EsService::LoadAesKey, EsService>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKey, &EsService::GenerateAesKey, EsService>(),
MakeServiceCommandMetaEx<CommandId::DecryptAesKey, &EsService::DecryptAesKey, EsService>(),
MakeServiceCommandMetaEx<CommandId::CryptAesCtr, &EsService::CryptAesCtr, EsService>(),
MakeServiceCommandMetaEx<CommandId::ComputeCmac, &EsService::ComputeCmac, EsService>(),
MakeServiceCommandMetaEx<CommandId::AllocateAesKeyslot, &EsService::AllocateAesKeyslot, EsService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::FreeAesKeyslot, &EsService::FreeAesKeyslot, EsService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::GetAesKeyslotAvailableEvent, &EsService::GetAesKeyslotAvailableEvent, EsService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::DecryptRsaPrivateKey, &EsService::DecryptRsaPrivateKeyDeprecated, EsService, FirmwareVersion_400, FirmwareVersion_400>(),
MakeServiceCommandMetaEx<CommandId::DecryptRsaPrivateKey, &EsService::DecryptRsaPrivateKey, EsService, FirmwareVersion_500>(),
MakeServiceCommandMetaEx<CommandId::ImportEsKey, &EsService::ImportEsKey, EsService>(),
MakeServiceCommandMetaEx<CommandId::UnwrapTitleKey, &EsService::UnwrapTitleKey, EsService>(),
MakeServiceCommandMetaEx<CommandId::UnwrapCommonTitleKey, &EsService::UnwrapCommonTitleKey, EsService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::ImportDrmKey, &EsService::ImportDrmKey, EsService, FirmwareVersion_500>(),
MakeServiceCommandMetaEx<CommandId::DrmExpMod, &EsService::DrmExpMod, EsService, FirmwareVersion_500>(),
MakeServiceCommandMetaEx<CommandId::UnwrapElicenseKey, &EsService::UnwrapElicenseKey, EsService, FirmwareVersion_600>(),
MakeServiceCommandMetaEx<CommandId::LoadElicenseKey, &EsService::LoadElicenseKey, EsService, FirmwareVersion_600>(),
MAKE_SERVICE_COMMAND_META(EsService, GetConfig),
MAKE_SERVICE_COMMAND_META(EsService, ExpMod),
MAKE_SERVICE_COMMAND_META(EsService, SetConfig),
MAKE_SERVICE_COMMAND_META(EsService, GenerateRandomBytes),
MAKE_SERVICE_COMMAND_META(EsService, IsDevelopment),
MAKE_SERVICE_COMMAND_META(EsService, SetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(EsService, GetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(EsService, GenerateAesKek),
MAKE_SERVICE_COMMAND_META(EsService, LoadAesKey),
MAKE_SERVICE_COMMAND_META(EsService, GenerateAesKey),
MAKE_SERVICE_COMMAND_META(EsService, DecryptAesKey),
MAKE_SERVICE_COMMAND_META(EsService, CryptAesCtr),
MAKE_SERVICE_COMMAND_META(EsService, ComputeCmac),
MAKE_SERVICE_COMMAND_META(EsService, AllocateAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(EsService, FreeAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(EsService, GetAesKeyslotAvailableEvent, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(EsService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400),
MAKE_SERVICE_COMMAND_META(EsService, DecryptRsaPrivateKey, FirmwareVersion_500),
MAKE_SERVICE_COMMAND_META(EsService, ImportEsKey),
MAKE_SERVICE_COMMAND_META(EsService, UnwrapTitleKey),
MAKE_SERVICE_COMMAND_META(EsService, UnwrapCommonTitleKey, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(EsService, ImportDrmKey, FirmwareVersion_500),
MAKE_SERVICE_COMMAND_META(EsService, DrmExpMod, FirmwareVersion_500),
MAKE_SERVICE_COMMAND_META(EsService, UnwrapElicenseKey, FirmwareVersion_600),
MAKE_SERVICE_COMMAND_META(EsService, LoadElicenseKey, FirmwareVersion_600),
};
};

View file

@ -36,27 +36,27 @@ namespace sts::spl {
virtual Result GetPackage2Hash(OutPointerWithClientSize<u8> dst);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMetaEx<CommandId::GetConfig, &FsService::GetConfig, FsService>(),
MakeServiceCommandMetaEx<CommandId::ExpMod, &FsService::ExpMod, FsService>(),
MakeServiceCommandMetaEx<CommandId::SetConfig, &FsService::SetConfig, FsService>(),
MakeServiceCommandMetaEx<CommandId::GenerateRandomBytes, &FsService::GenerateRandomBytes, FsService>(),
MakeServiceCommandMetaEx<CommandId::IsDevelopment, &FsService::IsDevelopment, FsService>(),
MakeServiceCommandMetaEx<CommandId::SetBootReason, &FsService::SetBootReason, FsService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GetBootReason, &FsService::GetBootReason, FsService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKek, &FsService::GenerateAesKek, FsService>(),
MakeServiceCommandMetaEx<CommandId::LoadAesKey, &FsService::LoadAesKey, FsService>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKey, &FsService::GenerateAesKey, FsService>(),
MakeServiceCommandMetaEx<CommandId::DecryptAesKey, &FsService::DecryptAesKey, FsService>(),
MakeServiceCommandMetaEx<CommandId::CryptAesCtr, &FsService::CryptAesCtr, FsService>(),
MakeServiceCommandMetaEx<CommandId::ComputeCmac, &FsService::ComputeCmac, FsService>(),
MakeServiceCommandMetaEx<CommandId::AllocateAesKeyslot, &FsService::AllocateAesKeyslot, FsService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::FreeAesKeyslot, &FsService::FreeAesKeyslot, FsService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::GetAesKeyslotAvailableEvent, &FsService::GetAesKeyslotAvailableEvent, FsService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::ImportLotusKey, &FsService::ImportLotusKey, FsService>(),
MakeServiceCommandMetaEx<CommandId::DecryptLotusMessage, &FsService::DecryptLotusMessage, FsService>(),
MakeServiceCommandMetaEx<CommandId::GenerateSpecificAesKey, &FsService::GenerateSpecificAesKey, FsService>(),
MakeServiceCommandMetaEx<CommandId::LoadTitleKey, &FsService::LoadTitleKey, FsService>(),
MakeServiceCommandMetaEx<CommandId::GetPackage2Hash, &FsService::GetPackage2Hash, FsService, FirmwareVersion_500>(),
MAKE_SERVICE_COMMAND_META(FsService, GetConfig),
MAKE_SERVICE_COMMAND_META(FsService, ExpMod),
MAKE_SERVICE_COMMAND_META(FsService, SetConfig),
MAKE_SERVICE_COMMAND_META(FsService, GenerateRandomBytes),
MAKE_SERVICE_COMMAND_META(FsService, IsDevelopment),
MAKE_SERVICE_COMMAND_META(FsService, SetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(FsService, GetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(FsService, GenerateAesKek),
MAKE_SERVICE_COMMAND_META(FsService, LoadAesKey),
MAKE_SERVICE_COMMAND_META(FsService, GenerateAesKey),
MAKE_SERVICE_COMMAND_META(FsService, DecryptAesKey),
MAKE_SERVICE_COMMAND_META(FsService, CryptAesCtr),
MAKE_SERVICE_COMMAND_META(FsService, ComputeCmac),
MAKE_SERVICE_COMMAND_META(FsService, AllocateAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(FsService, FreeAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(FsService, GetAesKeyslotAvailableEvent, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(FsService, ImportLotusKey),
MAKE_SERVICE_COMMAND_META(FsService, DecryptLotusMessage),
MAKE_SERVICE_COMMAND_META(FsService, GenerateSpecificAesKey),
MAKE_SERVICE_COMMAND_META(FsService, LoadTitleKey),
MAKE_SERVICE_COMMAND_META(FsService, GetPackage2Hash, FirmwareVersion_500),
};
};

View file

@ -80,13 +80,13 @@ namespace sts::spl {
virtual Result GetBootReason(Out<BootReasonValue> out);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<CommandId::GetConfig, &GeneralService::GetConfig>(),
MakeServiceCommandMeta<CommandId::ExpMod, &GeneralService::ExpMod>(),
MakeServiceCommandMeta<CommandId::SetConfig, &GeneralService::SetConfig>(),
MakeServiceCommandMeta<CommandId::GenerateRandomBytes, &GeneralService::GenerateRandomBytes>(),
MakeServiceCommandMeta<CommandId::IsDevelopment, &GeneralService::IsDevelopment>(),
MakeServiceCommandMeta<CommandId::SetBootReason, &GeneralService::SetBootReason, FirmwareVersion_300>(),
MakeServiceCommandMeta<CommandId::GetBootReason, &GeneralService::GetBootReason, FirmwareVersion_300>(),
MAKE_SERVICE_COMMAND_META(GeneralService, GetConfig),
MAKE_SERVICE_COMMAND_META(GeneralService, ExpMod),
MAKE_SERVICE_COMMAND_META(GeneralService, SetConfig),
MAKE_SERVICE_COMMAND_META(GeneralService, GenerateRandomBytes),
MAKE_SERVICE_COMMAND_META(GeneralService, IsDevelopment),
MAKE_SERVICE_COMMAND_META(GeneralService, SetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(GeneralService, GetBootReason, FirmwareVersion_300),
};
};

View file

@ -33,25 +33,25 @@ namespace sts::spl {
virtual Result ReEncryptRsaPrivateKey(OutPointerWithClientSize<u8> out, InPointer<u8> src, AccessKey access_key_dec, KeySource source_dec, AccessKey access_key_enc, KeySource source_enc, u32 option);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMetaEx<CommandId::GetConfig, &ManuService::GetConfig, ManuService>(),
MakeServiceCommandMetaEx<CommandId::ExpMod, &ManuService::ExpMod, ManuService>(),
MakeServiceCommandMetaEx<CommandId::SetConfig, &ManuService::SetConfig, ManuService>(),
MakeServiceCommandMetaEx<CommandId::GenerateRandomBytes, &ManuService::GenerateRandomBytes, ManuService>(),
MakeServiceCommandMetaEx<CommandId::IsDevelopment, &ManuService::IsDevelopment, ManuService>(),
MakeServiceCommandMetaEx<CommandId::SetBootReason, &ManuService::SetBootReason, ManuService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GetBootReason, &ManuService::GetBootReason, ManuService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKek, &ManuService::GenerateAesKek, ManuService>(),
MakeServiceCommandMetaEx<CommandId::LoadAesKey, &ManuService::LoadAesKey, ManuService>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKey, &ManuService::GenerateAesKey, ManuService>(),
MakeServiceCommandMetaEx<CommandId::DecryptAesKey, &ManuService::DecryptAesKey, ManuService>(),
MakeServiceCommandMetaEx<CommandId::CryptAesCtr, &ManuService::CryptAesCtr, ManuService>(),
MakeServiceCommandMetaEx<CommandId::ComputeCmac, &ManuService::ComputeCmac, ManuService>(),
MakeServiceCommandMetaEx<CommandId::AllocateAesKeyslot, &ManuService::AllocateAesKeyslot, ManuService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::FreeAesKeyslot, &ManuService::FreeAesKeyslot, ManuService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::GetAesKeyslotAvailableEvent, &ManuService::GetAesKeyslotAvailableEvent, ManuService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::DecryptRsaPrivateKey, &ManuService::DecryptRsaPrivateKeyDeprecated, ManuService, FirmwareVersion_400, FirmwareVersion_400>(),
MakeServiceCommandMetaEx<CommandId::DecryptRsaPrivateKey, &ManuService::DecryptRsaPrivateKey, ManuService, FirmwareVersion_500>(),
MakeServiceCommandMetaEx<CommandId::ReEncryptRsaPrivateKey, &ManuService::ReEncryptRsaPrivateKey, ManuService, FirmwareVersion_500>(),
MAKE_SERVICE_COMMAND_META(ManuService, GetConfig),
MAKE_SERVICE_COMMAND_META(ManuService, ExpMod),
MAKE_SERVICE_COMMAND_META(ManuService, SetConfig),
MAKE_SERVICE_COMMAND_META(ManuService, GenerateRandomBytes),
MAKE_SERVICE_COMMAND_META(ManuService, IsDevelopment),
MAKE_SERVICE_COMMAND_META(ManuService, SetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(ManuService, GetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(ManuService, GenerateAesKek),
MAKE_SERVICE_COMMAND_META(ManuService, LoadAesKey),
MAKE_SERVICE_COMMAND_META(ManuService, GenerateAesKey),
MAKE_SERVICE_COMMAND_META(ManuService, DecryptAesKey),
MAKE_SERVICE_COMMAND_META(ManuService, CryptAesCtr),
MAKE_SERVICE_COMMAND_META(ManuService, ComputeCmac),
MAKE_SERVICE_COMMAND_META(ManuService, AllocateAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(ManuService, FreeAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(ManuService, GetAesKeyslotAvailableEvent, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(ManuService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400),
MAKE_SERVICE_COMMAND_META(ManuService, DecryptRsaPrivateKey, FirmwareVersion_500),
MAKE_SERVICE_COMMAND_META(ManuService, ReEncryptRsaPrivateKey, FirmwareVersion_500),
};
};

View file

@ -34,7 +34,7 @@ namespace sts::spl {
virtual Result GenerateRandomBytes(OutBuffer<u8> out);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<CommandId::GenerateRandomBytes, &RandomService::GenerateRandomBytes>(),
MAKE_SERVICE_COMMAND_META(RandomService, GenerateRandomBytes),
};
};

View file

@ -33,24 +33,24 @@ namespace sts::spl {
virtual Result DecryptRsaPrivateKey(OutPointerWithClientSize<u8> dst, InPointer<u8> src, AccessKey access_key, KeySource key_source);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMetaEx<CommandId::GetConfig, &RsaService::GetConfig, RsaService>(),
MakeServiceCommandMetaEx<CommandId::ExpMod, &RsaService::ExpMod, RsaService>(),
MakeServiceCommandMetaEx<CommandId::SetConfig, &RsaService::SetConfig, RsaService>(),
MakeServiceCommandMetaEx<CommandId::GenerateRandomBytes, &RsaService::GenerateRandomBytes, RsaService>(),
MakeServiceCommandMetaEx<CommandId::IsDevelopment, &RsaService::IsDevelopment, RsaService>(),
MakeServiceCommandMetaEx<CommandId::SetBootReason, &RsaService::SetBootReason, RsaService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GetBootReason, &RsaService::GetBootReason, RsaService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKek, &RsaService::GenerateAesKek, RsaService>(),
MakeServiceCommandMetaEx<CommandId::LoadAesKey, &RsaService::LoadAesKey, RsaService>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKey, &RsaService::GenerateAesKey, RsaService>(),
MakeServiceCommandMetaEx<CommandId::DecryptAesKey, &RsaService::DecryptAesKey, RsaService>(),
MakeServiceCommandMetaEx<CommandId::CryptAesCtr, &RsaService::CryptAesCtr, RsaService>(),
MakeServiceCommandMetaEx<CommandId::ComputeCmac, &RsaService::ComputeCmac, RsaService>(),
MakeServiceCommandMetaEx<CommandId::AllocateAesKeyslot, &RsaService::AllocateAesKeyslot, RsaService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::FreeAesKeyslot, &RsaService::FreeAesKeyslot, RsaService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::GetAesKeyslotAvailableEvent, &RsaService::GetAesKeyslotAvailableEvent, RsaService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::DecryptRsaPrivateKey, &RsaService::DecryptRsaPrivateKeyDeprecated, RsaService, FirmwareVersion_400, FirmwareVersion_400>(),
MakeServiceCommandMetaEx<CommandId::DecryptRsaPrivateKey, &RsaService::DecryptRsaPrivateKey, RsaService, FirmwareVersion_500>(),
MAKE_SERVICE_COMMAND_META(RsaService, GetConfig),
MAKE_SERVICE_COMMAND_META(RsaService, ExpMod),
MAKE_SERVICE_COMMAND_META(RsaService, SetConfig),
MAKE_SERVICE_COMMAND_META(RsaService, GenerateRandomBytes),
MAKE_SERVICE_COMMAND_META(RsaService, IsDevelopment),
MAKE_SERVICE_COMMAND_META(RsaService, SetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(RsaService, GetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(RsaService, GenerateAesKek),
MAKE_SERVICE_COMMAND_META(RsaService, LoadAesKey),
MAKE_SERVICE_COMMAND_META(RsaService, GenerateAesKey),
MAKE_SERVICE_COMMAND_META(RsaService, DecryptAesKey),
MAKE_SERVICE_COMMAND_META(RsaService, CryptAesCtr),
MAKE_SERVICE_COMMAND_META(RsaService, ComputeCmac),
MAKE_SERVICE_COMMAND_META(RsaService, AllocateAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(RsaService, FreeAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(RsaService, GetAesKeyslotAvailableEvent, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(RsaService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400),
MAKE_SERVICE_COMMAND_META(RsaService, DecryptRsaPrivateKey, FirmwareVersion_500),
};
};

View file

@ -33,26 +33,26 @@ namespace sts::spl {
virtual Result SslExpMod(OutPointerWithClientSize<u8> out, InPointer<u8> base, InPointer<u8> mod);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMetaEx<CommandId::GetConfig, &SslService::GetConfig, SslService>(),
MakeServiceCommandMetaEx<CommandId::ExpMod, &SslService::ExpMod, SslService>(),
MakeServiceCommandMetaEx<CommandId::SetConfig, &SslService::SetConfig, SslService>(),
MakeServiceCommandMetaEx<CommandId::GenerateRandomBytes, &SslService::GenerateRandomBytes, SslService>(),
MakeServiceCommandMetaEx<CommandId::IsDevelopment, &SslService::IsDevelopment, SslService>(),
MakeServiceCommandMetaEx<CommandId::SetBootReason, &SslService::SetBootReason, SslService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GetBootReason, &SslService::GetBootReason, SslService, FirmwareVersion_300>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKek, &SslService::GenerateAesKek, SslService>(),
MakeServiceCommandMetaEx<CommandId::LoadAesKey, &SslService::LoadAesKey, SslService>(),
MakeServiceCommandMetaEx<CommandId::GenerateAesKey, &SslService::GenerateAesKey, SslService>(),
MakeServiceCommandMetaEx<CommandId::DecryptAesKey, &SslService::DecryptAesKey, SslService>(),
MakeServiceCommandMetaEx<CommandId::CryptAesCtr, &SslService::CryptAesCtr, SslService>(),
MakeServiceCommandMetaEx<CommandId::ComputeCmac, &SslService::ComputeCmac, SslService>(),
MakeServiceCommandMetaEx<CommandId::AllocateAesKeyslot, &SslService::AllocateAesKeyslot, SslService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::FreeAesKeyslot, &SslService::FreeAesKeyslot, SslService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::GetAesKeyslotAvailableEvent, &SslService::GetAesKeyslotAvailableEvent, SslService, FirmwareVersion_200>(),
MakeServiceCommandMetaEx<CommandId::DecryptRsaPrivateKey, &SslService::DecryptRsaPrivateKeyDeprecated, SslService, FirmwareVersion_400, FirmwareVersion_400>(),
MakeServiceCommandMetaEx<CommandId::DecryptRsaPrivateKey, &SslService::DecryptRsaPrivateKey, SslService, FirmwareVersion_500>(),
MakeServiceCommandMetaEx<CommandId::ImportSslKey, &SslService::ImportSslKey, SslService, FirmwareVersion_500>(),
MakeServiceCommandMetaEx<CommandId::SslExpMod, &SslService::SslExpMod, SslService, FirmwareVersion_500>(),
MAKE_SERVICE_COMMAND_META(SslService, GetConfig),
MAKE_SERVICE_COMMAND_META(SslService, ExpMod),
MAKE_SERVICE_COMMAND_META(SslService, SetConfig),
MAKE_SERVICE_COMMAND_META(SslService, GenerateRandomBytes),
MAKE_SERVICE_COMMAND_META(SslService, IsDevelopment),
MAKE_SERVICE_COMMAND_META(SslService, SetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(SslService, GetBootReason, FirmwareVersion_300),
MAKE_SERVICE_COMMAND_META(SslService, GenerateAesKek),
MAKE_SERVICE_COMMAND_META(SslService, LoadAesKey),
MAKE_SERVICE_COMMAND_META(SslService, GenerateAesKey),
MAKE_SERVICE_COMMAND_META(SslService, DecryptAesKey),
MAKE_SERVICE_COMMAND_META(SslService, CryptAesCtr),
MAKE_SERVICE_COMMAND_META(SslService, ComputeCmac),
MAKE_SERVICE_COMMAND_META(SslService, AllocateAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(SslService, FreeAesKeyslot, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(SslService, GetAesKeyslotAvailableEvent, FirmwareVersion_200),
MAKE_SERVICE_COMMAND_META(SslService, DecryptRsaPrivateKey, FirmwareVersion_400, FirmwareVersion_400),
MAKE_SERVICE_COMMAND_META(SslService, DecryptRsaPrivateKey, FirmwareVersion_500),
MAKE_SERVICE_COMMAND_META(SslService, ImportSslKey, FirmwareVersion_500),
MAKE_SERVICE_COMMAND_META(SslService, SslExpMod, FirmwareVersion_500),
};
};