mirror of
https://github.com/EchoStretch/kstuff.git
synced 2026-10-22 19:52:21 -05:00
ps5-kstuff: add missing files
This commit is contained in:
1 parent
d0cdc83e8a
commit
f9987bb310
2 files changed
+34
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#include "utils.h"
|
||||
#include "syscall_fixes.h"
|
||||
|
||||
extern char mprotect_fix_start[];
|
||||
extern char mprotect_fix_end[];
|
||||
extern char mdbg_call_fix[];
|
||||
|
||||
static uint64_t dbgregs_for_syscall_fix[6] = {
|
||||
(uint64_t)mprotect_fix_start, (uint64_t)mdbg_call_fix, 0, 0,
|
||||
0, 0x405,
|
||||
};
|
||||
|
||||
void handle_syscall_fix(uint64_t* regs)
|
||||
{
|
||||
start_syscall_with_dbgregs(regs, dbgregs_for_syscall_fix);
|
||||
}
|
||||
|
||||
int try_handle_syscall_fix_trap(uint64_t* regs)
|
||||
{
|
||||
if(regs[RIP] == (uint64_t)mprotect_fix_start)
|
||||
regs[RIP] = (uint64_t)mprotect_fix_end;
|
||||
else if(regs[RIP] == (uint64_t)mdbg_call_fix)
|
||||
regs[RAX] = 1;
|
||||
else
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include <sys/types.h>
|
||||
|
||||
#define SYS_mdbg_call 573
|
||||
|
||||
void handle_syscall_fix(uint64_t* regs);
|
||||
int try_handle_syscall_fix_trap(uint64_t* regs);
|
||||
Reference in new issue
Block a user