hexcore-capstone 1.2.0
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.
- package/LICENSE +26 -0
- package/README.md +191 -0
- package/binding.gyp +168 -0
- package/deps/capstone/LEB128.h +38 -0
- package/deps/capstone/MCDisassembler.h +14 -0
- package/deps/capstone/MCFixedLenDisassembler.h +32 -0
- package/deps/capstone/MCInst.c +270 -0
- package/deps/capstone/MCInst.h +165 -0
- package/deps/capstone/MCInstrDesc.c +41 -0
- package/deps/capstone/MCInstrDesc.h +167 -0
- package/deps/capstone/MCRegisterInfo.c +151 -0
- package/deps/capstone/MCRegisterInfo.h +116 -0
- package/deps/capstone/Mapping.c +254 -0
- package/deps/capstone/Mapping.h +174 -0
- package/deps/capstone/MathExtras.h +442 -0
- package/deps/capstone/SStream.c +181 -0
- package/deps/capstone/SStream.h +40 -0
- package/deps/capstone/arch/AArch64/AArch64AddressingModes.h +945 -0
- package/deps/capstone/arch/AArch64/AArch64BaseInfo.c +77 -0
- package/deps/capstone/arch/AArch64/AArch64BaseInfo.h +585 -0
- package/deps/capstone/arch/AArch64/AArch64Disassembler.c +2280 -0
- package/deps/capstone/arch/AArch64/AArch64Disassembler.h +18 -0
- package/deps/capstone/arch/AArch64/AArch64GenAsmWriter.inc +26589 -0
- package/deps/capstone/arch/AArch64/AArch64GenDisassemblerTables.inc +27322 -0
- package/deps/capstone/arch/AArch64/AArch64GenInstrInfo.inc +13194 -0
- package/deps/capstone/arch/AArch64/AArch64GenRegisterInfo.inc +3814 -0
- package/deps/capstone/arch/AArch64/AArch64GenRegisterName.inc +714 -0
- package/deps/capstone/arch/AArch64/AArch64GenRegisterV.inc +673 -0
- package/deps/capstone/arch/AArch64/AArch64GenSubtargetInfo.inc +229 -0
- package/deps/capstone/arch/AArch64/AArch64GenSystemOperands.inc +2863 -0
- package/deps/capstone/arch/AArch64/AArch64GenSystemOperands_enum.inc +21 -0
- package/deps/capstone/arch/AArch64/AArch64InstPrinter.c +3029 -0
- package/deps/capstone/arch/AArch64/AArch64InstPrinter.h +28 -0
- package/deps/capstone/arch/AArch64/AArch64Mapping.c +883 -0
- package/deps/capstone/arch/AArch64/AArch64Mapping.h +43 -0
- package/deps/capstone/arch/AArch64/AArch64MappingInsn.inc +37790 -0
- package/deps/capstone/arch/AArch64/AArch64MappingInsnName.inc +1282 -0
- package/deps/capstone/arch/AArch64/AArch64MappingInsnOp.inc +26994 -0
- package/deps/capstone/arch/AArch64/AArch64Module.c +44 -0
- package/deps/capstone/arch/AArch64/AArch64Module.h +12 -0
- package/deps/capstone/arch/ARM/ARMAddressingModes.h +698 -0
- package/deps/capstone/arch/ARM/ARMBaseInfo.h +486 -0
- package/deps/capstone/arch/ARM/ARMDisassembler.c +5763 -0
- package/deps/capstone/arch/ARM/ARMDisassembler.h +18 -0
- package/deps/capstone/arch/ARM/ARMGenAsmWriter.inc +9545 -0
- package/deps/capstone/arch/ARM/ARMGenDisassemblerTables.inc +15185 -0
- package/deps/capstone/arch/ARM/ARMGenInstrInfo.inc +6632 -0
- package/deps/capstone/arch/ARM/ARMGenRegisterInfo.inc +2102 -0
- package/deps/capstone/arch/ARM/ARMGenRegisterName.inc +231 -0
- package/deps/capstone/arch/ARM/ARMGenRegisterName_digit.inc +231 -0
- package/deps/capstone/arch/ARM/ARMGenSubtargetInfo.inc +162 -0
- package/deps/capstone/arch/ARM/ARMGenSystemRegister.inc +270 -0
- package/deps/capstone/arch/ARM/ARMInstPrinter.c +3364 -0
- package/deps/capstone/arch/ARM/ARMInstPrinter.h +43 -0
- package/deps/capstone/arch/ARM/ARMMapping.c +551 -0
- package/deps/capstone/arch/ARM/ARMMapping.h +40 -0
- package/deps/capstone/arch/ARM/ARMMappingInsn.inc +18772 -0
- package/deps/capstone/arch/ARM/ARMMappingInsnName.inc +475 -0
- package/deps/capstone/arch/ARM/ARMMappingInsnOp.inc +10729 -0
- package/deps/capstone/arch/ARM/ARMModule.c +63 -0
- package/deps/capstone/arch/ARM/ARMModule.h +12 -0
- package/deps/capstone/arch/BPF/BPFConstants.h +88 -0
- package/deps/capstone/arch/BPF/BPFDisassembler.c +464 -0
- package/deps/capstone/arch/BPF/BPFDisassembler.h +27 -0
- package/deps/capstone/arch/BPF/BPFInstPrinter.c +285 -0
- package/deps/capstone/arch/BPF/BPFInstPrinter.h +16 -0
- package/deps/capstone/arch/BPF/BPFMapping.c +513 -0
- package/deps/capstone/arch/BPF/BPFMapping.h +21 -0
- package/deps/capstone/arch/BPF/BPFModule.c +34 -0
- package/deps/capstone/arch/BPF/BPFModule.h +12 -0
- package/deps/capstone/arch/EVM/EVMDisassembler.c +379 -0
- package/deps/capstone/arch/EVM/EVMDisassembler.h +12 -0
- package/deps/capstone/arch/EVM/EVMInstPrinter.c +20 -0
- package/deps/capstone/arch/EVM/EVMInstPrinter.h +17 -0
- package/deps/capstone/arch/EVM/EVMMapping.c +344 -0
- package/deps/capstone/arch/EVM/EVMMapping.h +8 -0
- package/deps/capstone/arch/EVM/EVMMappingInsn.inc +259 -0
- package/deps/capstone/arch/EVM/EVMModule.c +33 -0
- package/deps/capstone/arch/EVM/EVMModule.h +12 -0
- package/deps/capstone/arch/M680X/M680XDisassembler.c +2307 -0
- package/deps/capstone/arch/M680X/M680XDisassembler.h +17 -0
- package/deps/capstone/arch/M680X/M680XDisassemblerInternals.h +57 -0
- package/deps/capstone/arch/M680X/M680XInstPrinter.c +360 -0
- package/deps/capstone/arch/M680X/M680XInstPrinter.h +25 -0
- package/deps/capstone/arch/M680X/M680XModule.c +77 -0
- package/deps/capstone/arch/M680X/M680XModule.h +12 -0
- package/deps/capstone/arch/M680X/cpu12.inc +335 -0
- package/deps/capstone/arch/M680X/hcs08.inc +60 -0
- package/deps/capstone/arch/M680X/hd6301.inc +15 -0
- package/deps/capstone/arch/M680X/hd6309.inc +259 -0
- package/deps/capstone/arch/M680X/insn_props.inc +367 -0
- package/deps/capstone/arch/M680X/m6800.inc +277 -0
- package/deps/capstone/arch/M680X/m6801.inc +39 -0
- package/deps/capstone/arch/M680X/m6805.inc +277 -0
- package/deps/capstone/arch/M680X/m6808.inc +91 -0
- package/deps/capstone/arch/M680X/m6809.inc +352 -0
- package/deps/capstone/arch/M680X/m6811.inc +105 -0
- package/deps/capstone/arch/M68K/M68KDisassembler.c +3668 -0
- package/deps/capstone/arch/M68K/M68KDisassembler.h +30 -0
- package/deps/capstone/arch/M68K/M68KInstPrinter.c +387 -0
- package/deps/capstone/arch/M68K/M68KInstPrinter.h +21 -0
- package/deps/capstone/arch/M68K/M68KInstructionTable.inc +65540 -0
- package/deps/capstone/arch/M68K/M68KModule.c +42 -0
- package/deps/capstone/arch/M68K/M68KModule.h +12 -0
- package/deps/capstone/arch/MOS65XX/MOS65XXDisassembler.c +544 -0
- package/deps/capstone/arch/MOS65XX/MOS65XXDisassembler.h +22 -0
- package/deps/capstone/arch/MOS65XX/MOS65XXDisassemblerInternals.h +23 -0
- package/deps/capstone/arch/MOS65XX/MOS65XXModule.c +79 -0
- package/deps/capstone/arch/MOS65XX/MOS65XXModule.h +12 -0
- package/deps/capstone/arch/MOS65XX/instruction_info.inc +106 -0
- package/deps/capstone/arch/MOS65XX/m6502.inc +256 -0
- package/deps/capstone/arch/MOS65XX/m65816.inc +256 -0
- package/deps/capstone/arch/MOS65XX/m65c02.inc +256 -0
- package/deps/capstone/arch/MOS65XX/mw65c02.inc +256 -0
- package/deps/capstone/arch/Mips/MipsDisassembler.c +1794 -0
- package/deps/capstone/arch/Mips/MipsDisassembler.h +16 -0
- package/deps/capstone/arch/Mips/MipsGenAsmWriter.inc +5725 -0
- package/deps/capstone/arch/Mips/MipsGenDisassemblerTables.inc +6942 -0
- package/deps/capstone/arch/Mips/MipsGenInstrInfo.inc +1805 -0
- package/deps/capstone/arch/Mips/MipsGenRegisterInfo.inc +1679 -0
- package/deps/capstone/arch/Mips/MipsGenSubtargetInfo.inc +52 -0
- package/deps/capstone/arch/Mips/MipsInstPrinter.c +424 -0
- package/deps/capstone/arch/Mips/MipsInstPrinter.h +25 -0
- package/deps/capstone/arch/Mips/MipsMapping.c +1070 -0
- package/deps/capstone/arch/Mips/MipsMapping.h +25 -0
- package/deps/capstone/arch/Mips/MipsMappingInsn.inc +9315 -0
- package/deps/capstone/arch/Mips/MipsModule.c +52 -0
- package/deps/capstone/arch/Mips/MipsModule.h +12 -0
- package/deps/capstone/arch/PowerPC/PPCDisassembler.c +627 -0
- package/deps/capstone/arch/PowerPC/PPCDisassembler.h +17 -0
- package/deps/capstone/arch/PowerPC/PPCGenAsmWriter.inc +11451 -0
- package/deps/capstone/arch/PowerPC/PPCGenDisassemblerTables.inc +6886 -0
- package/deps/capstone/arch/PowerPC/PPCGenInstrInfo.inc +4772 -0
- package/deps/capstone/arch/PowerPC/PPCGenRegisterInfo.inc +1122 -0
- package/deps/capstone/arch/PowerPC/PPCGenRegisterName.inc +278 -0
- package/deps/capstone/arch/PowerPC/PPCGenSubtargetInfo.inc +90 -0
- package/deps/capstone/arch/PowerPC/PPCInstPrinter.c +1238 -0
- package/deps/capstone/arch/PowerPC/PPCInstPrinter.h +15 -0
- package/deps/capstone/arch/PowerPC/PPCMapping.c +570 -0
- package/deps/capstone/arch/PowerPC/PPCMapping.h +40 -0
- package/deps/capstone/arch/PowerPC/PPCMappingInsn.inc +13220 -0
- package/deps/capstone/arch/PowerPC/PPCMappingInsnName.inc +1731 -0
- package/deps/capstone/arch/PowerPC/PPCModule.c +45 -0
- package/deps/capstone/arch/PowerPC/PPCModule.h +12 -0
- package/deps/capstone/arch/PowerPC/PPCPredicates.h +62 -0
- package/deps/capstone/arch/RISCV/RISCVBaseInfo.h +106 -0
- package/deps/capstone/arch/RISCV/RISCVDisassembler.c +433 -0
- package/deps/capstone/arch/RISCV/RISCVDisassembler.h +18 -0
- package/deps/capstone/arch/RISCV/RISCVGenAsmWriter.inc +2651 -0
- package/deps/capstone/arch/RISCV/RISCVGenDisassemblerTables.inc +1776 -0
- package/deps/capstone/arch/RISCV/RISCVGenInsnNameMaps.inc +275 -0
- package/deps/capstone/arch/RISCV/RISCVGenInstrInfo.inc +470 -0
- package/deps/capstone/arch/RISCV/RISCVGenRegisterInfo.inc +426 -0
- package/deps/capstone/arch/RISCV/RISCVGenSubtargetInfo.inc +33 -0
- package/deps/capstone/arch/RISCV/RISCVInstPrinter.c +447 -0
- package/deps/capstone/arch/RISCV/RISCVInstPrinter.h +24 -0
- package/deps/capstone/arch/RISCV/RISCVMapping.c +366 -0
- package/deps/capstone/arch/RISCV/RISCVMapping.h +22 -0
- package/deps/capstone/arch/RISCV/RISCVMappingInsn.inc +1635 -0
- package/deps/capstone/arch/RISCV/RISCVModule.c +42 -0
- package/deps/capstone/arch/RISCV/RISCVModule.h +12 -0
- package/deps/capstone/arch/SH/SHDisassembler.c +2221 -0
- package/deps/capstone/arch/SH/SHDisassembler.h +19 -0
- package/deps/capstone/arch/SH/SHInsnTable.inc +66 -0
- package/deps/capstone/arch/SH/SHInstPrinter.c +438 -0
- package/deps/capstone/arch/SH/SHInstPrinter.h +23 -0
- package/deps/capstone/arch/SH/SHModule.c +39 -0
- package/deps/capstone/arch/SH/SHModule.h +12 -0
- package/deps/capstone/arch/SH/mktable.rb +390 -0
- package/deps/capstone/arch/Sparc/Sparc.h +63 -0
- package/deps/capstone/arch/Sparc/SparcDisassembler.c +500 -0
- package/deps/capstone/arch/Sparc/SparcDisassembler.h +17 -0
- package/deps/capstone/arch/Sparc/SparcGenAsmWriter.inc +5709 -0
- package/deps/capstone/arch/Sparc/SparcGenDisassemblerTables.inc +2028 -0
- package/deps/capstone/arch/Sparc/SparcGenInstrInfo.inc +514 -0
- package/deps/capstone/arch/Sparc/SparcGenRegisterInfo.inc +451 -0
- package/deps/capstone/arch/Sparc/SparcGenSubtargetInfo.inc +27 -0
- package/deps/capstone/arch/Sparc/SparcInstPrinter.c +446 -0
- package/deps/capstone/arch/Sparc/SparcInstPrinter.h +17 -0
- package/deps/capstone/arch/Sparc/SparcMapping.c +665 -0
- package/deps/capstone/arch/Sparc/SparcMapping.h +34 -0
- package/deps/capstone/arch/Sparc/SparcMappingInsn.inc +2643 -0
- package/deps/capstone/arch/Sparc/SparcModule.c +45 -0
- package/deps/capstone/arch/Sparc/SparcModule.h +12 -0
- package/deps/capstone/arch/SystemZ/SystemZDisassembler.c +484 -0
- package/deps/capstone/arch/SystemZ/SystemZDisassembler.h +17 -0
- package/deps/capstone/arch/SystemZ/SystemZGenAsmWriter.inc +11575 -0
- package/deps/capstone/arch/SystemZ/SystemZGenDisassemblerTables.inc +10262 -0
- package/deps/capstone/arch/SystemZ/SystemZGenInsnNameMaps.inc +2348 -0
- package/deps/capstone/arch/SystemZ/SystemZGenInstrInfo.inc +2820 -0
- package/deps/capstone/arch/SystemZ/SystemZGenRegisterInfo.inc +741 -0
- package/deps/capstone/arch/SystemZ/SystemZGenSubtargetInfo.inc +49 -0
- package/deps/capstone/arch/SystemZ/SystemZInstPrinter.c +433 -0
- package/deps/capstone/arch/SystemZ/SystemZInstPrinter.h +15 -0
- package/deps/capstone/arch/SystemZ/SystemZMCTargetDesc.c +195 -0
- package/deps/capstone/arch/SystemZ/SystemZMCTargetDesc.h +51 -0
- package/deps/capstone/arch/SystemZ/SystemZMapping.c +479 -0
- package/deps/capstone/arch/SystemZ/SystemZMapping.h +23 -0
- package/deps/capstone/arch/SystemZ/SystemZMappingInsn.inc +14175 -0
- package/deps/capstone/arch/SystemZ/SystemZModule.c +44 -0
- package/deps/capstone/arch/SystemZ/SystemZModule.h +12 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xDisassembler.c +628 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xDisassembler.h +19 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xGenAsmWriter.inc +684 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xGenDisassemblerTables.inc +1352 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xGenInstrInfo.inc +298 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xGenRegisterInfo.inc +277 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xInstPrinter.c +572 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xInstPrinter.h +15 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xMapping.c +1926 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xMapping.h +26 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xModule.c +39 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xModule.h +12 -0
- package/deps/capstone/arch/TriCore/TriCore.td +134 -0
- package/deps/capstone/arch/TriCore/TriCoreCallingConv.td +61 -0
- package/deps/capstone/arch/TriCore/TriCoreDisassembler.c +1655 -0
- package/deps/capstone/arch/TriCore/TriCoreDisassembler.h +18 -0
- package/deps/capstone/arch/TriCore/TriCoreGenAsmWriter.inc +3691 -0
- package/deps/capstone/arch/TriCore/TriCoreGenCSFeatureName.inc +22 -0
- package/deps/capstone/arch/TriCore/TriCoreGenCSMappingInsn.inc +8938 -0
- package/deps/capstone/arch/TriCore/TriCoreGenCSMappingInsnName.inc +404 -0
- package/deps/capstone/arch/TriCore/TriCoreGenCSMappingInsnOp.inc +7994 -0
- package/deps/capstone/arch/TriCore/TriCoreGenCSOpGroup.inc +32 -0
- package/deps/capstone/arch/TriCore/TriCoreGenDisassemblerTables.inc +4044 -0
- package/deps/capstone/arch/TriCore/TriCoreGenInstrInfo.inc +2693 -0
- package/deps/capstone/arch/TriCore/TriCoreGenRegisterInfo.inc +295 -0
- package/deps/capstone/arch/TriCore/TriCoreGenSubtargetInfo.inc +40 -0
- package/deps/capstone/arch/TriCore/TriCoreInstPrinter.c +488 -0
- package/deps/capstone/arch/TriCore/TriCoreInstrFormats.td +773 -0
- package/deps/capstone/arch/TriCore/TriCoreInstrInfo.td +1873 -0
- package/deps/capstone/arch/TriCore/TriCoreLinkage.h +21 -0
- package/deps/capstone/arch/TriCore/TriCoreMapping.c +241 -0
- package/deps/capstone/arch/TriCore/TriCoreMapping.h +32 -0
- package/deps/capstone/arch/TriCore/TriCoreModule.c +44 -0
- package/deps/capstone/arch/TriCore/TriCoreModule.h +11 -0
- package/deps/capstone/arch/TriCore/TriCoreRegisterInfo.td +153 -0
- package/deps/capstone/arch/WASM/WASMDisassembler.c +1009 -0
- package/deps/capstone/arch/WASM/WASMDisassembler.h +12 -0
- package/deps/capstone/arch/WASM/WASMInstPrinter.c +47 -0
- package/deps/capstone/arch/WASM/WASMInstPrinter.h +18 -0
- package/deps/capstone/arch/WASM/WASMMapping.c +333 -0
- package/deps/capstone/arch/WASM/WASMMapping.h +9 -0
- package/deps/capstone/arch/WASM/WASMModule.c +33 -0
- package/deps/capstone/arch/WASM/WASMModule.h +12 -0
- package/deps/capstone/arch/X86/X86ATTInstPrinter.c +997 -0
- package/deps/capstone/arch/X86/X86BaseInfo.h +50 -0
- package/deps/capstone/arch/X86/X86Disassembler.c +1033 -0
- package/deps/capstone/arch/X86/X86Disassembler.h +28 -0
- package/deps/capstone/arch/X86/X86DisassemblerDecoder.c +2358 -0
- package/deps/capstone/arch/X86/X86DisassemblerDecoder.h +725 -0
- package/deps/capstone/arch/X86/X86DisassemblerDecoderCommon.h +483 -0
- package/deps/capstone/arch/X86/X86GenAsmWriter.inc +49199 -0
- package/deps/capstone/arch/X86/X86GenAsmWriter1.inc +33196 -0
- package/deps/capstone/arch/X86/X86GenAsmWriter1_reduce.inc +2531 -0
- package/deps/capstone/arch/X86/X86GenAsmWriter_reduce.inc +2855 -0
- package/deps/capstone/arch/X86/X86GenDisassemblerTables.inc +112961 -0
- package/deps/capstone/arch/X86/X86GenDisassemblerTables2.inc +102151 -0
- package/deps/capstone/arch/X86/X86GenDisassemblerTables_reduce.inc +28047 -0
- package/deps/capstone/arch/X86/X86GenDisassemblerTables_reduce2.inc +18827 -0
- package/deps/capstone/arch/X86/X86GenInstrInfo.inc +15158 -0
- package/deps/capstone/arch/X86/X86GenInstrInfo_reduce.inc +1564 -0
- package/deps/capstone/arch/X86/X86GenRegisterInfo.inc +1549 -0
- package/deps/capstone/arch/X86/X86GenRegisterName.inc +292 -0
- package/deps/capstone/arch/X86/X86GenRegisterName1.inc +291 -0
- package/deps/capstone/arch/X86/X86ImmSize.inc +335 -0
- package/deps/capstone/arch/X86/X86InstPrinter.h +26 -0
- package/deps/capstone/arch/X86/X86InstPrinterCommon.c +116 -0
- package/deps/capstone/arch/X86/X86InstPrinterCommon.h +16 -0
- package/deps/capstone/arch/X86/X86IntelInstPrinter.c +1061 -0
- package/deps/capstone/arch/X86/X86Lookup16.inc +16874 -0
- package/deps/capstone/arch/X86/X86Lookup16_reduce.inc +2308 -0
- package/deps/capstone/arch/X86/X86Mapping.c +2266 -0
- package/deps/capstone/arch/X86/X86Mapping.h +96 -0
- package/deps/capstone/arch/X86/X86MappingInsn.inc +105977 -0
- package/deps/capstone/arch/X86/X86MappingInsnName.inc +1527 -0
- package/deps/capstone/arch/X86/X86MappingInsnName_reduce.inc +348 -0
- package/deps/capstone/arch/X86/X86MappingInsnOp.inc +75700 -0
- package/deps/capstone/arch/X86/X86MappingInsnOp_reduce.inc +7729 -0
- package/deps/capstone/arch/X86/X86MappingInsn_reduce.inc +10819 -0
- package/deps/capstone/arch/X86/X86MappingReg.inc +280 -0
- package/deps/capstone/arch/X86/X86Module.c +94 -0
- package/deps/capstone/arch/X86/X86Module.h +12 -0
- package/deps/capstone/arch/XCore/XCoreDisassembler.c +794 -0
- package/deps/capstone/arch/XCore/XCoreDisassembler.h +17 -0
- package/deps/capstone/arch/XCore/XCoreGenAsmWriter.inc +772 -0
- package/deps/capstone/arch/XCore/XCoreGenDisassemblerTables.inc +853 -0
- package/deps/capstone/arch/XCore/XCoreGenInstrInfo.inc +267 -0
- package/deps/capstone/arch/XCore/XCoreGenRegisterInfo.inc +110 -0
- package/deps/capstone/arch/XCore/XCoreInstPrinter.c +250 -0
- package/deps/capstone/arch/XCore/XCoreInstPrinter.h +18 -0
- package/deps/capstone/arch/XCore/XCoreMapping.c +297 -0
- package/deps/capstone/arch/XCore/XCoreMapping.h +26 -0
- package/deps/capstone/arch/XCore/XCoreMappingInsn.inc +1287 -0
- package/deps/capstone/arch/XCore/XCoreModule.c +41 -0
- package/deps/capstone/arch/XCore/XCoreModule.h +12 -0
- package/deps/capstone/cs.c +1664 -0
- package/deps/capstone/cs_priv.h +101 -0
- package/deps/capstone/cs_simple_types.h +886 -0
- package/deps/capstone/include/capstone/arm.h +991 -0
- package/deps/capstone/include/capstone/arm64.h +3159 -0
- package/deps/capstone/include/capstone/bpf.h +209 -0
- package/deps/capstone/include/capstone/capstone.h +875 -0
- package/deps/capstone/include/capstone/evm.h +188 -0
- package/deps/capstone/include/capstone/m680x.h +537 -0
- package/deps/capstone/include/capstone/m68k.h +613 -0
- package/deps/capstone/include/capstone/mips.h +956 -0
- package/deps/capstone/include/capstone/mos65xx.h +204 -0
- package/deps/capstone/include/capstone/platform.h +122 -0
- package/deps/capstone/include/capstone/ppc.h +2108 -0
- package/deps/capstone/include/capstone/riscv.h +531 -0
- package/deps/capstone/include/capstone/sh.h +465 -0
- package/deps/capstone/include/capstone/sparc.h +520 -0
- package/deps/capstone/include/capstone/systemz.h +2601 -0
- package/deps/capstone/include/capstone/tms320c64x.h +359 -0
- package/deps/capstone/include/capstone/tricore.h +567 -0
- package/deps/capstone/include/capstone/wasm.h +250 -0
- package/deps/capstone/include/capstone/x86.h +1986 -0
- package/deps/capstone/include/capstone/xcore.h +235 -0
- package/deps/capstone/include/platform.h +110 -0
- package/deps/capstone/include/windowsce/intrin.h +12 -0
- package/deps/capstone/include/windowsce/stdint.h +133 -0
- package/deps/capstone/utils.c +140 -0
- package/deps/capstone/utils.h +54 -0
- package/index.d.ts +448 -0
- package/index.js +64 -0
- package/index.mjs +25 -0
- package/package.json +82 -0
- package/prebuilds/win32-x64/hexcore-capstone.node +0 -0
- package/src/capstone_wrapper.cpp +910 -0
- package/src/capstone_wrapper.h +147 -0
- package/src/disasm_async_worker.h +215 -0
- package/src/main.cpp +145 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* Capstone Disassembly Engine */
|
|
2
|
+
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
|
|
3
|
+
|
|
4
|
+
#ifdef CAPSTONE_HAS_SPARC
|
|
5
|
+
|
|
6
|
+
#include "../../utils.h"
|
|
7
|
+
#include "../../MCRegisterInfo.h"
|
|
8
|
+
#include "SparcDisassembler.h"
|
|
9
|
+
#include "SparcInstPrinter.h"
|
|
10
|
+
#include "SparcMapping.h"
|
|
11
|
+
#include "SparcModule.h"
|
|
12
|
+
|
|
13
|
+
cs_err Sparc_global_init(cs_struct *ud)
|
|
14
|
+
{
|
|
15
|
+
MCRegisterInfo *mri;
|
|
16
|
+
mri = cs_mem_malloc(sizeof(*mri));
|
|
17
|
+
|
|
18
|
+
Sparc_init(mri);
|
|
19
|
+
ud->printer = Sparc_printInst;
|
|
20
|
+
ud->printer_info = mri;
|
|
21
|
+
ud->getinsn_info = mri;
|
|
22
|
+
ud->disasm = Sparc_getInstruction;
|
|
23
|
+
ud->post_printer = Sparc_post_printer;
|
|
24
|
+
|
|
25
|
+
ud->reg_name = Sparc_reg_name;
|
|
26
|
+
ud->insn_id = Sparc_get_insn_id;
|
|
27
|
+
ud->insn_name = Sparc_insn_name;
|
|
28
|
+
ud->group_name = Sparc_group_name;
|
|
29
|
+
|
|
30
|
+
return CS_ERR_OK;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
cs_err Sparc_option(cs_struct *handle, cs_opt_type type, size_t value)
|
|
34
|
+
{
|
|
35
|
+
if (type == CS_OPT_SYNTAX)
|
|
36
|
+
handle->syntax = (int) value;
|
|
37
|
+
|
|
38
|
+
if (type == CS_OPT_MODE) {
|
|
39
|
+
handle->mode = (cs_mode)value;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return CS_ERR_OK;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#endif
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Capstone Disassembly Engine */
|
|
2
|
+
/* By Travis Finkenauer <tmfinken@gmail.com>, 2018 */
|
|
3
|
+
|
|
4
|
+
#ifndef CS_SPARC_MODULE_H
|
|
5
|
+
#define CS_SPARC_MODULE_H
|
|
6
|
+
|
|
7
|
+
#include "../../utils.h"
|
|
8
|
+
|
|
9
|
+
cs_err Sparc_global_init(cs_struct *ud);
|
|
10
|
+
cs_err Sparc_option(cs_struct *handle, cs_opt_type type, size_t value);
|
|
11
|
+
|
|
12
|
+
#endif
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
//===------ SystemZDisassembler.cpp - Disassembler for PowerPC ------*- C++ -*-===//
|
|
2
|
+
//
|
|
3
|
+
// The LLVM Compiler Infrastructure
|
|
4
|
+
//
|
|
5
|
+
// This file is distributed under the University of Illinois Open Source
|
|
6
|
+
// License. See LICENSE.TXT for details.
|
|
7
|
+
//
|
|
8
|
+
//===----------------------------------------------------------------------===//
|
|
9
|
+
|
|
10
|
+
/* Capstone Disassembly Engine */
|
|
11
|
+
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
|
|
12
|
+
|
|
13
|
+
#ifdef CAPSTONE_HAS_SYSZ
|
|
14
|
+
|
|
15
|
+
#include <stdio.h> // DEBUG
|
|
16
|
+
#include <stdlib.h>
|
|
17
|
+
#include <string.h>
|
|
18
|
+
|
|
19
|
+
#include "../../cs_priv.h"
|
|
20
|
+
#include "../../utils.h"
|
|
21
|
+
|
|
22
|
+
#include "SystemZDisassembler.h"
|
|
23
|
+
|
|
24
|
+
#include "../../MCInst.h"
|
|
25
|
+
#include "../../MCInstrDesc.h"
|
|
26
|
+
#include "../../MCFixedLenDisassembler.h"
|
|
27
|
+
#include "../../MCRegisterInfo.h"
|
|
28
|
+
#include "../../MCDisassembler.h"
|
|
29
|
+
#include "../../MathExtras.h"
|
|
30
|
+
|
|
31
|
+
#include "SystemZMCTargetDesc.h"
|
|
32
|
+
|
|
33
|
+
static uint64_t getFeatureBits(int mode)
|
|
34
|
+
{
|
|
35
|
+
// support everything
|
|
36
|
+
return (uint64_t)-1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static DecodeStatus decodeRegisterClass(MCInst *Inst, uint64_t RegNo, const unsigned *Regs)
|
|
40
|
+
{
|
|
41
|
+
//assert(RegNo < 16 && "Invalid register");
|
|
42
|
+
RegNo = Regs[RegNo];
|
|
43
|
+
if (RegNo == 0)
|
|
44
|
+
return MCDisassembler_Fail;
|
|
45
|
+
|
|
46
|
+
MCOperand_CreateReg0(Inst, (unsigned)RegNo);
|
|
47
|
+
return MCDisassembler_Success;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static DecodeStatus DecodeGR32BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
51
|
+
uint64_t Address, const void *Decoder)
|
|
52
|
+
{
|
|
53
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_GR32Regs);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static DecodeStatus DecodeGRH32BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
57
|
+
uint64_t Address, const void *Decoder)
|
|
58
|
+
{
|
|
59
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_GRH32Regs);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static DecodeStatus DecodeGR64BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
63
|
+
uint64_t Address, const void *Decoder)
|
|
64
|
+
{
|
|
65
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_GR64Regs);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static DecodeStatus DecodeGR128BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
69
|
+
uint64_t Address, const void *Decoder)
|
|
70
|
+
{
|
|
71
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_GR128Regs);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static DecodeStatus DecodeADDR64BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
75
|
+
uint64_t Address, const void *Decoder)
|
|
76
|
+
{
|
|
77
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_GR64Regs);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static DecodeStatus DecodeFP32BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
81
|
+
uint64_t Address, const void *Decoder)
|
|
82
|
+
{
|
|
83
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_FP32Regs);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
static DecodeStatus DecodeFP64BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
87
|
+
uint64_t Address, const void *Decoder)
|
|
88
|
+
{
|
|
89
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_FP64Regs);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
static DecodeStatus DecodeFP128BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
93
|
+
uint64_t Address, const void *Decoder)
|
|
94
|
+
{
|
|
95
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_FP128Regs);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
static DecodeStatus DecodeVR32BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
99
|
+
uint64_t Address, const void *Decoder)
|
|
100
|
+
{
|
|
101
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_VR32Regs);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
static DecodeStatus DecodeVR64BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
105
|
+
uint64_t Address, const void *Decoder)
|
|
106
|
+
{
|
|
107
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_VR64Regs);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
static DecodeStatus DecodeVR128BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
111
|
+
uint64_t Address, const void *Decoder)
|
|
112
|
+
{
|
|
113
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_VR128Regs);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
static DecodeStatus DecodeAR32BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
117
|
+
uint64_t Address, const void *Decoder)
|
|
118
|
+
{
|
|
119
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_AR32Regs);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
static DecodeStatus DecodeCR64BitRegisterClass(MCInst *Inst, uint64_t RegNo,
|
|
123
|
+
uint64_t Address, const void *Decoder)
|
|
124
|
+
{
|
|
125
|
+
return decodeRegisterClass(Inst, RegNo, SystemZMC_CR64Regs);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
static DecodeStatus decodeUImmOperand(MCInst *Inst, uint64_t Imm)
|
|
129
|
+
{
|
|
130
|
+
//assert(isUInt<N>(Imm) && "Invalid immediate");
|
|
131
|
+
MCOperand_CreateImm0(Inst, Imm);
|
|
132
|
+
return MCDisassembler_Success;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
static DecodeStatus decodeSImmOperand(MCInst *Inst, uint64_t Imm, unsigned N)
|
|
136
|
+
{
|
|
137
|
+
//assert(isUInt<N>(Imm) && "Invalid immediate");
|
|
138
|
+
MCOperand_CreateImm0(Inst, SignExtend64(Imm, N));
|
|
139
|
+
return MCDisassembler_Success;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
static DecodeStatus decodeU1ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
143
|
+
uint64_t Address, const void *Decoder)
|
|
144
|
+
{
|
|
145
|
+
return decodeUImmOperand(Inst, Imm);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
static DecodeStatus decodeU2ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
149
|
+
uint64_t Address, const void *Decoder)
|
|
150
|
+
{
|
|
151
|
+
return decodeUImmOperand(Inst, Imm);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
static DecodeStatus decodeU3ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
155
|
+
uint64_t Address, const void *Decoder)
|
|
156
|
+
{
|
|
157
|
+
return decodeUImmOperand(Inst, Imm);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
static DecodeStatus decodeU4ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
161
|
+
uint64_t Address, const void *Decoder)
|
|
162
|
+
{
|
|
163
|
+
return decodeUImmOperand(Inst, Imm);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
static DecodeStatus decodeU6ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
167
|
+
uint64_t Address, const void *Decoder)
|
|
168
|
+
{
|
|
169
|
+
return decodeUImmOperand(Inst, Imm);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
static DecodeStatus decodeU8ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
173
|
+
uint64_t Address, const void *Decoder)
|
|
174
|
+
{
|
|
175
|
+
return decodeUImmOperand(Inst, Imm);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
static DecodeStatus decodeU12ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
179
|
+
uint64_t Address, const void *Decoder)
|
|
180
|
+
{
|
|
181
|
+
return decodeUImmOperand(Inst, Imm);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
static DecodeStatus decodeU16ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
185
|
+
uint64_t Address, const void *Decoder)
|
|
186
|
+
{
|
|
187
|
+
return decodeUImmOperand(Inst, Imm);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
static DecodeStatus decodeU32ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
191
|
+
uint64_t Address, const void *Decoder)
|
|
192
|
+
{
|
|
193
|
+
return decodeUImmOperand(Inst, Imm);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
static DecodeStatus decodeS8ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
197
|
+
uint64_t Address, const void *Decoder)
|
|
198
|
+
{
|
|
199
|
+
return decodeSImmOperand(Inst, Imm, 8);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
static DecodeStatus decodeS16ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
203
|
+
uint64_t Address, const void *Decoder)
|
|
204
|
+
{
|
|
205
|
+
return decodeSImmOperand(Inst, Imm, 16);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
static DecodeStatus decodeS32ImmOperand(MCInst *Inst, uint64_t Imm,
|
|
209
|
+
uint64_t Address, const void *Decoder)
|
|
210
|
+
{
|
|
211
|
+
return decodeSImmOperand(Inst, Imm, 32);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
static DecodeStatus decodePCDBLOperand(MCInst *Inst, uint64_t Imm,
|
|
215
|
+
uint64_t Address, unsigned N)
|
|
216
|
+
{
|
|
217
|
+
//assert(isUInt<N>(Imm) && "Invalid PC-relative offset");
|
|
218
|
+
MCOperand_CreateImm0(Inst, SignExtend64(Imm, N) * 2 + Address);
|
|
219
|
+
return MCDisassembler_Success;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
static DecodeStatus decodePC12DBLBranchOperand(MCInst *Inst, uint64_t Imm,
|
|
223
|
+
uint64_t Address,
|
|
224
|
+
const void *Decoder)
|
|
225
|
+
{
|
|
226
|
+
return decodePCDBLOperand(Inst, Imm, Address, 12);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
static DecodeStatus decodePC16DBLBranchOperand(MCInst *Inst, uint64_t Imm,
|
|
230
|
+
uint64_t Address,
|
|
231
|
+
const void *Decoder)
|
|
232
|
+
{
|
|
233
|
+
return decodePCDBLOperand(Inst, Imm, Address, 16);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
static DecodeStatus decodePC24DBLBranchOperand(MCInst *Inst, uint64_t Imm,
|
|
237
|
+
uint64_t Address,
|
|
238
|
+
const void *Decoder)
|
|
239
|
+
{
|
|
240
|
+
return decodePCDBLOperand(Inst, Imm, Address, 24);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
static DecodeStatus decodePC32DBLBranchOperand(MCInst *Inst, uint64_t Imm,
|
|
244
|
+
uint64_t Address,
|
|
245
|
+
const void *Decoder)
|
|
246
|
+
{
|
|
247
|
+
return decodePCDBLOperand(Inst, Imm, Address, 32);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
static DecodeStatus decodePC32DBLOperand(MCInst *Inst, uint64_t Imm,
|
|
251
|
+
uint64_t Address,
|
|
252
|
+
const void *Decoder)
|
|
253
|
+
{
|
|
254
|
+
return decodePCDBLOperand(Inst, Imm, Address, 32);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
static DecodeStatus decodeBDAddr12Operand(MCInst *Inst, uint64_t Field,
|
|
258
|
+
const unsigned *Regs)
|
|
259
|
+
{
|
|
260
|
+
uint64_t Base = Field >> 12;
|
|
261
|
+
uint64_t Disp = Field & 0xfff;
|
|
262
|
+
//assert(Base < 16 && "Invalid BDAddr12");
|
|
263
|
+
|
|
264
|
+
MCOperand_CreateReg0(Inst, Base == 0 ? 0 : Regs[Base]);
|
|
265
|
+
MCOperand_CreateImm0(Inst, Disp);
|
|
266
|
+
|
|
267
|
+
return MCDisassembler_Success;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
static DecodeStatus decodeBDAddr20Operand(MCInst *Inst, uint64_t Field,
|
|
271
|
+
const unsigned *Regs)
|
|
272
|
+
{
|
|
273
|
+
uint64_t Base = Field >> 20;
|
|
274
|
+
uint64_t Disp = ((Field << 12) & 0xff000) | ((Field >> 8) & 0xfff);
|
|
275
|
+
//assert(Base < 16 && "Invalid BDAddr20");
|
|
276
|
+
|
|
277
|
+
MCOperand_CreateReg0(Inst, Base == 0 ? 0 : Regs[Base]);
|
|
278
|
+
MCOperand_CreateImm0(Inst, SignExtend64(Disp, 20));
|
|
279
|
+
return MCDisassembler_Success;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
static DecodeStatus decodeBDXAddr12Operand(MCInst *Inst, uint64_t Field,
|
|
283
|
+
const unsigned *Regs)
|
|
284
|
+
{
|
|
285
|
+
uint64_t Index = Field >> 16;
|
|
286
|
+
uint64_t Base = (Field >> 12) & 0xf;
|
|
287
|
+
uint64_t Disp = Field & 0xfff;
|
|
288
|
+
|
|
289
|
+
//assert(Index < 16 && "Invalid BDXAddr12");
|
|
290
|
+
MCOperand_CreateReg0(Inst, Base == 0 ? 0 : Regs[Base]);
|
|
291
|
+
MCOperand_CreateImm0(Inst, Disp);
|
|
292
|
+
MCOperand_CreateReg0(Inst, Index == 0 ? 0 : Regs[Index]);
|
|
293
|
+
|
|
294
|
+
return MCDisassembler_Success;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
static DecodeStatus decodeBDXAddr20Operand(MCInst *Inst, uint64_t Field,
|
|
298
|
+
const unsigned *Regs)
|
|
299
|
+
{
|
|
300
|
+
uint64_t Index = Field >> 24;
|
|
301
|
+
uint64_t Base = (Field >> 20) & 0xf;
|
|
302
|
+
uint64_t Disp = ((Field & 0xfff00) >> 8) | ((Field & 0xff) << 12);
|
|
303
|
+
|
|
304
|
+
//assert(Index < 16 && "Invalid BDXAddr20");
|
|
305
|
+
MCOperand_CreateReg0(Inst, Base == 0 ? 0 : Regs[Base]);
|
|
306
|
+
MCOperand_CreateImm0(Inst, SignExtend64(Disp, 20));
|
|
307
|
+
MCOperand_CreateReg0(Inst, Index == 0 ? 0 : Regs[Index]);
|
|
308
|
+
|
|
309
|
+
return MCDisassembler_Success;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
static DecodeStatus decodeBDLAddr12Len8Operand(MCInst *Inst, uint64_t Field,
|
|
313
|
+
const unsigned *Regs)
|
|
314
|
+
{
|
|
315
|
+
uint64_t Length = Field >> 16;
|
|
316
|
+
uint64_t Base = (Field >> 12) & 0xf;
|
|
317
|
+
uint64_t Disp = Field & 0xfff;
|
|
318
|
+
//assert(Length < 256 && "Invalid BDLAddr12Len8");
|
|
319
|
+
|
|
320
|
+
MCOperand_CreateReg0(Inst, Base == 0 ? 0 : Regs[Base]);
|
|
321
|
+
MCOperand_CreateImm0(Inst, Disp);
|
|
322
|
+
MCOperand_CreateImm0(Inst, Length + 1);
|
|
323
|
+
|
|
324
|
+
return MCDisassembler_Success;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
static DecodeStatus decodeBDRAddr12Operand(MCInst *Inst, uint64_t Field,
|
|
328
|
+
const unsigned *Regs)
|
|
329
|
+
{
|
|
330
|
+
uint64_t Length = Field >> 16;
|
|
331
|
+
uint64_t Base = (Field >> 12) & 0xf;
|
|
332
|
+
uint64_t Disp = Field & 0xfff;
|
|
333
|
+
//assert(Length < 16 && "Invalid BDRAddr12");
|
|
334
|
+
|
|
335
|
+
MCOperand_CreateReg0(Inst, Base == 0 ? 0 : Regs[Base]);
|
|
336
|
+
MCOperand_CreateImm0(Inst, Disp);
|
|
337
|
+
MCOperand_CreateReg0(Inst, Regs[Length]);
|
|
338
|
+
|
|
339
|
+
return MCDisassembler_Success;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
static DecodeStatus decodeBDVAddr12Operand(MCInst *Inst, uint64_t Field,
|
|
343
|
+
const unsigned *Regs)
|
|
344
|
+
{
|
|
345
|
+
uint64_t Index = Field >> 16;
|
|
346
|
+
uint64_t Base = (Field >> 12) & 0xf;
|
|
347
|
+
uint64_t Disp = Field & 0xfff;
|
|
348
|
+
//assert(Index < 32 && "Invalid BDVAddr12");
|
|
349
|
+
|
|
350
|
+
MCOperand_CreateReg0(Inst, Base == 0 ? 0 : Regs[Base]);
|
|
351
|
+
MCOperand_CreateImm0(Inst, Disp);
|
|
352
|
+
MCOperand_CreateReg0(Inst, SystemZMC_VR128Regs[Index]);
|
|
353
|
+
|
|
354
|
+
return MCDisassembler_Success;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
static DecodeStatus decodeBDAddr32Disp12Operand(MCInst *Inst, uint64_t Field,
|
|
358
|
+
uint64_t Address, const void *Decoder)
|
|
359
|
+
{
|
|
360
|
+
return decodeBDAddr12Operand(Inst, Field, SystemZMC_GR32Regs);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
static DecodeStatus decodeBDAddr32Disp20Operand(MCInst *Inst, uint64_t Field,
|
|
364
|
+
uint64_t Address, const void *Decoder)
|
|
365
|
+
{
|
|
366
|
+
return decodeBDAddr20Operand(Inst, Field, SystemZMC_GR32Regs);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
static DecodeStatus decodeBDAddr64Disp12Operand(MCInst *Inst, uint64_t Field,
|
|
370
|
+
uint64_t Address, const void *Decoder)
|
|
371
|
+
{
|
|
372
|
+
return decodeBDAddr12Operand(Inst, Field, SystemZMC_GR64Regs);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
static DecodeStatus decodeBDAddr64Disp20Operand(MCInst *Inst, uint64_t Field,
|
|
376
|
+
uint64_t Address, const void *Decoder)
|
|
377
|
+
{
|
|
378
|
+
return decodeBDAddr20Operand(Inst, Field, SystemZMC_GR64Regs);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
static DecodeStatus decodeBDXAddr64Disp12Operand(MCInst *Inst, uint64_t Field,
|
|
382
|
+
uint64_t Address, const void *Decoder)
|
|
383
|
+
{
|
|
384
|
+
return decodeBDXAddr12Operand(Inst, Field, SystemZMC_GR64Regs);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
static DecodeStatus decodeBDXAddr64Disp20Operand(MCInst *Inst, uint64_t Field,
|
|
388
|
+
uint64_t Address, const void *Decoder)
|
|
389
|
+
{
|
|
390
|
+
return decodeBDXAddr20Operand(Inst, Field, SystemZMC_GR64Regs);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
static DecodeStatus decodeBDLAddr64Disp12Len4Operand(MCInst *Inst, uint64_t Field,
|
|
394
|
+
uint64_t Address, const void *Decoder)
|
|
395
|
+
{
|
|
396
|
+
return decodeBDLAddr12Len8Operand(Inst, Field, SystemZMC_GR64Regs);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
static DecodeStatus decodeBDLAddr64Disp12Len8Operand(MCInst *Inst, uint64_t Field,
|
|
400
|
+
uint64_t Address, const void *Decoder)
|
|
401
|
+
{
|
|
402
|
+
return decodeBDLAddr12Len8Operand(Inst, Field, SystemZMC_GR64Regs);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
static DecodeStatus decodeBDRAddr64Disp12Operand(MCInst *Inst, uint64_t Field,
|
|
406
|
+
uint64_t Address, const void *Decoder)
|
|
407
|
+
{
|
|
408
|
+
return decodeBDRAddr12Operand(Inst, Field, SystemZMC_GR64Regs);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
static DecodeStatus decodeBDVAddr64Disp12Operand(MCInst *Inst, uint64_t Field,
|
|
412
|
+
uint64_t Address, const void *Decoder)
|
|
413
|
+
{
|
|
414
|
+
return decodeBDVAddr12Operand(Inst, Field, SystemZMC_GR64Regs);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
#define GET_SUBTARGETINFO_ENUM
|
|
419
|
+
#include "SystemZGenSubtargetInfo.inc"
|
|
420
|
+
#include "SystemZGenDisassemblerTables.inc"
|
|
421
|
+
bool SystemZ_getInstruction(csh ud, const uint8_t *code, size_t code_len, MCInst *MI,
|
|
422
|
+
uint16_t *size, uint64_t address, void *info)
|
|
423
|
+
{
|
|
424
|
+
uint64_t Inst;
|
|
425
|
+
const uint8_t *Table;
|
|
426
|
+
uint16_t I;
|
|
427
|
+
|
|
428
|
+
// The top 2 bits of the first byte specify the size.
|
|
429
|
+
if (*code < 0x40) {
|
|
430
|
+
*size = 2;
|
|
431
|
+
Table = DecoderTable16;
|
|
432
|
+
} else if (*code < 0xc0) {
|
|
433
|
+
*size = 4;
|
|
434
|
+
Table = DecoderTable32;
|
|
435
|
+
} else {
|
|
436
|
+
*size = 6;
|
|
437
|
+
Table = DecoderTable48;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if (code_len < *size)
|
|
441
|
+
// short of input data
|
|
442
|
+
return false;
|
|
443
|
+
|
|
444
|
+
if (MI->flat_insn->detail) {
|
|
445
|
+
memset(MI->flat_insn->detail, 0, offsetof(cs_detail, sysz)+sizeof(cs_sysz));
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// Construct the instruction.
|
|
449
|
+
Inst = 0;
|
|
450
|
+
for (I = 0; I < *size; ++I)
|
|
451
|
+
Inst = (Inst << 8) | code[I];
|
|
452
|
+
|
|
453
|
+
return decodeInstruction(Table, MI, Inst, address, info, 0);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
#define GET_REGINFO_ENUM
|
|
457
|
+
#define GET_REGINFO_MC_DESC
|
|
458
|
+
#include "SystemZGenRegisterInfo.inc"
|
|
459
|
+
void SystemZ_init(MCRegisterInfo *MRI)
|
|
460
|
+
{
|
|
461
|
+
/*
|
|
462
|
+
InitMCRegisterInfo(SystemZRegDesc, 98, RA, PC,
|
|
463
|
+
SystemZMCRegisterClasses, 12,
|
|
464
|
+
SystemZRegUnitRoots,
|
|
465
|
+
49,
|
|
466
|
+
SystemZRegDiffLists,
|
|
467
|
+
SystemZRegStrings,
|
|
468
|
+
SystemZSubRegIdxLists,
|
|
469
|
+
7,
|
|
470
|
+
SystemZSubRegIdxRanges,
|
|
471
|
+
SystemZRegEncodingTable);
|
|
472
|
+
*/
|
|
473
|
+
|
|
474
|
+
MCRegisterInfo_InitMCRegisterInfo(MRI, SystemZRegDesc, 194,
|
|
475
|
+
0, 0,
|
|
476
|
+
SystemZMCRegisterClasses, 21,
|
|
477
|
+
0, 0,
|
|
478
|
+
SystemZRegDiffLists,
|
|
479
|
+
0,
|
|
480
|
+
SystemZSubRegIdxLists, 7,
|
|
481
|
+
0);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
#endif
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* Capstone Disassembly Engine */
|
|
2
|
+
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
|
|
3
|
+
|
|
4
|
+
#ifndef CS_SYSZDISASSEMBLER_H
|
|
5
|
+
#define CS_SYSZDISASSEMBLER_H
|
|
6
|
+
|
|
7
|
+
#include "capstone/capstone.h"
|
|
8
|
+
#include "../../MCRegisterInfo.h"
|
|
9
|
+
#include "../../MCInst.h"
|
|
10
|
+
|
|
11
|
+
void SystemZ_init(MCRegisterInfo *MRI);
|
|
12
|
+
|
|
13
|
+
bool SystemZ_getInstruction(csh ud, const uint8_t *code, size_t code_len,
|
|
14
|
+
MCInst *instr, uint16_t *size, uint64_t address, void *info);
|
|
15
|
+
|
|
16
|
+
#endif
|
|
17
|
+
|