arm/shared/KernelExploit/Sources/CFastFind/CFastFind.c
uint64_t aarch64_emulate_conditional_branch(uint32_t instruction, uint64_t pc) {
    // Check that this is a conditional branch instruction
    if ((instruction & 0xFF000010) != 0x54000000) {
        return 0;
    }
    
    int32_t imm = (instruction & 0xFFFFE0) >> 3;
    if (instruction & 0x800000) {
        // Sign extend
        imm |= 0xFF000000;
    }
    
    // Emulate
    return pc + imm;
}
/**
 * Emulate a conditional branch at the given pc value
 * Returns branch destination
 */
Emulate a conditional branch at the given pc value
Returns branch destination
Emulate a conditional branch at the given pc value Returns branch destination
uint64_t aarch64_emulate_conditional_branch(uint32_t instruction, uint64_t pc) {
    if ((instruction & 0xFF000010) != 0x54000000) {
        return 0;
    }
    int32_t imm = (instruction & 0xFFFFE0) >> 3;
    if (instruction & 0x800000) {
        imm |= 0xFF000000;
    }
    return pc + imm;
}
uint64_t aarch64_emulate_conditional_branch ( uint32_t instruction , uint64_t pc ) { if ( ( instruction & 0xFF000010 ) != 0x54000000 ) { return 0 ; } int32_t imm = ( instruction & 0xFFFFE0 ) >> 3 ; if ( instruction & 0x800000 ) { imm |= 0xFF000000 ; } return pc + imm ; }
Emulate a conditional branch at the given pc value
 Returns branch destination
Emulate a conditional branch at the given pc value Returns branch destination
// Check that this is a conditional branch instruction // Sign extend // Emulate