arm/shared/KernelExploit/Sources/CFastFind/CFastFind.c
/**
 * Emulate an adrp and ldr instruction at the given pc value
 * Returns destination
 */
Emulate an adrp and ldr instruction at the given pc value
Returns destination
Emulate an adrp and ldr instruction at the given pc value Returns destination
uint64_t aarch64_emulate_adrp_ldr(uint32_t instruction, uint32_t ldrInstruction, uint64_t pc) {
    uint64_t adrp_target = aarch64_emulate_adrp(instruction, pc);
    if (!adrp_target) {
        return 0;
    }
    if ((instruction & 0x1F) != ((ldrInstruction >> 5) & 0x1F)) {
        return 0;
    }
    if ((ldrInstruction & 0xFFC00000) != 0xF9400000) {
        return 0;
    }
    uint32_t imm12 = ((ldrInstruction >> 10) & 0xFFF) << 3;
    return adrp_target + (uint64_t) imm12;
}
uint64_t aarch64_emulate_adrp_ldr ( uint32_t instruction , uint32_t ldrInstruction , uint64_t pc ) { uint64_t adrp_target = aarch64_emulate_adrp ( instruction , pc ) ; if ( ! adrp_target ) { return 0 ; } if ( ( instruction & 0x1F ) != ( ( ldrInstruction >> 5 ) & 0x1F ) ) { return 0 ; } if ( ( ldrInstruction & 0xFFC00000 ) != 0xF9400000 ) { return 0 ; } uint32_t imm12 = ( ( ldrInstruction >> 10 ) & 0xFFF ) << 3 ; return adrp_target + ( uint64_t ) imm12 ; }
Emulate an adrp and ldr instruction at the given pc value
 Returns destination
Emulate an adrp and ldr instruction at the given pc value Returns destination
// Emulate