arm/shared/KernelExploit/Sources/CFastFind/CFastFind.c
/**
 * Emulate an adr instruction at the given pc value
 * Returns adr destination
 */
Emulate an adr instruction at the given pc value
Returns adr destination
Emulate an adr instruction at the given pc value Returns adr destination
uint64_t aarch64_emulate_adr(uint32_t instruction, uint64_t pc) {
    if ((instruction & 0x9F000000) != 0x10000000) {
        return 0;
    }
    int32_t imm = (instruction & 0xFFFFE0) >> 3;
    imm |= (instruction & 0x60000000) >> 29;
    if (instruction & 0x800000) {
        imm |= 0xFFE00000;
    }
    return pc + imm;
}
uint64_t aarch64_emulate_adr ( uint32_t instruction , uint64_t pc ) { if ( ( instruction & 0x9F000000 ) != 0x10000000 ) { return 0 ; } int32_t imm = ( instruction & 0xFFFFE0 ) >> 3 ; imm |= ( instruction & 0x60000000 ) >> 29 ; if ( instruction & 0x800000 ) { imm |= 0xFFE00000 ; } return pc + imm ; }
Emulate an adr instruction at the given pc value
 Returns adr destination
Emulate an adr instruction at the given pc value Returns adr destination
// Check that this is an adr instruction // Sign extend // Emulate