capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.6k stars 1.56k forks source link

How to check if the statement is relative? #1095

Open exphck1337 opened 6 years ago

exphck1337 commented 6 years ago

How do I check if the statement is relative using capstone?

Example: jmp 0xDEADBEEF call 0xDEADBEEF

How to check this using capstone?

stharding commented 6 years ago

The way that I've been doing this is to check to see if the bytes "\xef\xbe\xad\xde" (assuming little endian) are in the instruction bytes. If there is a better way, I would also like to know about it.