This commit is contained in:
comex 2011-04-04 21:09:10 -04:00
parent e742db30f2
commit ce5dbdca3f
2 changed files with 6 additions and 11 deletions

View File

@ -42,7 +42,7 @@ addr_t find_sysctl(struct binary *binary, const char *name) {
}
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;
@ -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_memcmp")) return _memcmp;
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_is_armv7")) return is_armv7;
//if(!strcmp(name, "c_dvp_struct_offset")) return spec2(0xde, 0xad, 0xbe);
die("? %s", name);
})
b_relocate(sandbox, (void *) l.arg, (void *) l.func, 0);

View File

@ -4,8 +4,7 @@ start:
// <-
push {r0-r4, lr}
sub sp, #0x44
ldr r2, dvp_struct_offset
ldr r4, [r3, r2]
ldr r4, [r3, #0x14]
cmp r4, #0
beq actually_eval
ldr r3, vn_getpath
@ -63,10 +62,9 @@ actually_eval:
ldr r1, orig_addr
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
ldr r0, is_armv7
cmp r0, #0
# XXX - this is really stupid; it should be handled at compile time
movs r2, #1
tst r1, r2
pop {r0-r4}
add sp, #4
beq armlol
@ -92,5 +90,3 @@ preferences: .ascii "/private/var/mobile/Library/Preferences"
orig_addr: .long c_sb_evaluate_jumpto
memcmp: .long c_memcmp
vn_getpath: .long c_vn_getpath
dvp_struct_offset: .long c_dvp_struct_offset
is_armv7: .long c_is_armv7