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