crabstone 3.0.3 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGES.md +59 -42
- data/README.md +37 -39
- data/lib/{arch → crabstone/arch/3}/arm.rb +28 -49
- data/lib/crabstone/arch/3/arm64.rb +124 -0
- data/lib/{arch → crabstone/arch/3}/arm64_const.rb +45 -86
- data/lib/{arch → crabstone/arch/3}/arm_const.rb +19 -47
- data/lib/crabstone/arch/3/mips.rb +57 -0
- data/lib/{arch → crabstone/arch/3}/mips_const.rb +18 -38
- data/lib/crabstone/arch/3/ppc.rb +73 -0
- data/lib/{arch → crabstone/arch/3}/ppc_const.rb +27 -43
- data/lib/crabstone/arch/3/sparc.rb +60 -0
- data/lib/{arch → crabstone/arch/3}/sparc_const.rb +49 -67
- data/lib/crabstone/arch/3/sysz.rb +67 -0
- data/lib/{arch → crabstone/arch/3}/sysz_const.rb +11 -25
- data/lib/crabstone/arch/3/x86.rb +82 -0
- data/lib/{arch → crabstone/arch/3}/x86_const.rb +15 -36
- data/lib/crabstone/arch/3/xcore.rb +59 -0
- data/lib/{arch → crabstone/arch/3}/xcore_const.rb +10 -22
- data/lib/crabstone/arch/4/arm.rb +110 -0
- data/lib/crabstone/arch/4/arm64.rb +125 -0
- data/lib/crabstone/arch/4/arm64_const.rb +1016 -0
- data/lib/crabstone/arch/4/arm_const.rb +785 -0
- data/lib/crabstone/arch/4/evm.rb +20 -0
- data/lib/crabstone/arch/4/evm_const.rb +161 -0
- data/lib/crabstone/arch/4/m680x.rb +106 -0
- data/lib/crabstone/arch/4/m680x_const.rb +426 -0
- data/lib/crabstone/arch/4/m68k.rb +129 -0
- data/lib/crabstone/arch/4/m68k_const.rb +496 -0
- data/lib/crabstone/arch/4/mips.rb +57 -0
- data/lib/crabstone/arch/4/mips_const.rb +869 -0
- data/lib/crabstone/arch/4/ppc.rb +73 -0
- data/lib/crabstone/arch/4/ppc_const.rb +1375 -0
- data/lib/crabstone/arch/4/sparc.rb +60 -0
- data/lib/crabstone/arch/4/sparc_const.rb +439 -0
- data/lib/crabstone/arch/4/sysz.rb +67 -0
- data/lib/crabstone/arch/4/sysz_const.rb +763 -0
- data/lib/crabstone/arch/4/tms320c64x.rb +87 -0
- data/lib/crabstone/arch/4/tms320c64x_const.rb +287 -0
- data/lib/crabstone/arch/4/x86.rb +91 -0
- data/lib/crabstone/arch/4/x86_const.rb +1972 -0
- data/lib/crabstone/arch/4/xcore.rb +59 -0
- data/lib/crabstone/arch/4/xcore_const.rb +171 -0
- data/lib/crabstone/arch/extension.rb +27 -0
- data/lib/crabstone/arch/register.rb +34 -0
- data/lib/crabstone/arch.rb +37 -0
- data/lib/crabstone/binding/3/detail.rb +36 -0
- data/lib/crabstone/binding/3/instruction.rb +23 -0
- data/lib/crabstone/binding/4/detail.rb +40 -0
- data/lib/crabstone/binding/4/instruction.rb +23 -0
- data/lib/crabstone/binding/structs.rb +32 -0
- data/lib/crabstone/binding.rb +59 -0
- data/lib/crabstone/constants.rb +110 -0
- data/lib/crabstone/cs_version.rb +57 -0
- data/lib/crabstone/disassembler.rb +147 -0
- data/lib/crabstone/error.rb +74 -0
- data/lib/crabstone/instruction.rb +178 -0
- data/lib/crabstone/version.rb +5 -0
- data/lib/crabstone.rb +5 -557
- metadata +142 -331
- data/MANIFEST +0 -312
- data/Rakefile +0 -27
- data/bin/genconst +0 -66
- data/bin/genreg +0 -99
- data/crabstone.gemspec +0 -27
- data/examples/hello_world.rb +0 -43
- data/lib/arch/arm64.rb +0 -167
- data/lib/arch/arm64_registers.rb +0 -295
- data/lib/arch/arm_registers.rb +0 -149
- data/lib/arch/mips.rb +0 -78
- data/lib/arch/mips_registers.rb +0 -208
- data/lib/arch/ppc.rb +0 -90
- data/lib/arch/ppc_registers.rb +0 -209
- data/lib/arch/sparc.rb +0 -79
- data/lib/arch/sparc_registers.rb +0 -121
- data/lib/arch/systemz.rb +0 -79
- data/lib/arch/sysz_registers.rb +0 -66
- data/lib/arch/x86.rb +0 -107
- data/lib/arch/x86_registers.rb +0 -265
- data/lib/arch/xcore.rb +0 -78
- data/lib/arch/xcore_registers.rb +0 -57
- data/test/MC/AArch64/basic-a64-instructions.s.cs +0 -2014
- data/test/MC/AArch64/gicv3-regs.s.cs +0 -111
- data/test/MC/AArch64/neon-2velem.s.cs +0 -113
- data/test/MC/AArch64/neon-3vdiff.s.cs +0 -143
- data/test/MC/AArch64/neon-aba-abd.s.cs +0 -28
- data/test/MC/AArch64/neon-across.s.cs +0 -40
- data/test/MC/AArch64/neon-add-pairwise.s.cs +0 -11
- data/test/MC/AArch64/neon-add-sub-instructions.s.cs +0 -21
- data/test/MC/AArch64/neon-bitwise-instructions.s.cs +0 -17
- data/test/MC/AArch64/neon-compare-instructions.s.cs +0 -136
- data/test/MC/AArch64/neon-crypto.s.cs +0 -15
- data/test/MC/AArch64/neon-extract.s.cs +0 -3
- data/test/MC/AArch64/neon-facge-facgt.s.cs +0 -13
- data/test/MC/AArch64/neon-frsqrt-frecp.s.cs +0 -7
- data/test/MC/AArch64/neon-halving-add-sub.s.cs +0 -25
- data/test/MC/AArch64/neon-max-min-pairwise.s.cs +0 -37
- data/test/MC/AArch64/neon-max-min.s.cs +0 -37
- data/test/MC/AArch64/neon-mla-mls-instructions.s.cs +0 -19
- data/test/MC/AArch64/neon-mov.s.cs +0 -74
- data/test/MC/AArch64/neon-mul-div-instructions.s.cs +0 -24
- data/test/MC/AArch64/neon-perm.s.cs +0 -43
- data/test/MC/AArch64/neon-rounding-halving-add.s.cs +0 -13
- data/test/MC/AArch64/neon-rounding-shift.s.cs +0 -15
- data/test/MC/AArch64/neon-saturating-add-sub.s.cs +0 -29
- data/test/MC/AArch64/neon-saturating-rounding-shift.s.cs +0 -15
- data/test/MC/AArch64/neon-saturating-shift.s.cs +0 -15
- data/test/MC/AArch64/neon-scalar-abs.s.cs +0 -8
- data/test/MC/AArch64/neon-scalar-add-sub.s.cs +0 -3
- data/test/MC/AArch64/neon-scalar-by-elem-mla.s.cs +0 -13
- data/test/MC/AArch64/neon-scalar-by-elem-mul.s.cs +0 -13
- data/test/MC/AArch64/neon-scalar-by-elem-saturating-mla.s.cs +0 -15
- data/test/MC/AArch64/neon-scalar-by-elem-saturating-mul.s.cs +0 -18
- data/test/MC/AArch64/neon-scalar-compare.s.cs +0 -12
- data/test/MC/AArch64/neon-scalar-cvt.s.cs +0 -34
- data/test/MC/AArch64/neon-scalar-dup.s.cs +0 -23
- data/test/MC/AArch64/neon-scalar-extract-narrow.s.cs +0 -10
- data/test/MC/AArch64/neon-scalar-fp-compare.s.cs +0 -21
- data/test/MC/AArch64/neon-scalar-mul.s.cs +0 -13
- data/test/MC/AArch64/neon-scalar-neg.s.cs +0 -6
- data/test/MC/AArch64/neon-scalar-recip.s.cs +0 -11
- data/test/MC/AArch64/neon-scalar-reduce-pairwise.s.cs +0 -3
- data/test/MC/AArch64/neon-scalar-rounding-shift.s.cs +0 -3
- data/test/MC/AArch64/neon-scalar-saturating-add-sub.s.cs +0 -25
- data/test/MC/AArch64/neon-scalar-saturating-rounding-shift.s.cs +0 -9
- data/test/MC/AArch64/neon-scalar-saturating-shift.s.cs +0 -9
- data/test/MC/AArch64/neon-scalar-shift-imm.s.cs +0 -42
- data/test/MC/AArch64/neon-scalar-shift.s.cs +0 -3
- data/test/MC/AArch64/neon-shift-left-long.s.cs +0 -13
- data/test/MC/AArch64/neon-shift.s.cs +0 -22
- data/test/MC/AArch64/neon-simd-copy.s.cs +0 -42
- data/test/MC/AArch64/neon-simd-ldst-multi-elem.s.cs +0 -197
- data/test/MC/AArch64/neon-simd-ldst-one-elem.s.cs +0 -129
- data/test/MC/AArch64/neon-simd-misc.s.cs +0 -213
- data/test/MC/AArch64/neon-simd-post-ldst-multi-elem.s.cs +0 -107
- data/test/MC/AArch64/neon-simd-shift.s.cs +0 -151
- data/test/MC/AArch64/neon-tbl.s.cs +0 -21
- data/test/MC/AArch64/trace-regs.s.cs +0 -383
- data/test/MC/ARM/arm-aliases.s.cs +0 -7
- data/test/MC/ARM/arm-arithmetic-aliases.s.cs +0 -50
- data/test/MC/ARM/arm-it-block.s.cs +0 -2
- data/test/MC/ARM/arm-memory-instructions.s.cs +0 -138
- data/test/MC/ARM/arm-shift-encoding.s.cs +0 -50
- data/test/MC/ARM/arm-thumb-trustzone.s.cs +0 -3
- data/test/MC/ARM/arm-trustzone.s.cs +0 -3
- data/test/MC/ARM/arm_addrmode2.s.cs +0 -15
- data/test/MC/ARM/arm_addrmode3.s.cs +0 -9
- data/test/MC/ARM/arm_instructions.s.cs +0 -25
- data/test/MC/ARM/basic-arm-instructions-v8.s.cs +0 -10
- data/test/MC/ARM/basic-arm-instructions.s.cs +0 -997
- data/test/MC/ARM/basic-thumb-instructions.s.cs +0 -130
- data/test/MC/ARM/basic-thumb2-instructions-v8.s.cs +0 -1
- data/test/MC/ARM/basic-thumb2-instructions.s.cs +0 -1242
- data/test/MC/ARM/crc32-thumb.s.cs +0 -7
- data/test/MC/ARM/crc32.s.cs +0 -7
- data/test/MC/ARM/dot-req.s.cs +0 -3
- data/test/MC/ARM/fp-armv8.s.cs +0 -52
- data/test/MC/ARM/idiv-thumb.s.cs +0 -3
- data/test/MC/ARM/idiv.s.cs +0 -3
- data/test/MC/ARM/load-store-acquire-release-v8-thumb.s.cs +0 -15
- data/test/MC/ARM/load-store-acquire-release-v8.s.cs +0 -15
- data/test/MC/ARM/mode-switch.s.cs +0 -7
- data/test/MC/ARM/neon-abs-encoding.s.cs +0 -15
- data/test/MC/ARM/neon-absdiff-encoding.s.cs +0 -39
- data/test/MC/ARM/neon-add-encoding.s.cs +0 -119
- data/test/MC/ARM/neon-bitcount-encoding.s.cs +0 -15
- data/test/MC/ARM/neon-bitwise-encoding.s.cs +0 -126
- data/test/MC/ARM/neon-cmp-encoding.s.cs +0 -88
- data/test/MC/ARM/neon-convert-encoding.s.cs +0 -27
- data/test/MC/ARM/neon-crypto.s.cs +0 -16
- data/test/MC/ARM/neon-dup-encoding.s.cs +0 -13
- data/test/MC/ARM/neon-minmax-encoding.s.cs +0 -57
- data/test/MC/ARM/neon-mov-encoding.s.cs +0 -76
- data/test/MC/ARM/neon-mul-accum-encoding.s.cs +0 -39
- data/test/MC/ARM/neon-mul-encoding.s.cs +0 -72
- data/test/MC/ARM/neon-neg-encoding.s.cs +0 -15
- data/test/MC/ARM/neon-pairwise-encoding.s.cs +0 -47
- data/test/MC/ARM/neon-reciprocal-encoding.s.cs +0 -13
- data/test/MC/ARM/neon-reverse-encoding.s.cs +0 -13
- data/test/MC/ARM/neon-satshift-encoding.s.cs +0 -75
- data/test/MC/ARM/neon-shift-encoding.s.cs +0 -238
- data/test/MC/ARM/neon-shiftaccum-encoding.s.cs +0 -97
- data/test/MC/ARM/neon-shuffle-encoding.s.cs +0 -59
- data/test/MC/ARM/neon-sub-encoding.s.cs +0 -82
- data/test/MC/ARM/neon-table-encoding.s.cs +0 -9
- data/test/MC/ARM/neon-v8.s.cs +0 -38
- data/test/MC/ARM/neon-vld-encoding.s.cs +0 -213
- data/test/MC/ARM/neon-vst-encoding.s.cs +0 -120
- data/test/MC/ARM/neon-vswp.s.cs +0 -3
- data/test/MC/ARM/neont2-abs-encoding.s.cs +0 -15
- data/test/MC/ARM/neont2-absdiff-encoding.s.cs +0 -39
- data/test/MC/ARM/neont2-add-encoding.s.cs +0 -65
- data/test/MC/ARM/neont2-bitcount-encoding.s.cs +0 -15
- data/test/MC/ARM/neont2-bitwise-encoding.s.cs +0 -15
- data/test/MC/ARM/neont2-cmp-encoding.s.cs +0 -17
- data/test/MC/ARM/neont2-convert-encoding.s.cs +0 -19
- data/test/MC/ARM/neont2-dup-encoding.s.cs +0 -19
- data/test/MC/ARM/neont2-minmax-encoding.s.cs +0 -57
- data/test/MC/ARM/neont2-mov-encoding.s.cs +0 -58
- data/test/MC/ARM/neont2-mul-accum-encoding.s.cs +0 -41
- data/test/MC/ARM/neont2-mul-encoding.s.cs +0 -31
- data/test/MC/ARM/neont2-neg-encoding.s.cs +0 -15
- data/test/MC/ARM/neont2-pairwise-encoding.s.cs +0 -43
- data/test/MC/ARM/neont2-reciprocal-encoding.s.cs +0 -13
- data/test/MC/ARM/neont2-reverse-encoding.s.cs +0 -13
- data/test/MC/ARM/neont2-satshift-encoding.s.cs +0 -75
- data/test/MC/ARM/neont2-shift-encoding.s.cs +0 -80
- data/test/MC/ARM/neont2-shiftaccum-encoding.s.cs +0 -97
- data/test/MC/ARM/neont2-shuffle-encoding.s.cs +0 -23
- data/test/MC/ARM/neont2-sub-encoding.s.cs +0 -23
- data/test/MC/ARM/neont2-table-encoding.s.cs +0 -9
- data/test/MC/ARM/neont2-vld-encoding.s.cs +0 -51
- data/test/MC/ARM/neont2-vst-encoding.s.cs +0 -48
- data/test/MC/ARM/simple-fp-encoding.s.cs +0 -157
- data/test/MC/ARM/thumb-fp-armv8.s.cs +0 -51
- data/test/MC/ARM/thumb-hints.s.cs +0 -12
- data/test/MC/ARM/thumb-neon-crypto.s.cs +0 -16
- data/test/MC/ARM/thumb-neon-v8.s.cs +0 -38
- data/test/MC/ARM/thumb-shift-encoding.s.cs +0 -19
- data/test/MC/ARM/thumb.s.cs +0 -19
- data/test/MC/ARM/thumb2-b.w-encodingT4.s.cs +0 -2
- data/test/MC/ARM/thumb2-branches.s.cs +0 -85
- data/test/MC/ARM/thumb2-mclass.s.cs +0 -41
- data/test/MC/ARM/thumb2-narrow-dp.ll.cs +0 -379
- data/test/MC/ARM/thumb2-pldw.s.cs +0 -2
- data/test/MC/ARM/vfp4-thumb.s.cs +0 -13
- data/test/MC/ARM/vfp4.s.cs +0 -13
- data/test/MC/ARM/vpush-vpop-thumb.s.cs +0 -9
- data/test/MC/ARM/vpush-vpop.s.cs +0 -9
- data/test/MC/Mips/hilo-addressing.s.cs +0 -4
- data/test/MC/Mips/micromips-alu-instructions-EB.s.cs +0 -33
- data/test/MC/Mips/micromips-alu-instructions.s.cs +0 -33
- data/test/MC/Mips/micromips-branch-instructions-EB.s.cs +0 -11
- data/test/MC/Mips/micromips-branch-instructions.s.cs +0 -11
- data/test/MC/Mips/micromips-expansions.s.cs +0 -20
- data/test/MC/Mips/micromips-jump-instructions-EB.s.cs +0 -5
- data/test/MC/Mips/micromips-jump-instructions.s.cs +0 -6
- data/test/MC/Mips/micromips-loadstore-instructions-EB.s.cs +0 -9
- data/test/MC/Mips/micromips-loadstore-instructions.s.cs +0 -9
- data/test/MC/Mips/micromips-loadstore-unaligned-EB.s.cs +0 -5
- data/test/MC/Mips/micromips-loadstore-unaligned.s.cs +0 -5
- data/test/MC/Mips/micromips-movcond-instructions-EB.s.cs +0 -5
- data/test/MC/Mips/micromips-movcond-instructions.s.cs +0 -5
- data/test/MC/Mips/micromips-multiply-instructions-EB.s.cs +0 -5
- data/test/MC/Mips/micromips-multiply-instructions.s.cs +0 -5
- data/test/MC/Mips/micromips-shift-instructions-EB.s.cs +0 -9
- data/test/MC/Mips/micromips-shift-instructions.s.cs +0 -9
- data/test/MC/Mips/micromips-trap-instructions-EB.s.cs +0 -13
- data/test/MC/Mips/micromips-trap-instructions.s.cs +0 -13
- data/test/MC/Mips/mips-alu-instructions.s.cs +0 -53
- data/test/MC/Mips/mips-control-instructions-64.s.cs +0 -33
- data/test/MC/Mips/mips-control-instructions.s.cs +0 -33
- data/test/MC/Mips/mips-coprocessor-encodings.s.cs +0 -17
- data/test/MC/Mips/mips-dsp-instructions.s.cs +0 -43
- data/test/MC/Mips/mips-expansions.s.cs +0 -20
- data/test/MC/Mips/mips-fpu-instructions.s.cs +0 -93
- data/test/MC/Mips/mips-jump-instructions.s.cs +0 -1
- data/test/MC/Mips/mips-memory-instructions.s.cs +0 -17
- data/test/MC/Mips/mips-register-names.s.cs +0 -33
- data/test/MC/Mips/mips64-alu-instructions.s.cs +0 -47
- data/test/MC/Mips/mips64-instructions.s.cs +0 -3
- data/test/MC/Mips/mips64-register-names.s.cs +0 -33
- data/test/MC/Mips/mips_directives.s.cs +0 -12
- data/test/MC/Mips/nabi-regs.s.cs +0 -12
- data/test/MC/Mips/set-at-directive.s.cs +0 -6
- data/test/MC/Mips/test_2r.s.cs +0 -16
- data/test/MC/Mips/test_2rf.s.cs +0 -33
- data/test/MC/Mips/test_3r.s.cs +0 -243
- data/test/MC/Mips/test_3rf.s.cs +0 -83
- data/test/MC/Mips/test_bit.s.cs +0 -49
- data/test/MC/Mips/test_cbranch.s.cs +0 -11
- data/test/MC/Mips/test_ctrlregs.s.cs +0 -33
- data/test/MC/Mips/test_elm.s.cs +0 -16
- data/test/MC/Mips/test_elm_insert.s.cs +0 -4
- data/test/MC/Mips/test_elm_insve.s.cs +0 -5
- data/test/MC/Mips/test_i10.s.cs +0 -5
- data/test/MC/Mips/test_i5.s.cs +0 -45
- data/test/MC/Mips/test_i8.s.cs +0 -11
- data/test/MC/Mips/test_lsa.s.cs +0 -5
- data/test/MC/Mips/test_mi10.s.cs +0 -24
- data/test/MC/Mips/test_vec.s.cs +0 -8
- data/test/MC/PowerPC/ppc64-encoding-bookII.s.cs +0 -25
- data/test/MC/PowerPC/ppc64-encoding-bookIII.s.cs +0 -35
- data/test/MC/PowerPC/ppc64-encoding-ext.s.cs +0 -535
- data/test/MC/PowerPC/ppc64-encoding-fp.s.cs +0 -110
- data/test/MC/PowerPC/ppc64-encoding-vmx.s.cs +0 -170
- data/test/MC/PowerPC/ppc64-encoding.s.cs +0 -202
- data/test/MC/PowerPC/ppc64-operands.s.cs +0 -32
- data/test/MC/README +0 -6
- data/test/MC/Sparc/sparc-alu-instructions.s.cs +0 -47
- data/test/MC/Sparc/sparc-atomic-instructions.s.cs +0 -7
- data/test/MC/Sparc/sparc-ctrl-instructions.s.cs +0 -11
- data/test/MC/Sparc/sparc-fp-instructions.s.cs +0 -59
- data/test/MC/Sparc/sparc-mem-instructions.s.cs +0 -25
- data/test/MC/Sparc/sparc-vis.s.cs +0 -2
- data/test/MC/Sparc/sparc64-alu-instructions.s.cs +0 -13
- data/test/MC/Sparc/sparc64-ctrl-instructions.s.cs +0 -102
- data/test/MC/Sparc/sparcv8-instructions.s.cs +0 -7
- data/test/MC/Sparc/sparcv9-instructions.s.cs +0 -1
- data/test/MC/SystemZ/insn-good-z196.s.cs +0 -589
- data/test/MC/SystemZ/insn-good.s.cs +0 -2265
- data/test/MC/SystemZ/regs-good.s.cs +0 -45
- data/test/MC/X86/3DNow.s.cs +0 -29
- data/test/MC/X86/address-size.s.cs +0 -5
- data/test/MC/X86/avx512-encodings.s.cs +0 -12
- data/test/MC/X86/intel-syntax-encoding.s.cs +0 -30
- data/test/MC/X86/x86-32-avx.s.cs +0 -833
- data/test/MC/X86/x86-32-fma3.s.cs +0 -169
- data/test/MC/X86/x86-32-ms-inline-asm.s.cs +0 -27
- data/test/MC/X86/x86_64-avx-clmul-encoding.s.cs +0 -11
- data/test/MC/X86/x86_64-avx-encoding.s.cs +0 -1058
- data/test/MC/X86/x86_64-bmi-encoding.s.cs +0 -51
- data/test/MC/X86/x86_64-encoding.s.cs +0 -59
- data/test/MC/X86/x86_64-fma3-encoding.s.cs +0 -169
- data/test/MC/X86/x86_64-fma4-encoding.s.cs +0 -98
- data/test/MC/X86/x86_64-hle-encoding.s.cs +0 -3
- data/test/MC/X86/x86_64-imm-widths.s.cs +0 -27
- data/test/MC/X86/x86_64-rand-encoding.s.cs +0 -13
- data/test/MC/X86/x86_64-rtm-encoding.s.cs +0 -4
- data/test/MC/X86/x86_64-sse4a.s.cs +0 -1
- data/test/MC/X86/x86_64-tbm-encoding.s.cs +0 -40
- data/test/MC/X86/x86_64-xop-encoding.s.cs +0 -152
- data/test/README +0 -6
- data/test/test.rb +0 -205
- data/test/test.rb.SPEC +0 -235
- data/test/test_arm.rb +0 -202
- data/test/test_arm.rb.SPEC +0 -275
- data/test/test_arm64.rb +0 -150
- data/test/test_arm64.rb.SPEC +0 -116
- data/test/test_detail.rb +0 -228
- data/test/test_detail.rb.SPEC +0 -322
- data/test/test_exhaustive.rb +0 -80
- data/test/test_mips.rb +0 -118
- data/test/test_mips.rb.SPEC +0 -91
- data/test/test_ppc.rb +0 -137
- data/test/test_ppc.rb.SPEC +0 -84
- data/test/test_sanity.rb +0 -83
- data/test/test_skipdata.rb +0 -111
- data/test/test_skipdata.rb.SPEC +0 -58
- data/test/test_sparc.rb +0 -113
- data/test/test_sparc.rb.SPEC +0 -116
- data/test/test_sysz.rb +0 -111
- data/test/test_sysz.rb.SPEC +0 -61
- data/test/test_x86.rb +0 -189
- data/test/test_x86.rb.SPEC +0 -579
- data/test/test_xcore.rb +0 -100
- data/test/test_xcore.rb.SPEC +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: aa7db8d4574680563c5d764ba18f89a8e9a4a1782d63e5cc4183d8c23b6e46e4
|
4
|
+
data.tar.gz: ef92564c3c75cc1efe08b87a962b963256cb1f6f1aab2e06f60ba31e1aa38a4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67d59e8f780525172b86ac58b05c8f91a49818fd2cf5b2df79461d507663c80fd48e205b561df4dbe31f1a2cfa764a2cd5debe1f652dd16ee0e3cb24d2455a3b
|
7
|
+
data.tar.gz: fcfa5c85c21dd8ee39d2d22fee4d5233e240ee0785acc1c8e645277b4bef96aa160537e66a2c8979536f391639891f76850dac448116e08b6ce9c689f4529aca
|
data/CHANGES.md
CHANGED
@@ -1,23 +1,54 @@
|
|
1
|
-
##
|
2
|
-
*
|
1
|
+
## 4.0.4
|
2
|
+
* Ensured Ruby version support 2.6 ~ 3.1
|
3
|
+
* [Diff from previous release](https://github.com/david942j/crabstone/compare/v4.0.3...v4.0.4)
|
3
4
|
|
4
|
-
##
|
5
|
-
*
|
5
|
+
## 4.0.3
|
6
|
+
* Fixed Instruction class redefinition ([#12](https://github.com/david942j/crabstone/pull/12))
|
7
|
+
* [Diff from previous release](https://github.com/david942j/crabstone/compare/v4.0.2...v4.0.3)
|
6
8
|
|
7
|
-
##
|
8
|
-
*
|
9
|
+
## 4.0.2
|
10
|
+
* Supported binding Capstone 4.0.2
|
11
|
+
* Raised errors when the version of libcapstone is not supported
|
12
|
+
* Internal refactors and code cleanup
|
13
|
+
* [Diff from previous release](https://github.com/david942j/crabstone/compare/4.0.0...v4.0.2)
|
9
14
|
|
10
|
-
## 0.0
|
11
|
-
*
|
15
|
+
## 4.0.0
|
16
|
+
* Supported *both* Capstone 3.x and 4.x.
|
17
|
+
* Supported 4 new architectures: M68K, M680X, TMS320C64x, and EVM.
|
18
|
+
* Added `cs_regs_access` API (wrapped as `Instruction#regs_access` in Crabstone).
|
19
|
+
* Changed some internal constants and methods.
|
20
|
+
* Fixed tons of bugs.
|
21
|
+
* For more details, see https://github.com/david942j/crabstone/pull/2
|
12
22
|
|
13
|
-
##
|
14
|
-
*
|
23
|
+
## 3.0.3-rc1
|
24
|
+
* Internal binding updates, updated some test specs.
|
15
25
|
|
16
|
-
##
|
17
|
-
*
|
26
|
+
## 3.0
|
27
|
+
* See https://github.com/aquynh/capstone/wiki/ChangeLog-since-3.0-rc3
|
28
|
+
* Shouldn't be breaking, most changes are internal.
|
18
29
|
|
19
|
-
##
|
20
|
-
*
|
30
|
+
## 3.0rc3
|
31
|
+
* Generic groups ( CS_GRP_JUMP, CS_GRP_CALL etc)
|
32
|
+
* Mips 32R6 + MICRO
|
33
|
+
* Many constant changes
|
34
|
+
* PPC CRX operand
|
35
|
+
* X86: added prefixed symbols
|
36
|
+
* THIS IS A BREAKING CHANGE ( even from rc1 )
|
37
|
+
|
38
|
+
## 3.0rc1
|
39
|
+
* Update for C side changes
|
40
|
+
* Add support for Xcore
|
41
|
+
* ARM, ARM64 and X86 passing, rest waiting for upstream
|
42
|
+
|
43
|
+
## 2.2.0
|
44
|
+
* Add support for Sparc and SystemZ
|
45
|
+
|
46
|
+
## 2.1rc1
|
47
|
+
* Many constant changes
|
48
|
+
* disasm CAN now return an Array, with a slightly scary built-in finalizer
|
49
|
+
|
50
|
+
## 2.0.1
|
51
|
+
* Update X86 constants
|
21
52
|
|
22
53
|
## 2.0.0
|
23
54
|
* Add PPC support
|
@@ -25,37 +56,23 @@
|
|
25
56
|
* disasm can now ONLY be used with a block ( hopefully fix later )
|
26
57
|
* THIS IS A BREAKING CHANGE
|
27
58
|
|
28
|
-
##
|
29
|
-
*
|
30
|
-
|
31
|
-
## 2.1rc1
|
32
|
-
* Many constant changes
|
33
|
-
* disasm CAN now return an Array, with a slightly scary built-in finalizer
|
59
|
+
## 1.0.0
|
60
|
+
* Move to new github repo
|
34
61
|
|
35
|
-
##
|
36
|
-
*
|
37
|
-
* Better error handling for diet mode
|
38
|
-
* Internally change cs_close() signature, so closed handles can't be used
|
62
|
+
## 0.0.6
|
63
|
+
* Final set of API changes before public beta.
|
39
64
|
|
40
|
-
##
|
41
|
-
*
|
65
|
+
## 0.0.5
|
66
|
+
* API changes including cs_errno.
|
42
67
|
|
43
|
-
##
|
44
|
-
*
|
45
|
-
* Add support for Xcore
|
46
|
-
* ARM, ARM64 and X86 passing, rest waiting for upstream
|
68
|
+
## 0.0.4
|
69
|
+
* Verify MIPS support, tests, slight API changes
|
47
70
|
|
48
|
-
## 3
|
49
|
-
*
|
50
|
-
* Mips 32R6 + MICRO
|
51
|
-
* Many constant changes
|
52
|
-
* PPC CRX operand
|
53
|
-
* X86: added prefixed symbols
|
54
|
-
* THIS IS A BREAKING CHANGE ( even from rc1 )
|
71
|
+
## 0.0.3
|
72
|
+
* Refactoring and cosmetics
|
55
73
|
|
56
|
-
##
|
57
|
-
*
|
58
|
-
* Shouldn't be breaking, most changes are internal.
|
74
|
+
## 0.0.2
|
75
|
+
* Update tests, add syntax sugar
|
59
76
|
|
60
|
-
##
|
61
|
-
*
|
77
|
+
## 0.0.1
|
78
|
+
* Alpha release.
|
data/README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
+
[](https://badge.fury.io/rb/crabstone)
|
2
|
+
[](https://github.com/david942j/crabstone/actions)
|
3
|
+
[](https://codeclimate.com/github/david942j/crabstone)
|
4
|
+
[](https://codeclimate.com/github/david942j/crabstone/coverage)
|
5
|
+
[](https://opensource.org/licenses/BSD-3-Clause)
|
6
|
+
|
1
7
|
crabstone
|
2
8
|
====
|
3
9
|
|
4
|
-
|
5
|
-
===
|
6
|
-
|
7
|
-
Hopefully working.
|
8
|
-
|
9
|
-
Current Library binding: 3.0.3-rc1
|
10
|
+
Current library support: Capstone 3 \& 4
|
10
11
|
----
|
11
12
|
|
12
13
|
( FROM THE CAPSTONE README )
|
@@ -17,22 +18,31 @@ disasm engine for binary analysis and reversing in the security community.
|
|
17
18
|
Created by Nguyen Anh Quynh, then developed and maintained by a small community,
|
18
19
|
Capstone offers some unparalleled features:
|
19
20
|
|
20
|
-
- Support multiple hardware architectures: ARM, ARM64 (
|
21
|
+
- Support multiple hardware architectures: ARM, ARM64 (ARMv8), Ethereum VM, M68K,
|
22
|
+
Mips, MOS65XX, PPC, Sparc, SystemZ, TMS320C64X, M680X, XCore and X86 (including X86_64).
|
21
23
|
|
22
24
|
- Having clean/simple/lightweight/intuitive architecture-neutral API.
|
23
25
|
|
24
26
|
- Provide details on disassembled instruction (called “decomposer” by others).
|
25
27
|
|
26
28
|
- Provide semantics of the disassembled instruction, such as list of implicit
|
27
|
-
|
29
|
+
registers read & written.
|
28
30
|
|
29
|
-
- Implemented in pure C language, with lightweight
|
30
|
-
|
31
|
+
- Implemented in pure C language, with lightweight bindings for D, Clojure, F#,
|
32
|
+
Common Lisp, Visual Basic, PHP, PowerShell, Emacs, Haskell, Perl, Python,
|
33
|
+
Ruby, C#, NodeJS, Java, GO, C++, OCaml, Lua, Rust, Delphi, Free Pascal & Vala
|
34
|
+
ready either in main code, or provided externally by the community.
|
31
35
|
|
32
|
-
- Native support for
|
36
|
+
- Native support for all popular platforms: Windows, Mac OSX, iOS, Android,
|
37
|
+
Linux, \*BSD, Solaris, etc.
|
33
38
|
|
34
39
|
- Thread-safe by design.
|
35
40
|
|
41
|
+
- Special support for embedding into firmware or OS kernel.
|
42
|
+
|
43
|
+
- High performance & suitable for malware analysis (capable of handling various
|
44
|
+
X86 malware tricks).
|
45
|
+
|
36
46
|
- Distributed under the open source BSD license.
|
37
47
|
|
38
48
|
To install:
|
@@ -41,55 +51,43 @@ To install:
|
|
41
51
|
First install the capstone library from either https://github.com/aquynh/capstone
|
42
52
|
or http://www.capstone-engine.org
|
43
53
|
|
44
|
-
Then
|
54
|
+
Then:
|
45
55
|
|
46
56
|
```bash
|
47
|
-
gem
|
48
|
-
gem install crabstone-3.0.3.gem
|
49
|
-
rake test
|
57
|
+
gem install crabstone
|
50
58
|
```
|
51
59
|
|
52
60
|
To write code:
|
53
61
|
----
|
54
62
|
|
55
|
-
Check the tests for more examples. Here is "Hello World":
|
63
|
+
Check the tests in [Capstone](https://github.com/aquynh/capstone) for more examples. Here is "Hello World":
|
56
64
|
```ruby
|
65
|
+
|
57
66
|
require 'crabstone'
|
58
67
|
include Crabstone
|
59
|
-
|
60
|
-
|
61
|
-
"\xED\xFF\xFF\xEB\x04\xe0\x2d\xe5\x00\x00\x00\x00\xe0\x83\x22" <<
|
68
|
+
arm =
|
69
|
+
"\xED\xFF\xFF\xEB\x04\xe0\x2d\xe5\x00\x00\x00\x00\xe0\x83\x22" \
|
62
70
|
"\xe5\xf1\x02\x03\x0e\x00\x00\xa0\xe3\x02\x30\xc1\xe7\x00\x00\x53\xe3"
|
63
|
-
)
|
64
71
|
|
65
72
|
begin
|
66
|
-
|
67
73
|
cs = Disassembler.new(ARCH_ARM, MODE_ARM)
|
68
|
-
puts "Hello from Capstone v
|
69
|
-
puts
|
74
|
+
puts "Hello from Capstone v#{cs.version.join('.')}!"
|
75
|
+
puts 'Disasm:'
|
70
76
|
|
71
77
|
begin
|
72
|
-
cs.disasm(arm, 0x1000).each
|
73
|
-
printf("0x%x:\t%s\t\t%s\n",i.address, i.mnemonic, i.op_str)
|
74
|
-
|
75
|
-
rescue
|
76
|
-
|
78
|
+
cs.disasm(arm, 0x1000).each do |i|
|
79
|
+
printf("0x%x:\t%s\t\t%s\n", i.address, i.mnemonic, i.op_str)
|
80
|
+
end
|
81
|
+
rescue StandardError => e
|
82
|
+
raise "Disassembly error: #{e.message}"
|
77
83
|
ensure
|
78
84
|
cs.close
|
79
85
|
end
|
80
|
-
|
81
|
-
|
82
|
-
fail "Unable to open engine: #{$!}"
|
86
|
+
rescue StandardError => e
|
87
|
+
raise "Unable to open engine: #{e.message}"
|
83
88
|
end
|
84
89
|
```
|
85
90
|
|
86
|
-
Interpreter Support:
|
87
|
-
----
|
88
|
-
|
89
|
-
I test with JRuby >= 1.7.8, MRI >= 2.0.0. If it doesn't work with any of those
|
90
|
-
it's a bug. If it doesn't work with like Rubinius or REE or 1.8 or whatever then
|
91
|
-
"patches welcome". ( AFAIK it does, actually, work with rbx )
|
92
|
-
|
93
91
|
Contributing:
|
94
92
|
----
|
95
93
|
|
@@ -97,7 +95,7 @@ If you feel like chipping in, especially with better tests or examples, or (plea
|
|
97
95
|
|
98
96
|
|
99
97
|
Library Author: Nguyen Anh Quynh
|
100
|
-
Binding Authors: Nguyen Anh Quynh, Tan Sheng Di, Ben Nagy
|
98
|
+
Binding Authors: Nguyen Anh Quynh, Tan Sheng Di, Ben Nagy, david942j
|
101
99
|
License: BSD style - details in the LICENSE file
|
102
100
|
(c) 2013 COSEINC. All Rights Reserved.
|
103
101
|
|
@@ -1,15 +1,14 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
#
|
4
|
-
# (c) 2013 COSEINC. All Rights Reserved.
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# THIS FILE WAS AUTO-GENERATED -- DO NOT EDIT!
|
5
4
|
|
6
5
|
require 'ffi'
|
7
6
|
|
7
|
+
require 'crabstone/arch/extension'
|
8
8
|
require_relative 'arm_const'
|
9
9
|
|
10
10
|
module Crabstone
|
11
11
|
module ARM
|
12
|
-
|
13
12
|
class OperandShift < FFI::Struct
|
14
13
|
layout(
|
15
14
|
:type, :uint,
|
@@ -17,7 +16,7 @@ module Crabstone
|
|
17
16
|
)
|
18
17
|
end
|
19
18
|
|
20
|
-
class
|
19
|
+
class OperandMemory < FFI::Struct
|
21
20
|
layout(
|
22
21
|
:base, :uint,
|
23
22
|
:index, :uint,
|
@@ -29,9 +28,9 @@ module Crabstone
|
|
29
28
|
class OperandValue < FFI::Union
|
30
29
|
layout(
|
31
30
|
:reg, :uint,
|
32
|
-
:imm, :
|
31
|
+
:imm, :int,
|
33
32
|
:fp, :double,
|
34
|
-
:mem,
|
33
|
+
:mem, OperandMemory,
|
35
34
|
:setend, :int
|
36
35
|
)
|
37
36
|
end
|
@@ -45,29 +44,29 @@ module Crabstone
|
|
45
44
|
:subtracted, :bool
|
46
45
|
)
|
47
46
|
|
48
|
-
|
49
|
-
case self[:type]
|
50
|
-
when *[OP_REG, OP_SYSREG]
|
51
|
-
self[:value][:reg]
|
52
|
-
when *[OP_IMM, OP_CIMM, OP_PIMM]
|
53
|
-
self[:value][:imm]
|
54
|
-
when OP_MEM
|
55
|
-
self[:value][:mem]
|
56
|
-
when OP_FP
|
57
|
-
self[:value][:fp]
|
58
|
-
when OP_SETEND
|
59
|
-
self[:value][:setend]
|
60
|
-
else
|
61
|
-
nil
|
62
|
-
end
|
63
|
-
end
|
47
|
+
include Crabstone::Extension::Operand
|
64
48
|
|
65
49
|
def reg?
|
66
|
-
[
|
50
|
+
[
|
51
|
+
OP_REG,
|
52
|
+
OP_SYSREG
|
53
|
+
].include?(self[:type])
|
67
54
|
end
|
68
55
|
|
69
56
|
def imm?
|
70
|
-
[
|
57
|
+
[
|
58
|
+
OP_IMM,
|
59
|
+
OP_CIMM,
|
60
|
+
OP_PIMM
|
61
|
+
].include?(self[:type])
|
62
|
+
end
|
63
|
+
|
64
|
+
def mem?
|
65
|
+
self[:type] == OP_MEM
|
66
|
+
end
|
67
|
+
|
68
|
+
def fp?
|
69
|
+
self[:type] == OP_FP
|
71
70
|
end
|
72
71
|
|
73
72
|
def cimm?
|
@@ -78,30 +77,13 @@ module Crabstone
|
|
78
77
|
self[:type] == OP_PIMM
|
79
78
|
end
|
80
79
|
|
81
|
-
def
|
82
|
-
self[:type] ==
|
83
|
-
end
|
84
|
-
|
85
|
-
def fp?
|
86
|
-
self[:type] == OP_FP
|
80
|
+
def setend?
|
81
|
+
self[:type] == OP_SETEND
|
87
82
|
end
|
88
83
|
|
89
84
|
def sysreg?
|
90
85
|
self[:type] == OP_SYSREG
|
91
86
|
end
|
92
|
-
|
93
|
-
def valid?
|
94
|
-
[
|
95
|
-
OP_MEM,
|
96
|
-
OP_IMM,
|
97
|
-
OP_CIMM,
|
98
|
-
OP_PIMM,
|
99
|
-
OP_FP,
|
100
|
-
OP_REG,
|
101
|
-
OP_SYSREG,
|
102
|
-
OP_SETEND
|
103
|
-
].include? self[:type]
|
104
|
-
end
|
105
87
|
end
|
106
88
|
|
107
89
|
class Instruction < FFI::Struct
|
@@ -119,10 +101,7 @@ module Crabstone
|
|
119
101
|
:operands, [Operand, 36]
|
120
102
|
)
|
121
103
|
|
122
|
-
|
123
|
-
self[:operands].take_while {|op| op[:type].nonzero?}
|
124
|
-
end
|
125
|
-
|
104
|
+
include Crabstone::Extension::Instruction
|
126
105
|
end
|
127
106
|
end
|
128
107
|
end
|
@@ -0,0 +1,124 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# THIS FILE WAS AUTO-GENERATED -- DO NOT EDIT!
|
4
|
+
|
5
|
+
require 'ffi'
|
6
|
+
|
7
|
+
require 'crabstone/arch/extension'
|
8
|
+
require_relative 'arm64_const'
|
9
|
+
|
10
|
+
module Crabstone
|
11
|
+
module ARM64
|
12
|
+
class OperandShift < FFI::Struct
|
13
|
+
layout(
|
14
|
+
:type, :uint,
|
15
|
+
:value, :uint
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
class OperandMemory < FFI::Struct
|
20
|
+
layout(
|
21
|
+
:base, :uint,
|
22
|
+
:index, :uint,
|
23
|
+
:disp, :int
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
class OperandValue < FFI::Union
|
28
|
+
layout(
|
29
|
+
:reg, :uint,
|
30
|
+
:imm, :long,
|
31
|
+
:fp, :double,
|
32
|
+
:mem, OperandMemory,
|
33
|
+
:pstate, :int,
|
34
|
+
:sys, :uint,
|
35
|
+
:prefetch, :int,
|
36
|
+
:barrier, :int
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
class Operand < FFI::Struct
|
41
|
+
layout(
|
42
|
+
:vector_index, :int,
|
43
|
+
:vas, :int,
|
44
|
+
:vess, :int,
|
45
|
+
:shift, OperandShift,
|
46
|
+
:ext, :uint,
|
47
|
+
:type, :uint,
|
48
|
+
:value, OperandValue
|
49
|
+
)
|
50
|
+
def shift?
|
51
|
+
self[:shift][:type] != SFT_INVALID
|
52
|
+
end
|
53
|
+
|
54
|
+
def ext?
|
55
|
+
self[:ext] != EXT_INVALID
|
56
|
+
end
|
57
|
+
|
58
|
+
include Crabstone::Extension::Operand
|
59
|
+
|
60
|
+
def reg?
|
61
|
+
[
|
62
|
+
OP_REG,
|
63
|
+
OP_REG_MRS,
|
64
|
+
OP_REG_MSR
|
65
|
+
].include?(self[:type])
|
66
|
+
end
|
67
|
+
|
68
|
+
def imm?
|
69
|
+
[
|
70
|
+
OP_IMM,
|
71
|
+
OP_CIMM
|
72
|
+
].include?(self[:type])
|
73
|
+
end
|
74
|
+
|
75
|
+
def mem?
|
76
|
+
self[:type] == OP_MEM
|
77
|
+
end
|
78
|
+
|
79
|
+
def fp?
|
80
|
+
self[:type] == OP_FP
|
81
|
+
end
|
82
|
+
|
83
|
+
def cimm?
|
84
|
+
self[:type] == OP_CIMM
|
85
|
+
end
|
86
|
+
|
87
|
+
def reg_mrs?
|
88
|
+
self[:type] == OP_REG_MRS
|
89
|
+
end
|
90
|
+
|
91
|
+
def reg_msr?
|
92
|
+
self[:type] == OP_REG_MSR
|
93
|
+
end
|
94
|
+
|
95
|
+
def pstate?
|
96
|
+
self[:type] == OP_PSTATE
|
97
|
+
end
|
98
|
+
|
99
|
+
def sys?
|
100
|
+
self[:type] == OP_SYS
|
101
|
+
end
|
102
|
+
|
103
|
+
def prefetch?
|
104
|
+
self[:type] == OP_PREFETCH
|
105
|
+
end
|
106
|
+
|
107
|
+
def barrier?
|
108
|
+
self[:type] == OP_BARRIER
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
class Instruction < FFI::Struct
|
113
|
+
layout(
|
114
|
+
:cc, :uint,
|
115
|
+
:update_flags, :bool,
|
116
|
+
:writeback, :bool,
|
117
|
+
:op_count, :uint8,
|
118
|
+
:operands, [Operand, 8]
|
119
|
+
)
|
120
|
+
|
121
|
+
include Crabstone::Extension::Instruction
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|