summaryrefslogtreecommitdiff
path: root/kern_funcs.c
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2018-12-21 18:24:37 -1000
committerSam Bingner <sam@bingner.com>2018-12-21 18:24:37 -1000
commit8031d5da39b95aa65e4989e094a636bee424aef4 (patch)
treea672c430ad39ee2a35cb31019cbeec7247b1a91d /kern_funcs.c
parentae8077efe69311b8eee2846affebd6194b7b29c4 (diff)
Split inject code to a separate file to be more easily integrated in external projects
Diffstat (limited to 'kern_funcs.c')
-rw-r--r--kern_funcs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kern_funcs.c b/kern_funcs.c
index cd43438..2d7d182 100644
--- a/kern_funcs.c
+++ b/kern_funcs.c
@@ -20,10 +20,14 @@
#include <kmem.h>
#include "CSCommon.h"
-extern mach_port_t tfp0;
+static mach_port_t tfp0=MACH_PORT_NULL;
size_t kread(uint64_t where, void *p, size_t size);
size_t kwrite(uint64_t where, const void *p, size_t size);
+void set_tfp0(mach_port_t port) {
+ tfp0 = port;
+}
+
void wk32(uint64_t kaddr, uint32_t val) {
kwrite(kaddr, &val, sizeof(uint32_t));
}