ams_mitm: implement ns.mitm

This commit is contained in:
Michael Scire authored and SciresM committed 2019-12-07 12:41:28 -08:00
1 parent 2bae1ad116
commit 66372e2b2e
10 files changed
+296 -12

No files matched your search

@@ -421,6 +421,14 @@ namespace ams::ncm {
return ProgramId::ApplicationStart <= program_id && program_id <= ProgramId::ApplicationEnd;
}
inline constexpr bool IsWebAppletProgramId(const ProgramId &program_id) {
return program_id == ProgramId::AppletWeb ||
program_id == ProgramId::AppletShop ||
program_id == ProgramId::AppletOfflineWeb ||
program_id == ProgramId::AppletLoginShare ||
program_id == ProgramId::AppletWifiWebAuth;
}
static_assert(sizeof(ProgramId) == sizeof(u64) && std::is_pod<ProgramId>::value, "ProgramId definition!");
/* Program Location. */
@@ -31,4 +31,7 @@ namespace ams::pm::info {
/* Information convenience API. */
bool HasLaunchedProgram(ncm::ProgramId program_id);
Result IsHblProcessId(bool *out, os::ProcessId process_id);
Result IsHblProgramId(bool *out, ncm::ProgramId program_id);
}
@@ -20,7 +20,10 @@
namespace ams::sf {
class IServiceObject{};
class IServiceObject {
public:
virtual ~IServiceObject() { /* ... */ }
};
class IMitmServiceObject : public IServiceObject {
protected:
@@ -29,6 +32,8 @@ namespace ams::sf {
public:
IMitmServiceObject(std::shared_ptr<::Service> &&s, const sm::MitmProcessInfo &c) : forward_service(std::move(s)), client_info(c) { /* ... */ }
virtual ~IMitmServiceObject() { /* ... */ }
static bool ShouldMitm(os::ProcessId process_id, ncm::ProgramId program_id);
};