fix
This commit is contained in:
parent
e742db30f2
commit
ce5dbdca3f
@ -42,7 +42,7 @@ addr_t find_sysctl(struct binary *binary, const char *name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void do_kernel(struct binary *binary, struct binary *sandbox) {
|
void do_kernel(struct binary *binary, struct binary *sandbox) {
|
||||||
//printf("%x\n", find_dvp_struct_offset(binary));
|
//printf("** DVP is %x\n", find_dvp_struct_offset(binary));
|
||||||
|
|
||||||
bool is_armv7 = binary->actual_cpusubtype == 9;
|
bool is_armv7 = binary->actual_cpusubtype == 9;
|
||||||
|
|
||||||
@ -123,8 +123,7 @@ void do_kernel(struct binary *binary, struct binary *sandbox) {
|
|||||||
if(!strcmp(name, "c_sb_evaluate_jumpto")) return sb_evaluate + (is_armv7 ? 9 : 8);
|
if(!strcmp(name, "c_sb_evaluate_jumpto")) return sb_evaluate + (is_armv7 ? 9 : 8);
|
||||||
if(!strcmp(name, "c_memcmp")) return _memcmp;
|
if(!strcmp(name, "c_memcmp")) return _memcmp;
|
||||||
if(!strcmp(name, "c_vn_getpath")) return _vn_getpath;
|
if(!strcmp(name, "c_vn_getpath")) return _vn_getpath;
|
||||||
if(!strcmp(name, "c_dvp_struct_offset")) return spec3(0xde, 0xad, 0xbe);
|
//if(!strcmp(name, "c_dvp_struct_offset")) return spec2(0xde, 0xad, 0xbe);
|
||||||
if(!strcmp(name, "c_is_armv7")) return is_armv7;
|
|
||||||
die("? %s", name);
|
die("? %s", name);
|
||||||
})
|
})
|
||||||
b_relocate(sandbox, (void *) l.arg, (void *) l.func, 0);
|
b_relocate(sandbox, (void *) l.arg, (void *) l.func, 0);
|
||||||
|
12
sandbox.S
12
sandbox.S
@ -4,8 +4,7 @@ start:
|
|||||||
// <-
|
// <-
|
||||||
push {r0-r4, lr}
|
push {r0-r4, lr}
|
||||||
sub sp, #0x44
|
sub sp, #0x44
|
||||||
ldr r2, dvp_struct_offset
|
ldr r4, [r3, #0x14]
|
||||||
ldr r4, [r3, r2]
|
|
||||||
cmp r4, #0
|
cmp r4, #0
|
||||||
beq actually_eval
|
beq actually_eval
|
||||||
ldr r3, vn_getpath
|
ldr r3, vn_getpath
|
||||||
@ -63,10 +62,9 @@ actually_eval:
|
|||||||
ldr r1, orig_addr
|
ldr r1, orig_addr
|
||||||
mov r9, r1
|
mov r9, r1
|
||||||
|
|
||||||
# XXX - this is really stupid; it should be handled at compile time, but if not, at least it should be tst r1, #1
|
# XXX - this is really stupid; it should be handled at compile time
|
||||||
|
movs r2, #1
|
||||||
ldr r0, is_armv7
|
tst r1, r2
|
||||||
cmp r0, #0
|
|
||||||
pop {r0-r4}
|
pop {r0-r4}
|
||||||
add sp, #4
|
add sp, #4
|
||||||
beq armlol
|
beq armlol
|
||||||
@ -92,5 +90,3 @@ preferences: .ascii "/private/var/mobile/Library/Preferences"
|
|||||||
orig_addr: .long c_sb_evaluate_jumpto
|
orig_addr: .long c_sb_evaluate_jumpto
|
||||||
memcmp: .long c_memcmp
|
memcmp: .long c_memcmp
|
||||||
vn_getpath: .long c_vn_getpath
|
vn_getpath: .long c_vn_getpath
|
||||||
dvp_struct_offset: .long c_dvp_struct_offset
|
|
||||||
is_armv7: .long c_is_armv7
|
|
||||||
|
Loading…
Reference in New Issue
Block a user