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
package/LICENSE
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 HikariSystem
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
This package uses Capstone Engine, which is licensed under the BSD license.
|
|
26
|
+
See https://github.com/capstone-engine/capstone/blob/master/LICENSE.TXT
|
package/README.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# HexCore Capstone
|
|
2
|
+
|
|
3
|
+
Modern Node.js bindings for [Capstone](https://capstone-engine.org) disassembler engine using N-API.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/hexcore-capstone)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- **Async API**: Non-blocking `disasmAsync()` for large binaries
|
|
11
|
+
- **Modern N-API**: Binary compatible across Node.js 18+
|
|
12
|
+
- **Zero Dependencies**: Capstone is bundled - just `npm install`
|
|
13
|
+
- **Full TypeScript**: Complete type definitions with JSDoc
|
|
14
|
+
- **Multi-Architecture**: x86, ARM, ARM64, MIPS, PPC, SPARC, M68K, and more
|
|
15
|
+
- **Detail Mode**: Access operands, registers, groups, and flags
|
|
16
|
+
- **ESM + CommonJS**: Works with `import` and `require`
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install hexcore-capstone
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
No system dependencies required! Capstone is compiled from source automatically.
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
### Basic Example
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
const { Capstone, ARCH, MODE } = require('hexcore-capstone');
|
|
32
|
+
|
|
33
|
+
// Create a disassembler for x86-64
|
|
34
|
+
const cs = new Capstone(ARCH.X86, MODE.MODE_64);
|
|
35
|
+
|
|
36
|
+
// Machine code to disassemble
|
|
37
|
+
const code = Buffer.from([
|
|
38
|
+
0x55, // push rbp
|
|
39
|
+
0x48, 0x89, 0xe5, // mov rbp, rsp
|
|
40
|
+
0x48, 0x83, 0xec, 0x20, // sub rsp, 0x20
|
|
41
|
+
0xc3 // ret
|
|
42
|
+
]);
|
|
43
|
+
|
|
44
|
+
// Disassemble
|
|
45
|
+
const instructions = cs.disasm(code, 0x401000);
|
|
46
|
+
|
|
47
|
+
for (const insn of instructions) {
|
|
48
|
+
console.log(`0x${insn.address.toString(16)}: ${insn.mnemonic} ${insn.opStr}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Output:
|
|
52
|
+
// 0x401000: push rbp
|
|
53
|
+
// 0x401001: mov rbp, rsp
|
|
54
|
+
// 0x401004: sub rsp, 0x20
|
|
55
|
+
// 0x401008: ret
|
|
56
|
+
|
|
57
|
+
cs.close();
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Async Disassembly (Recommended for large files)
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
const { Capstone, ARCH, MODE } = require('hexcore-capstone');
|
|
64
|
+
const fs = require('fs');
|
|
65
|
+
|
|
66
|
+
const cs = new Capstone(ARCH.X86, MODE.MODE_64);
|
|
67
|
+
|
|
68
|
+
// Load a large binary
|
|
69
|
+
const largeCode = fs.readFileSync('large_binary.bin');
|
|
70
|
+
|
|
71
|
+
// Disassemble without blocking the event loop
|
|
72
|
+
const instructions = await cs.disasmAsync(largeCode, 0x401000);
|
|
73
|
+
|
|
74
|
+
console.log(`Disassembled ${instructions.length} instructions`);
|
|
75
|
+
|
|
76
|
+
cs.close();
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### ESM Import
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
import { Capstone, ARCH, MODE, OPT, OPT_VALUE } from 'hexcore-capstone';
|
|
83
|
+
|
|
84
|
+
const cs = new Capstone(ARCH.ARM64, MODE.ARM);
|
|
85
|
+
// ...
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Detail Mode
|
|
89
|
+
|
|
90
|
+
```javascript
|
|
91
|
+
const { Capstone, ARCH, MODE, OPT, OPT_VALUE } = require('hexcore-capstone');
|
|
92
|
+
|
|
93
|
+
const cs = new Capstone(ARCH.X86, MODE.MODE_64);
|
|
94
|
+
|
|
95
|
+
// Enable detail mode for operand info
|
|
96
|
+
cs.setOption(OPT.DETAIL, OPT_VALUE.ON);
|
|
97
|
+
|
|
98
|
+
const code = Buffer.from([0x48, 0x89, 0xc3]); // mov rbx, rax
|
|
99
|
+
const insns = cs.disasm(code, 0x1000);
|
|
100
|
+
|
|
101
|
+
for (const insn of insns) {
|
|
102
|
+
console.log(`${insn.mnemonic} ${insn.opStr}`);
|
|
103
|
+
|
|
104
|
+
if (insn.detail) {
|
|
105
|
+
console.log(' Registers read:', insn.detail.regsRead.map(r => cs.regName(r)));
|
|
106
|
+
console.log(' Registers written:', insn.detail.regsWrite.map(r => cs.regName(r)));
|
|
107
|
+
console.log(' Groups:', insn.detail.groups.map(g => cs.groupName(g)));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
cs.close();
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Supported Architectures
|
|
115
|
+
|
|
116
|
+
| Architecture | Constant | Detail Mode |
|
|
117
|
+
|--------------|----------|-------------|
|
|
118
|
+
| x86/x64 | `ARCH.X86` | ✅ Full |
|
|
119
|
+
| ARM | `ARCH.ARM` | ✅ Full |
|
|
120
|
+
| ARM64 | `ARCH.ARM64` | ✅ Full |
|
|
121
|
+
| MIPS | `ARCH.MIPS` | ✅ Full |
|
|
122
|
+
| PowerPC | `ARCH.PPC` | ✅ Full |
|
|
123
|
+
| SPARC | `ARCH.SPARC` | ✅ Full |
|
|
124
|
+
| SystemZ | `ARCH.SYSZ` | ✅ Full |
|
|
125
|
+
| XCore | `ARCH.XCORE` | ✅ Full |
|
|
126
|
+
| M68K | `ARCH.M68K` | ✅ Full |
|
|
127
|
+
|
|
128
|
+
## API Reference
|
|
129
|
+
|
|
130
|
+
### Class: Capstone
|
|
131
|
+
|
|
132
|
+
#### `new Capstone(arch, mode)`
|
|
133
|
+
Create a new disassembler instance.
|
|
134
|
+
|
|
135
|
+
#### `cs.disasm(code, address, [count])`
|
|
136
|
+
Disassemble code buffer synchronously. Returns `Instruction[]`.
|
|
137
|
+
|
|
138
|
+
#### `cs.disasmAsync(code, address, [count])`
|
|
139
|
+
Disassemble code buffer asynchronously. Returns `Promise<Instruction[]>`.
|
|
140
|
+
|
|
141
|
+
> ⚡ **Use `disasmAsync()` for buffers >1MB** to avoid blocking the event loop.
|
|
142
|
+
|
|
143
|
+
#### `cs.setOption(type, value)`
|
|
144
|
+
Set a disassembler option (e.g., enable detail mode).
|
|
145
|
+
|
|
146
|
+
#### `cs.close()`
|
|
147
|
+
Close the handle and free resources.
|
|
148
|
+
|
|
149
|
+
#### `cs.regName(regId)`, `cs.insnName(insnId)`, `cs.groupName(groupId)`
|
|
150
|
+
Get human-readable names.
|
|
151
|
+
|
|
152
|
+
### Helper Functions
|
|
153
|
+
|
|
154
|
+
```javascript
|
|
155
|
+
const { version, support, ARCH } = require('hexcore-capstone');
|
|
156
|
+
|
|
157
|
+
console.log(`Capstone version: ${version().string}`); // "5.0"
|
|
158
|
+
console.log(`ARM supported: ${support(ARCH.ARM)}`); // true
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Building from Source
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
git clone --recursive https://github.com/LXrdKnowkill/hexcore-capstone.git
|
|
165
|
+
cd hexcore-capstone
|
|
166
|
+
npm install
|
|
167
|
+
npm run build
|
|
168
|
+
npm test
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
> **Note:** Use `--recursive` to clone the vendored Capstone submodule.
|
|
172
|
+
|
|
173
|
+
## Changelog
|
|
174
|
+
|
|
175
|
+
### v1.1.0
|
|
176
|
+
- Add `disasmAsync()` for non-blocking disassembly
|
|
177
|
+
- Add ESM support via `index.mjs`
|
|
178
|
+
- Add detail mode for PPC, SPARC, SYSZ, XCORE, M68K
|
|
179
|
+
- Enhanced TypeScript definitions with JSDoc
|
|
180
|
+
|
|
181
|
+
### v1.0.0
|
|
182
|
+
- Initial release with sync API
|
|
183
|
+
|
|
184
|
+
## License
|
|
185
|
+
|
|
186
|
+
MIT License - Copyright (c) HikariSystem
|
|
187
|
+
|
|
188
|
+
## Acknowledgments
|
|
189
|
+
|
|
190
|
+
- [Capstone Engine](https://capstone-engine.org) by Nguyen Anh Quynh
|
|
191
|
+
- The Node.js N-API team
|
package/binding.gyp
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
{
|
|
2
|
+
"targets": [
|
|
3
|
+
{
|
|
4
|
+
"target_name": "capstone_native",
|
|
5
|
+
"sources": [
|
|
6
|
+
"src/main.cpp",
|
|
7
|
+
"src/capstone_wrapper.cpp",
|
|
8
|
+
|
|
9
|
+
"deps/capstone/cs.c",
|
|
10
|
+
"deps/capstone/MCInst.c",
|
|
11
|
+
"deps/capstone/MCInstrDesc.c",
|
|
12
|
+
"deps/capstone/MCRegisterInfo.c",
|
|
13
|
+
"deps/capstone/Mapping.c",
|
|
14
|
+
"deps/capstone/SStream.c",
|
|
15
|
+
"deps/capstone/utils.c",
|
|
16
|
+
|
|
17
|
+
"deps/capstone/arch/X86/X86Module.c",
|
|
18
|
+
"deps/capstone/arch/X86/X86Disassembler.c",
|
|
19
|
+
"deps/capstone/arch/X86/X86DisassemblerDecoder.c",
|
|
20
|
+
"deps/capstone/arch/X86/X86ATTInstPrinter.c",
|
|
21
|
+
"deps/capstone/arch/X86/X86IntelInstPrinter.c",
|
|
22
|
+
"deps/capstone/arch/X86/X86InstPrinterCommon.c",
|
|
23
|
+
"deps/capstone/arch/X86/X86Mapping.c",
|
|
24
|
+
|
|
25
|
+
"deps/capstone/arch/ARM/ARMModule.c",
|
|
26
|
+
"deps/capstone/arch/ARM/ARMDisassembler.c",
|
|
27
|
+
"deps/capstone/arch/ARM/ARMInstPrinter.c",
|
|
28
|
+
"deps/capstone/arch/ARM/ARMMapping.c",
|
|
29
|
+
|
|
30
|
+
"deps/capstone/arch/AArch64/AArch64Module.c",
|
|
31
|
+
"deps/capstone/arch/AArch64/AArch64Disassembler.c",
|
|
32
|
+
"deps/capstone/arch/AArch64/AArch64InstPrinter.c",
|
|
33
|
+
"deps/capstone/arch/AArch64/AArch64Mapping.c",
|
|
34
|
+
"deps/capstone/arch/AArch64/AArch64BaseInfo.c",
|
|
35
|
+
|
|
36
|
+
"deps/capstone/arch/Mips/MipsModule.c",
|
|
37
|
+
"deps/capstone/arch/Mips/MipsDisassembler.c",
|
|
38
|
+
"deps/capstone/arch/Mips/MipsInstPrinter.c",
|
|
39
|
+
"deps/capstone/arch/Mips/MipsMapping.c",
|
|
40
|
+
|
|
41
|
+
"deps/capstone/arch/PowerPC/PPCModule.c",
|
|
42
|
+
"deps/capstone/arch/PowerPC/PPCDisassembler.c",
|
|
43
|
+
"deps/capstone/arch/PowerPC/PPCInstPrinter.c",
|
|
44
|
+
"deps/capstone/arch/PowerPC/PPCMapping.c",
|
|
45
|
+
|
|
46
|
+
"deps/capstone/arch/Sparc/SparcModule.c",
|
|
47
|
+
"deps/capstone/arch/Sparc/SparcDisassembler.c",
|
|
48
|
+
"deps/capstone/arch/Sparc/SparcInstPrinter.c",
|
|
49
|
+
"deps/capstone/arch/Sparc/SparcMapping.c",
|
|
50
|
+
|
|
51
|
+
"deps/capstone/arch/SystemZ/SystemZModule.c",
|
|
52
|
+
"deps/capstone/arch/SystemZ/SystemZDisassembler.c",
|
|
53
|
+
"deps/capstone/arch/SystemZ/SystemZInstPrinter.c",
|
|
54
|
+
"deps/capstone/arch/SystemZ/SystemZMapping.c",
|
|
55
|
+
"deps/capstone/arch/SystemZ/SystemZMCTargetDesc.c",
|
|
56
|
+
|
|
57
|
+
"deps/capstone/arch/XCore/XCoreModule.c",
|
|
58
|
+
"deps/capstone/arch/XCore/XCoreDisassembler.c",
|
|
59
|
+
"deps/capstone/arch/XCore/XCoreInstPrinter.c",
|
|
60
|
+
"deps/capstone/arch/XCore/XCoreMapping.c",
|
|
61
|
+
|
|
62
|
+
"deps/capstone/arch/M68K/M68KModule.c",
|
|
63
|
+
"deps/capstone/arch/M68K/M68KDisassembler.c",
|
|
64
|
+
"deps/capstone/arch/M68K/M68KInstPrinter.c",
|
|
65
|
+
|
|
66
|
+
"deps/capstone/arch/TMS320C64x/TMS320C64xModule.c",
|
|
67
|
+
"deps/capstone/arch/TMS320C64x/TMS320C64xDisassembler.c",
|
|
68
|
+
"deps/capstone/arch/TMS320C64x/TMS320C64xInstPrinter.c",
|
|
69
|
+
"deps/capstone/arch/TMS320C64x/TMS320C64xMapping.c",
|
|
70
|
+
|
|
71
|
+
"deps/capstone/arch/M680X/M680XModule.c",
|
|
72
|
+
"deps/capstone/arch/M680X/M680XDisassembler.c",
|
|
73
|
+
"deps/capstone/arch/M680X/M680XInstPrinter.c",
|
|
74
|
+
|
|
75
|
+
"deps/capstone/arch/EVM/EVMModule.c",
|
|
76
|
+
"deps/capstone/arch/EVM/EVMDisassembler.c",
|
|
77
|
+
"deps/capstone/arch/EVM/EVMInstPrinter.c",
|
|
78
|
+
"deps/capstone/arch/EVM/EVMMapping.c",
|
|
79
|
+
|
|
80
|
+
"deps/capstone/arch/WASM/WASMModule.c",
|
|
81
|
+
"deps/capstone/arch/WASM/WASMDisassembler.c",
|
|
82
|
+
"deps/capstone/arch/WASM/WASMInstPrinter.c",
|
|
83
|
+
"deps/capstone/arch/WASM/WASMMapping.c",
|
|
84
|
+
|
|
85
|
+
"deps/capstone/arch/MOS65XX/MOS65XXModule.c",
|
|
86
|
+
"deps/capstone/arch/MOS65XX/MOS65XXDisassembler.c",
|
|
87
|
+
|
|
88
|
+
"deps/capstone/arch/BPF/BPFModule.c",
|
|
89
|
+
"deps/capstone/arch/BPF/BPFDisassembler.c",
|
|
90
|
+
"deps/capstone/arch/BPF/BPFInstPrinter.c",
|
|
91
|
+
"deps/capstone/arch/BPF/BPFMapping.c",
|
|
92
|
+
|
|
93
|
+
"deps/capstone/arch/RISCV/RISCVModule.c",
|
|
94
|
+
"deps/capstone/arch/RISCV/RISCVDisassembler.c",
|
|
95
|
+
"deps/capstone/arch/RISCV/RISCVInstPrinter.c",
|
|
96
|
+
"deps/capstone/arch/RISCV/RISCVMapping.c",
|
|
97
|
+
|
|
98
|
+
"deps/capstone/arch/SH/SHModule.c",
|
|
99
|
+
"deps/capstone/arch/SH/SHDisassembler.c",
|
|
100
|
+
"deps/capstone/arch/SH/SHInstPrinter.c",
|
|
101
|
+
|
|
102
|
+
"deps/capstone/arch/TriCore/TriCoreModule.c",
|
|
103
|
+
"deps/capstone/arch/TriCore/TriCoreDisassembler.c",
|
|
104
|
+
"deps/capstone/arch/TriCore/TriCoreInstPrinter.c",
|
|
105
|
+
"deps/capstone/arch/TriCore/TriCoreMapping.c"
|
|
106
|
+
],
|
|
107
|
+
"include_dirs": [
|
|
108
|
+
"<!@(node -p \"require('node-addon-api').include\")",
|
|
109
|
+
"deps/capstone/include",
|
|
110
|
+
"deps/capstone"
|
|
111
|
+
],
|
|
112
|
+
"defines": [
|
|
113
|
+
"NAPI_VERSION=8",
|
|
114
|
+
"NAPI_DISABLE_CPP_EXCEPTIONS",
|
|
115
|
+
"CAPSTONE_HAS_X86",
|
|
116
|
+
"CAPSTONE_HAS_ARM",
|
|
117
|
+
"CAPSTONE_HAS_ARM64",
|
|
118
|
+
"CAPSTONE_HAS_MIPS",
|
|
119
|
+
"CAPSTONE_HAS_POWERPC",
|
|
120
|
+
"CAPSTONE_HAS_SPARC",
|
|
121
|
+
"CAPSTONE_HAS_SYSZ",
|
|
122
|
+
"CAPSTONE_HAS_XCORE",
|
|
123
|
+
"CAPSTONE_HAS_M68K",
|
|
124
|
+
"CAPSTONE_HAS_TMS320C64X",
|
|
125
|
+
"CAPSTONE_HAS_M680X",
|
|
126
|
+
"CAPSTONE_HAS_EVM",
|
|
127
|
+
"CAPSTONE_HAS_WASM",
|
|
128
|
+
"CAPSTONE_HAS_MOS65XX",
|
|
129
|
+
"CAPSTONE_HAS_BPF",
|
|
130
|
+
"CAPSTONE_HAS_RISCV",
|
|
131
|
+
"CAPSTONE_HAS_SH",
|
|
132
|
+
"CAPSTONE_HAS_TRICORE",
|
|
133
|
+
"CAPSTONE_USE_SYS_DYN_MEM"
|
|
134
|
+
],
|
|
135
|
+
"conditions": [
|
|
136
|
+
["OS=='win'", {
|
|
137
|
+
"msvs_settings": {
|
|
138
|
+
"VCCLCompilerTool": {
|
|
139
|
+
"ExceptionHandling": 1,
|
|
140
|
+
"AdditionalIncludeDirectories": [
|
|
141
|
+
"<(module_root_dir)/deps/capstone/include",
|
|
142
|
+
"<(module_root_dir)/deps/capstone"
|
|
143
|
+
],
|
|
144
|
+
"DisableSpecificWarnings": ["4244", "4267", "4996"]
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"defines": [
|
|
148
|
+
"WIN32",
|
|
149
|
+
"_WINDOWS"
|
|
150
|
+
]
|
|
151
|
+
}],
|
|
152
|
+
["OS=='linux'", {
|
|
153
|
+
"cflags": ["-fPIC", "-w"],
|
|
154
|
+
"cflags_cc": ["-fPIC", "-std=c++17", "-w"]
|
|
155
|
+
}],
|
|
156
|
+
["OS=='mac'", {
|
|
157
|
+
"xcode_settings": {
|
|
158
|
+
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
|
|
159
|
+
"CLANG_CXX_LIBRARY": "libc++",
|
|
160
|
+
"MACOSX_DEPLOYMENT_TARGET": "10.15",
|
|
161
|
+
"WARNING_CFLAGS": ["-w"],
|
|
162
|
+
"OTHER_CFLAGS": ["-w"]
|
|
163
|
+
}
|
|
164
|
+
}]
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//===- llvm/Support/LEB128.h - [SU]LEB128 utility functions -----*- 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
|
+
// This file declares some utility functions for encoding SLEB128 and
|
|
11
|
+
// ULEB128 values.
|
|
12
|
+
//
|
|
13
|
+
//===----------------------------------------------------------------------===//
|
|
14
|
+
|
|
15
|
+
/* Capstone Disassembly Engine */
|
|
16
|
+
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2019 */
|
|
17
|
+
|
|
18
|
+
#ifndef CS_LLVM_SUPPORT_LEB128_H
|
|
19
|
+
#define CS_LLVM_SUPPORT_LEB128_H
|
|
20
|
+
|
|
21
|
+
#include "include/capstone/capstone.h"
|
|
22
|
+
|
|
23
|
+
/// Utility function to decode a ULEB128 value.
|
|
24
|
+
static inline uint64_t decodeULEB128(const uint8_t *p, unsigned *n)
|
|
25
|
+
{
|
|
26
|
+
const uint8_t *orig_p = p;
|
|
27
|
+
uint64_t Value = 0;
|
|
28
|
+
unsigned Shift = 0;
|
|
29
|
+
do {
|
|
30
|
+
Value += (uint64_t)(*p & 0x7f) << Shift;
|
|
31
|
+
Shift += 7;
|
|
32
|
+
} while (*p++ >= 128);
|
|
33
|
+
if (n)
|
|
34
|
+
*n = (unsigned)(p - orig_p);
|
|
35
|
+
return Value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#endif // LLVM_SYSTEM_LEB128_H
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* Capstone Disassembly Engine */
|
|
2
|
+
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2019 */
|
|
3
|
+
|
|
4
|
+
#ifndef CS_MCDISASSEMBLER_H
|
|
5
|
+
#define CS_MCDISASSEMBLER_H
|
|
6
|
+
|
|
7
|
+
typedef enum DecodeStatus {
|
|
8
|
+
MCDisassembler_Fail = 0,
|
|
9
|
+
MCDisassembler_SoftFail = 1,
|
|
10
|
+
MCDisassembler_Success = 3,
|
|
11
|
+
} DecodeStatus;
|
|
12
|
+
|
|
13
|
+
#endif
|
|
14
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//===-- llvm/MC/MCFixedLenDisassembler.h - Decoder driver -------*- 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
|
+
// Fixed length disassembler decoder state machine driver.
|
|
10
|
+
//===----------------------------------------------------------------------===//
|
|
11
|
+
|
|
12
|
+
/* Capstone Disassembly Engine */
|
|
13
|
+
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2019 */
|
|
14
|
+
|
|
15
|
+
#ifndef CS_LLVM_MC_MCFIXEDLENDISASSEMBLER_H
|
|
16
|
+
#define CS_LLVM_MC_MCFIXEDLENDISASSEMBLER_H
|
|
17
|
+
|
|
18
|
+
// Disassembler state machine opcodes.
|
|
19
|
+
enum DecoderOps {
|
|
20
|
+
MCD_OPC_ExtractField = 1, // OPC_ExtractField(uint8_t Start, uint8_t Len)
|
|
21
|
+
MCD_OPC_FilterValue, // OPC_FilterValue(uleb128 Val, uint16_t NumToSkip)
|
|
22
|
+
MCD_OPC_CheckField, // OPC_CheckField(uint8_t Start, uint8_t Len,
|
|
23
|
+
// uleb128 Val, uint16_t NumToSkip)
|
|
24
|
+
MCD_OPC_CheckPredicate, // OPC_CheckPredicate(uleb128 PIdx, uint16_t NumToSkip)
|
|
25
|
+
MCD_OPC_Decode, // OPC_Decode(uleb128 Opcode, uleb128 DIdx)
|
|
26
|
+
MCD_OPC_TryDecode, // OPC_TryDecode(uleb128 Opcode, uleb128 DIdx,
|
|
27
|
+
// uint16_t NumToSkip)
|
|
28
|
+
MCD_OPC_SoftFail, // OPC_SoftFail(uleb128 PMask, uleb128 NMask)
|
|
29
|
+
MCD_OPC_Fail // OPC_Fail()
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
#endif
|