I have a function that can make a branch opcode:

uint32_t JMPCode(uintptr_t func, uintptr_t addr)
    uint32_t code = ((addr-func-4) >> 12) & 0x7FF | 0xF000 | ((((addr-func-4) >> 1) & 0x7FF | 0xB800) << 16);
    return code;

how i can get offset from returned result of this foo? and how i can detect branch opcode?

sorry for my English

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.