mirror of
https://github.com/XorTroll/SaltyNX.git
synced 2025-03-01 06:15:45 +00:00
Don't bootstrap ARM32 processes
This commit is contained in:
parent
0422802aeb
commit
7d28e045d8
@ -6,6 +6,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
#include "../arm/thread_context.h"
|
#include "../arm/thread_context.h"
|
||||||
|
|
||||||
|
#define LIBNX_NO_EXTRA_ADAPT
|
||||||
#include "svc_extra.h"
|
#include "svc_extra.h"
|
||||||
|
|
||||||
/// Pseudo handle for the current process.
|
/// Pseudo handle for the current process.
|
||||||
|
@ -18,7 +18,13 @@ typedef struct {
|
|||||||
u64 tid;
|
u64 tid;
|
||||||
u64 pid;
|
u64 pid;
|
||||||
char name[12];
|
char name[12];
|
||||||
u32 mmuFlags;
|
u32 isA64 : 1;
|
||||||
|
u32 addrSpace : 3;
|
||||||
|
u32 enableDebug : 1;
|
||||||
|
u32 enableAslr : 1;
|
||||||
|
u32 useSysMemBlocks : 1;
|
||||||
|
u32 poolPartition : 4;
|
||||||
|
u32 unused : 22;
|
||||||
u64 userExceptionContextAddr;
|
u64 userExceptionContextAddr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -54,6 +60,7 @@ typedef enum {
|
|||||||
DebugEvent_Exception=4, ///< Exception
|
DebugEvent_Exception=4, ///< Exception
|
||||||
} DebugEvent;
|
} DebugEvent;
|
||||||
|
|
||||||
|
#ifndef LIBNX_NO_EXTRA_ADAPT
|
||||||
/**
|
/**
|
||||||
* @brief Gets an incoming debug event from a debugging session.
|
* @brief Gets an incoming debug event from a debugging session.
|
||||||
* @return Result code.
|
* @return Result code.
|
||||||
@ -64,3 +71,4 @@ inline Result svcGetDebugEventInfo(DebugEventInfo* event_out, Handle debug)
|
|||||||
{
|
{
|
||||||
return svcGetDebugEvent((u8*)event_out, debug);
|
return svcGetDebugEvent((u8*)event_out, debug);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -116,16 +116,20 @@ void hijack_pid(u64 pid)
|
|||||||
SaltySD_printf("SaltySD: found AttachProcess event:\n");
|
SaltySD_printf("SaltySD: found AttachProcess event:\n");
|
||||||
SaltySD_printf(" tid %016llx pid %016llx\n", eventinfo.tid, eventinfo.pid);
|
SaltySD_printf(" tid %016llx pid %016llx\n", eventinfo.tid, eventinfo.pid);
|
||||||
SaltySD_printf(" name %s\n", eventinfo.name);
|
SaltySD_printf(" name %s\n", eventinfo.name);
|
||||||
SaltySD_printf(" mmuflags %08x exception %016llx\n", eventinfo.mmuFlags, eventinfo.userExceptionContextAddr);
|
SaltySD_printf(" isA64 %01x addrSpace %01x enableDebug %01x\n", eventinfo.isA64, eventinfo.addrSpace, eventinfo.enableDebug);
|
||||||
|
SaltySD_printf(" enableAslr %01x useSysMemBlocks %01x poolPartition %01x\n", eventinfo.enableAslr, eventinfo.useSysMemBlocks, eventinfo.poolPartition);
|
||||||
|
SaltySD_printf(" exception %016llx\n", eventinfo.userExceptionContextAddr);
|
||||||
|
|
||||||
|
if (!eventinfo.isA64)
|
||||||
|
{
|
||||||
|
SaltySD_printf("SaltySD: ARM32 applications are not supported, aborting bootstrap...\n");
|
||||||
|
goto abort_bootstrap;
|
||||||
|
}
|
||||||
|
|
||||||
if (eventinfo.tid <= 0x010000000000FFFF)
|
if (eventinfo.tid <= 0x010000000000FFFF)
|
||||||
{
|
{
|
||||||
SaltySD_printf("SaltySD: TID %016llx is a system application, aborting bootstrap...\n", eventinfo.tid);
|
SaltySD_printf("SaltySD: TID %016llx is a system application, aborting bootstrap...\n", eventinfo.tid);
|
||||||
free(tids);
|
goto abort_bootstrap;
|
||||||
|
|
||||||
already_hijacking = false;
|
|
||||||
svcCloseHandle(debug);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -138,6 +142,13 @@ void hijack_pid(u64 pid)
|
|||||||
hijack_bootstrap(&debug, pid, tids[0]);
|
hijack_bootstrap(&debug, pid, tids[0]);
|
||||||
|
|
||||||
free(tids);
|
free(tids);
|
||||||
|
return;
|
||||||
|
|
||||||
|
abort_bootstrap:
|
||||||
|
free(tids);
|
||||||
|
|
||||||
|
already_hijacking = false;
|
||||||
|
svcCloseHandle(debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result handleServiceCmd(int cmd)
|
Result handleServiceCmd(int cmd)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user