crabstone 3.0.3 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES.md +45 -42
- data/README.md +16 -33
- data/lib/crabstone.rb +5 -557
- data/lib/crabstone/arch.rb +37 -0
- 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 +36 -0
- data/lib/crabstone/binding.rb +60 -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/constants.rb +110 -0
- data/lib/crabstone/cs_version.rb +49 -0
- data/lib/crabstone/disassembler.rb +153 -0
- data/lib/crabstone/error.rb +60 -0
- data/lib/crabstone/instruction.rb +183 -0
- data/lib/crabstone/version.rb +5 -0
- metadata +128 -324
- 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
data/lib/arch/ppc_registers.rb
DELETED
@@ -1,209 +0,0 @@
|
|
1
|
-
# Library by Nguyen Anh Quynh
|
2
|
-
# Original binding by Nguyen Anh Quynh and Tan Sheng Di
|
3
|
-
# Additional binding work by Ben Nagy
|
4
|
-
# (c) 2013 COSEINC. All Rights Reserved.
|
5
|
-
|
6
|
-
# THIS FILE WAS AUTO-GENERATED -- DO NOT EDIT!
|
7
|
-
# Command: ./genreg /Users/ben/src/capstone/bindings/python/capstone/
|
8
|
-
# 2015-05-02T13:24:07+12:00
|
9
|
-
|
10
|
-
module Crabstone
|
11
|
-
module PPC
|
12
|
-
REG_LOOKUP = {
|
13
|
-
'INVALID' => 0,
|
14
|
-
'CARRY' => 1,
|
15
|
-
'CC' => 2,
|
16
|
-
'CR0' => 3,
|
17
|
-
'CR1' => 4,
|
18
|
-
'CR2' => 5,
|
19
|
-
'CR3' => 6,
|
20
|
-
'CR4' => 7,
|
21
|
-
'CR5' => 8,
|
22
|
-
'CR6' => 9,
|
23
|
-
'CR7' => 10,
|
24
|
-
'CTR' => 11,
|
25
|
-
'F0' => 12,
|
26
|
-
'F1' => 13,
|
27
|
-
'F2' => 14,
|
28
|
-
'F3' => 15,
|
29
|
-
'F4' => 16,
|
30
|
-
'F5' => 17,
|
31
|
-
'F6' => 18,
|
32
|
-
'F7' => 19,
|
33
|
-
'F8' => 20,
|
34
|
-
'F9' => 21,
|
35
|
-
'F10' => 22,
|
36
|
-
'F11' => 23,
|
37
|
-
'F12' => 24,
|
38
|
-
'F13' => 25,
|
39
|
-
'F14' => 26,
|
40
|
-
'F15' => 27,
|
41
|
-
'F16' => 28,
|
42
|
-
'F17' => 29,
|
43
|
-
'F18' => 30,
|
44
|
-
'F19' => 31,
|
45
|
-
'F20' => 32,
|
46
|
-
'F21' => 33,
|
47
|
-
'F22' => 34,
|
48
|
-
'F23' => 35,
|
49
|
-
'F24' => 36,
|
50
|
-
'F25' => 37,
|
51
|
-
'F26' => 38,
|
52
|
-
'F27' => 39,
|
53
|
-
'F28' => 40,
|
54
|
-
'F29' => 41,
|
55
|
-
'F30' => 42,
|
56
|
-
'F31' => 43,
|
57
|
-
'LR' => 44,
|
58
|
-
'R0' => 45,
|
59
|
-
'R1' => 46,
|
60
|
-
'R2' => 47,
|
61
|
-
'R3' => 48,
|
62
|
-
'R4' => 49,
|
63
|
-
'R5' => 50,
|
64
|
-
'R6' => 51,
|
65
|
-
'R7' => 52,
|
66
|
-
'R8' => 53,
|
67
|
-
'R9' => 54,
|
68
|
-
'R10' => 55,
|
69
|
-
'R11' => 56,
|
70
|
-
'R12' => 57,
|
71
|
-
'R13' => 58,
|
72
|
-
'R14' => 59,
|
73
|
-
'R15' => 60,
|
74
|
-
'R16' => 61,
|
75
|
-
'R17' => 62,
|
76
|
-
'R18' => 63,
|
77
|
-
'R19' => 64,
|
78
|
-
'R20' => 65,
|
79
|
-
'R21' => 66,
|
80
|
-
'R22' => 67,
|
81
|
-
'R23' => 68,
|
82
|
-
'R24' => 69,
|
83
|
-
'R25' => 70,
|
84
|
-
'R26' => 71,
|
85
|
-
'R27' => 72,
|
86
|
-
'R28' => 73,
|
87
|
-
'R29' => 74,
|
88
|
-
'R30' => 75,
|
89
|
-
'R31' => 76,
|
90
|
-
'V0' => 77,
|
91
|
-
'V1' => 78,
|
92
|
-
'V2' => 79,
|
93
|
-
'V3' => 80,
|
94
|
-
'V4' => 81,
|
95
|
-
'V5' => 82,
|
96
|
-
'V6' => 83,
|
97
|
-
'V7' => 84,
|
98
|
-
'V8' => 85,
|
99
|
-
'V9' => 86,
|
100
|
-
'V10' => 87,
|
101
|
-
'V11' => 88,
|
102
|
-
'V12' => 89,
|
103
|
-
'V13' => 90,
|
104
|
-
'V14' => 91,
|
105
|
-
'V15' => 92,
|
106
|
-
'V16' => 93,
|
107
|
-
'V17' => 94,
|
108
|
-
'V18' => 95,
|
109
|
-
'V19' => 96,
|
110
|
-
'V20' => 97,
|
111
|
-
'V21' => 98,
|
112
|
-
'V22' => 99,
|
113
|
-
'V23' => 100,
|
114
|
-
'V24' => 101,
|
115
|
-
'V25' => 102,
|
116
|
-
'V26' => 103,
|
117
|
-
'V27' => 104,
|
118
|
-
'V28' => 105,
|
119
|
-
'V29' => 106,
|
120
|
-
'V30' => 107,
|
121
|
-
'V31' => 108,
|
122
|
-
'VRSAVE' => 109,
|
123
|
-
'VS0' => 110,
|
124
|
-
'VS1' => 111,
|
125
|
-
'VS2' => 112,
|
126
|
-
'VS3' => 113,
|
127
|
-
'VS4' => 114,
|
128
|
-
'VS5' => 115,
|
129
|
-
'VS6' => 116,
|
130
|
-
'VS7' => 117,
|
131
|
-
'VS8' => 118,
|
132
|
-
'VS9' => 119,
|
133
|
-
'VS10' => 120,
|
134
|
-
'VS11' => 121,
|
135
|
-
'VS12' => 122,
|
136
|
-
'VS13' => 123,
|
137
|
-
'VS14' => 124,
|
138
|
-
'VS15' => 125,
|
139
|
-
'VS16' => 126,
|
140
|
-
'VS17' => 127,
|
141
|
-
'VS18' => 128,
|
142
|
-
'VS19' => 129,
|
143
|
-
'VS20' => 130,
|
144
|
-
'VS21' => 131,
|
145
|
-
'VS22' => 132,
|
146
|
-
'VS23' => 133,
|
147
|
-
'VS24' => 134,
|
148
|
-
'VS25' => 135,
|
149
|
-
'VS26' => 136,
|
150
|
-
'VS27' => 137,
|
151
|
-
'VS28' => 138,
|
152
|
-
'VS29' => 139,
|
153
|
-
'VS30' => 140,
|
154
|
-
'VS31' => 141,
|
155
|
-
'VS32' => 142,
|
156
|
-
'VS33' => 143,
|
157
|
-
'VS34' => 144,
|
158
|
-
'VS35' => 145,
|
159
|
-
'VS36' => 146,
|
160
|
-
'VS37' => 147,
|
161
|
-
'VS38' => 148,
|
162
|
-
'VS39' => 149,
|
163
|
-
'VS40' => 150,
|
164
|
-
'VS41' => 151,
|
165
|
-
'VS42' => 152,
|
166
|
-
'VS43' => 153,
|
167
|
-
'VS44' => 154,
|
168
|
-
'VS45' => 155,
|
169
|
-
'VS46' => 156,
|
170
|
-
'VS47' => 157,
|
171
|
-
'VS48' => 158,
|
172
|
-
'VS49' => 159,
|
173
|
-
'VS50' => 160,
|
174
|
-
'VS51' => 161,
|
175
|
-
'VS52' => 162,
|
176
|
-
'VS53' => 163,
|
177
|
-
'VS54' => 164,
|
178
|
-
'VS55' => 165,
|
179
|
-
'VS56' => 166,
|
180
|
-
'VS57' => 167,
|
181
|
-
'VS58' => 168,
|
182
|
-
'VS59' => 169,
|
183
|
-
'VS60' => 170,
|
184
|
-
'VS61' => 171,
|
185
|
-
'VS62' => 172,
|
186
|
-
'VS63' => 173,
|
187
|
-
'RM' => 174,
|
188
|
-
'CTR8' => 175,
|
189
|
-
'LR8' => 176,
|
190
|
-
'CR1EQ' => 177
|
191
|
-
}
|
192
|
-
|
193
|
-
ID_LOOKUP = REG_LOOKUP.invert
|
194
|
-
|
195
|
-
# alias registers
|
196
|
-
|
197
|
-
SYM_LOOKUP = Hash[REG_LOOKUP.map {|k,v| [k.downcase.to_sym,v]}]
|
198
|
-
|
199
|
-
def self.register reg
|
200
|
-
return reg if ID_LOOKUP[reg]
|
201
|
-
return SYM_LOOKUP[reg] if SYM_LOOKUP[reg]
|
202
|
-
if reg.respond_to? :upcase
|
203
|
-
return REG_LOOKUP[reg.upcase] || REG_LOOKUP['INVALID']
|
204
|
-
end
|
205
|
-
REG_LOOKUP['INVALID']
|
206
|
-
end
|
207
|
-
|
208
|
-
end
|
209
|
-
end
|
data/lib/arch/sparc.rb
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
# Library by Nguyen Anh Quynh
|
2
|
-
# Original binding by Nguyen Anh Quynh and Tan Sheng Di
|
3
|
-
# Additional binding work by Ben Nagy
|
4
|
-
# (c) 2013 COSEINC. All Rights Reserved.
|
5
|
-
|
6
|
-
require 'ffi'
|
7
|
-
|
8
|
-
require_relative 'sparc_const'
|
9
|
-
|
10
|
-
module Crabstone
|
11
|
-
module Sparc
|
12
|
-
|
13
|
-
class MemoryOperand < FFI::Struct
|
14
|
-
layout(
|
15
|
-
:base, :uint8,
|
16
|
-
:index, :uint8,
|
17
|
-
:disp, :int32
|
18
|
-
)
|
19
|
-
end
|
20
|
-
|
21
|
-
class OperandValue < FFI::Union
|
22
|
-
layout(
|
23
|
-
:reg, :uint,
|
24
|
-
:imm, :int32,
|
25
|
-
:mem, MemoryOperand
|
26
|
-
)
|
27
|
-
end
|
28
|
-
|
29
|
-
class Operand < FFI::Struct
|
30
|
-
layout(
|
31
|
-
:type, :uint,
|
32
|
-
:value, OperandValue
|
33
|
-
)
|
34
|
-
|
35
|
-
def value
|
36
|
-
case self[:type]
|
37
|
-
when OP_REG
|
38
|
-
self[:value][:reg]
|
39
|
-
when OP_IMM
|
40
|
-
self[:value][:imm]
|
41
|
-
when OP_MEM
|
42
|
-
self[:value][:mem]
|
43
|
-
else
|
44
|
-
nil
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def reg?
|
49
|
-
self[:type] == OP_REG
|
50
|
-
end
|
51
|
-
|
52
|
-
def imm?
|
53
|
-
self[:type] == OP_IMM
|
54
|
-
end
|
55
|
-
|
56
|
-
def mem?
|
57
|
-
self[:type] == OP_MEM
|
58
|
-
end
|
59
|
-
|
60
|
-
def valid?
|
61
|
-
[OP_MEM, OP_IMM, OP_REG].include? self[:type]
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
class Instruction < FFI::Struct
|
66
|
-
layout(
|
67
|
-
:cc, :uint,
|
68
|
-
:hint, :uint,
|
69
|
-
:op_count, :uint8,
|
70
|
-
:operands, [Operand, 4],
|
71
|
-
)
|
72
|
-
|
73
|
-
def operands
|
74
|
-
self[:operands].take_while {|op| op[:type].nonzero?}
|
75
|
-
end
|
76
|
-
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
data/lib/arch/sparc_registers.rb
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
# Library by Nguyen Anh Quynh
|
2
|
-
# Original binding by Nguyen Anh Quynh and Tan Sheng Di
|
3
|
-
# Additional binding work by Ben Nagy
|
4
|
-
# (c) 2013 COSEINC. All Rights Reserved.
|
5
|
-
|
6
|
-
# THIS FILE WAS AUTO-GENERATED -- DO NOT EDIT!
|
7
|
-
# Command: ./genreg /Users/ben/src/capstone/bindings/python/capstone/
|
8
|
-
# 2015-05-02T13:24:08+12:00
|
9
|
-
|
10
|
-
module Crabstone
|
11
|
-
module Sparc
|
12
|
-
REG_LOOKUP = {
|
13
|
-
'INVALID' => 0,
|
14
|
-
'F0' => 1,
|
15
|
-
'F1' => 2,
|
16
|
-
'F2' => 3,
|
17
|
-
'F3' => 4,
|
18
|
-
'F4' => 5,
|
19
|
-
'F5' => 6,
|
20
|
-
'F6' => 7,
|
21
|
-
'F7' => 8,
|
22
|
-
'F8' => 9,
|
23
|
-
'F9' => 10,
|
24
|
-
'F10' => 11,
|
25
|
-
'F11' => 12,
|
26
|
-
'F12' => 13,
|
27
|
-
'F13' => 14,
|
28
|
-
'F14' => 15,
|
29
|
-
'F15' => 16,
|
30
|
-
'F16' => 17,
|
31
|
-
'F17' => 18,
|
32
|
-
'F18' => 19,
|
33
|
-
'F19' => 20,
|
34
|
-
'F20' => 21,
|
35
|
-
'F21' => 22,
|
36
|
-
'F22' => 23,
|
37
|
-
'F23' => 24,
|
38
|
-
'F24' => 25,
|
39
|
-
'F25' => 26,
|
40
|
-
'F26' => 27,
|
41
|
-
'F27' => 28,
|
42
|
-
'F28' => 29,
|
43
|
-
'F29' => 30,
|
44
|
-
'F30' => 31,
|
45
|
-
'F31' => 32,
|
46
|
-
'F32' => 33,
|
47
|
-
'F34' => 34,
|
48
|
-
'F36' => 35,
|
49
|
-
'F38' => 36,
|
50
|
-
'F40' => 37,
|
51
|
-
'F42' => 38,
|
52
|
-
'F44' => 39,
|
53
|
-
'F46' => 40,
|
54
|
-
'F48' => 41,
|
55
|
-
'F50' => 42,
|
56
|
-
'F52' => 43,
|
57
|
-
'F54' => 44,
|
58
|
-
'F56' => 45,
|
59
|
-
'F58' => 46,
|
60
|
-
'F60' => 47,
|
61
|
-
'F62' => 48,
|
62
|
-
'FCC0' => 49,
|
63
|
-
'FCC1' => 50,
|
64
|
-
'FCC2' => 51,
|
65
|
-
'FCC3' => 52,
|
66
|
-
'FP' => 53,
|
67
|
-
'G0' => 54,
|
68
|
-
'G1' => 55,
|
69
|
-
'G2' => 56,
|
70
|
-
'G3' => 57,
|
71
|
-
'G4' => 58,
|
72
|
-
'G5' => 59,
|
73
|
-
'G6' => 60,
|
74
|
-
'G7' => 61,
|
75
|
-
'I0' => 62,
|
76
|
-
'I1' => 63,
|
77
|
-
'I2' => 64,
|
78
|
-
'I3' => 65,
|
79
|
-
'I4' => 66,
|
80
|
-
'I5' => 67,
|
81
|
-
'I7' => 68,
|
82
|
-
'ICC' => 69,
|
83
|
-
'L0' => 70,
|
84
|
-
'L1' => 71,
|
85
|
-
'L2' => 72,
|
86
|
-
'L3' => 73,
|
87
|
-
'L4' => 74,
|
88
|
-
'L5' => 75,
|
89
|
-
'L6' => 76,
|
90
|
-
'L7' => 77,
|
91
|
-
'O0' => 78,
|
92
|
-
'O1' => 79,
|
93
|
-
'O2' => 80,
|
94
|
-
'O3' => 81,
|
95
|
-
'O4' => 82,
|
96
|
-
'O5' => 83,
|
97
|
-
'O7' => 84,
|
98
|
-
'SP' => 85,
|
99
|
-
'Y' => 86,
|
100
|
-
'XCC' => 87
|
101
|
-
}
|
102
|
-
|
103
|
-
ID_LOOKUP = REG_LOOKUP.invert
|
104
|
-
|
105
|
-
# alias registers
|
106
|
-
REG_LOOKUP['O6'] = REG_LOOKUP['SP']
|
107
|
-
REG_LOOKUP['I6'] = REG_LOOKUP['FP']
|
108
|
-
|
109
|
-
SYM_LOOKUP = Hash[REG_LOOKUP.map {|k,v| [k.downcase.to_sym,v]}]
|
110
|
-
|
111
|
-
def self.register reg
|
112
|
-
return reg if ID_LOOKUP[reg]
|
113
|
-
return SYM_LOOKUP[reg] if SYM_LOOKUP[reg]
|
114
|
-
if reg.respond_to? :upcase
|
115
|
-
return REG_LOOKUP[reg.upcase] || REG_LOOKUP['INVALID']
|
116
|
-
end
|
117
|
-
REG_LOOKUP['INVALID']
|
118
|
-
end
|
119
|
-
|
120
|
-
end
|
121
|
-
end
|
data/lib/arch/systemz.rb
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
# Library by Nguyen Anh Quynh
|
2
|
-
# Original binding by Nguyen Anh Quynh and Tan Sheng Di
|
3
|
-
# Additional binding work by Ben Nagy
|
4
|
-
# (c) 2013 COSEINC. All Rights Reserved.
|
5
|
-
|
6
|
-
require 'ffi'
|
7
|
-
|
8
|
-
require_relative 'sysz_const'
|
9
|
-
|
10
|
-
module Crabstone
|
11
|
-
module SysZ
|
12
|
-
|
13
|
-
class MemoryOperand < FFI::Struct
|
14
|
-
layout(
|
15
|
-
:base, :uint8,
|
16
|
-
:index, :uint8,
|
17
|
-
:length, :uint64,
|
18
|
-
:disp, :int64
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
22
|
-
class OperandValue < FFI::Union
|
23
|
-
layout(
|
24
|
-
:reg, :uint,
|
25
|
-
:imm, :int64,
|
26
|
-
:mem, MemoryOperand
|
27
|
-
)
|
28
|
-
end
|
29
|
-
|
30
|
-
class Operand < FFI::Struct
|
31
|
-
layout(
|
32
|
-
:type, :uint,
|
33
|
-
:value, OperandValue
|
34
|
-
)
|
35
|
-
|
36
|
-
def value
|
37
|
-
case self[:type]
|
38
|
-
when *[OP_REG, OP_ACREG]
|
39
|
-
self[:value][:reg]
|
40
|
-
when OP_IMM
|
41
|
-
self[:value][:imm]
|
42
|
-
when OP_MEM
|
43
|
-
self[:value][:mem]
|
44
|
-
else
|
45
|
-
nil
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def reg?
|
50
|
-
[OP_REG, OP_ACREG].include? self[:type]
|
51
|
-
end
|
52
|
-
|
53
|
-
def imm?
|
54
|
-
self[:type] == OP_IMM
|
55
|
-
end
|
56
|
-
|
57
|
-
def mem?
|
58
|
-
self[:type] == OP_MEM
|
59
|
-
end
|
60
|
-
|
61
|
-
def valid?
|
62
|
-
[OP_MEM, OP_IMM, OP_REG, OP_ACREG].include? self[:type]
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
class Instruction < FFI::Struct
|
67
|
-
layout(
|
68
|
-
:cc, :uint,
|
69
|
-
:op_count, :uint8,
|
70
|
-
:operands, [Operand, 6],
|
71
|
-
)
|
72
|
-
|
73
|
-
def operands
|
74
|
-
self[:operands].take_while {|op| op[:type].nonzero?}
|
75
|
-
end
|
76
|
-
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|