2019-01-31 09:10:19 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <iomanip>
|
|
|
|
#include "MetaProcess.h"
|
2019-10-31 11:35:03 +00:00
|
|
|
#include <nn/hac/define/svc.h>
|
2019-01-31 09:10:19 +00:00
|
|
|
|
|
|
|
MetaProcess::MetaProcess() :
|
|
|
|
mFile(),
|
|
|
|
mCliOutputMode(_BIT(OUTPUT_BASIC)),
|
|
|
|
mVerify(false)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::process()
|
|
|
|
{
|
|
|
|
importMeta();
|
|
|
|
|
|
|
|
if (mVerify)
|
|
|
|
{
|
|
|
|
validateAcidSignature(mMeta.getAcid());
|
|
|
|
validateAciFromAcid(mMeta.getAci(), mMeta.getAcid());
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_HAS_BIT(mCliOutputMode, OUTPUT_BASIC))
|
|
|
|
{
|
|
|
|
// npdm binary
|
|
|
|
displayMetaHeader(mMeta);
|
|
|
|
|
|
|
|
// aci binary
|
|
|
|
displayAciHdr(mMeta.getAci());
|
|
|
|
displayFac(mMeta.getAci().getFileSystemAccessControl());
|
|
|
|
displaySac(mMeta.getAci().getServiceAccessControl());
|
|
|
|
displayKernelCap(mMeta.getAci().getKernelCapabilities());
|
|
|
|
|
|
|
|
// acid binary
|
|
|
|
if (_HAS_BIT(mCliOutputMode, OUTPUT_EXTENDED))
|
|
|
|
{
|
|
|
|
displayAciDescHdr(mMeta.getAcid());
|
|
|
|
displayFac(mMeta.getAcid().getFileSystemAccessControl());
|
|
|
|
displaySac(mMeta.getAcid().getServiceAccessControl());
|
|
|
|
displayKernelCap(mMeta.getAcid().getKernelCapabilities());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::setInputFile(const fnd::SharedPtr<fnd::IFile>& file)
|
|
|
|
{
|
|
|
|
mFile = file;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::setKeyCfg(const KeyConfiguration& keycfg)
|
|
|
|
{
|
|
|
|
mKeyCfg = keycfg;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::setCliOutputMode(CliOutputMode type)
|
|
|
|
{
|
|
|
|
mCliOutputMode = type;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::setVerifyMode(bool verify)
|
|
|
|
{
|
|
|
|
mVerify = verify;
|
|
|
|
}
|
|
|
|
|
|
|
|
const nn::hac::Meta& MetaProcess::getMeta() const
|
|
|
|
{
|
|
|
|
return mMeta;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::importMeta()
|
|
|
|
{
|
|
|
|
fnd::Vec<byte_t> scratch;
|
|
|
|
|
|
|
|
if (*mFile == nullptr)
|
|
|
|
{
|
|
|
|
throw fnd::Exception(kModuleName, "No file reader set.");
|
|
|
|
}
|
|
|
|
|
|
|
|
scratch.alloc((*mFile)->size());
|
|
|
|
(*mFile)->read(scratch.data(), 0, scratch.size());
|
|
|
|
|
|
|
|
mMeta.fromBytes(scratch.data(), scratch.size());
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::validateAcidSignature(const nn::hac::AccessControlInfoDesc& acid)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
fnd::rsa::sRsa2048Key acid_sign_key;
|
|
|
|
if (mKeyCfg.getAcidSignKey(acid_sign_key) != true)
|
|
|
|
throw fnd::Exception();
|
|
|
|
|
|
|
|
acid.validateSignature(acid_sign_key);
|
|
|
|
}
|
|
|
|
catch (...) {
|
|
|
|
std::cout << "[WARNING] ACID Signature: FAIL" << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::validateAciFromAcid(const nn::hac::AccessControlInfo& aci, const nn::hac::AccessControlInfoDesc& acid)
|
|
|
|
{
|
|
|
|
// check Program ID
|
|
|
|
if (acid.getProgramIdRestrict().min > 0 && aci.getProgramId() < acid.getProgramIdRestrict().min)
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI ProgramId: FAIL (Outside Legal Range)" << std::endl;
|
|
|
|
}
|
|
|
|
else if (acid.getProgramIdRestrict().max > 0 && aci.getProgramId() > acid.getProgramIdRestrict().max)
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI ProgramId: FAIL (Outside Legal Range)" << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (size_t i = 0; i < aci.getFileSystemAccessControl().getFsaRightsList().size(); i++)
|
|
|
|
{
|
|
|
|
bool fsaRightFound = false;
|
|
|
|
for (size_t j = 0; j < acid.getFileSystemAccessControl().getFsaRightsList().size() && fsaRightFound == false; j++)
|
|
|
|
{
|
|
|
|
if (aci.getFileSystemAccessControl().getFsaRightsList()[i] == acid.getFileSystemAccessControl().getFsaRightsList()[j])
|
|
|
|
fsaRightFound = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fsaRightFound == false)
|
|
|
|
{
|
|
|
|
|
|
|
|
std::cout << "[WARNING] ACI/FAC FsaRights: FAIL (" << getFsaRightStr(aci.getFileSystemAccessControl().getFsaRightsList()[i]) << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (size_t i = 0; i < aci.getFileSystemAccessControl().getContentOwnerIdList().size(); i++)
|
|
|
|
{
|
|
|
|
bool rightFound = false;
|
|
|
|
for (size_t j = 0; j < acid.getFileSystemAccessControl().getContentOwnerIdList().size() && rightFound == false; j++)
|
|
|
|
{
|
|
|
|
if (aci.getFileSystemAccessControl().getContentOwnerIdList()[i] == acid.getFileSystemAccessControl().getContentOwnerIdList()[j])
|
|
|
|
rightFound = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rightFound == false)
|
|
|
|
{
|
|
|
|
|
|
|
|
std::cout << "[WARNING] ACI/FAC ContentOwnerId: FAIL (" << std::hex << std::setw(16) << std::setfill('0') << aci.getFileSystemAccessControl().getContentOwnerIdList()[i] << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (size_t i = 0; i < aci.getFileSystemAccessControl().getSaveDataOwnerIdList().size(); i++)
|
|
|
|
{
|
|
|
|
bool rightFound = false;
|
|
|
|
for (size_t j = 0; j < acid.getFileSystemAccessControl().getSaveDataOwnerIdList().size() && rightFound == false; j++)
|
|
|
|
{
|
|
|
|
if (aci.getFileSystemAccessControl().getSaveDataOwnerIdList()[i] == acid.getFileSystemAccessControl().getSaveDataOwnerIdList()[j])
|
|
|
|
rightFound = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rightFound == false)
|
|
|
|
{
|
|
|
|
|
|
|
|
std::cout << "[WARNING] ACI/FAC SaveDataOwnerId: FAIL (" << std::hex << std::setw(16) << std::setfill('0') << aci.getFileSystemAccessControl().getSaveDataOwnerIdList()[i].id << "(" << std::dec << (uint32_t)aci.getFileSystemAccessControl().getSaveDataOwnerIdList()[i].access_type << ") not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// check SAC
|
|
|
|
for (size_t i = 0; i < aci.getServiceAccessControl().getServiceList().size(); i++)
|
|
|
|
{
|
|
|
|
bool rightFound = false;
|
|
|
|
for (size_t j = 0; j < acid.getServiceAccessControl().getServiceList().size() && rightFound == false; j++)
|
|
|
|
{
|
|
|
|
if (aci.getServiceAccessControl().getServiceList()[i] == acid.getServiceAccessControl().getServiceList()[j])
|
|
|
|
rightFound = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rightFound == false)
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI/SAC ServiceList: FAIL (" << aci.getServiceAccessControl().getServiceList()[i].getName() << (aci.getServiceAccessControl().getServiceList()[i].isServer()? " (Server)" : "") << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// check KC
|
|
|
|
// check thread info
|
|
|
|
if (aci.getKernelCapabilities().getThreadInfo().getMaxCpuId() != acid.getKernelCapabilities().getThreadInfo().getMaxCpuId())
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI/KC ThreadInfo/MaxCpuId: FAIL (" << std::dec << (uint32_t)aci.getKernelCapabilities().getThreadInfo().getMaxCpuId() << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
if (aci.getKernelCapabilities().getThreadInfo().getMinCpuId() != acid.getKernelCapabilities().getThreadInfo().getMinCpuId())
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI/KC ThreadInfo/MinCpuId: FAIL (" << std::dec << (uint32_t)aci.getKernelCapabilities().getThreadInfo().getMinCpuId() << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
if (aci.getKernelCapabilities().getThreadInfo().getMaxPriority() != acid.getKernelCapabilities().getThreadInfo().getMaxPriority())
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI/KC ThreadInfo/MaxPriority: FAIL (" << std::dec << (uint32_t)aci.getKernelCapabilities().getThreadInfo().getMaxPriority() << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
if (aci.getKernelCapabilities().getThreadInfo().getMinPriority() != acid.getKernelCapabilities().getThreadInfo().getMinPriority())
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI/KC ThreadInfo/MinPriority: FAIL (" << std::dec << (uint32_t)aci.getKernelCapabilities().getThreadInfo().getMinPriority() << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
// check system calls
|
|
|
|
for (size_t i = 0; i < aci.getKernelCapabilities().getSystemCalls().getSystemCalls().size(); i++)
|
|
|
|
{
|
|
|
|
bool rightFound = false;
|
|
|
|
for (size_t j = 0; j < acid.getKernelCapabilities().getSystemCalls().getSystemCalls().size() && rightFound == false; j++)
|
|
|
|
{
|
|
|
|
if (aci.getKernelCapabilities().getSystemCalls().getSystemCalls()[i] == acid.getKernelCapabilities().getSystemCalls().getSystemCalls()[j])
|
|
|
|
rightFound = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rightFound == false)
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI/KC SystemCallList: FAIL (" << getSystemCallStr(aci.getKernelCapabilities().getSystemCalls().getSystemCalls()[i]) << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// check memory maps
|
|
|
|
for (size_t i = 0; i < aci.getKernelCapabilities().getMemoryMaps().getMemoryMaps().size(); i++)
|
|
|
|
{
|
|
|
|
bool rightFound = false;
|
|
|
|
for (size_t j = 0; j < acid.getKernelCapabilities().getMemoryMaps().getMemoryMaps().size() && rightFound == false; j++)
|
|
|
|
{
|
|
|
|
if (aci.getKernelCapabilities().getMemoryMaps().getMemoryMaps()[i] == acid.getKernelCapabilities().getMemoryMaps().getMemoryMaps()[j])
|
|
|
|
rightFound = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rightFound == false)
|
|
|
|
{
|
|
|
|
const nn::hac::MemoryMappingHandler::sMemoryMapping& map = aci.getKernelCapabilities().getMemoryMaps().getMemoryMaps()[i];
|
|
|
|
|
|
|
|
std::cout << "[WARNING] ACI/KC MemoryMap: FAIL (0x" << std::hex << std::setw(16) << std::setfill('0') << ((uint64_t)map.addr << 12) << " - 0x" << std::hex << std::setw(16) << std::setfill('0') << (((uint64_t)(map.addr + map.size) << 12) - 1) << " (perm=" << getMemMapPermStr(map.perm) << ") (type=" << getMemMapTypeStr(map.type) << ") not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (size_t i = 0; i < aci.getKernelCapabilities().getMemoryMaps().getIoMemoryMaps().size(); i++)
|
|
|
|
{
|
|
|
|
bool rightFound = false;
|
|
|
|
for (size_t j = 0; j < acid.getKernelCapabilities().getMemoryMaps().getIoMemoryMaps().size() && rightFound == false; j++)
|
|
|
|
{
|
|
|
|
if (aci.getKernelCapabilities().getMemoryMaps().getIoMemoryMaps()[i] == acid.getKernelCapabilities().getMemoryMaps().getIoMemoryMaps()[j])
|
|
|
|
rightFound = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rightFound == false)
|
|
|
|
{
|
|
|
|
const nn::hac::MemoryMappingHandler::sMemoryMapping& map = aci.getKernelCapabilities().getMemoryMaps().getIoMemoryMaps()[i];
|
|
|
|
|
|
|
|
std::cout << "[WARNING] ACI/KC IoMemoryMap: FAIL (0x" << std::hex << std::setw(16) << std::setfill('0') << ((uint64_t)map.addr << 12) << " - 0x" << std::hex << std::setw(16) << std::setfill('0') << (((uint64_t)(map.addr + map.size) << 12) - 1) << " (perm=" << getMemMapPermStr(map.perm) << ") (type=" << getMemMapTypeStr(map.type) << ") not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// check interupts
|
|
|
|
for (size_t i = 0; i < aci.getKernelCapabilities().getInterupts().getInteruptList().size(); i++)
|
|
|
|
{
|
|
|
|
bool rightFound = false;
|
|
|
|
for (size_t j = 0; j < acid.getKernelCapabilities().getInterupts().getInteruptList().size() && rightFound == false; j++)
|
|
|
|
{
|
|
|
|
if (aci.getKernelCapabilities().getInterupts().getInteruptList()[i] == acid.getKernelCapabilities().getInterupts().getInteruptList()[j])
|
|
|
|
rightFound = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rightFound == false)
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI/KC InteruptsList: FAIL (0x" << std::hex << (uint32_t)aci.getKernelCapabilities().getInterupts().getInteruptList()[i] << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// check misc params
|
|
|
|
if (aci.getKernelCapabilities().getMiscParams().getProgramType() != acid.getKernelCapabilities().getMiscParams().getProgramType())
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI/KC ProgramType: FAIL (" << std::dec << (uint32_t)aci.getKernelCapabilities().getMiscParams().getProgramType() << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
// check kernel version
|
|
|
|
uint32_t aciKernelVersion = (uint32_t)aci.getKernelCapabilities().getKernelVersion().getVerMajor() << 16 | (uint32_t)aci.getKernelCapabilities().getKernelVersion().getVerMinor();
|
|
|
|
uint32_t acidKernelVersion = (uint32_t)acid.getKernelCapabilities().getKernelVersion().getVerMajor() << 16 | (uint32_t)acid.getKernelCapabilities().getKernelVersion().getVerMinor();
|
|
|
|
if (aciKernelVersion < acidKernelVersion)
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI/KC RequiredKernelVersion: FAIL (" << std::dec << aci.getKernelCapabilities().getKernelVersion().getVerMajor() << "." << aci.getKernelCapabilities().getKernelVersion().getVerMinor() << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
// check handle table size
|
|
|
|
if (aci.getKernelCapabilities().getHandleTableSize().getHandleTableSize() > acid.getKernelCapabilities().getHandleTableSize().getHandleTableSize())
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI/KC HandleTableSize: FAIL (0x" << std::hex << (uint32_t)aci.getKernelCapabilities().getHandleTableSize().getHandleTableSize() << " too large)" << std::endl;
|
|
|
|
}
|
|
|
|
// check misc flags
|
|
|
|
for (size_t i = 0; i < aci.getKernelCapabilities().getMiscFlags().getFlagList().size(); i++)
|
|
|
|
{
|
|
|
|
bool rightFound = false;
|
|
|
|
for (size_t j = 0; j < acid.getKernelCapabilities().getMiscFlags().getFlagList().size() && rightFound == false; j++)
|
|
|
|
{
|
|
|
|
if (aci.getKernelCapabilities().getMiscFlags().getFlagList()[i] == acid.getKernelCapabilities().getMiscFlags().getFlagList()[j])
|
|
|
|
rightFound = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rightFound == false)
|
|
|
|
{
|
|
|
|
std::cout << "[WARNING] ACI/KC MiscFlag: FAIL (" << getMiscFlagStr(aci.getKernelCapabilities().getMiscFlags().getFlagList()[i]) << " not permitted)" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::displayMetaHeader(const nn::hac::Meta& hdr)
|
|
|
|
{
|
|
|
|
std::cout << "[Meta Header]" << std::endl;
|
|
|
|
std::cout << " Process Architecture Params:" << std::endl;
|
|
|
|
std::cout << " Ins. Type: " << getInstructionTypeStr(hdr.getInstructionType()) << std::endl;
|
|
|
|
std::cout << " Addr Space: " << getProcAddressSpaceTypeStr(hdr.getProcAddressSpaceType()) << std::endl;
|
|
|
|
std::cout << " Main Thread Params:" << std::endl;
|
|
|
|
std::cout << " Priority: " << std::dec << (uint32_t)hdr.getMainThreadPriority() << std::endl;
|
|
|
|
std::cout << " CpuId: " << std::dec << (uint32_t)hdr.getMainThreadCpuId() << std::endl;
|
|
|
|
std::cout << " StackSize: 0x" << std::hex << hdr.getMainThreadStackSize() << std::endl;
|
|
|
|
std::cout << " TitleInfo:" << std::endl;
|
|
|
|
std::cout << " Version: v" << std::dec << hdr.getVersion() << std::endl;
|
|
|
|
std::cout << " Name: " << hdr.getName() << std::endl;
|
|
|
|
if (hdr.getProductCode().length())
|
|
|
|
{
|
|
|
|
std::cout << " ProductCode: " << hdr.getProductCode() << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::displayAciHdr(const nn::hac::AccessControlInfo& aci)
|
|
|
|
{
|
|
|
|
std::cout << "[Access Control Info]" << std::endl;
|
|
|
|
std::cout << " ProgramID: 0x" << std::hex << std::setw(16) << std::setfill('0') << aci.getProgramId() << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::displayAciDescHdr(const nn::hac::AccessControlInfoDesc& acid)
|
|
|
|
{
|
|
|
|
std::cout << "[Access Control Info Desc]" << std::endl;
|
|
|
|
if (acid.getFlagList().size() > 0 || _HAS_BIT(mCliOutputMode, OUTPUT_EXTENDED))
|
|
|
|
{
|
|
|
|
std::cout << " Flags: " << std::endl;
|
|
|
|
for (size_t i = 0; i < acid.getFlagList().size(); i++)
|
|
|
|
{
|
|
|
|
std::cout << " " << getAcidFlagStr(acid.getFlagList()[i]) << " (" << std::dec << (uint32_t)acid.getFlagList()[i] << ")" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
std::cout << " ProgramID Restriction" << std::endl;
|
|
|
|
std::cout << " Min: 0x" << std::hex << std::setw(16) << std::setfill('0') << acid.getProgramIdRestrict().min << std::endl;
|
|
|
|
std::cout << " Max: 0x" << std::hex << std::setw(16) << std::setfill('0') << acid.getProgramIdRestrict().max << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::displayFac(const nn::hac::FileSystemAccessControl& fac)
|
|
|
|
{
|
|
|
|
std::cout << "[FS Access Control]" << std::endl;
|
|
|
|
std::cout << " Format Version: " << std::dec << (uint32_t)fac.getFormatVersion() << std::endl;
|
|
|
|
|
|
|
|
if (fac.getFsaRightsList().size())
|
|
|
|
{
|
|
|
|
std::cout << " FS Rights:" << std::endl;
|
|
|
|
for (size_t i = 0; i < fac.getFsaRightsList().size(); i++)
|
|
|
|
{
|
|
|
|
if (i % 10 == 0)
|
|
|
|
{
|
|
|
|
if (i != 0)
|
|
|
|
std::cout << std::endl;
|
|
|
|
std::cout << " ";
|
|
|
|
}
|
|
|
|
std::cout << getFsaRightStr(fac.getFsaRightsList()[i]);
|
|
|
|
if (_HAS_BIT(mCliOutputMode, OUTPUT_EXTENDED))
|
|
|
|
std::cout << " (bit " << std::dec << (uint32_t)fac.getFsaRightsList()[i] << ")";
|
|
|
|
if (fac.getFsaRightsList()[i] != fac.getFsaRightsList().atBack())
|
|
|
|
std::cout << ", ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fac.getContentOwnerIdList().size())
|
|
|
|
{
|
|
|
|
std::cout << " Content Owner IDs:" << std::endl;
|
|
|
|
for (size_t i = 0; i < fac.getContentOwnerIdList().size(); i++)
|
|
|
|
{
|
|
|
|
std::cout << " 0x" << std::hex << std::setw(16) << std::setfill('0') << fac.getContentOwnerIdList()[i] << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fac.getSaveDataOwnerIdList().size())
|
|
|
|
{
|
|
|
|
std::cout << " Save Data Owner IDs:" << std::endl;
|
|
|
|
for (size_t i = 0; i < fac.getSaveDataOwnerIdList().size(); i++)
|
|
|
|
{
|
|
|
|
std::cout << " 0x" << std::hex << std::setw(16) << std::setfill('0') << fac.getSaveDataOwnerIdList()[i].id << " (" << getSaveDataOwnerAccessModeStr(fac.getSaveDataOwnerIdList()[i].access_type) << ")" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::displaySac(const nn::hac::ServiceAccessControl& sac)
|
|
|
|
{
|
|
|
|
std::cout << "[Service Access Control]" << std::endl;
|
|
|
|
std::cout << " Service List:" << std::endl;
|
|
|
|
for (size_t i = 0; i < sac.getServiceList().size(); i++)
|
|
|
|
{
|
|
|
|
if (i % 10 == 0)
|
|
|
|
{
|
|
|
|
if (i != 0)
|
|
|
|
std::cout << std::endl;
|
|
|
|
std::cout << " ";
|
|
|
|
}
|
|
|
|
std::cout << sac.getServiceList()[i].getName();
|
|
|
|
if (sac.getServiceList()[i].isServer())
|
|
|
|
std::cout << "(isSrv)";
|
|
|
|
if (sac.getServiceList()[i] != sac.getServiceList().atBack())
|
|
|
|
std::cout << ", ";
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MetaProcess::displayKernelCap(const nn::hac::KernelCapabilityControl& kern)
|
|
|
|
{
|
|
|
|
std::cout << "[Kernel Capabilities]" << std::endl;
|
|
|
|
if (kern.getThreadInfo().isSet())
|
|
|
|
{
|
|
|
|
nn::hac::ThreadInfoHandler threadInfo = kern.getThreadInfo();
|
|
|
|
std::cout << " Thread Priority:" << std::endl;
|
|
|
|
std::cout << " Min: " << std::dec << (uint32_t)threadInfo.getMinPriority() << std::endl;
|
|
|
|
std::cout << " Max: " << std::dec << (uint32_t)threadInfo.getMaxPriority() << std::endl;
|
|
|
|
std::cout << " CpuId:" << std::endl;
|
|
|
|
std::cout << " Min: " << std::dec << (uint32_t)threadInfo.getMinCpuId() << std::endl;
|
|
|
|
std::cout << " Max: " << std::dec << (uint32_t)threadInfo.getMaxCpuId() << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (kern.getSystemCalls().isSet())
|
|
|
|
{
|
|
|
|
fnd::List<uint8_t> syscalls = kern.getSystemCalls().getSystemCalls();
|
|
|
|
std::cout << " SystemCalls:" << std::endl;
|
|
|
|
std::cout << " ";
|
|
|
|
size_t lineLen = 0;
|
|
|
|
for (size_t i = 0; i < syscalls.size(); i++)
|
|
|
|
{
|
|
|
|
if (lineLen > 60)
|
|
|
|
{
|
|
|
|
lineLen = 0;
|
|
|
|
std::cout << std::endl;
|
|
|
|
std::cout << " ";
|
|
|
|
}
|
|
|
|
std::cout << getSystemCallStr(syscalls[i]);
|
|
|
|
if (syscalls[i] != syscalls.atBack())
|
|
|
|
std::cout << ", ";
|
|
|
|
lineLen += strlen(getSystemCallStr(syscalls[i]));
|
|
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
if (kern.getMemoryMaps().isSet())
|
|
|
|
{
|
|
|
|
fnd::List<nn::hac::MemoryMappingHandler::sMemoryMapping> maps = kern.getMemoryMaps().getMemoryMaps();
|
|
|
|
fnd::List<nn::hac::MemoryMappingHandler::sMemoryMapping> ioMaps = kern.getMemoryMaps().getIoMemoryMaps();
|
|
|
|
|
|
|
|
std::cout << " MemoryMaps:" << std::endl;
|
|
|
|
for (size_t i = 0; i < maps.size(); i++)
|
|
|
|
{
|
|
|
|
std::cout << " 0x" << std::hex << std::setw(16) << std::setfill('0') << ((uint64_t)maps[i].addr << 12) << " - 0x" << std::hex << std::setw(16) << std::setfill('0') << (((uint64_t)(maps[i].addr + maps[i].size) << 12) - 1) << " (perm=" << getMemMapPermStr(maps[i].perm) << ") (type=" << getMemMapTypeStr(maps[i].type) << ")" << std::endl;
|
|
|
|
}
|
|
|
|
//std::cout << " IoMaps:" << std::endl;
|
|
|
|
for (size_t i = 0; i < ioMaps.size(); i++)
|
|
|
|
{
|
|
|
|
std::cout << " 0x" << std::hex << std::setw(16) << std::setfill('0') << ((uint64_t)ioMaps[i].addr << 12) << " - 0x" << std::hex << std::setw(16) << std::setfill('0') << (((uint64_t)(ioMaps[i].addr + ioMaps[i].size) << 12) - 1) << " (perm=" << getMemMapPermStr(ioMaps[i].perm) << ") (type=" << getMemMapTypeStr(ioMaps[i].type) << ")" << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (kern.getInterupts().isSet())
|
|
|
|
{
|
|
|
|
fnd::List<uint16_t> interupts = kern.getInterupts().getInteruptList();
|
|
|
|
std::cout << " Interupts Flags:" << std::endl;
|
|
|
|
for (uint32_t i = 0; i < interupts.size(); i++)
|
|
|
|
{
|
|
|
|
if (i % 10 == 0)
|
|
|
|
{
|
|
|
|
if (i != 0)
|
|
|
|
std::cout << std::endl;
|
|
|
|
std::cout << " ";
|
|
|
|
}
|
|
|
|
std::cout << "0x" << std::hex << (uint32_t)interupts[i];
|
|
|
|
if (interupts[i] != interupts.atBack())
|
|
|
|
std::cout << ", ";
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (kern.getMiscParams().isSet())
|
|
|
|
{
|
|
|
|
std::cout << " ProgramType: " << std::dec << (uint32_t)kern.getMiscParams().getProgramType() << std::endl;
|
|
|
|
}
|
|
|
|
if (kern.getKernelVersion().isSet())
|
|
|
|
{
|
|
|
|
std::cout << " Kernel Version: " << std::dec << (uint32_t)kern.getKernelVersion().getVerMajor() << "." << (uint32_t)kern.getKernelVersion().getVerMinor() << std::endl;
|
|
|
|
}
|
|
|
|
if (kern.getHandleTableSize().isSet())
|
|
|
|
{
|
|
|
|
std::cout << " Handle Table Size: 0x" << std::hex << kern.getHandleTableSize().getHandleTableSize() << std::endl;
|
|
|
|
}
|
|
|
|
if (kern.getMiscFlags().isSet())
|
|
|
|
{
|
|
|
|
fnd::List<nn::hac::MiscFlagsHandler::Flags> flagList = kern.getMiscFlags().getFlagList();
|
|
|
|
|
|
|
|
std::cout << " Misc Flags:" << std::endl;
|
|
|
|
for (uint32_t i = 0; i < flagList.size(); i++)
|
|
|
|
{
|
|
|
|
if (i % 10 == 0)
|
|
|
|
{
|
|
|
|
if (i != 0)
|
|
|
|
std::cout << std::endl;
|
|
|
|
std::cout << " ";
|
|
|
|
}
|
|
|
|
std::cout << getMiscFlagStr(flagList[i]);
|
|
|
|
if (flagList[i] != flagList.atBack())
|
|
|
|
std::cout << ", ";
|
|
|
|
std::cout << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* MetaProcess::getInstructionTypeStr(nn::hac::meta::InstructionType type) const
|
|
|
|
{
|
|
|
|
const char* str = nullptr;
|
|
|
|
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case (nn::hac::meta::INSTR_32BIT):
|
|
|
|
str = "32Bit";
|
|
|
|
break;
|
|
|
|
case (nn::hac::meta::INSTR_64BIT):
|
|
|
|
str = "64Bit";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
str = "Unknown";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* MetaProcess::getProcAddressSpaceTypeStr(nn::hac::meta::ProcAddrSpaceType type) const
|
|
|
|
{
|
|
|
|
const char* str = nullptr;
|
|
|
|
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case (nn::hac::meta::ADDR_SPACE_64BIT):
|
|
|
|
str = "64Bit";
|
|
|
|
break;
|
|
|
|
case (nn::hac::meta::ADDR_SPACE_32BIT):
|
|
|
|
str = "32Bit";
|
|
|
|
break;
|
|
|
|
case (nn::hac::meta::ADDR_SPACE_32BIT_NO_RESERVED):
|
|
|
|
str = "32Bit no reserved";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
str = "Unknown";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* MetaProcess::getAcidFlagStr(nn::hac::aci::Flag flag) const
|
|
|
|
{
|
|
|
|
const char* str = nullptr;
|
|
|
|
|
|
|
|
switch(flag)
|
|
|
|
{
|
|
|
|
case (nn::hac::aci::FLAG_PRODUCTION):
|
|
|
|
str = "Production";
|
|
|
|
break;
|
|
|
|
case (nn::hac::aci::FLAG_UNQUALIFIED_APPROVAL):
|
|
|
|
str = "UnqualifiedApproval";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
str = "Unknown";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* MetaProcess::getMiscFlagStr(nn::hac::MiscFlagsHandler::Flags flag) const
|
|
|
|
{
|
|
|
|
const char* str = nullptr;
|
|
|
|
|
|
|
|
switch(flag)
|
|
|
|
{
|
|
|
|
case (nn::hac::MiscFlagsHandler::FLAG_ENABLE_DEBUG):
|
|
|
|
str = "EnableDebug";
|
|
|
|
break;
|
|
|
|
case (nn::hac::MiscFlagsHandler::FLAG_FORCE_DEBUG):
|
|
|
|
str = "ForceDebug";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
str = "Unknown";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* MetaProcess::getFsaRightStr(nn::hac::fac::FsAccessFlag flag) const
|
|
|
|
{
|
|
|
|
const char* str = nullptr;
|
|
|
|
|
|
|
|
switch(flag)
|
|
|
|
{
|
|
|
|
case (nn::hac::fac::FSA_APPLICATION_INFO):
|
|
|
|
str = "ApplicationInfo";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_BOOT_MODE_CONTROL):
|
|
|
|
str = "BootModeControl";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_CALIBRATION):
|
|
|
|
str = "Calibration";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SYSTEM_SAVE_DATA):
|
|
|
|
str = "SystemSaveData";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_GAME_CARD):
|
|
|
|
str = "GameCard";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SAVE_DATA_BACKUP):
|
|
|
|
str = "SaveDataBackUp";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SAVE_DATA_MANAGEMENT):
|
|
|
|
str = "SaveDataManagement";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_BIS_ALL_RAW):
|
|
|
|
str = "BisAllRaw";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_GAME_CARD_RAW):
|
|
|
|
str = "GameCardRaw";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_GAME_CARD_PRIVATE):
|
|
|
|
str = "GameCardPrivate";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SET_TIME):
|
|
|
|
str = "SetTime";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_CONTENT_MANAGER):
|
|
|
|
str = "ContentManager";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_IMAGE_MANAGER):
|
|
|
|
str = "ImageManager";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_CREATE_SAVE_DATA):
|
|
|
|
str = "CreateSaveData";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SYSTEM_SAVE_DATA_MANAGEMENT):
|
|
|
|
str = "SystemSaveDataManagement";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_BIS_FILE_SYSTEM):
|
|
|
|
str = "BisFileSystem";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SYSTEM_UPDATE):
|
|
|
|
str = "SystemUpdate";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SAVE_DATA_META):
|
|
|
|
str = "SaveDataMeta";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_DEVICE_SAVE_CONTROL):
|
|
|
|
str = "DeviceSaveData";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SETTINGS_CONTROL):
|
|
|
|
str = "SettingsControl";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::fac::FSA_SYSTEM_DATA):
|
|
|
|
str = "SystemData";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SD_CARD):
|
|
|
|
str = "SdCard";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_HOST):
|
|
|
|
str = "Host";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_FILL_BIS):
|
|
|
|
str = "FillBis";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_CORRUPT_SAVE_DATA):
|
|
|
|
str = "CorruptSaveData";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SAVE_DATA_FOR_DEBUG):
|
|
|
|
str = "SaveDataForDebug";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_FORMAT_SD_CARD):
|
|
|
|
str = "FormateSdCard";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_GET_RIGHTS_ID):
|
|
|
|
str = "GetRightsId";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_REGISTER_EXTERNAL_KEY):
|
|
|
|
str = "RegisterExternalKey";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_REGISTER_UPDATE_PARTITION):
|
|
|
|
str = "RegisterUpdatePartition";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SAVE_DATA_TRANSFER):
|
|
|
|
str = "SaveDataTransfer";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_DEVICE_DETECTION):
|
|
|
|
str = "DeviceDetection";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_ACCESS_FAILURE_RESOLUTION):
|
|
|
|
str = "AccessFailureResolution";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_SAVE_DATA_TRANSFER_V2):
|
|
|
|
str = "SaveDataTransfer2";
|
|
|
|
break;
|
2019-01-31 09:10:19 +00:00
|
|
|
case (nn::hac::fac::FSA_DEBUG):
|
|
|
|
str = "Debug";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::FSA_FULL_PERMISSION):
|
|
|
|
str = "FullPermission";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
str = "Unknown";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* MetaProcess::getSaveDataOwnerAccessModeStr(nn::hac::fac::SaveDataOwnerIdAccessType type) const
|
|
|
|
{
|
|
|
|
const char* str = nullptr;
|
|
|
|
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case (nn::hac::fac::SDO_READ):
|
|
|
|
str = "Read";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::SDO_WRITE):
|
|
|
|
str = "Write";
|
|
|
|
break;
|
|
|
|
case (nn::hac::fac::SDO_READWRITE):
|
|
|
|
str = "ReadWrite";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
str = "Unknown";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* MetaProcess::getSystemCallStr(byte_t syscall_id) const
|
|
|
|
{
|
|
|
|
const char* str = nullptr;
|
|
|
|
|
|
|
|
switch(syscall_id)
|
|
|
|
{
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_HEAP_SIZE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetHeapSize";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_MEMORY_PERMISSION):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetMemoryPermission";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_MEMORY_ATTRIBUTE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetMemoryAttribute";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_MAP_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "MapMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNMAP_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "UnmapMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_QUERY_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "QueryMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_EXIT_PROCESS):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ExitProcess";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CREATE_THREAD):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CreateThread";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_START_THREAD):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "StartThread";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_EXIT_THREAD):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ExitThread";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SLEEP_THREAD):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SleepThread";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_THREAD_PRIORITY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetThreadPriority";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_THREAD_PRIORITY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetThreadPriority";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_THREAD_CORE_MASK):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetThreadCoreMask";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_THREAD_CORE_MASK):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetThreadCoreMask";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_CURRENT_PROCESSOR_NUMBER):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetCurrentProcessorNumber";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SIGNAL_EVENT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SignalEvent";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CLEAR_EVENT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ClearEvent";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_MAP_SHARED_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "MapSharedMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNMAP_SHARED_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "UnmapSharedMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CREATE_TRANSFER_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CreateTransferMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CLOSE_HANDLE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CloseHandle";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_RESET_SIGNAL):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ResetSignal";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_WAIT_SYNCHRONIZATION):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "WaitSynchronization";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CANCEL_SYNCHRONIZATION):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CancelSynchronization";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_ARBIRATE_LOCK):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ArbitrateLock";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_ARBIRATE_UNLOCK):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ArbitrateUnlock";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_WAIT_PROCESS_WIDE_KEY_ATOMIC):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "WaitProcessWideKeyAtomic";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SIGNAL_PROCESS_WIDE_KEY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SignalProcessWideKey";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_SYSTEM_TICK):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetSystemTick";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CONNECT_TO_NAMED_PORT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ConnectToNamedPort";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SEND_SYNC_REQUEST_LIGHT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SendSyncRequestLight";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SEND_SYNC_REQUEST):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SendSyncRequest";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SEND_SYNC_REQUEST_WITH_USER_BUFFER):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SendSyncRequestWithUserBuffer";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SEND_ASYNC_REQUEST_WITH_USER_BUFFER):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SendAsyncRequestWithUserBuffer";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_PROCESS_ID):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetProcessId";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_THREAD_ID):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetThreadId";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_BREAK):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "Break";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_OUTPUT_DEBUG_STRING):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "OutputDebugString";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_RETURN_FROM_EXCEPTION):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ReturnFromException";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_INFO):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetInfo";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_FLUSH_ENTIRE_DATA_CACHE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "FlushEntireDataCache";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_FLUSH_DATA_CACHE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "FlushDataCache";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_MAP_PHYSICAL_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "MapPhysicalMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNMAP_PHYSICAL_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "UnmapPhysicalMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_FUTURE_THREAD_INFO):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetFutureThreadInfo";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_LAST_THREAD_INFO):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetLastThreadInfo";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_RESOURCE_LIMIT_LIMIT_VALUE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetResourceLimitLimitValue";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_RESOURCE_LIMIT_CURRENT_VALUE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetResourceLimitCurrentValue";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_THREAD_ACTIVITY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetThreadActivity";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_THREAD_CONTEXT3):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetThreadContext3";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_WAIT_FOR_ADDRESS):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "WaitForAddress";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SIGNAL_TO_ADDRESS):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SignalToAddress";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SYNCHRONIZE_PREEMPTION_STATE):
|
|
|
|
str = "SynchronizePreemptionState";
|
2019-01-31 09:10:19 +00:00
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNK_0x37):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "svc37";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNK_0x38):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "svc38";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNK_0x39):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "svc39";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNK_0x3A):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "svc3A";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNK_0x3B):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "svc3B";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_DUMP_INFO):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "DumpInfo";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_DUMP_INFO_NEW):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "DumpInfoNew";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNK_0x3E):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "svc3E";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNK_0x3F):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "svc3F";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CREATE_SESSION):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CreateSession";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_ACCEPT_SESSION):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "AcceptSession";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_REPLY_AND_RECEIVE_LIGHT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ReplyAndReceiveLight";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_REPLY_AND_RECEIVE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ReplyAndReceive";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_REPLY_AND_RECEIVE_WITH_USER_BUFFER):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ReplyAndReceiveWithUserBuffer";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CREATE_EVENT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CreateEvent";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNK_0x46):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "svc46";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNK_0x47):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "svc47";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_MAP_PHYSICAL_MEMORY_UNSAFE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "MapPhysicalMemoryUnsafe";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNMAP_PHYSICAL_MEMORY_UNSAFE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "UnmapPhysicalMemoryUnsafe";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_UNSAFE_LIMIT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetUnsafeLimit";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CREATE_CODE_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CreateCodeMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CONTROL_CODE_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ControlCodeMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SLEEP_SYSTEM):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SleepSystem";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_READ_WRITE_REGISTER):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ReadWriteRegister";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_PROCESS_ACTIVITY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetProcessActivity";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CREATE_SHARED_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CreateSharedMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_MAP_TRANSFER_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "MapTransferMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNMAP_TRANSFER_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "UnmapTransferMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CREATE_INTERRUPT_EVENT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CreateInterruptEvent";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_QUERY_PHYSICAL_ADDRESS):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "QueryPhysicalAddress";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_QUERY_IO_MAPPING):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "QueryIoMapping";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CREATE_DEVICE_ADDRESS_SPACE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CreateDeviceAddressSpace";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_ATTACH_DEVICE_ADDRESS_SPACE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "AttachDeviceAddressSpace";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_DETACH_DEVICE_ADDRESS_SPACE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "DetachDeviceAddressSpace";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_MAP_DEVICE_ADDRESS_SPACE_BY_FORCE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "MapDeviceAddressSpaceByForce";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_MAP_DEVICE_ADDRESS_SPACE_ALIGNED):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "MapDeviceAddressSpaceAligned";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_MAP_DEVICE_ADDRESS_SPACE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "MapDeviceAddressSpace";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNMAP_DEVICE_ADDRESS_SPACE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "UnmapDeviceAddressSpace";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_INVALIDATE_PROCESS_DATA_CACHE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "InvalidateProcessDataCache";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_STORE_PROCESS_DATA_CACHE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "StoreProcessDataCache";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_FLUSH_PROCESS_DATA_CACHE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "FlushProcessDataCache";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_DEBUG_ACTIVE_PROCESS):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "DebugActiveProcess";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_BREAK_DEBUG_PROCESS):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "BreakDebugProcess";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_TERMINATE_DEBUG_PROCESS):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "TerminateDebugProcess";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_DEBUG_EVENT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetDebugEvent";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CONTINUE_DEBUG_EVENT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ContinueDebugEvent";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_PROCESS_LIST):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetProcessList";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_THREAD_LIST):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetThreadList";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_DEBUG_THREAD_CONTEXT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetDebugThreadContext";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_DEBUG_THREAD_CONTEXT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetDebugThreadContext";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_QUERY_DEBUG_PROCESS_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "QueryDebugProcessMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_READ_DEBUG_PROCESS_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ReadDebugProcessMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_WRITE_DEBUG_PROCESS_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "WriteDebugProcessMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_HARDWARE_BREAK_POINT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetHardwareBreakPoint";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_DEBUG_THREAD_PARAM):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetDebugThreadParam";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNK_0x6E):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "svc6E";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_SYSTEM_INFO):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetSystemInfo";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CREATE_PORT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CreatePort";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_MANAGE_NAMED_PORT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ManageNamedPort";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CONNECT_TO_PORT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "ConnectToPort";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_PROCESS_MEMORY_PERMISSION):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetProcessMemoryPermission";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_MAP_PROCESS_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "MapProcessMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNMAP_PROCESS_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "UnmapProcessMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_QUERY_PROCESS_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "QueryProcessMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_MAP_PROCESS_CODE_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "MapProcessCodeMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_UNMAP_PROCESS_CODE_MEMORY):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "UnmapProcessCodeMemory";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CREATE_PROCESS):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CreateProcess";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_START_PROCESS):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "StartProcess";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_TERMINATE_PROCESS):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "TerminateProcess";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_GET_PROCESS_INFO):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "GetProcessInfo";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CREATE_RESOURCE_LIMIT):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CreateResourceLimit";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_SET_RESOURCE_LIMIT_LIMIT_VALUE):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "SetResourceLimitLimitValue";
|
|
|
|
break;
|
2019-10-31 11:35:03 +00:00
|
|
|
case (nn::hac::svc::SVC_CALL_SECURE_MONITOR):
|
2019-01-31 09:10:19 +00:00
|
|
|
str = "CallSecureMonitor";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
str = "Unknown";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* MetaProcess::getMemMapPermStr(nn::hac::MemoryMappingHandler::MemoryPerm type) const
|
|
|
|
{
|
|
|
|
const char* str = nullptr;
|
|
|
|
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case (nn::hac::MemoryMappingHandler::MEM_RW):
|
|
|
|
str = "RW";
|
|
|
|
break;
|
|
|
|
case (nn::hac::MemoryMappingHandler::MEM_RO):
|
|
|
|
str = "RO";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
str = "Unknown";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* MetaProcess::getMemMapTypeStr(nn::hac::MemoryMappingHandler::MappingType type) const
|
|
|
|
{
|
|
|
|
const char* str = nullptr;
|
|
|
|
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case (nn::hac::MemoryMappingHandler::MAP_IO):
|
|
|
|
str = "Io";
|
|
|
|
break;
|
|
|
|
case (nn::hac::MemoryMappingHandler::MAP_STATIC):
|
|
|
|
str = "Static";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
str = "Unknown";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return str;
|
2018-08-12 05:24:34 +00:00
|
|
|
}
|