build
This commit is contained in:
parent
94e96392fe
commit
95cd350b5c
27
Makefile
27
Makefile
@ -1,23 +1,26 @@
|
||||
DATA = $(word 1,$(wildcard ./data ../data))
|
||||
CFLAGS += -I$(DATA)
|
||||
include $(DATA)/Makefile.common
|
||||
|
||||
BINS := check_sanity make_kernel_patchfile apply_patchfile sandboxc.c
|
||||
all: .settings .data $(BINS)
|
||||
BINS := $(OUTDIR)/check_sanity $(OUTDIR)/make_kernel_patchfile $(OUTDIR)/apply_patchfile sandboxc.c
|
||||
|
||||
all: .data $(OUTDIR) $(BINS)
|
||||
.data:
|
||||
make -C $(DATA)
|
||||
%.o: %.c
|
||||
$(GCC) -c -o $@ $< -I$(DATA)
|
||||
$(OUTDIR):
|
||||
mkdir $(OUTDIR)
|
||||
|
||||
sandbox.o: sandbox.S
|
||||
$(SDK_GCC) -c -o $@ $<
|
||||
sandboxc.c: sandbox.o
|
||||
xxd -i sandbox.o > sandboxc.c
|
||||
|
||||
check_sanity: check_sanity.o $(DATA)/libdata.a
|
||||
$(GCC) -o $@ $^ $(DATA)/libdata.a
|
||||
apply_patchfile: apply_patchfile.o $(DATA)/libdata.a
|
||||
$(GCC) -o $@ $^ $(DATA)/libdata.a
|
||||
make_kernel_patchfile: make_kernel_patchfile.o sandboxc.o $(DATA)/libdata.a
|
||||
$(GCC) -o $@ $^ $(DATA)/libdata.a
|
||||
$(OUTDIR)/check_sanity: $(OUTDIR)/check_sanity.o $(DATA)/$(OUTDIR)/libdata.a
|
||||
$(GCC) -o $@ $^
|
||||
$(OUTDIR)/apply_patchfile: $(OUTDIR)/apply_patchfile.o $(DATA)/$(OUTDIR)/libdata.a
|
||||
$(GCC) -o $@ $^
|
||||
$(OUTDIR)/make_kernel_patchfile: $(OUTDIR)/make_kernel_patchfile.o $(OUTDIR)/sandboxc.o $(DATA)/$(OUTDIR)/libdata.a
|
||||
$(GCC) -o $@ $^
|
||||
|
||||
clean:
|
||||
rm -f $(BINS) *.o
|
||||
clean: .clean
|
||||
rm -f sandbox.o sandboxc.c
|
||||
|
@ -104,6 +104,10 @@ void do_kernel(struct binary *binary, struct binary *sandbox) {
|
||||
find_sysctl(binary, "proc_enforce"),
|
||||
uint32_t, {0});
|
||||
|
||||
/*patch("vnode_enforce",
|
||||
find_sysctl(binary, "vnode_enforce"),
|
||||
uint32_t, {0});*/
|
||||
|
||||
// sandbox
|
||||
range_t range = b_macho_segrange(binary, "__PRELINK_TEXT");
|
||||
addr_t sb_evaluate = find_bof(range, find_int32(range, find_string(range, "bad opcode", false, true), true), is_armv7);
|
||||
@ -129,7 +133,9 @@ void do_kernel(struct binary *binary, struct binary *sandbox) {
|
||||
uint32_t, {(is_armv7 ? 0xf000f8df : 0xe51ff004), scratch | 1});
|
||||
|
||||
// "note"
|
||||
#ifndef __arm__
|
||||
patch("scratch", 0, uint32_t, {(scratch + sandbox_pr.size + 0xfff) & ~0xfff});
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user