pm: add api for ams.mitm to steal application memory

This commit is contained in:
Michael Scire
2023-05-09 15:07:40 -07:00
parent e1c4523c41
commit 9b480e4757
11 changed files with 114 additions and 52 deletions

View File

@@ -90,3 +90,9 @@ Result pmdmntAtmosphereGetCurrentLimitInfo(u64 *out_cur, u64 *out_lim, u32 group
return rc;
}
Result pmshellAtmosphereBoostSystemMemoryResourceLimitForMitm(u64 size) {
return serviceDispatchIn(pmshellGetServiceSession(), 65000, size);
}

View File

@@ -26,6 +26,8 @@ Result pminfoAtmosphereGetProcessInfo(NcmProgramLocation *loc_out, CfgOverrideSt
Result pmdmntAtmosphereGetProcessInfo(Handle *out, NcmProgramLocation *loc_out, CfgOverrideStatus *status_out, u64 pid);
Result pmdmntAtmosphereGetCurrentLimitInfo(u64 *out_cur, u64 *out_lim, u32 group, u32 resource);
Result pmshellAtmosphereBoostSystemMemoryResourceLimitForMitm(u64 size);
#ifdef __cplusplus
}
#endif

View File

@@ -14,6 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stratosphere.hpp>
#include "pm_ams.os.horizon.h"
namespace ams::pm::shell {
@@ -57,6 +58,10 @@ namespace ams::pm::shell {
Result BoostSystemThreadResourceLimit() {
R_RETURN(::pmshellBoostSystemThreadResourceLimit());
}
Result AtmosphereBoostSystemMemoryResourceLimitForMitm(u64 size) {
R_RETURN(pmshellAtmosphereBoostSystemMemoryResourceLimitForMitm(size));
}
#endif
}