diff --git a/bindings/java/capstone/Capstone.java b/bindings/java/capstone/Capstone.java index e1c4bdf196..adb514d54d 100644 --- a/bindings/java/capstone/Capstone.java +++ b/bindings/java/capstone/Capstone.java @@ -331,7 +331,14 @@ public NativeLong cs_disasm(NativeLong handle, byte[] code, NativeLong code_len, public static final int CS_OPT_ON = 3; // Turn ON an option (CS_OPT_DETAIL) public static final int CS_OPT_SYNTAX_NOREGNAME = 3; // PPC asm syntax: Prints register name with only number (CS_OPT_SYNTAX) - // query id for cs_support() + // Common instruction operand types - to be consistent across all architectures. + public static final int CS_OP_INVALID = 0; + public static final int CS_OP_REG = 1; + public static final int CS_OP_IMM = 2; + public static final int CS_OP_MEM = 3; + public static final int CS_OP_FP = 4; + + // Query id for cs_support() public static final int CS_SUPPORT_DIET = CS_ARCH_ALL+1; // diet mode protected class NativeStruct { diff --git a/bindings/ocaml/capstone.ml b/bindings/ocaml/capstone.ml index d3127bca4d..92f340a824 100644 --- a/bindings/ocaml/capstone.ml +++ b/bindings/ocaml/capstone.ml @@ -11,6 +11,7 @@ open Systemz open Xcore open Printf (* debug *) +(* Hardware architectures *) type arch = | CS_ARCH_ARM | CS_ARCH_ARM64 @@ -21,6 +22,7 @@ type arch = | CS_ARCH_SYSZ | CS_ARCH_XCORE +(* Hardware modes *) type mode = | CS_MODE_LITTLE_ENDIAN (* little-endian mode (default mode) *) | CS_MODE_ARM (* ARM mode *) @@ -37,6 +39,7 @@ type mode = | CS_MODE_BIG_ENDIAN (* big-endian mode *) +(* Runtime option for the disassembled engine *) type opt_type = | CS_OPT_SYNTAX (* Asssembly output syntax *) | CS_OPT_DETAIL (* Break down instruction structure into details *) @@ -46,6 +49,7 @@ type opt_type = | CS_OPT_SKIPDATA_SETUP (* Setup user-defined function for SKIPDATA option *) +(* Runtime option value (associated with option type above) *) let _CS_OPT_OFF = 0L;; (* Turn OFF an option - default option of CS_OPT_DETAIL, CS_OPT_SKIPDATA. *) let _CS_OPT_ON = 3L;; (* Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA). *) let _CS_OPT_SYNTAX_DEFAULT = 0L;; (* Default asm syntax (CS_OPT_SYNTAX). *) @@ -53,6 +57,12 @@ let _CS_OPT_SYNTAX_INTEL = 1L;; (* X86 Intel asm syntax - default on X86 (CS_OPT let _CS_OPT_SYNTAX_ATT = 2L;; (* X86 ATT asm syntax (CS_OPT_SYNTAX). *) let _CS_OPT_SYNTAX_NOREGNAME = 3L;; (* Prints register name with only number (CS_OPT_SYNTAX) *) +(* Common instruction operand types - to be consistent across all architectures. *) +let _CS_OP_INVALID = 0;; (* uninitialized/invalid operand. *) +let _CS_OP_REG = 1;; (* Register operand. *) +let _CS_OP_IMM = 2;; (* Immediate operand. *) +let _CS_OP_MEM = 3;; (* Memory operand. *) +let _CS_OP_FP = 4;; (* Floating-Point operand. *) type cs_arch = | CS_INFO_ARM of cs_arm diff --git a/bindings/python/capstone/__init__.py b/bindings/python/capstone/__init__.py index 8c0bc4f8d5..c8e6e65aa6 100644 --- a/bindings/python/capstone/__init__.py +++ b/bindings/python/capstone/__init__.py @@ -121,6 +121,13 @@ CS_OPT_OFF = 0 # Turn OFF an option - default option of CS_OPT_DETAIL CS_OPT_ON = 3 # Turn ON an option (CS_OPT_DETAIL) +# Common instruction operand types - to be consistent across all architectures. +CS_OP_INVALID = 0 +CS_OP_REG = 1 +CS_OP_IMM = 2 +CS_OP_MEM = 3 +CS_OP_FP = 4 + # Capstone syntax value CS_OPT_SYNTAX_DEFAULT = 0 # Default assembly syntax of all platforms (CS_OPT_SYNTAX) CS_OPT_SYNTAX_INTEL = 1 # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86)