mirror of
https://github.com/XorTroll/SaltyNX.git
synced 2024-11-30 04:40:23 +00:00
Don't bootstrap ARM32 processes
This commit is contained in:
parent
0422802aeb
commit
7d28e045d8
@ -6,6 +6,8 @@
|
||||
#pragma once
|
||||
#include "../types.h"
|
||||
#include "../arm/thread_context.h"
|
||||
|
||||
#define LIBNX_NO_EXTRA_ADAPT
|
||||
#include "svc_extra.h"
|
||||
|
||||
/// Pseudo handle for the current process.
|
||||
|
@ -18,7 +18,13 @@ typedef struct {
|
||||
u64 tid;
|
||||
u64 pid;
|
||||
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;
|
||||
};
|
||||
|
||||
@ -54,6 +60,7 @@ typedef enum {
|
||||
DebugEvent_Exception=4, ///< Exception
|
||||
} DebugEvent;
|
||||
|
||||
#ifndef LIBNX_NO_EXTRA_ADAPT
|
||||
/**
|
||||
* @brief Gets an incoming debug event from a debugging session.
|
||||
* @return Result code.
|
||||
@ -64,3 +71,4 @@ inline Result svcGetDebugEventInfo(DebugEventInfo* event_out, Handle 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(" tid %016llx pid %016llx\n", eventinfo.tid, eventinfo.pid);
|
||||
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)
|
||||
{
|
||||
SaltySD_printf("SaltySD: TID %016llx is a system application, aborting bootstrap...\n", eventinfo.tid);
|
||||
free(tids);
|
||||
|
||||
already_hijacking = false;
|
||||
svcCloseHandle(debug);
|
||||
return;
|
||||
goto abort_bootstrap;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -138,6 +142,13 @@ void hijack_pid(u64 pid)
|
||||
hijack_bootstrap(&debug, pid, tids[0]);
|
||||
|
||||
free(tids);
|
||||
return;
|
||||
|
||||
abort_bootstrap:
|
||||
free(tids);
|
||||
|
||||
already_hijacking = false;
|
||||
svcCloseHandle(debug);
|
||||
}
|
||||
|
||||
Result handleServiceCmd(int cmd)
|
||||
|
Loading…
Reference in New Issue
Block a user