mirror of
https://github.com/capstone-engine/capstone.git
synced 2025-02-12 18:08:42 +00:00
fix some conflicts when merging msvc2 into next
This commit is contained in:
commit
f260c2023e
9
.gitignore
vendored
9
.gitignore
vendored
@ -42,6 +42,7 @@ tests/*.static
|
||||
|
||||
# vim tmp file
|
||||
*.swp
|
||||
*~
|
||||
|
||||
capstone.pc
|
||||
|
||||
@ -50,3 +51,11 @@ _*
|
||||
|
||||
# freebsd ports: generated file with "make makesum" command
|
||||
packages/freebsd/ports/devel/capstone/distinfo
|
||||
|
||||
# VisualStudio
|
||||
Debug
|
||||
Release
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.suo
|
||||
*.user
|
||||
|
10
COMPILE.TXT
10
COMPILE.TXT
@ -1,4 +1,8 @@
|
||||
How To Compile, install & run Capstone for Linux, Mac OSX, *BSD and Windows
|
||||
This documentation explains how to compile, install & run Capstone on MacOSX,
|
||||
Linux, *BSD & Solaris. We also show steps to cross-compile for Microsoft Windows.
|
||||
|
||||
To natively compile for Windows using Microsoft Visual Studio, see COMPILE_MSVC.TXT.
|
||||
|
||||
*-*-*-*-*-*
|
||||
|
||||
Capstone requires no prerequisite packages, so it is easy to compile & install.
|
||||
@ -22,6 +26,9 @@ Capstone requires no prerequisite packages, so it is easy to compile & install.
|
||||
- CAPSTONE_DIET: use this to make the output binaries more compact.
|
||||
- CAPSTONE_X86_REDUCE: another option to make X86 binary smaller.
|
||||
|
||||
By default, Capstone use system dynamic memory management, and both DIET and X86_REDUCE
|
||||
modes are disable.
|
||||
|
||||
To avoid editing config.mk for these customization, can pass their values to
|
||||
make.sh, as followings.
|
||||
|
||||
@ -29,7 +36,6 @@ Capstone requires no prerequisite packages, so it is easy to compile & install.
|
||||
|
||||
NOTE: on commandline, put these values in front of ./make.sh, not after it.
|
||||
|
||||
See default values of above options in config.mk
|
||||
For each option, refer to docs/README for more details.
|
||||
|
||||
|
||||
|
58
COMPILE_MSVC.TXT
Normal file
58
COMPILE_MSVC.TXT
Normal file
@ -0,0 +1,58 @@
|
||||
How To compile Capstone on Windows using Microsoft Visual Studio.
|
||||
|
||||
*-*-*-*-*-*
|
||||
|
||||
Capstone requires no prerequisite packages, so it is easy to compile & install.
|
||||
Open the Visual Studio solution "msvc/capstone.sln" and follow the instructions
|
||||
below.
|
||||
|
||||
NOTE: This requires Visual Studio 2010 or newer versions.
|
||||
|
||||
|
||||
(0) Tailor Capstone to your need.
|
||||
|
||||
Out of 7 archtitectures supported by Capstone (Arm, Arm64, Mips, PPC, Sparc,
|
||||
SystemZ & X86), if you just need several selected archs, choose the ones you
|
||||
want to compile in by opening Visual Studio solution "msvc\capstone.sln", then
|
||||
directly editing the projects "capstone_static" & "capstone_dll" for static
|
||||
and dynamic libraries, respectively. This must be done before going to the
|
||||
next steps.
|
||||
|
||||
In VisualStudio interface, modify the preprocessor definitions via
|
||||
"Project Properties" -> "Configuration Propertis" -> "C/C++" -> "Preprocessor"
|
||||
to customize Capstone library, as followings.
|
||||
|
||||
- CAPSTONE_HAS_ARM: support ARM. Delete this to remove ARM support.
|
||||
- CAPSTONE_HAS_ARM64: support ARM64. Delete this to remove ARM64 support.
|
||||
- CAPSTONE_HAS_MIPS: support Mips. Delete this to remove Mips support.
|
||||
- CAPSTONE_HAS_PPC: support PPC. Delete this to remove PPC support.
|
||||
- CAPSTONE_HAS_SPARC: support Sparc. Delete this to remove Sparc support.
|
||||
- CAPSTONE_HAS_SYSZ: support SystemZ. Delete this to remove SystemZ support.
|
||||
- CAPSTONE_HAS_X86: support X86. Delete this to remove X86 support.
|
||||
|
||||
By default, all 7 architectures are compiled in.
|
||||
|
||||
|
||||
Besides, Capstone also allows some more customization via following macros.
|
||||
|
||||
- CAPSTONE_USE_SYS_DYN_MEM: delete this to use your own dynamic memory management.
|
||||
- CAPSTONE_DIET_NO: rename this to "CAPSTONE_DIET" to make the binaries more compact.
|
||||
- CAPSTONE_X86_REDUCE_NO: rename this to "CAPSTONE_X86_REDUCE" to make X86 binary smaller.
|
||||
|
||||
By default, Capstone use system dynamic memory management, and both DIET and X86_REDUCE
|
||||
modes are disable.
|
||||
|
||||
|
||||
For each option, refer to docs/README for more details.
|
||||
|
||||
|
||||
|
||||
(1) Compile from source on Windows with Visual Studio
|
||||
|
||||
- Choose the configuration and the platform you want: Release/Debug & Win32/Win64.
|
||||
- Build only the libraries, or the libraries along with all the tests.
|
||||
|
||||
|
||||
|
||||
(2) You can make sure the prior steps successfully worked by launching one of the
|
||||
testing binary (test*.exe).
|
@ -45,3 +45,4 @@ Contributors (in no particular order)
|
||||
(Please let us know if you want to have your name here)
|
||||
|
||||
Ole André Vadla Ravnås (author of the 100th Pull-Request in our Github repo, thanks!)
|
||||
Axel "0vercl0k" Souchet (@0vercl0k) & Alex Ionescu: port to MSVC.
|
||||
|
1
MCInst.h
1
MCInst.h
@ -20,7 +20,6 @@
|
||||
#define CS_MCINST_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "include/capstone.h"
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
#ifndef CS_LLVM_MC_MCINSTRDESC_H
|
||||
#define CS_LLVM_MC_MCINSTRDESC_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "include/platform.h"
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Machine Operand Flags and Description
|
||||
|
@ -19,8 +19,8 @@
|
||||
#ifndef CS_LLVM_MC_MCREGISTERINFO_H
|
||||
#define CS_LLVM_MC_MCREGISTERINFO_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "include/platform.h"
|
||||
|
||||
/// An unsigned integer type large enough to represent all physical registers,
|
||||
/// but not necessarily virtual registers.
|
||||
|
11
Makefile
11
Makefile
@ -36,7 +36,7 @@ endif
|
||||
CFLAGS += -fPIC -Wall -Iinclude
|
||||
|
||||
ifeq ($(CAPSTONE_USE_SYS_DYN_MEM),yes)
|
||||
CFLAGS += -DUSE_SYS_DYN_MEM
|
||||
CFLAGS += -DCAPSTONE_USE_SYS_DYN_MEM
|
||||
endif
|
||||
|
||||
PREFIX ?= /usr
|
||||
@ -196,7 +196,10 @@ ifneq (,$(findstring x86,$(CAPSTONE_ARCHS)))
|
||||
LIBOBJ_X86 += $(OBJDIR)/arch/X86/X86DisassemblerDecoder.o
|
||||
LIBOBJ_X86 += $(OBJDIR)/arch/X86/X86Disassembler.o
|
||||
LIBOBJ_X86 += $(OBJDIR)/arch/X86/X86IntelInstPrinter.o
|
||||
# assembly syntax is irrelevant in Diet mode, when this info is suppressed
|
||||
ifeq (,$(findstring yes,$(CAPSTONE_DIET)))
|
||||
LIBOBJ_X86 += $(OBJDIR)/arch/X86/X86ATTInstPrinter.o
|
||||
endif
|
||||
LIBOBJ_X86 += $(OBJDIR)/arch/X86/X86Mapping.o
|
||||
LIBOBJ_X86 += $(OBJDIR)/arch/X86/X86Module.o
|
||||
endif
|
||||
@ -231,7 +234,7 @@ $(LIBNAME)_LDFLAGS += -shared
|
||||
IS_CYGWIN := $(shell $(CC) -dumpmachine | grep -i cygwin | wc -l)
|
||||
ifeq ($(IS_CYGWIN),1)
|
||||
EXT = dll
|
||||
AR_EXT = dll.a
|
||||
AR_EXT = lib
|
||||
# Cygwin doesn't like -fPIC
|
||||
CFLAGS := $(CFLAGS:-fPIC=)
|
||||
# On Windows we need the shared library to be executable
|
||||
@ -240,7 +243,7 @@ else
|
||||
IS_MINGW := $(shell $(CC) --version | grep -i mingw | wc -l)
|
||||
ifeq ($(IS_MINGW),1)
|
||||
EXT = dll
|
||||
AR_EXT = dll.a
|
||||
AR_EXT = lib
|
||||
# mingw doesn't like -fPIC either
|
||||
CFLAGS := $(CFLAGS:-fPIC=)
|
||||
# On Windows we need the shared library to be executable
|
||||
@ -340,7 +343,7 @@ uninstall:
|
||||
|
||||
clean:
|
||||
rm -f $(LIBOBJ)
|
||||
rm -f $(LIBRARY) $(ARCHIVE)
|
||||
rm -f $(BLDIR)/lib$(LIBNAME).*
|
||||
rm -f $(PKGCFGF)
|
||||
cd tests && $(MAKE) clean
|
||||
rm -f $(BLDIR)/tests/lib$(LIBNAME).$(EXT)
|
||||
|
@ -23,6 +23,12 @@
|
||||
# include <intrin.h>
|
||||
#endif
|
||||
|
||||
#ifndef __cplusplus
|
||||
#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
|
||||
#define inline /* inline */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// NOTE: The following support functions use the _32/_64 extensions instead of
|
||||
// type overloading so that signed and unsigned integers can be used without
|
||||
// ambiguity.
|
||||
|
@ -18,9 +18,10 @@ void SStream_concat(SStream *ss, const char *fmt, ...)
|
||||
{
|
||||
#ifndef CAPSTONE_DIET
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
va_start(ap, fmt);
|
||||
int ret = cs_vsnprintf(ss->buffer + ss->index, sizeof(ss->buffer) - (ss->index + 1), fmt, ap);
|
||||
ret = cs_vsnprintf(ss->buffer + ss->index, sizeof(ss->buffer) - (ss->index + 1), fmt, ap);
|
||||
va_end(ap);
|
||||
ss->index += ret;
|
||||
#endif
|
||||
|
@ -11,8 +11,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_ARM64
|
||||
|
||||
#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
|
||||
#pragma warning(disable:4996)
|
||||
#endif
|
||||
|
||||
#include "../../utils.h"
|
||||
|
||||
@ -39,11 +45,12 @@ char *NamedImmMapper_toString(NamedImmMapper *N, uint32_t Value, bool *Valid)
|
||||
// return true if s1 == lower(f2), and false otherwise
|
||||
static bool compare_lower_str(char *s1, char *s2)
|
||||
{
|
||||
bool res;
|
||||
char *lower = cs_strdup(s2), *c;
|
||||
for (c = lower; *c; c++)
|
||||
*c = (char)tolower((int) *c);
|
||||
|
||||
bool res = (strcmp(s1, lower) == 0);
|
||||
res = (strcmp(s1, lower) == 0);
|
||||
cs_mem_free(lower);
|
||||
|
||||
return res;
|
||||
@ -74,6 +81,7 @@ static char *utostr(uint64_t X, bool isNeg)
|
||||
{
|
||||
char Buffer[22];
|
||||
char *BufPtr = Buffer+21;
|
||||
char *result;
|
||||
|
||||
Buffer[21] = '\0';
|
||||
if (X == 0) *--BufPtr = '0'; // Handle special case...
|
||||
@ -85,7 +93,7 @@ static char *utostr(uint64_t X, bool isNeg)
|
||||
|
||||
if (isNeg) *--BufPtr = '-'; // Add negative sign...
|
||||
|
||||
char *result = cs_strdup(BufPtr);
|
||||
result = cs_strdup(BufPtr);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -571,7 +579,11 @@ static NamedImmMapper_Mapping SysRegPairs[] = {
|
||||
// result must be a big enough buffer: 128 bytes is more than enough
|
||||
void SysRegMapper_toString(SysRegMapper *S, uint32_t Bits, bool *Valid, char *result)
|
||||
{
|
||||
int dummy;
|
||||
uint32_t Op0, Op1, CRn, CRm, Op2;
|
||||
char *Op1S, *CRnS, *CRmS, *Op2S;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < ARR_SIZE(SysRegPairs); ++i) {
|
||||
if (SysRegPairs[i].Value == Bits) {
|
||||
*Valid = true;
|
||||
@ -588,11 +600,11 @@ void SysRegMapper_toString(SysRegMapper *S, uint32_t Bits, bool *Valid, char *re
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t Op0 = (Bits >> 14) & 0x3;
|
||||
uint32_t Op1 = (Bits >> 11) & 0x7;
|
||||
uint32_t CRn = (Bits >> 7) & 0xf;
|
||||
uint32_t CRm = (Bits >> 3) & 0xf;
|
||||
uint32_t Op2 = Bits & 0x7;
|
||||
Op0 = (Bits >> 14) & 0x3;
|
||||
Op1 = (Bits >> 11) & 0x7;
|
||||
CRn = (Bits >> 7) & 0xf;
|
||||
CRm = (Bits >> 3) & 0xf;
|
||||
Op2 = Bits & 0x7;
|
||||
|
||||
// Only combinations matching: 11 xxx 1x11 xxxx xxx are valid for a generic
|
||||
// name.
|
||||
@ -605,14 +617,13 @@ void SysRegMapper_toString(SysRegMapper *S, uint32_t Bits, bool *Valid, char *re
|
||||
|
||||
*Valid = true;
|
||||
|
||||
char *Op1S, *CRnS, *CRmS, *Op2S;
|
||||
Op1S = utostr(Op1, false);
|
||||
CRnS = utostr(CRn, false);
|
||||
CRmS = utostr(CRm, false);
|
||||
Op2S = utostr(Op2, false);
|
||||
|
||||
//printf("Op1S: %s, CRnS: %s, CRmS: %s, Op2S: %s\n", Op1S, CRnS, CRmS, Op2S);
|
||||
int dummy = sprintf(result, "s3_%s_c%s_c%s_%s", Op1S, CRnS, CRmS, Op2S);
|
||||
dummy = sprintf(result, "s3_%s_c%s_c%s_%s", Op1S, CRnS, CRmS, Op2S);
|
||||
(void)dummy;
|
||||
|
||||
cs_mem_free(Op1S);
|
||||
@ -657,9 +668,9 @@ static NamedImmMapper_Mapping TLBIPairs[] = {
|
||||
};
|
||||
|
||||
NamedImmMapper A64TLBI_TLBIMapper = {
|
||||
.Pairs = TLBIPairs,
|
||||
.NumPairs = ARR_SIZE(TLBIPairs),
|
||||
.TooBigImm = 0,
|
||||
TLBIPairs,
|
||||
ARR_SIZE(TLBIPairs),
|
||||
0,
|
||||
};
|
||||
|
||||
static NamedImmMapper_Mapping ATPairs[] = {
|
||||
@ -678,9 +689,9 @@ static NamedImmMapper_Mapping ATPairs[] = {
|
||||
};
|
||||
|
||||
NamedImmMapper A64AT_ATMapper = {
|
||||
.Pairs = ATPairs,
|
||||
.NumPairs = ARR_SIZE(ATPairs),
|
||||
.TooBigImm = 0,
|
||||
ATPairs,
|
||||
ARR_SIZE(ATPairs),
|
||||
0,
|
||||
};
|
||||
|
||||
static NamedImmMapper_Mapping DBarrierPairs[] = {
|
||||
@ -699,9 +710,9 @@ static NamedImmMapper_Mapping DBarrierPairs[] = {
|
||||
};
|
||||
|
||||
NamedImmMapper A64DB_DBarrierMapper = {
|
||||
.Pairs = DBarrierPairs,
|
||||
.NumPairs = ARR_SIZE(DBarrierPairs),
|
||||
.TooBigImm = 16,
|
||||
DBarrierPairs,
|
||||
ARR_SIZE(DBarrierPairs),
|
||||
16,
|
||||
};
|
||||
|
||||
static NamedImmMapper_Mapping DCPairs[] = {
|
||||
@ -716,9 +727,9 @@ static NamedImmMapper_Mapping DCPairs[] = {
|
||||
};
|
||||
|
||||
NamedImmMapper A64DC_DCMapper = {
|
||||
.Pairs = DCPairs,
|
||||
.NumPairs = ARR_SIZE(DCPairs),
|
||||
.TooBigImm = 0,
|
||||
DCPairs,
|
||||
ARR_SIZE(DCPairs),
|
||||
0,
|
||||
};
|
||||
|
||||
static NamedImmMapper_Mapping ICPairs[] = {
|
||||
@ -728,9 +739,9 @@ static NamedImmMapper_Mapping ICPairs[] = {
|
||||
};
|
||||
|
||||
NamedImmMapper A64IC_ICMapper = {
|
||||
.Pairs = ICPairs,
|
||||
.NumPairs = ARR_SIZE(ICPairs),
|
||||
.TooBigImm = 0,
|
||||
ICPairs,
|
||||
ARR_SIZE(ICPairs),
|
||||
0,
|
||||
};
|
||||
|
||||
static NamedImmMapper_Mapping ISBPairs[] = {
|
||||
@ -738,9 +749,9 @@ static NamedImmMapper_Mapping ISBPairs[] = {
|
||||
};
|
||||
|
||||
NamedImmMapper A64ISB_ISBMapper = {
|
||||
.Pairs = ISBPairs,
|
||||
.NumPairs = ARR_SIZE(ISBPairs),
|
||||
.TooBigImm = 16,
|
||||
ISBPairs,
|
||||
ARR_SIZE(ISBPairs),
|
||||
16,
|
||||
};
|
||||
|
||||
static NamedImmMapper_Mapping PRFMPairs[] = {
|
||||
@ -765,9 +776,9 @@ static NamedImmMapper_Mapping PRFMPairs[] = {
|
||||
};
|
||||
|
||||
NamedImmMapper A64PRFM_PRFMMapper = {
|
||||
.Pairs = PRFMPairs,
|
||||
.NumPairs = ARR_SIZE(PRFMPairs),
|
||||
.TooBigImm = 32,
|
||||
PRFMPairs,
|
||||
ARR_SIZE(PRFMPairs),
|
||||
32,
|
||||
};
|
||||
|
||||
static NamedImmMapper_Mapping PStatePairs[] = {
|
||||
@ -777,9 +788,9 @@ static NamedImmMapper_Mapping PStatePairs[] = {
|
||||
};
|
||||
|
||||
NamedImmMapper A64PState_PStateMapper = {
|
||||
.Pairs = PStatePairs,
|
||||
.NumPairs = ARR_SIZE(PStatePairs),
|
||||
.TooBigImm = 0,
|
||||
PStatePairs,
|
||||
ARR_SIZE(PStatePairs),
|
||||
0,
|
||||
};
|
||||
|
||||
static NamedImmMapper_Mapping MRSPairs[] = {
|
||||
@ -882,8 +893,9 @@ static NamedImmMapper_Mapping MRSPairs[] = {
|
||||
};
|
||||
|
||||
SysRegMapper AArch64_MRSMapper = {
|
||||
.InstPairs = MRSPairs,
|
||||
.NumInstPairs = ARR_SIZE(MRSPairs),
|
||||
NULL,
|
||||
MRSPairs,
|
||||
ARR_SIZE(MRSPairs),
|
||||
};
|
||||
|
||||
static NamedImmMapper_Mapping MSRPairs[] = {
|
||||
@ -905,8 +917,9 @@ static NamedImmMapper_Mapping MSRPairs[] = {
|
||||
};
|
||||
|
||||
SysRegMapper AArch64_MSRMapper = {
|
||||
.InstPairs = MSRPairs,
|
||||
.NumInstPairs = ARR_SIZE(MSRPairs),
|
||||
NULL,
|
||||
MSRPairs,
|
||||
ARR_SIZE(MSRPairs),
|
||||
};
|
||||
|
||||
// Encoding of the immediate for logical (immediate) instructions:
|
||||
@ -935,12 +948,14 @@ bool A64Imms_isLogicalImmBits(unsigned RegWidth, uint32_t Bits, uint64_t *Imm)
|
||||
uint32_t N = Bits >> 12;
|
||||
uint32_t ImmR = (Bits >> 6) & 0x3f;
|
||||
uint32_t ImmS = Bits & 0x3f;
|
||||
uint64_t Mask, WidthMask;
|
||||
unsigned i;
|
||||
int Width = 0, Num1s, Rotation;
|
||||
|
||||
// N=1 encodes a 64-bit replication and is invalid for the 32-bit
|
||||
// instructions.
|
||||
if (RegWidth == 32 && N != 0) return false;
|
||||
|
||||
int Width = 0;
|
||||
if (N == 1)
|
||||
Width = 64;
|
||||
else if ((ImmS & 0x20) == 0)
|
||||
@ -958,20 +973,20 @@ bool A64Imms_isLogicalImmBits(unsigned RegWidth, uint32_t Bits, uint64_t *Imm)
|
||||
return false;
|
||||
}
|
||||
|
||||
int Num1s = (ImmS & (Width - 1)) + 1;
|
||||
Num1s = (ImmS & (Width - 1)) + 1;
|
||||
|
||||
// All encodings which would map to -1 (signed) are RESERVED.
|
||||
if (Num1s == Width) return false;
|
||||
if (Num1s == Width)
|
||||
return false;
|
||||
|
||||
int Rotation = (ImmR & (Width - 1));
|
||||
uint64_t Mask = (1ULL << Num1s) - 1;
|
||||
uint64_t WidthMask = Width == 64 ? -1 : (1ULL << Width) - 1;
|
||||
Rotation = (ImmR & (Width - 1));
|
||||
Mask = (1ULL << Num1s) - 1;
|
||||
WidthMask = Width == 64 ? -1 : (1ULL << Width) - 1;
|
||||
if (Rotation != 0 && Rotation != 64)
|
||||
Mask = (Mask >> Rotation)
|
||||
| ((Mask << (Width - Rotation)) & WidthMask);
|
||||
|
||||
*Imm = Mask;
|
||||
unsigned i;
|
||||
for (i = 1; i < RegWidth / Width; ++i) {
|
||||
Mask <<= Width;
|
||||
*Imm |= Mask;
|
||||
@ -980,3 +995,4 @@ bool A64Imms_isLogicalImmBits(unsigned RegWidth, uint32_t Bits, uint64_t *Imm)
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -14,15 +14,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifndef CS_LLVM_AARCH64_BASEINFO_H
|
||||
#define CS_LLVM_AARCH64_BASEINFO_H
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
/// Instances of this class can perform bidirectional mapping from random
|
||||
@ -90,6 +89,11 @@ typedef enum A64CC_CondCodes { // Meaning (integer) Meaning (floating
|
||||
A64CC_Invalid
|
||||
} A64CC_CondCodes;
|
||||
|
||||
#ifndef __cplusplus
|
||||
#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
|
||||
#define inline /* inline */
|
||||
#endif
|
||||
#endif
|
||||
inline static const char *A64CondCodeToString(A64CC_CondCodes CC)
|
||||
{
|
||||
switch (CC) {
|
||||
|
@ -16,6 +16,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_ARM64
|
||||
|
||||
#include <stdio.h> // DEBUG
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -32,14 +34,12 @@
|
||||
// Forward-declarations used in the auto-generated files.
|
||||
static DecodeStatus DecodeGPR64RegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
uint64_t Address, void *Decoder);
|
||||
static DecodeStatus
|
||||
DecodeGPR64xspRegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
static DecodeStatus DecodeGPR64xspRegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
uint64_t Address, void *Decoder);
|
||||
|
||||
static DecodeStatus DecodeGPR32RegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
uint64_t Address, void *Decoder);
|
||||
static DecodeStatus
|
||||
DecodeGPR32wspRegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
static DecodeStatus DecodeGPR32wspRegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
uint64_t Address, void *Decoder);
|
||||
|
||||
static DecodeStatus DecodeFPR8RegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
@ -262,13 +262,15 @@ static DecodeStatus _getInstruction(cs_struct *ud, MCInst *MI,
|
||||
uint16_t *Size,
|
||||
uint64_t Address, MCRegisterInfo *MRI)
|
||||
{
|
||||
uint32_t insn;
|
||||
DecodeStatus result;
|
||||
|
||||
if (code_len < 4) {
|
||||
// not enough data
|
||||
*Size = 0;
|
||||
return MCDisassembler_Fail;
|
||||
}
|
||||
|
||||
uint32_t insn;
|
||||
if (ud->big_endian)
|
||||
insn = (code[3] << 0) | (code[2] << 8) |
|
||||
(code[1] << 16) | (code[0] << 24);
|
||||
@ -277,7 +279,7 @@ static DecodeStatus _getInstruction(cs_struct *ud, MCInst *MI,
|
||||
(code[1] << 8) | (code[0] << 0);
|
||||
|
||||
// Calling the auto-generated decoder function.
|
||||
DecodeStatus result = decodeInstruction(DecoderTableA6432, MI, insn, Address, MRI, 0);
|
||||
result = decodeInstruction(DecoderTableA6432, MI, insn, Address, MRI, 0);
|
||||
if (result != MCDisassembler_Fail) {
|
||||
*Size = 4;
|
||||
return result;
|
||||
@ -700,6 +702,7 @@ static DecodeStatus DecodeBitfieldInstruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address,
|
||||
void *Decoder)
|
||||
{
|
||||
unsigned ExtractOp = 0, InsertOp = 0;
|
||||
unsigned Rd = fieldFromInstruction(Insn, 0, 5);
|
||||
unsigned Rn = fieldFromInstruction(Insn, 5, 5);
|
||||
unsigned ImmS = fieldFromInstruction(Insn, 10, 6);
|
||||
@ -759,7 +762,6 @@ static DecodeStatus DecodeBitfieldInstruction(MCInst *Inst, unsigned Insn,
|
||||
|
||||
// Otherwise it's definitely either an extract or an insert depending on which
|
||||
// of ImmR or ImmS is larger.
|
||||
unsigned ExtractOp = 0, InsertOp = 0;
|
||||
switch (Opc) {
|
||||
default: break; // never reach
|
||||
case SBFM:
|
||||
@ -1166,6 +1168,7 @@ static DecodeStatus DecodeVLDSTLanePostInstruction(MCInst *Inst, unsigned Insn,
|
||||
// TransferBytes = NumVecs * OneLaneBytes
|
||||
unsigned TransferBytes = 0;
|
||||
unsigned NumVecs = 0;
|
||||
unsigned Rt, Rn, Rm, Q, S, lane, NumLanes;
|
||||
unsigned Opc = MCInst_getOpcode(Inst);
|
||||
switch (Opc) {
|
||||
case AArch64_LD1R_WB_8B_fixed: case AArch64_LD1R_WB_8B_register:
|
||||
@ -1492,9 +1495,9 @@ static DecodeStatus DecodeVLDSTLanePostInstruction(MCInst *Inst, unsigned Insn,
|
||||
return MCDisassembler_Fail;
|
||||
} // End of switch (Opc)
|
||||
|
||||
unsigned Rt = fieldFromInstruction(Insn, 0, 5);
|
||||
unsigned Rn = fieldFromInstruction(Insn, 5, 5);
|
||||
unsigned Rm = fieldFromInstruction(Insn, 16, 5);
|
||||
Rt = fieldFromInstruction(Insn, 0, 5);
|
||||
Rn = fieldFromInstruction(Insn, 5, 5);
|
||||
Rm = fieldFromInstruction(Insn, 16, 5);
|
||||
|
||||
// Decode post-index of load duplicate lane
|
||||
if (IsLoadDup) {
|
||||
@ -1571,12 +1574,12 @@ static DecodeStatus DecodeVLDSTLanePostInstruction(MCInst *Inst, unsigned Insn,
|
||||
}
|
||||
|
||||
// Decode lane
|
||||
unsigned Q = fieldFromInstruction(Insn, 30, 1);
|
||||
unsigned S = fieldFromInstruction(Insn, 10, 3);
|
||||
unsigned lane = 0;
|
||||
Q = fieldFromInstruction(Insn, 30, 1);
|
||||
S = fieldFromInstruction(Insn, 10, 3);
|
||||
lane = 0;
|
||||
// Calculate the number of lanes by number of vectors and transfered bytes.
|
||||
// NumLanes = 16 bytes / bytes of each lane
|
||||
unsigned NumLanes = 16 / (TransferBytes / NumVecs);
|
||||
NumLanes = 16 / (TransferBytes / NumVecs);
|
||||
switch (NumLanes) {
|
||||
case 16: // A vector has 16 lanes, each lane is 1 bytes.
|
||||
lane = (Q << 3) | S;
|
||||
@ -1628,3 +1631,4 @@ static DecodeStatus DecodeSHLLInstruction(MCInst *Inst, unsigned Insn,
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -7,7 +7,7 @@
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
/* Capstone Disassembly Engine, http://www.capstone-engine.org */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
/// printInstruction - This method is automatically generated by tablegen
|
||||
/// from the instruction set description.
|
||||
@ -8871,6 +8871,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
{
|
||||
#define GETREGCLASS_CONTAIN(_class, _reg) MCRegisterClass_contains(MCRegisterInfo_getRegClass(MRI, _class), MCOperand_getReg(MCInst_getOperand(MI, _reg)))
|
||||
const char *AsmString;
|
||||
char *tmp, *AsmMnem, *AsmOps, *c;
|
||||
MCRegisterInfo *MRI = (MCRegisterInfo *)info;
|
||||
switch (MCInst_getOpcode(MI)) {
|
||||
default: return NULL;
|
||||
@ -11316,7 +11317,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *tmp = cs_strdup(AsmString), *AsmMnem, *AsmOps;
|
||||
tmp = cs_strdup(AsmString);
|
||||
AsmMnem = tmp;
|
||||
AsmOps = strchr(tmp, ' ');
|
||||
if (AsmOps) {
|
||||
@ -11326,7 +11327,6 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
SStream_concat(OS, "%s", AsmMnem);
|
||||
if (AsmOps) {
|
||||
SStream_concat(OS, "\t");
|
||||
char *c;
|
||||
for (c = AsmOps; *c; c++) {
|
||||
if (*c == '$') {
|
||||
c += 1;
|
||||
|
@ -7,7 +7,7 @@
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
/* Capstone Disassembly Engine, http://www.capstone-engine.org */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#include "../../MCInst.h"
|
||||
#include "../../LEB128.h"
|
||||
@ -10895,16 +10895,21 @@ static uint8_t DecoderTableA6432[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static bool getbool(uint64_t b)
|
||||
{
|
||||
return b != 0;
|
||||
}
|
||||
|
||||
static bool checkDecoderPredicate(unsigned Idx, uint64_t Bits)
|
||||
{
|
||||
switch (Idx) {
|
||||
default: // llvm_unreachable("Invalid index!");
|
||||
case 0:
|
||||
return ((Bits & AArch64_FeatureNEON));
|
||||
return getbool(Bits & AArch64_FeatureNEON);
|
||||
case 1:
|
||||
return ((Bits & AArch64_FeatureFPARMv8));
|
||||
return getbool(Bits & AArch64_FeatureFPARMv8);
|
||||
case 2:
|
||||
return ((Bits & AArch64_FeatureNEON) && (Bits & AArch64_FeatureCrypto));
|
||||
return getbool((Bits & AArch64_FeatureNEON) && (Bits & AArch64_FeatureCrypto));
|
||||
}
|
||||
}
|
||||
|
||||
@ -14036,48 +14041,48 @@ static DecodeStatus fname(uint8_t DecodeTable[], MCInst *MI, \
|
||||
{ \
|
||||
uint64_t Bits = getFeatureBits(feature); \
|
||||
uint8_t *Ptr = DecodeTable; \
|
||||
uint32_t CurFieldValue = 0; \
|
||||
uint32_t CurFieldValue = 0, ExpectedValue; \
|
||||
DecodeStatus S = MCDisassembler_Success; \
|
||||
unsigned Start, Len, NumToSkip, PIdx, Opc, DecodeIdx; \
|
||||
InsnType Val, FieldValue, PositiveMask, NegativeMask; \
|
||||
bool Pred, Fail; \
|
||||
for (;;) { \
|
||||
switch (*Ptr) { \
|
||||
default: \
|
||||
return MCDisassembler_Fail; \
|
||||
case MCD_OPC_ExtractField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
++Ptr; \
|
||||
CurFieldValue = fieldname(insn, Start, Len); \
|
||||
CurFieldValue = (uint32_t)fieldname(insn, Start, Len); \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_FilterValue: { \
|
||||
unsigned Len; \
|
||||
InsnType Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (Val != CurFieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
InsnType FieldValue = fieldname(insn, Start, Len); \
|
||||
uint32_t ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
FieldValue = fieldname(insn, Start, Len); \
|
||||
ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (ExpectedValue != FieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckPredicate: { \
|
||||
unsigned Len; \
|
||||
unsigned PIdx = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
PIdx = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
bool Pred; \
|
||||
Pred = checkDecoderPredicate(PIdx, Bits); \
|
||||
if (!Pred) \
|
||||
Ptr += NumToSkip; \
|
||||
@ -14085,21 +14090,19 @@ static DecodeStatus fname(uint8_t DecodeTable[], MCInst *MI, \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_Decode: { \
|
||||
unsigned Len; \
|
||||
unsigned Opc = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Opc = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned DecodeIdx = (uint32_t)decodeULEB128(Ptr, &Len); \
|
||||
DecodeIdx = (uint32_t)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
MCInst_setOpcode(MI, Opc); \
|
||||
return decoder(S, DecodeIdx, insn, MI, Address, MRI); \
|
||||
} \
|
||||
case MCD_OPC_SoftFail: { \
|
||||
unsigned Len; \
|
||||
InsnType PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
InsnType NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
bool Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
if (Fail) \
|
||||
S = MCDisassembler_SoftFail; \
|
||||
break; \
|
||||
|
@ -11,8 +11,10 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_ARM64
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
@ -315,6 +317,8 @@ static void printLabelOperand(MCInst *MI, unsigned OpNum,
|
||||
SStream *O, unsigned field_width, unsigned scale)
|
||||
{
|
||||
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
||||
uint64_t UImm, Sign;
|
||||
int64_t SImm, tmp;
|
||||
|
||||
if (!MCOperand_isImm(MO)) {
|
||||
printOperand(MI, OpNum, O);
|
||||
@ -323,9 +327,9 @@ static void printLabelOperand(MCInst *MI, unsigned OpNum,
|
||||
|
||||
// The immediate of LDR (lit) instructions is a signed 19-bit immediate, which
|
||||
// is multiplied by 4 (because all A64 instructions are 32-bits wide).
|
||||
uint64_t UImm = MCOperand_getImm(MO);
|
||||
uint64_t Sign = UImm & (1LL << (field_width - 1));
|
||||
int64_t SImm = scale * ((UImm & ~Sign) - Sign);
|
||||
UImm = MCOperand_getImm(MO);
|
||||
Sign = UImm & (1LL << (field_width - 1));
|
||||
SImm = scale * ((UImm & ~Sign) - Sign);
|
||||
|
||||
// this is a relative address, so add with the address
|
||||
// of current instruction
|
||||
@ -343,10 +347,11 @@ static void printLabelOperand(MCInst *MI, unsigned OpNum,
|
||||
else
|
||||
SStream_concat(O, "#%"PRIu64, SImm);
|
||||
} else {
|
||||
tmp = -(int64_t)SImm;
|
||||
if (SImm < -HEX_THRESHOLD)
|
||||
SStream_concat(O, "#-0x%"PRIx64, -SImm);
|
||||
SStream_concat(O, "#-0x%"PRIx64, tmp);
|
||||
else
|
||||
SStream_concat(O, "#-%"PRIu64, -SImm);
|
||||
SStream_concat(O, "#-%"PRIu64, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -396,6 +401,7 @@ static void printShiftOperand(MCInst *MI, unsigned OpNum,
|
||||
SStream *O, A64SE_ShiftExtSpecifiers Shift)
|
||||
{
|
||||
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
||||
unsigned int imm;
|
||||
|
||||
// LSL #0 is not printed
|
||||
if (Shift == A64SE_LSL && MCOperand_isImm(MO) && MCOperand_getImm(MO) == 0)
|
||||
@ -409,7 +415,7 @@ static void printShiftOperand(MCInst *MI, unsigned OpNum,
|
||||
default: break; // llvm_unreachable("Invalid shift specifier in logical instruction");
|
||||
}
|
||||
|
||||
unsigned int imm = (unsigned int)MCOperand_getImm(MO);
|
||||
imm = (unsigned int)MCOperand_getImm(MO);
|
||||
if (imm > HEX_THRESHOLD)
|
||||
SStream_concat(O, " #0x%x", imm);
|
||||
else
|
||||
@ -579,10 +585,10 @@ static void printSImm7ScaledOperand(MCInst *MI, unsigned OpNum,
|
||||
|
||||
if (MI->csh->detail) {
|
||||
if (MI->csh->doing_mem) {
|
||||
MI->flat_insn.arm64.operands[MI->flat_insn.arm64.op_count].mem.disp = res;
|
||||
MI->flat_insn.arm64.operands[MI->flat_insn.arm64.op_count].mem.disp = (int32_t)res;
|
||||
} else {
|
||||
MI->flat_insn.arm64.operands[MI->flat_insn.arm64.op_count].type = ARM64_OP_IMM;
|
||||
MI->flat_insn.arm64.operands[MI->flat_insn.arm64.op_count].imm = res;
|
||||
MI->flat_insn.arm64.operands[MI->flat_insn.arm64.op_count].imm = (int32_t)res;
|
||||
MI->flat_insn.arm64.op_count++;
|
||||
}
|
||||
}
|
||||
@ -657,7 +663,7 @@ static void printNeonMovImmShiftOperand(MCInst *MI, unsigned OpNum,
|
||||
SStream *O, A64SE_ShiftExtSpecifiers Ext, bool isHalf)
|
||||
{
|
||||
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
||||
|
||||
int64_t Imm;
|
||||
//assert(MO.isImm() &&
|
||||
// "Immediate operand required for Neon vector immediate inst.");
|
||||
|
||||
@ -668,7 +674,7 @@ static void printNeonMovImmShiftOperand(MCInst *MI, unsigned OpNum,
|
||||
//llvm_unreachable("Invalid shift specifier in movi instruction");
|
||||
}
|
||||
|
||||
int64_t Imm = MCOperand_getImm(MO);
|
||||
Imm = MCOperand_getImm(MO);
|
||||
|
||||
// MSL and LSLH accepts encoded shift amount 0 or 1.
|
||||
if ((!IsLSL || (IsLSL && isHalf)) && Imm != 0 && Imm != 1) {
|
||||
@ -867,3 +873,4 @@ void AArch64_printInst(MCInst *MI, SStream *O, void *Info)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* Capstone Unified Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_ARM64
|
||||
|
||||
#include <stdio.h> // debug
|
||||
#include <string.h>
|
||||
@ -18,9 +20,9 @@ static name_map reg_name_maps[] = {
|
||||
//=========
|
||||
{ ARM64_REG_NZCV, "nzcv"},
|
||||
{ ARM64_REG_WSP, "wsp"},
|
||||
{ ARM64_REG_WZR, "wzr"}, // dummy data for array mapping order only
|
||||
{ ARM64_REG_WZR, "wzr"},
|
||||
{ ARM64_REG_SP, "sp"},
|
||||
{ ARM64_REG_XZR, "xzr"}, // dummy data for array mapping order only
|
||||
{ ARM64_REG_XZR, "xzr"},
|
||||
{ ARM64_REG_B0, "b0"},
|
||||
{ ARM64_REG_B1, "b1"},
|
||||
{ ARM64_REG_B2, "b2"},
|
||||
@ -17045,3 +17047,5 @@ arm64_reg AArch64_map_insn(const char *name)
|
||||
|
||||
return (i != -1)? i : ARM64_REG_INVALID;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* Capstone Disassembler Engine */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Dang Hoang Vu <danghvu@gmail.com> 2013 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_ARM64
|
||||
|
||||
#include "../../utils.h"
|
||||
#include "../../MCRegisterInfo.h"
|
||||
#include "AArch64Disassembler.h"
|
||||
@ -48,3 +50,5 @@ void AArch64_enable(void)
|
||||
// support this arch
|
||||
all_arch |= (1 << CS_ARCH_ARM64);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -11,14 +11,13 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifndef CS_LLVM_TARGET_ARM_ARMADDRESSINGMODES_H
|
||||
#define CS_LLVM_TARGET_ARM_ARMADDRESSINGMODES_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "../../include/platform.h"
|
||||
#include "../../MathExtras.h"
|
||||
|
||||
/// ARM_AM - ARM Addressing Mode Stuff
|
||||
@ -148,16 +147,17 @@ static inline unsigned getSOImmValRot(unsigned Imm)
|
||||
/// take a maximal chunk of bits out of the immediate.
|
||||
static inline unsigned getSOImmValRotate(unsigned Imm)
|
||||
{
|
||||
unsigned TZ, RotAmt;
|
||||
// 8-bit (or less) immediates are trivially shifter_operands with a rotate
|
||||
// of zero.
|
||||
if ((Imm & ~255U) == 0) return 0;
|
||||
|
||||
// Use CTZ to compute the rotate amount.
|
||||
unsigned TZ = CountTrailingZeros_32(Imm);
|
||||
TZ = CountTrailingZeros_32(Imm);
|
||||
|
||||
// Rotate amount must be even. Something like 0x200 must be rotated 8 bits,
|
||||
// not 9.
|
||||
unsigned RotAmt = TZ & ~1;
|
||||
RotAmt = TZ & ~1;
|
||||
|
||||
// If we can handle this spread, return it.
|
||||
if ((rotr32(Imm, RotAmt) & ~255U) == 0)
|
||||
@ -183,11 +183,12 @@ static inline unsigned getSOImmValRotate(unsigned Imm)
|
||||
/// it. If not, return -1.
|
||||
static inline int getSOImmVal(unsigned Arg)
|
||||
{
|
||||
unsigned RotAmt;
|
||||
// 8-bit (or less) immediates are trivially shifter_operands with a rotate
|
||||
// of zero.
|
||||
if ((Arg & ~255U) == 0) return Arg;
|
||||
|
||||
unsigned RotAmt = getSOImmValRotate(Arg);
|
||||
RotAmt = getSOImmValRotate(Arg);
|
||||
|
||||
// If this cannot be handled with a single shifter_op, bail out.
|
||||
if (rotr32(~255U, RotAmt) & Arg)
|
||||
@ -337,13 +338,14 @@ static inline int getT2SOImmValRotateVal(unsigned V)
|
||||
/// See ARM Reference Manual A6.3.2.
|
||||
static inline int getT2SOImmVal(unsigned Arg)
|
||||
{
|
||||
int Rot;
|
||||
// If 'Arg' is an 8-bit splat, then get the encoded value.
|
||||
int Splat = getT2SOImmValSplatVal(Arg);
|
||||
if (Splat != -1)
|
||||
return Splat;
|
||||
|
||||
// If 'Arg' can be handled with a single shifter_op return the value.
|
||||
int Rot = getT2SOImmValRotateVal(Arg);
|
||||
Rot = getT2SOImmValRotateVal(Arg);
|
||||
if (Rot != -1)
|
||||
return Rot;
|
||||
|
||||
@ -352,9 +354,13 @@ static inline int getT2SOImmVal(unsigned Arg)
|
||||
|
||||
static inline unsigned getT2SOImmValRotate(unsigned V)
|
||||
{
|
||||
if ((V & ~255U) == 0) return 0;
|
||||
unsigned RotAmt;
|
||||
|
||||
if ((V & ~255U) == 0)
|
||||
return 0;
|
||||
|
||||
// Use CTZ to compute the rotate amount.
|
||||
unsigned RotAmt = CountTrailingZeros_32(V);
|
||||
RotAmt = CountTrailingZeros_32(V);
|
||||
return (32 - RotAmt) & 31;
|
||||
}
|
||||
|
||||
|
@ -7,8 +7,10 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_ARM
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@ -437,7 +439,9 @@ void ARM_init(MCRegisterInfo *MRI)
|
||||
static DecodeStatus _ARM_getInstruction(cs_struct *ud, MCInst *MI, const uint8_t *code, size_t code_len,
|
||||
uint16_t *Size, uint64_t Address)
|
||||
{
|
||||
uint32_t insn;
|
||||
uint8_t bytes[4];
|
||||
DecodeStatus result;
|
||||
|
||||
ud->ITBlock.size = 0;
|
||||
|
||||
@ -447,7 +451,6 @@ static DecodeStatus _ARM_getInstruction(cs_struct *ud, MCInst *MI, const uint8_t
|
||||
|
||||
memcpy(bytes, code, 4);
|
||||
|
||||
uint32_t insn;
|
||||
if (ud->big_endian)
|
||||
insn = (bytes[3] << 0) |
|
||||
(bytes[2] << 8) |
|
||||
@ -460,7 +463,7 @@ static DecodeStatus _ARM_getInstruction(cs_struct *ud, MCInst *MI, const uint8_t
|
||||
(bytes[0] << 0);
|
||||
|
||||
// Calling the auto-generated decoder function.
|
||||
DecodeStatus result = decodeInstruction_4(DecoderTableARM32, MI, insn, Address, NULL, ud->mode);
|
||||
result = decodeInstruction_4(DecoderTableARM32, MI, insn, Address, NULL, ud->mode);
|
||||
if (result != MCDisassembler_Fail) {
|
||||
*Size = 4;
|
||||
return result;
|
||||
@ -567,6 +570,7 @@ static DecodeStatus AddThumbPredicate(cs_struct *ud, MCInst *MI)
|
||||
MCOperandInfo *OpInfo;
|
||||
unsigned short NumOps;
|
||||
unsigned int i;
|
||||
unsigned CC;
|
||||
|
||||
// A few instructions actually have predicates encoded in them. Don't
|
||||
// try to overwrite it if we're seeing one of those.
|
||||
@ -604,7 +608,6 @@ static DecodeStatus AddThumbPredicate(cs_struct *ud, MCInst *MI)
|
||||
|
||||
// If we're in an IT block, base the predicate on that. Otherwise,
|
||||
// assume a predicate of AL.
|
||||
unsigned CC;
|
||||
CC = ITStatus_getITCC(&(ud->ITBlock));
|
||||
if (CC == 0xF)
|
||||
CC = ARMCC_AL;
|
||||
@ -670,6 +673,11 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
|
||||
uint16_t *Size, uint64_t Address)
|
||||
{
|
||||
uint8_t bytes[4];
|
||||
uint16_t insn16;
|
||||
DecodeStatus result;
|
||||
bool InITBlock;
|
||||
unsigned Firstcond, Mask;
|
||||
uint32_t NEONLdStInsn, insn32, NEONDataInsn, NEONCryptoInsn, NEONv8Insn;
|
||||
|
||||
ud->ITBlock.size = 0;
|
||||
|
||||
@ -680,13 +688,12 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
|
||||
|
||||
memcpy(bytes, code, 2);
|
||||
|
||||
uint16_t insn16;
|
||||
if (ud->big_endian)
|
||||
insn16 = (bytes[0] << 8) | bytes[1];
|
||||
else
|
||||
insn16 = (bytes[1] << 8) | bytes[0];
|
||||
|
||||
DecodeStatus result = decodeInstruction_2(DecoderTableThumb16, MI, insn16, Address, NULL, ud->mode);
|
||||
result = decodeInstruction_2(DecoderTableThumb16, MI, insn16, Address, NULL, ud->mode);
|
||||
if (result != MCDisassembler_Fail) {
|
||||
*Size = 2;
|
||||
Check(&result, AddThumbPredicate(ud, MI));
|
||||
@ -697,7 +704,7 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
|
||||
result = decodeInstruction_2(DecoderTableThumbSBit16, MI, insn16, Address, NULL, ud->mode);
|
||||
if (result) {
|
||||
*Size = 2;
|
||||
bool InITBlock = ITStatus_instrInITBlock(&(ud->ITBlock));
|
||||
InITBlock = ITStatus_instrInITBlock(&(ud->ITBlock));
|
||||
Check(&result, AddThumbPredicate(ud, MI));
|
||||
AddThumb1SBit(MI, InITBlock);
|
||||
return result;
|
||||
@ -720,8 +727,8 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
|
||||
// to the subsequent instructions.
|
||||
if (MCInst_getOpcode(MI) == ARM_t2IT) {
|
||||
|
||||
unsigned Firstcond = (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, 0));
|
||||
unsigned Mask = (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, 1));
|
||||
Firstcond = (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, 0));
|
||||
Mask = (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, 1));
|
||||
ITStatus_setITState(&(ud->ITBlock), (char)Firstcond, (char)Mask);
|
||||
}
|
||||
|
||||
@ -735,7 +742,6 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
|
||||
|
||||
memcpy(bytes, code, 4);
|
||||
|
||||
uint32_t insn32;
|
||||
if (ud->big_endian)
|
||||
insn32 = (bytes[3] << 24) |
|
||||
(bytes[2] << 16) |
|
||||
@ -751,7 +757,7 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
|
||||
result = decodeInstruction_4(DecoderTableThumb32, MI, insn32, Address, NULL, ud->mode);
|
||||
if (result != MCDisassembler_Fail) {
|
||||
*Size = 4;
|
||||
bool InITBlock = ITStatus_instrInITBlock(&(ud->ITBlock));
|
||||
InITBlock = ITStatus_instrInITBlock(&(ud->ITBlock));
|
||||
Check(&result, AddThumbPredicate(ud, MI));
|
||||
AddThumb1SBit(MI, InITBlock);
|
||||
return result;
|
||||
@ -802,7 +808,7 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
|
||||
|
||||
if (fieldFromInstruction_4(insn32, 24, 8) == 0xF9) {
|
||||
MCInst_clear(MI);
|
||||
uint32_t NEONLdStInsn = insn32;
|
||||
NEONLdStInsn = insn32;
|
||||
NEONLdStInsn &= 0xF0FFFFFF;
|
||||
NEONLdStInsn |= 0x04000000;
|
||||
result = decodeInstruction_4(DecoderTableNEONLoadStore32, MI, NEONLdStInsn, Address, NULL, ud->mode);
|
||||
@ -815,7 +821,7 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
|
||||
|
||||
if (fieldFromInstruction_4(insn32, 24, 4) == 0xF) {
|
||||
MCInst_clear(MI);
|
||||
uint32_t NEONDataInsn = insn32;
|
||||
NEONDataInsn = insn32;
|
||||
NEONDataInsn &= 0xF0FFFFFF; // Clear bits 27-24
|
||||
NEONDataInsn |= (NEONDataInsn & 0x10000000) >> 4; // Move bit 28 to bit 24
|
||||
NEONDataInsn |= 0x12000000; // Set bits 28 and 25
|
||||
@ -828,7 +834,7 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
|
||||
}
|
||||
|
||||
MCInst_clear(MI);
|
||||
uint32_t NEONCryptoInsn = insn32;
|
||||
NEONCryptoInsn = insn32;
|
||||
NEONCryptoInsn &= 0xF0FFFFFF; // Clear bits 27-24
|
||||
NEONCryptoInsn |= (NEONCryptoInsn & 0x10000000) >> 4; // Move bit 28 to bit 24
|
||||
NEONCryptoInsn |= 0x12000000; // Set bits 28 and 25
|
||||
@ -840,7 +846,7 @@ static DecodeStatus _Thumb_getInstruction(cs_struct *ud, MCInst *MI, const uint8
|
||||
}
|
||||
|
||||
MCInst_clear(MI);
|
||||
uint32_t NEONv8Insn = insn32;
|
||||
NEONv8Insn = insn32;
|
||||
NEONv8Insn &= 0xF3FFFFFF; // Clear bits 27-26
|
||||
result = decodeInstruction_4(DecoderTablev8NEON32, MI, NEONv8Insn, Address, NULL, ud->mode);
|
||||
if (result != MCDisassembler_Fail) {
|
||||
@ -881,10 +887,11 @@ static const uint16_t GPRDecoderTable[] = {
|
||||
static DecodeStatus DecodeGPRRegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned Register;
|
||||
if (RegNo > 15)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Register = GPRDecoderTable[RegNo];
|
||||
Register = GPRDecoderTable[RegNo];
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Register));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -932,6 +939,7 @@ static const uint16_t GPRPairDecoderTable[] = {
|
||||
static DecodeStatus DecodeGPRPairRegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned RegisterPair;
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
if (RegNo > 13)
|
||||
@ -940,7 +948,7 @@ static DecodeStatus DecodeGPRPairRegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
if ((RegNo & 1) || RegNo == 0xe)
|
||||
S = MCDisassembler_SoftFail;
|
||||
|
||||
unsigned RegisterPair = GPRPairDecoderTable[RegNo/2];
|
||||
RegisterPair = GPRPairDecoderTable[RegNo/2];
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(RegisterPair));
|
||||
return S;
|
||||
}
|
||||
@ -1000,10 +1008,11 @@ static const uint16_t SPRDecoderTable[] = {
|
||||
static DecodeStatus DecodeSPRRegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned Register;
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Register = SPRDecoderTable[RegNo];
|
||||
Register = SPRDecoderTable[RegNo];
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Register));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -1022,10 +1031,11 @@ static const uint16_t DPRDecoderTable[] = {
|
||||
static DecodeStatus DecodeDPRRegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned Register = 0;
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Register = DPRDecoderTable[RegNo];
|
||||
Register = DPRDecoderTable[RegNo];
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Register));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -1057,11 +1067,12 @@ static const uint16_t QPRDecoderTable[] = {
|
||||
static DecodeStatus DecodeQPRRegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned Register;
|
||||
if (RegNo > 31 || (RegNo & 1) != 0)
|
||||
return MCDisassembler_Fail;
|
||||
RegNo >>= 1;
|
||||
|
||||
unsigned Register = QPRDecoderTable[RegNo];
|
||||
Register = QPRDecoderTable[RegNo];
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Register));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -1078,10 +1089,11 @@ static const uint16_t DPairDecoderTable[] = {
|
||||
static DecodeStatus DecodeDPairRegisterClass(MCInst *Inst, unsigned RegNo,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned Register;
|
||||
if (RegNo > 30)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Register = DPairDecoderTable[RegNo];
|
||||
Register = DPairDecoderTable[RegNo];
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Register));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -1100,10 +1112,11 @@ static const uint16_t DPairSpacedDecoderTable[] = {
|
||||
static DecodeStatus DecodeDPairSpacedRegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned Register;
|
||||
if (RegNo > 29)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Register = DPairSpacedDecoderTable[RegNo];
|
||||
Register = DPairSpacedDecoderTable[RegNo];
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Register));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -1133,7 +1146,7 @@ static DecodeStatus DecodeSORegImmOperand(MCInst *Inst, unsigned Val,
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
ARM_AM_ShiftOpc Shift;
|
||||
|
||||
unsigned Op;
|
||||
unsigned Rm = fieldFromInstruction_4(Val, 0, 4);
|
||||
unsigned type = fieldFromInstruction_4(Val, 5, 2);
|
||||
unsigned imm = fieldFromInstruction_4(Val, 7, 5);
|
||||
@ -1161,7 +1174,7 @@ static DecodeStatus DecodeSORegImmOperand(MCInst *Inst, unsigned Val,
|
||||
if (Shift == ARM_AM_ror && imm == 0)
|
||||
Shift = ARM_AM_rrx;
|
||||
|
||||
unsigned Op = Shift | (imm << 3);
|
||||
Op = Shift | (imm << 3);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateImm(Op));
|
||||
|
||||
return S;
|
||||
@ -1207,6 +1220,7 @@ static DecodeStatus DecodeSORegRegOperand(MCInst *Inst, unsigned Val,
|
||||
static DecodeStatus DecodeRegListOperand(MCInst *Inst, unsigned Val,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned i;
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
bool NeedDisjointWriteback = false;
|
||||
@ -1229,7 +1243,6 @@ static DecodeStatus DecodeRegListOperand(MCInst *Inst, unsigned Val,
|
||||
|
||||
// Empty register lists are not allowed.
|
||||
if (Val == 0) return MCDisassembler_Fail;
|
||||
unsigned i;
|
||||
for (i = 0; i < 16; ++i) {
|
||||
if (Val & (1 << i)) {
|
||||
if (!Check(&S, DecodeGPRRegisterClass(Inst, i, Address, Decoder)))
|
||||
@ -1247,7 +1260,7 @@ static DecodeStatus DecodeSPRRegListOperand(MCInst *Inst, unsigned Val,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned i;
|
||||
unsigned Vd = fieldFromInstruction_4(Val, 8, 5);
|
||||
unsigned regs = fieldFromInstruction_4(Val, 0, 8);
|
||||
|
||||
@ -1260,7 +1273,6 @@ static DecodeStatus DecodeSPRRegListOperand(MCInst *Inst, unsigned Val,
|
||||
|
||||
if (!Check(&S, DecodeSPRRegisterClass(Inst, Vd, Address, Decoder)))
|
||||
return MCDisassembler_Fail;
|
||||
unsigned i;
|
||||
for (i = 0; i < (regs - 1); ++i) {
|
||||
if (!Check(&S, DecodeSPRRegisterClass(Inst, ++Vd, Address, Decoder)))
|
||||
return MCDisassembler_Fail;
|
||||
@ -1273,7 +1285,7 @@ static DecodeStatus DecodeDPRRegListOperand(MCInst *Inst, unsigned Val,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned i;
|
||||
unsigned Vd = fieldFromInstruction_4(Val, 8, 5);
|
||||
unsigned regs = fieldFromInstruction_4(Val, 1, 7);
|
||||
|
||||
@ -1287,7 +1299,7 @@ static DecodeStatus DecodeDPRRegListOperand(MCInst *Inst, unsigned Val,
|
||||
|
||||
if (!Check(&S, DecodeDPRRegisterClass(Inst, Vd, Address, Decoder)))
|
||||
return MCDisassembler_Fail;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < (regs - 1); ++i) {
|
||||
if (!Check(&S, DecodeDPRRegisterClass(Inst, ++Vd, Address, Decoder)))
|
||||
return MCDisassembler_Fail;
|
||||
@ -1306,7 +1318,7 @@ static DecodeStatus DecodeBitfieldMaskOperand(MCInst *Inst, unsigned Val,
|
||||
// create the final mask.
|
||||
unsigned msb = fieldFromInstruction_4(Val, 5, 5);
|
||||
unsigned lsb = fieldFromInstruction_4(Val, 0, 5);
|
||||
uint32_t lsb_mask;
|
||||
uint32_t lsb_mask, msb_mask;
|
||||
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
if (lsb > msb) {
|
||||
@ -1317,7 +1329,7 @@ static DecodeStatus DecodeBitfieldMaskOperand(MCInst *Inst, unsigned Val,
|
||||
lsb = msb;
|
||||
}
|
||||
|
||||
uint32_t msb_mask = 0xFFFFFFFF;
|
||||
msb_mask = 0xFFFFFFFF;
|
||||
if (msb != 31) msb_mask = (1U << (msb+1)) - 1;
|
||||
lsb_mask = (1U << lsb) - 1;
|
||||
|
||||
@ -1476,7 +1488,7 @@ static DecodeStatus DecodeAddrMode2IdxInstruction(MCInst *Inst, unsigned Insn,
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
ARM_AM_AddrOpc Op;
|
||||
ARM_AM_ShiftOpc Opc;
|
||||
|
||||
bool writeback;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rt = fieldFromInstruction_4(Insn, 12, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
@ -1485,6 +1497,7 @@ static DecodeStatus DecodeAddrMode2IdxInstruction(MCInst *Inst, unsigned Insn,
|
||||
unsigned reg = fieldFromInstruction_4(Insn, 25, 1);
|
||||
unsigned P = fieldFromInstruction_4(Insn, 24, 1);
|
||||
unsigned W = fieldFromInstruction_4(Insn, 21, 1);
|
||||
unsigned idx_mode = 0, amt, tmp;
|
||||
|
||||
// On stores, the writeback operand precedes Rt.
|
||||
switch (MCInst_getOpcode(Inst)) {
|
||||
@ -1530,8 +1543,7 @@ static DecodeStatus DecodeAddrMode2IdxInstruction(MCInst *Inst, unsigned Insn,
|
||||
if (!fieldFromInstruction_4(Insn, 23, 1))
|
||||
Op = ARM_AM_sub;
|
||||
|
||||
bool writeback = (P == 0) || (W == 1);
|
||||
unsigned idx_mode = 0;
|
||||
writeback = (P == 0) || (W == 1);
|
||||
if (P && writeback)
|
||||
idx_mode = ARMII_IndexModePre;
|
||||
else if (!P && writeback)
|
||||
@ -1560,15 +1572,15 @@ static DecodeStatus DecodeAddrMode2IdxInstruction(MCInst *Inst, unsigned Insn,
|
||||
default:
|
||||
return MCDisassembler_Fail;
|
||||
}
|
||||
unsigned amt = fieldFromInstruction_4(Insn, 7, 5);
|
||||
amt = fieldFromInstruction_4(Insn, 7, 5);
|
||||
if (Opc == ARM_AM_ror && amt == 0)
|
||||
Opc = ARM_AM_rrx;
|
||||
unsigned imm = ARM_AM_getAM2Opc(Op, amt, Opc, idx_mode);
|
||||
imm = ARM_AM_getAM2Opc(Op, amt, Opc, idx_mode);
|
||||
|
||||
MCInst_addOperand(Inst, MCOperand_CreateImm(imm));
|
||||
} else {
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(0));
|
||||
unsigned tmp = ARM_AM_getAM2Opc(Op, imm, ARM_AM_lsl, idx_mode);
|
||||
tmp = ARM_AM_getAM2Opc(Op, imm, ARM_AM_lsl, idx_mode);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateImm(tmp));
|
||||
}
|
||||
|
||||
@ -1583,7 +1595,7 @@ static DecodeStatus DecodeSORegMemOperand(MCInst *Inst, unsigned Val,
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
ARM_AM_ShiftOpc ShOp;
|
||||
|
||||
unsigned shift;
|
||||
unsigned Rn = fieldFromInstruction_4(Val, 13, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Val, 0, 4);
|
||||
unsigned type = fieldFromInstruction_4(Val, 5, 2);
|
||||
@ -1613,7 +1625,6 @@ static DecodeStatus DecodeSORegMemOperand(MCInst *Inst, unsigned Val,
|
||||
return MCDisassembler_Fail;
|
||||
if (!Check(&S, DecodeGPRRegisterClass(Inst, Rm, Address, Decoder)))
|
||||
return MCDisassembler_Fail;
|
||||
unsigned shift;
|
||||
if (U)
|
||||
shift = ARM_AM_getAM2Opc(ARM_AM_add, imm, ShOp, 0);
|
||||
else
|
||||
@ -2248,13 +2259,13 @@ static DecodeStatus DecodeVLDInstruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned wb, Rn, Rm;
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned wb = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
wb = fieldFromInstruction_4(Insn, 16, 4);
|
||||
Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
Rn |= fieldFromInstruction_4(Insn, 4, 2) << 4;
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
|
||||
// First output register
|
||||
switch (MCInst_getOpcode(Inst)) {
|
||||
@ -2522,13 +2533,14 @@ static DecodeStatus DecodeVLDInstruction(MCInst *Inst, unsigned Insn,
|
||||
static DecodeStatus DecodeVLDST1Instruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned load;
|
||||
unsigned type = fieldFromInstruction_4(Insn, 8, 4);
|
||||
unsigned align = fieldFromInstruction_4(Insn, 4, 2);
|
||||
if (type == 6 && (align & 2)) return MCDisassembler_Fail;
|
||||
if (type == 7 && (align & 2)) return MCDisassembler_Fail;
|
||||
if (type == 10 && align == 3) return MCDisassembler_Fail;
|
||||
|
||||
unsigned load = fieldFromInstruction_4(Insn, 21, 1);
|
||||
load = fieldFromInstruction_4(Insn, 21, 1);
|
||||
return load ? DecodeVLDInstruction(Inst, Insn, Address, Decoder)
|
||||
: DecodeVSTInstruction(Inst, Insn, Address, Decoder);
|
||||
}
|
||||
@ -2536,15 +2548,16 @@ static DecodeStatus DecodeVLDST1Instruction(MCInst *Inst, unsigned Insn,
|
||||
static DecodeStatus DecodeVLDST2Instruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned type, align, load;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 6, 2);
|
||||
if (size == 3) return MCDisassembler_Fail;
|
||||
|
||||
unsigned type = fieldFromInstruction_4(Insn, 8, 4);
|
||||
unsigned align = fieldFromInstruction_4(Insn, 4, 2);
|
||||
type = fieldFromInstruction_4(Insn, 8, 4);
|
||||
align = fieldFromInstruction_4(Insn, 4, 2);
|
||||
if (type == 8 && align == 3) return MCDisassembler_Fail;
|
||||
if (type == 9 && align == 3) return MCDisassembler_Fail;
|
||||
|
||||
unsigned load = fieldFromInstruction_4(Insn, 21, 1);
|
||||
load = fieldFromInstruction_4(Insn, 21, 1);
|
||||
return load ? DecodeVLDInstruction(Inst, Insn, Address, Decoder)
|
||||
: DecodeVSTInstruction(Inst, Insn, Address, Decoder);
|
||||
}
|
||||
@ -2552,13 +2565,14 @@ static DecodeStatus DecodeVLDST2Instruction(MCInst *Inst, unsigned Insn,
|
||||
static DecodeStatus DecodeVLDST3Instruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned align, load;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 6, 2);
|
||||
if (size == 3) return MCDisassembler_Fail;
|
||||
|
||||
unsigned align = fieldFromInstruction_4(Insn, 4, 2);
|
||||
align = fieldFromInstruction_4(Insn, 4, 2);
|
||||
if (align & 2) return MCDisassembler_Fail;
|
||||
|
||||
unsigned load = fieldFromInstruction_4(Insn, 21, 1);
|
||||
load = fieldFromInstruction_4(Insn, 21, 1);
|
||||
return load ? DecodeVLDInstruction(Inst, Insn, Address, Decoder)
|
||||
: DecodeVSTInstruction(Inst, Insn, Address, Decoder);
|
||||
}
|
||||
@ -2566,10 +2580,11 @@ static DecodeStatus DecodeVLDST3Instruction(MCInst *Inst, unsigned Insn,
|
||||
static DecodeStatus DecodeVLDST4Instruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned load;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 6, 2);
|
||||
if (size == 3) return MCDisassembler_Fail;
|
||||
|
||||
unsigned load = fieldFromInstruction_4(Insn, 21, 1);
|
||||
load = fieldFromInstruction_4(Insn, 21, 1);
|
||||
return load ? DecodeVLDInstruction(Inst, Insn, Address, Decoder)
|
||||
: DecodeVSTInstruction(Inst, Insn, Address, Decoder);
|
||||
}
|
||||
@ -2578,13 +2593,13 @@ static DecodeStatus DecodeVSTInstruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned wb, Rn, Rm;
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned wb = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
wb = fieldFromInstruction_4(Insn, 16, 4);
|
||||
Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
Rn |= fieldFromInstruction_4(Insn, 4, 2) << 4;
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
|
||||
// Writeback Operand
|
||||
switch (MCInst_getOpcode(Inst)) {
|
||||
@ -2850,13 +2865,13 @@ static DecodeStatus DecodeVLD1DupInstruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned Rn, Rm, align, size;
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned align = fieldFromInstruction_4(Insn, 4, 1);
|
||||
unsigned size = fieldFromInstruction_4(Insn, 6, 2);
|
||||
Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
align = fieldFromInstruction_4(Insn, 4, 1);
|
||||
size = fieldFromInstruction_4(Insn, 6, 2);
|
||||
|
||||
if (size == 0 && align == 1)
|
||||
return MCDisassembler_Fail;
|
||||
@ -2898,13 +2913,13 @@ static DecodeStatus DecodeVLD2DupInstruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned Rn, Rm, align, size;
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned align = fieldFromInstruction_4(Insn, 4, 1);
|
||||
unsigned size = 1 << fieldFromInstruction_4(Insn, 6, 2);
|
||||
Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
align = fieldFromInstruction_4(Insn, 4, 1);
|
||||
size = 1 << fieldFromInstruction_4(Insn, 6, 2);
|
||||
align *= 2*size;
|
||||
|
||||
switch (MCInst_getOpcode(Inst)) {
|
||||
@ -2947,12 +2962,12 @@ static DecodeStatus DecodeVLD3DupInstruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned Rn, Rm, inc;
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned inc = fieldFromInstruction_4(Insn, 5, 1) + 1;
|
||||
Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
inc = fieldFromInstruction_4(Insn, 5, 1) + 1;
|
||||
|
||||
if (!Check(&S, DecodeDPRRegisterClass(Inst, Rd, Address, Decoder)))
|
||||
return MCDisassembler_Fail;
|
||||
@ -2983,14 +2998,14 @@ static DecodeStatus DecodeVLD4DupInstruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned Rn, Rm, size, inc, align;
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned size = fieldFromInstruction_4(Insn, 6, 2);
|
||||
unsigned inc = fieldFromInstruction_4(Insn, 5, 1) + 1;
|
||||
unsigned align = fieldFromInstruction_4(Insn, 4, 1);
|
||||
Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
size = fieldFromInstruction_4(Insn, 6, 2);
|
||||
inc = fieldFromInstruction_4(Insn, 5, 1) + 1;
|
||||
align = fieldFromInstruction_4(Insn, 4, 1);
|
||||
|
||||
if (size == 0x3) {
|
||||
if (align == 0)
|
||||
@ -3032,20 +3047,19 @@ static DecodeStatus DecodeVLD4DupInstruction(MCInst *Inst, unsigned Insn,
|
||||
return S;
|
||||
}
|
||||
|
||||
static DecodeStatus
|
||||
DecodeNEONModImmInstruction(MCInst *Inst, unsigned Insn,
|
||||
static DecodeStatus DecodeNEONModImmInstruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned imm, Q;
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned imm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
imm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
imm |= fieldFromInstruction_4(Insn, 16, 3) << 4;
|
||||
imm |= fieldFromInstruction_4(Insn, 24, 1) << 7;
|
||||
imm |= fieldFromInstruction_4(Insn, 8, 4) << 8;
|
||||
imm |= fieldFromInstruction_4(Insn, 5, 1) << 12;
|
||||
unsigned Q = fieldFromInstruction_4(Insn, 6, 1);
|
||||
Q = fieldFromInstruction_4(Insn, 6, 1);
|
||||
|
||||
if (Q) {
|
||||
if (!Check(&S, DecodeQPRRegisterClass(Inst, Rd, Address, Decoder)))
|
||||
@ -3083,12 +3097,12 @@ static DecodeStatus DecodeVSHLMaxInstruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned Rm, size;
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
Rm |= fieldFromInstruction_4(Insn, 5, 1) << 4;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 18, 2);
|
||||
size = fieldFromInstruction_4(Insn, 18, 2);
|
||||
|
||||
if (!Check(&S, DecodeQPRRegisterClass(Inst, Rd, Address, Decoder)))
|
||||
return MCDisassembler_Fail;
|
||||
@ -3131,14 +3145,14 @@ static DecodeStatus DecodeTBLInstruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned Rn, Rm, op;
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
Rn |= fieldFromInstruction_4(Insn, 7, 1) << 4;
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
Rm |= fieldFromInstruction_4(Insn, 5, 1) << 4;
|
||||
unsigned op = fieldFromInstruction_4(Insn, 6, 1);
|
||||
op = fieldFromInstruction_4(Insn, 6, 1);
|
||||
|
||||
if (!Check(&S, DecodeDPRRegisterClass(Inst, Rd, Address, Decoder)))
|
||||
return MCDisassembler_Fail;
|
||||
@ -3294,7 +3308,7 @@ static DecodeStatus DecodeT2LoadShift(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned addrmode;
|
||||
unsigned Rt = fieldFromInstruction_4(Insn, 12, 4);
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
|
||||
@ -3353,7 +3367,7 @@ static DecodeStatus DecodeT2LoadShift(MCInst *Inst, unsigned Insn,
|
||||
return MCDisassembler_Fail;
|
||||
}
|
||||
|
||||
unsigned addrmode = fieldFromInstruction_4(Insn, 4, 2);
|
||||
addrmode = fieldFromInstruction_4(Insn, 4, 2);
|
||||
addrmode |= fieldFromInstruction_4(Insn, 0, 4) << 2;
|
||||
addrmode |= fieldFromInstruction_4(Insn, 16, 4) << 6;
|
||||
if (!Check(&S, DecodeT2AddrModeSOReg(Inst, addrmode, Address, Decoder)))
|
||||
@ -3690,13 +3704,13 @@ static DecodeStatus DecodeT2LdStPre(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned load;
|
||||
unsigned Rt = fieldFromInstruction_4(Insn, 12, 4);
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned addr = fieldFromInstruction_4(Insn, 0, 8);
|
||||
addr |= fieldFromInstruction_4(Insn, 9, 1) << 8;
|
||||
addr |= Rn << 9;
|
||||
unsigned load = fieldFromInstruction_4(Insn, 20, 1);
|
||||
load = fieldFromInstruction_4(Insn, 20, 1);
|
||||
|
||||
if (Rn == 15) {
|
||||
switch (MCInst_getOpcode(Inst)) {
|
||||
@ -3890,9 +3904,10 @@ static DecodeStatus DecodeThumb2BCCInstruction(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned brtarget;
|
||||
unsigned pred = fieldFromInstruction_4(Insn, 22, 4);
|
||||
if (pred == 0xE || pred == 0xF) {
|
||||
unsigned imm;
|
||||
unsigned opc = fieldFromInstruction_4(Insn, 4, 28);
|
||||
switch (opc) {
|
||||
default:
|
||||
@ -3908,11 +3923,11 @@ static DecodeStatus DecodeThumb2BCCInstruction(MCInst *Inst, unsigned Insn,
|
||||
break;
|
||||
}
|
||||
|
||||
unsigned imm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
imm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
return DecodeMemBarrierOption(Inst, imm, Address, Decoder);
|
||||
}
|
||||
|
||||
unsigned brtarget = fieldFromInstruction_4(Insn, 0, 11) << 1;
|
||||
brtarget = fieldFromInstruction_4(Insn, 0, 11) << 1;
|
||||
brtarget |= fieldFromInstruction_4(Insn, 11, 1) << 19;
|
||||
brtarget |= fieldFromInstruction_4(Insn, 13, 1) << 18;
|
||||
brtarget |= fieldFromInstruction_4(Insn, 16, 6) << 12;
|
||||
@ -4070,13 +4085,13 @@ static DecodeStatus DecodeLDRPreImm(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned pred;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rt = fieldFromInstruction_4(Insn, 12, 4);
|
||||
unsigned imm = fieldFromInstruction_4(Insn, 0, 12);
|
||||
imm |= fieldFromInstruction_4(Insn, 16, 4) << 13;
|
||||
imm |= fieldFromInstruction_4(Insn, 23, 1) << 12;
|
||||
unsigned pred = fieldFromInstruction_4(Insn, 28, 4);
|
||||
pred = fieldFromInstruction_4(Insn, 28, 4);
|
||||
|
||||
if (Rn == 0xF || Rn == Rt) S = MCDisassembler_SoftFail;
|
||||
|
||||
@ -4096,14 +4111,14 @@ static DecodeStatus DecodeLDRPreReg(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned pred, Rm;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rt = fieldFromInstruction_4(Insn, 12, 4);
|
||||
unsigned imm = fieldFromInstruction_4(Insn, 0, 12);
|
||||
imm |= fieldFromInstruction_4(Insn, 16, 4) << 13;
|
||||
imm |= fieldFromInstruction_4(Insn, 23, 1) << 12;
|
||||
unsigned pred = fieldFromInstruction_4(Insn, 28, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
pred = fieldFromInstruction_4(Insn, 28, 4);
|
||||
Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
|
||||
if (Rn == 0xF || Rn == Rt) S = MCDisassembler_SoftFail;
|
||||
if (Rm == 0xF) S = MCDisassembler_SoftFail;
|
||||
@ -4124,13 +4139,13 @@ static DecodeStatus DecodeSTRPreImm(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned pred;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rt = fieldFromInstruction_4(Insn, 12, 4);
|
||||
unsigned imm = fieldFromInstruction_4(Insn, 0, 12);
|
||||
imm |= fieldFromInstruction_4(Insn, 16, 4) << 13;
|
||||
imm |= fieldFromInstruction_4(Insn, 23, 1) << 12;
|
||||
unsigned pred = fieldFromInstruction_4(Insn, 28, 4);
|
||||
pred = fieldFromInstruction_4(Insn, 28, 4);
|
||||
|
||||
if (Rn == 0xF || Rn == Rt) S = MCDisassembler_SoftFail;
|
||||
|
||||
@ -4150,13 +4165,13 @@ static DecodeStatus DecodeSTRPreReg(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned pred;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rt = fieldFromInstruction_4(Insn, 12, 4);
|
||||
unsigned imm = fieldFromInstruction_4(Insn, 0, 12);
|
||||
imm |= fieldFromInstruction_4(Insn, 16, 4) << 13;
|
||||
imm |= fieldFromInstruction_4(Insn, 23, 1) << 12;
|
||||
unsigned pred = fieldFromInstruction_4(Insn, 28, 4);
|
||||
pred = fieldFromInstruction_4(Insn, 28, 4);
|
||||
|
||||
if (Rn == 0xF || Rn == Rt) S = MCDisassembler_SoftFail;
|
||||
|
||||
@ -4176,15 +4191,13 @@ static DecodeStatus DecodeVLD1LN(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned size, align = 0, index = 0;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
|
||||
unsigned align = 0;
|
||||
unsigned index = 0;
|
||||
switch (size) {
|
||||
default:
|
||||
return MCDisassembler_Fail;
|
||||
@ -4244,15 +4257,13 @@ static DecodeStatus DecodeVST1LN(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned size, align = 0, index = 0;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
|
||||
unsigned align = 0;
|
||||
unsigned index = 0;
|
||||
switch (size) {
|
||||
default:
|
||||
return MCDisassembler_Fail;
|
||||
@ -4310,16 +4321,13 @@ static DecodeStatus DecodeVLD2LN(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned size, align = 0, index = 0, inc = 1;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
|
||||
unsigned align = 0;
|
||||
unsigned index = 0;
|
||||
unsigned inc = 1;
|
||||
switch (size) {
|
||||
default:
|
||||
return MCDisassembler_Fail;
|
||||
@ -4378,16 +4386,13 @@ static DecodeStatus DecodeVST2LN(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned size, align = 0, index = 0, inc = 1;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
|
||||
unsigned align = 0;
|
||||
unsigned index = 0;
|
||||
unsigned inc = 1;
|
||||
switch (size) {
|
||||
default:
|
||||
return MCDisassembler_Fail;
|
||||
@ -4442,16 +4447,13 @@ static DecodeStatus DecodeVLD3LN(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned size, align = 0, index = 0, inc = 1;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
|
||||
unsigned align = 0;
|
||||
unsigned index = 0;
|
||||
unsigned inc = 1;
|
||||
switch (size) {
|
||||
default:
|
||||
return MCDisassembler_Fail;
|
||||
@ -4513,16 +4515,13 @@ static DecodeStatus DecodeVST3LN(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned size, align = 0, index = 0, inc = 1;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
|
||||
unsigned align = 0;
|
||||
unsigned index = 0;
|
||||
unsigned inc = 1;
|
||||
switch (size) {
|
||||
default:
|
||||
return MCDisassembler_Fail;
|
||||
@ -4577,16 +4576,13 @@ static DecodeStatus DecodeVLD4LN(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned size, align = 0, index = 0, inc = 1;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
|
||||
unsigned align = 0;
|
||||
unsigned index = 0;
|
||||
unsigned inc = 1;
|
||||
switch (size) {
|
||||
default:
|
||||
return MCDisassembler_Fail;
|
||||
@ -4659,16 +4655,13 @@ static DecodeStatus DecodeVST4LN(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned size, align = 0, index = 0, inc = 1;
|
||||
unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Insn, 0, 4);
|
||||
unsigned Rd = fieldFromInstruction_4(Insn, 12, 4);
|
||||
Rd |= fieldFromInstruction_4(Insn, 22, 1) << 4;
|
||||
unsigned size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
size = fieldFromInstruction_4(Insn, 10, 2);
|
||||
|
||||
unsigned align = 0;
|
||||
unsigned index = 0;
|
||||
unsigned inc = 1;
|
||||
switch (size) {
|
||||
default:
|
||||
return MCDisassembler_Fail;
|
||||
@ -4877,11 +4870,12 @@ static DecodeStatus DecodeT2STRDPreInstruction(MCInst *Inst, unsigned Insn,
|
||||
static DecodeStatus DecodeT2Adr(MCInst *Inst, uint32_t Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
unsigned Val;
|
||||
unsigned sign1 = fieldFromInstruction_4(Insn, 21, 1);
|
||||
unsigned sign2 = fieldFromInstruction_4(Insn, 23, 1);
|
||||
if (sign1 != sign2) return MCDisassembler_Fail;
|
||||
|
||||
unsigned Val = fieldFromInstruction_4(Insn, 0, 8);
|
||||
Val = fieldFromInstruction_4(Insn, 0, 8);
|
||||
Val |= fieldFromInstruction_4(Insn, 12, 3) << 8;
|
||||
Val |= fieldFromInstruction_4(Insn, 26, 1) << 11;
|
||||
Val |= sign1 << 12;
|
||||
@ -4934,15 +4928,15 @@ static DecodeStatus DecodeSwap(MCInst *Inst, unsigned Insn,
|
||||
static DecodeStatus DecodeVCVTD(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
unsigned Vm, imm, cmode, op;
|
||||
unsigned Vd = (fieldFromInstruction_4(Insn, 12, 4) << 0);
|
||||
Vd |= (fieldFromInstruction_4(Insn, 22, 1) << 4);
|
||||
unsigned Vm = (fieldFromInstruction_4(Insn, 0, 4) << 0);
|
||||
Vm = (fieldFromInstruction_4(Insn, 0, 4) << 0);
|
||||
Vm |= (fieldFromInstruction_4(Insn, 5, 1) << 4);
|
||||
unsigned imm = fieldFromInstruction_4(Insn, 16, 6);
|
||||
unsigned cmode = fieldFromInstruction_4(Insn, 8, 4);
|
||||
unsigned op = fieldFromInstruction_4(Insn, 5, 1);
|
||||
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
imm = fieldFromInstruction_4(Insn, 16, 6);
|
||||
cmode = fieldFromInstruction_4(Insn, 8, 4);
|
||||
op = fieldFromInstruction_4(Insn, 5, 1);
|
||||
|
||||
// VMOVv2f32 is ambiguous with these decodings.
|
||||
if (!(imm & 0x38) && cmode == 0xF) {
|
||||
@ -4965,15 +4959,15 @@ static DecodeStatus DecodeVCVTD(MCInst *Inst, unsigned Insn,
|
||||
static DecodeStatus DecodeVCVTQ(MCInst *Inst, unsigned Insn,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
unsigned Vm, imm, cmode, op;
|
||||
unsigned Vd = (fieldFromInstruction_4(Insn, 12, 4) << 0);
|
||||
Vd |= (fieldFromInstruction_4(Insn, 22, 1) << 4);
|
||||
unsigned Vm = (fieldFromInstruction_4(Insn, 0, 4) << 0);
|
||||
Vm = (fieldFromInstruction_4(Insn, 0, 4) << 0);
|
||||
Vm |= (fieldFromInstruction_4(Insn, 5, 1) << 4);
|
||||
unsigned imm = fieldFromInstruction_4(Insn, 16, 6);
|
||||
unsigned cmode = fieldFromInstruction_4(Insn, 8, 4);
|
||||
unsigned op = fieldFromInstruction_4(Insn, 5, 1);
|
||||
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
imm = fieldFromInstruction_4(Insn, 16, 6);
|
||||
cmode = fieldFromInstruction_4(Insn, 8, 4);
|
||||
op = fieldFromInstruction_4(Insn, 5, 1);
|
||||
|
||||
// VMOVv4f32 is ambiguous with these decodings.
|
||||
if (!(imm & 0x38) && cmode == 0xF) {
|
||||
@ -4997,12 +4991,12 @@ static DecodeStatus DecodeLDR(MCInst *Inst, unsigned Val,
|
||||
uint64_t Address, const void *Decoder)
|
||||
{
|
||||
DecodeStatus S = MCDisassembler_Success;
|
||||
|
||||
unsigned Cond;
|
||||
unsigned Rn = fieldFromInstruction_4(Val, 16, 4);
|
||||
unsigned Rt = fieldFromInstruction_4(Val, 12, 4);
|
||||
unsigned Rm = fieldFromInstruction_4(Val, 0, 4);
|
||||
Rm |= (fieldFromInstruction_4(Val, 23, 1) << 4);
|
||||
unsigned Cond = fieldFromInstruction_4(Val, 28, 4);
|
||||
Cond = fieldFromInstruction_4(Val, 28, 4);
|
||||
|
||||
if (fieldFromInstruction_4(Val, 8, 4) != 0 || Rn == Rt)
|
||||
S = MCDisassembler_SoftFail;
|
||||
@ -5050,3 +5044,4 @@ static DecodeStatus DecodeMRRC2(MCInst *Inst, unsigned Val,
|
||||
return S;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -9960,104 +9960,109 @@ static uint8_t DecoderTablev8NEON32[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static bool getbool(uint64_t b)
|
||||
{
|
||||
return b != 0;
|
||||
}
|
||||
|
||||
static bool checkDecoderPredicate(unsigned Idx, uint64_t Bits)
|
||||
{
|
||||
switch (Idx) {
|
||||
default: // llvm_unreachable("Invalid index!");
|
||||
case 0:
|
||||
return (bool)(!(Bits & ARM_ModeThumb));
|
||||
return getbool(!(Bits & ARM_ModeThumb));
|
||||
case 1:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV6Ops));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV6Ops));
|
||||
case 2:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV8Ops) && (Bits & ARM_FeatureCRC));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV8Ops) && (Bits & ARM_FeatureCRC));
|
||||
case 3:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV5TEOps));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV5TEOps));
|
||||
case 4:
|
||||
return (bool)(!(Bits & ARM_HasV8Ops));
|
||||
return getbool(!(Bits & ARM_HasV8Ops));
|
||||
case 5:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV8Ops));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV8Ops));
|
||||
case 6:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV4TOps));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV4TOps));
|
||||
case 7:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV5TOps));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV5TOps));
|
||||
case 8:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_FeatureTrustZone));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_FeatureTrustZone));
|
||||
case 9:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV6T2Ops));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV6T2Ops));
|
||||
case 10:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV7Ops));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV7Ops));
|
||||
case 11:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV7Ops) && (Bits & ARM_FeatureMP));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_HasV7Ops) && (Bits & ARM_FeatureMP));
|
||||
case 12:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_FeatureDB));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_FeatureDB));
|
||||
case 13:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_FeatureHWDivARM));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_FeatureHWDivARM));
|
||||
case 14:
|
||||
return (bool)(!(Bits & ARM_ModeThumb) && (Bits & ARM_FeatureNaClTrap));
|
||||
return getbool(!(Bits & ARM_ModeThumb) && (Bits & ARM_FeatureNaClTrap));
|
||||
case 15:
|
||||
return (bool)((Bits & ARM_FeatureNEON));
|
||||
return getbool((Bits & ARM_FeatureNEON));
|
||||
case 16:
|
||||
return (bool)((Bits & ARM_HasV8Ops) && (Bits & ARM_FeatureCrypto));
|
||||
return getbool((Bits & ARM_HasV8Ops) && (Bits & ARM_FeatureCrypto));
|
||||
case 17:
|
||||
return (bool)((Bits & ARM_FeatureNEON) && (Bits & ARM_FeatureFP16));
|
||||
return getbool((Bits & ARM_FeatureNEON) && (Bits & ARM_FeatureFP16));
|
||||
case 18:
|
||||
return (bool)((Bits & ARM_FeatureNEON) && (Bits & ARM_FeatureVFP4));
|
||||
return getbool((Bits & ARM_FeatureNEON) && (Bits & ARM_FeatureVFP4));
|
||||
case 19:
|
||||
return (bool)((Bits & ARM_ModeThumb));
|
||||
return getbool((Bits & ARM_ModeThumb));
|
||||
case 20:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_HasV5TOps));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_HasV5TOps));
|
||||
case 21:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_HasV6Ops));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_HasV6Ops));
|
||||
case 22:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2));
|
||||
case 23:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_HasV8Ops));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_HasV8Ops));
|
||||
case 24:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_HasV6MOps));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_HasV6MOps));
|
||||
case 25:
|
||||
return (bool)((Bits & ARM_FeatureT2XtPk) && (Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2));
|
||||
return getbool((Bits & ARM_FeatureT2XtPk) && (Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2));
|
||||
case 26:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && !(Bits & ARM_HasV8Ops));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && !(Bits & ARM_HasV8Ops));
|
||||
case 27:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_FeatureDSPThumb2));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_FeatureDSPThumb2));
|
||||
case 28:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_HasV7Ops));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_HasV7Ops));
|
||||
case 29:
|
||||
return (bool)((Bits & ARM_FeatureDB));
|
||||
return getbool((Bits & ARM_FeatureDB));
|
||||
case 30:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && !(Bits & ARM_FeatureMClass));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && !(Bits & ARM_FeatureMClass));
|
||||
case 31:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureMClass));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureMClass));
|
||||
case 32:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_HasV8Ops));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_HasV8Ops));
|
||||
case 33:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_FeatureTrustZone));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_FeatureTrustZone));
|
||||
case 34:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_HasV7Ops) && (Bits & ARM_FeatureMP));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_HasV7Ops) && (Bits & ARM_FeatureMP));
|
||||
case 35:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_FeatureT2XtPk));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_FeatureT2XtPk));
|
||||
case 36:
|
||||
return (bool)((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_HasV8Ops) && (Bits & ARM_FeatureCRC));
|
||||
return getbool((Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2) && (Bits & ARM_HasV8Ops) && (Bits & ARM_FeatureCRC));
|
||||
case 37:
|
||||
return (bool)((Bits & ARM_FeatureHWDiv) && (Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2));
|
||||
return getbool((Bits & ARM_FeatureHWDiv) && (Bits & ARM_ModeThumb) && (Bits & ARM_FeatureThumb2));
|
||||
case 38:
|
||||
return (bool)((Bits & ARM_FeatureVFP2));
|
||||
return getbool((Bits & ARM_FeatureVFP2));
|
||||
case 39:
|
||||
return (bool)((Bits & ARM_FeatureVFP2) && !(Bits & ARM_FeatureVFPOnlySP));
|
||||
return getbool((Bits & ARM_FeatureVFP2) && !(Bits & ARM_FeatureVFPOnlySP));
|
||||
case 40:
|
||||
return (bool)((Bits & ARM_FeatureVFP4));
|
||||
return getbool((Bits & ARM_FeatureVFP4));
|
||||
case 41:
|
||||
return (bool)((Bits & ARM_FeatureVFP4) && !(Bits & ARM_FeatureVFPOnlySP));
|
||||
return getbool((Bits & ARM_FeatureVFP4) && !(Bits & ARM_FeatureVFPOnlySP));
|
||||
case 42:
|
||||
return (bool)((Bits & ARM_FeatureVFP3));
|
||||
return getbool((Bits & ARM_FeatureVFP3));
|
||||
case 43:
|
||||
return (bool)((Bits & ARM_FeatureFPARMv8));
|
||||
return getbool((Bits & ARM_FeatureFPARMv8));
|
||||
case 44:
|
||||
return (bool)((Bits & ARM_FeatureVFP3) && !(Bits & ARM_FeatureVFPOnlySP));
|
||||
return getbool((Bits & ARM_FeatureVFP3) && !(Bits & ARM_FeatureVFPOnlySP));
|
||||
case 45:
|
||||
return (bool)((Bits & ARM_FeatureFPARMv8) && !(Bits & ARM_FeatureVFPOnlySP));
|
||||
return getbool((Bits & ARM_FeatureFPARMv8) && !(Bits & ARM_FeatureVFPOnlySP));
|
||||
case 46:
|
||||
return (bool)((Bits & ARM_HasV8Ops) && (Bits & ARM_FeatureNEON));
|
||||
return getbool((Bits & ARM_HasV8Ops) && (Bits & ARM_FeatureNEON));
|
||||
}
|
||||
}
|
||||
|
||||
@ -13449,48 +13454,48 @@ static DecodeStatus fname(uint8_t DecodeTable[], MCInst *MI, \
|
||||
{ \
|
||||
uint64_t Bits = getFeatureBits(feature); \
|
||||
uint8_t *Ptr = DecodeTable; \
|
||||
uint32_t CurFieldValue = 0; \
|
||||
uint32_t CurFieldValue = 0, ExpectedValue; \
|
||||
DecodeStatus S = MCDisassembler_Success; \
|
||||
unsigned Start, Len, NumToSkip, PIdx, Opc, DecodeIdx; \
|
||||
InsnType Val, FieldValue, PositiveMask, NegativeMask; \
|
||||
bool Pred, Fail; \
|
||||
for (;;) { \
|
||||
switch (*Ptr) { \
|
||||
default: \
|
||||
return MCDisassembler_Fail; \
|
||||
case MCD_OPC_ExtractField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
++Ptr; \
|
||||
CurFieldValue = fieldname(insn, Start, Len); \
|
||||
CurFieldValue = (uint32_t)fieldname(insn, Start, Len); \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_FilterValue: { \
|
||||
unsigned Len; \
|
||||
InsnType Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (Val != CurFieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
InsnType FieldValue = fieldname(insn, Start, Len); \
|
||||
uint32_t ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
FieldValue = fieldname(insn, Start, Len); \
|
||||
ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (ExpectedValue != FieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckPredicate: { \
|
||||
unsigned Len; \
|
||||
unsigned PIdx = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
PIdx = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
bool Pred; \
|
||||
Pred = checkDecoderPredicate(PIdx, Bits); \
|
||||
if (!Pred) \
|
||||
Ptr += NumToSkip; \
|
||||
@ -13498,21 +13503,19 @@ static DecodeStatus fname(uint8_t DecodeTable[], MCInst *MI, \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_Decode: { \
|
||||
unsigned Len; \
|
||||
unsigned Opc = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Opc = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned DecodeIdx = (uint32_t)decodeULEB128(Ptr, &Len); \
|
||||
DecodeIdx = (uint32_t)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
MCInst_setOpcode(MI, Opc); \
|
||||
return decoder(S, DecodeIdx, insn, MI, Address, MRI); \
|
||||
} \
|
||||
case MCD_OPC_SoftFail: { \
|
||||
unsigned Len; \
|
||||
InsnType PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
InsnType NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
bool Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
if (Fail) \
|
||||
S = MCDisassembler_SoftFail; \
|
||||
break; \
|
||||
|
@ -11,11 +11,12 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_ARM
|
||||
|
||||
#include <stdio.h> // DEBUG
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
@ -269,7 +270,7 @@ void ARM_printInst(MCInst *MI, SStream *O, void *Info)
|
||||
{
|
||||
MCRegisterInfo *MRI = (MCRegisterInfo *)Info;
|
||||
|
||||
unsigned Opcode = MCInst_getOpcode(MI);
|
||||
unsigned Opcode = MCInst_getOpcode(MI), tmp, i;
|
||||
|
||||
switch(Opcode) {
|
||||
// Check for HINT instructions w/ canonical names.
|
||||
@ -374,7 +375,7 @@ void ARM_printInst(MCInst *MI, SStream *O, void *Info)
|
||||
}
|
||||
|
||||
SStream_concat(O, ", %s", markup("<imm:"));
|
||||
unsigned tmp = translateShiftImm(getSORegOffset((unsigned int)MCOperand_getImm(MO2)));
|
||||
tmp = translateShiftImm(getSORegOffset((unsigned int)MCOperand_getImm(MO2)));
|
||||
if (tmp > HEX_THRESHOLD)
|
||||
SStream_concat(O, "#0x%x", tmp);
|
||||
else
|
||||
@ -518,25 +519,24 @@ void ARM_printInst(MCInst *MI, SStream *O, void *Info)
|
||||
bool isStore = Opcode == ARM_STREXD || Opcode == ARM_STLEXD;
|
||||
|
||||
unsigned Reg = MCOperand_getReg(MCInst_getOperand(MI, isStore ? 1 : 0));
|
||||
if (MCRegisterClass_contains(MRC, Reg)) {
|
||||
MCInst NewMI;
|
||||
MCOperand *NewReg;
|
||||
MCInst_setOpcode(&NewMI, Opcode);
|
||||
if (MCRegisterClass_contains(MRC, Reg)) {
|
||||
MCInst NewMI;
|
||||
MCOperand *NewReg;
|
||||
MCInst_setOpcode(&NewMI, Opcode);
|
||||
|
||||
if (isStore)
|
||||
MCInst_addOperand2(&NewMI, MCInst_getOperand(MI, 0));
|
||||
NewReg = MCOperand_CreateReg(MCRegisterInfo_getMatchingSuperReg(MRI, Reg, ARM_gsub_0,
|
||||
MCRegisterInfo_getRegClass(MRI, ARM_GPRPairRegClassID)));
|
||||
MCInst_addOperand2(&NewMI, NewReg);
|
||||
cs_mem_free(NewReg);
|
||||
if (isStore)
|
||||
MCInst_addOperand2(&NewMI, MCInst_getOperand(MI, 0));
|
||||
NewReg = MCOperand_CreateReg(MCRegisterInfo_getMatchingSuperReg(MRI, Reg, ARM_gsub_0,
|
||||
MCRegisterInfo_getRegClass(MRI, ARM_GPRPairRegClassID)));
|
||||
MCInst_addOperand2(&NewMI, NewReg);
|
||||
cs_mem_free(NewReg);
|
||||
|
||||
// Copy the rest operands into NewMI.
|
||||
unsigned i;
|
||||
for(i= isStore ? 3 : 2; i < MCInst_getNumOperands(MI); ++i)
|
||||
MCInst_addOperand2(&NewMI, MCInst_getOperand(MI, i));
|
||||
printInstruction(&NewMI, O, MRI);
|
||||
return;
|
||||
}
|
||||
// Copy the rest operands into NewMI.
|
||||
for(i= isStore ? 3 : 2; i < MCInst_getNumOperands(MI); ++i)
|
||||
MCInst_addOperand2(&NewMI, MCInst_getOperand(MI, i));
|
||||
printInstruction(&NewMI, O, MRI);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -547,6 +547,7 @@ void ARM_printInst(MCInst *MI, SStream *O, void *Info)
|
||||
|
||||
static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
{
|
||||
int32_t imm;
|
||||
MCOperand *Op = MCInst_getOperand(MI, OpNo);
|
||||
if (MCOperand_isReg(Op)) {
|
||||
unsigned Reg = MCOperand_getReg(Op);
|
||||
@ -565,7 +566,7 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
}
|
||||
} else if (MCOperand_isImm(Op)) {
|
||||
SStream_concat(O, markup("<imm:"));
|
||||
int32_t imm = (int32_t)MCOperand_getImm(Op);
|
||||
imm = (int32_t)MCOperand_getImm(Op);
|
||||
|
||||
// relative branch only has relative offset, so we have to update it
|
||||
// to reflect absolute address.
|
||||
@ -618,11 +619,12 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
static void printThumbLdrLabelOperand(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
{
|
||||
MCOperand *MO1 = MCInst_getOperand(MI, OpNum);
|
||||
|
||||
int32_t OffImm;
|
||||
bool isSub;
|
||||
SStream_concat(O, "%s[pc, ", markup("<mem:"));
|
||||
|
||||
int32_t OffImm = (int32_t)MCOperand_getImm(MO1);
|
||||
bool isSub = OffImm < 0;
|
||||
OffImm = (int32_t)MCOperand_getImm(MO1);
|
||||
isSub = OffImm < 0;
|
||||
|
||||
// Special value for #-0. All others are normal.
|
||||
if (OffImm == INT32_MIN)
|
||||
@ -649,6 +651,7 @@ static void printSORegRegOperand(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
MCOperand *MO1 = MCInst_getOperand(MI, OpNum);
|
||||
MCOperand *MO2 = MCInst_getOperand(MI, OpNum+1);
|
||||
MCOperand *MO3 = MCInst_getOperand(MI, OpNum+2);
|
||||
ARM_AM_ShiftOpc ShOpc;
|
||||
|
||||
printRegName(MI->csh, O, MCOperand_getReg(MO1));
|
||||
|
||||
@ -661,7 +664,7 @@ static void printSORegRegOperand(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
}
|
||||
|
||||
// Print the shift opc.
|
||||
ARM_AM_ShiftOpc ShOpc = ARM_AM_getSORegShOp((unsigned int)MCOperand_getImm(MO3));
|
||||
ShOpc = ARM_AM_getSORegShOp((unsigned int)MCOperand_getImm(MO3));
|
||||
SStream_concat(O, ", ");
|
||||
SStream_concat(O, ARM_AM_getShiftOpcStr(ShOpc));
|
||||
if (ShOpc == ARM_AM_rrx)
|
||||
@ -838,6 +841,7 @@ static void printAM3PostIndexOp(MCInst *MI, unsigned Op, SStream *O)
|
||||
MCOperand *MO2 = MCInst_getOperand(MI, Op+1);
|
||||
MCOperand *MO3 = MCInst_getOperand(MI, Op+2);
|
||||
ARM_AM_AddrOpc op = getAM3Op((unsigned int)MCOperand_getImm(MO3));
|
||||
unsigned ImmOffs;
|
||||
|
||||
SStream_concat(O, "%s[", markup("<mem:"));
|
||||
set_mem_access(MI, true);
|
||||
@ -858,7 +862,7 @@ static void printAM3PostIndexOp(MCInst *MI, unsigned Op, SStream *O)
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned ImmOffs = getAM3Offset((unsigned int)MCOperand_getImm(MO3));
|
||||
ImmOffs = getAM3Offset((unsigned int)MCOperand_getImm(MO3));
|
||||
if (ImmOffs > HEX_THRESHOLD)
|
||||
SStream_concat(O, "%s#%s0x%x%s", markup("<imm:"),
|
||||
ARM_AM_getAddrOpcStr(op), ImmOffs,
|
||||
@ -887,6 +891,7 @@ static void printAM3PreOrOffsetIndexOp(MCInst *MI, unsigned Op, SStream *O,
|
||||
MCOperand *MO2 = MCInst_getOperand(MI, Op+1);
|
||||
MCOperand *MO3 = MCInst_getOperand(MI, Op+2);
|
||||
ARM_AM_AddrOpc op = getAM3Op((unsigned int)MCOperand_getImm(MO3));
|
||||
unsigned ImmOffs;
|
||||
|
||||
SStream_concat(O, "%s[", markup("<mem:"));
|
||||
set_mem_access(MI, true);
|
||||
@ -908,7 +913,7 @@ static void printAM3PreOrOffsetIndexOp(MCInst *MI, unsigned Op, SStream *O,
|
||||
}
|
||||
|
||||
//If the op is sub we have to print the immediate even if it is 0
|
||||
unsigned ImmOffs = getAM3Offset((unsigned int)MCOperand_getImm(MO3));
|
||||
ImmOffs = getAM3Offset((unsigned int)MCOperand_getImm(MO3));
|
||||
|
||||
if (AlwaysPrintImm0 || ImmOffs || (op == ARM_AM_sub)) {
|
||||
if (ImmOffs > HEX_THRESHOLD)
|
||||
@ -933,14 +938,16 @@ static void printAM3PreOrOffsetIndexOp(MCInst *MI, unsigned Op, SStream *O,
|
||||
static void printAddrMode3Operand(MCInst *MI, unsigned Op, SStream *O,
|
||||
bool AlwaysPrintImm0)
|
||||
{
|
||||
unsigned IdxMode;
|
||||
MCOperand *MO3;
|
||||
MCOperand *MO1 = MCInst_getOperand(MI, Op);
|
||||
if (!MCOperand_isReg(MO1)) { // For label symbolic references.
|
||||
printOperand(MI, Op, O);
|
||||
return;
|
||||
}
|
||||
|
||||
MCOperand *MO3 = MCInst_getOperand(MI, Op+2);
|
||||
unsigned IdxMode = getAM3IdxMode((unsigned int)MCOperand_getImm(MO3));
|
||||
MO3 = MCInst_getOperand(MI, Op+2);
|
||||
IdxMode = getAM3IdxMode((unsigned int)MCOperand_getImm(MO3));
|
||||
|
||||
if (IdxMode == ARMII_IndexModePost) {
|
||||
printAM3PostIndexOp(MI, Op, O);
|
||||
@ -955,6 +962,7 @@ static void printAddrMode3OffsetOperand(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
MCOperand *MO1 = MCInst_getOperand(MI, OpNum);
|
||||
MCOperand *MO2 = MCInst_getOperand(MI, OpNum+1);
|
||||
ARM_AM_AddrOpc op = getAM3Op((unsigned int)MCOperand_getImm(MO2));
|
||||
unsigned ImmOffs;
|
||||
|
||||
if (MCOperand_getReg(MO1)) {
|
||||
SStream_concat(O, ARM_AM_getAddrOpcStr(op));
|
||||
@ -967,7 +975,7 @@ static void printAddrMode3OffsetOperand(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned ImmOffs = getAM3Offset((unsigned int)MCOperand_getImm(MO2));
|
||||
ImmOffs = getAM3Offset((unsigned int)MCOperand_getImm(MO2));
|
||||
if (ImmOffs > HEX_THRESHOLD)
|
||||
SStream_concat(O, "%s#%s0x%x%s", markup("<imm:"),
|
||||
ARM_AM_getAddrOpcStr(op), ImmOffs,
|
||||
@ -1036,7 +1044,7 @@ static void printAddrMode5Operand(MCInst *MI, unsigned OpNum, SStream *O,
|
||||
{
|
||||
MCOperand *MO1 = MCInst_getOperand(MI, OpNum);
|
||||
MCOperand *MO2 = MCInst_getOperand(MI, OpNum+1);
|
||||
|
||||
unsigned ImmOffs, Op;
|
||||
if (!MCOperand_isReg(MO1)) { // FIXME: This is for CP entries, but isn't right.
|
||||
printOperand(MI, OpNum, O);
|
||||
return;
|
||||
@ -1045,8 +1053,8 @@ static void printAddrMode5Operand(MCInst *MI, unsigned OpNum, SStream *O,
|
||||
SStream_concat(O, "%s[", markup("<mem:"));
|
||||
printRegName(MI->csh, O, MCOperand_getReg(MO1));
|
||||
|
||||
unsigned ImmOffs = ARM_AM_getAM5Offset((unsigned int)MCOperand_getImm(MO2));
|
||||
unsigned Op = ARM_AM_getAM5Op((unsigned int)MCOperand_getImm(MO2));
|
||||
ImmOffs = ARM_AM_getAM5Offset((unsigned int)MCOperand_getImm(MO2));
|
||||
Op = ARM_AM_getAM5Op((unsigned int)MCOperand_getImm(MO2));
|
||||
if (AlwaysPrintImm0 || ImmOffs || Op == ARM_AM_sub) {
|
||||
if (ImmOffs * 4 > HEX_THRESHOLD)
|
||||
SStream_concat(O, ", %s#%s0x%x%s", markup("<imm:"),
|
||||
@ -1064,13 +1072,14 @@ static void printAddrMode6Operand(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
{
|
||||
MCOperand *MO1 = MCInst_getOperand(MI, OpNum);
|
||||
MCOperand *MO2 = MCInst_getOperand(MI, OpNum+1);
|
||||
unsigned tmp;
|
||||
|
||||
SStream_concat(O, "%s[", markup("<mem:"));
|
||||
set_mem_access(MI, true);
|
||||
printRegName(MI->csh, O, MCOperand_getReg(MO1));
|
||||
if (MI->csh->detail)
|
||||
MI->flat_insn.arm.operands[MI->flat_insn.arm.op_count].mem.base = MCOperand_getReg(MO1);
|
||||
unsigned tmp = (unsigned int)MCOperand_getImm(MO2);
|
||||
tmp = (unsigned int)MCOperand_getImm(MO2);
|
||||
if (tmp) {
|
||||
if (tmp << 3 > HEX_THRESHOLD)
|
||||
SStream_concat(O, ":0x%x", (tmp << 3));
|
||||
@ -1144,8 +1153,8 @@ static void printMemBOption(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
unsigned val = (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
|
||||
// FIXME: HasV80Ops becomes a mode
|
||||
// SStream_concat(O, ARM_MB_MemBOptToString(val,
|
||||
// ARM_getFeatureBits(MI->csh->mode) & ARM_HasV8Ops));
|
||||
SStream_concat(O, ARM_MB_MemBOptToString(val, ARM_HasV8Ops));
|
||||
// ARM_getFeatureBits(MI->csh->mode) & ARM_HasV8Ops));
|
||||
SStream_concat(O, ARM_MB_MemBOptToString(val, true));
|
||||
}
|
||||
|
||||
void printInstSyncBOption(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
@ -1217,8 +1226,8 @@ static void printPKHASRShiftImm(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
// FIXME: push {r1, r2, r3, ...} can exceed the number of operands in MCInst struct
|
||||
static void printRegisterList(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
{
|
||||
SStream_concat(O, "{");
|
||||
unsigned i, e;
|
||||
SStream_concat(O, "{");
|
||||
for (i = OpNum, e = MCInst_getNumOperands(MI); i != e; ++i) {
|
||||
if (i != OpNum) SStream_concat(O, ", ");
|
||||
printRegName(MI->csh, O, MCOperand_getReg(MCInst_getOperand(MI, i)));
|
||||
@ -1548,6 +1557,7 @@ static void printThumbAddrModeRROperand(MCInst *MI, unsigned Op, SStream *O)
|
||||
{
|
||||
MCOperand *MO1 = MCInst_getOperand(MI, Op);
|
||||
MCOperand *MO2 = MCInst_getOperand(MI, Op + 1);
|
||||
unsigned RegNum;
|
||||
|
||||
if (!MCOperand_isReg(MO1)) { // FIXME: This is for CP entries, but isn't right.
|
||||
printOperand(MI, Op, O);
|
||||
@ -1560,7 +1570,7 @@ static void printThumbAddrModeRROperand(MCInst *MI, unsigned Op, SStream *O)
|
||||
printRegName(MI->csh, O, MCOperand_getReg(MO1));
|
||||
if (MI->csh->detail)
|
||||
MI->flat_insn.arm.operands[MI->flat_insn.arm.op_count].mem.base = MCOperand_getReg(MO1);
|
||||
unsigned RegNum = MCOperand_getReg(MO2);
|
||||
RegNum = MCOperand_getReg(MO2);
|
||||
if (RegNum) {
|
||||
SStream_concat(O, ", ");
|
||||
printRegName(MI->csh, O, RegNum);
|
||||
@ -1577,6 +1587,7 @@ static void printThumbAddrModeImm5SOperand(MCInst *MI, unsigned Op, SStream *O,
|
||||
{
|
||||
MCOperand *MO1 = MCInst_getOperand(MI, Op);
|
||||
MCOperand *MO2 = MCInst_getOperand(MI, Op + 1);
|
||||
unsigned ImmOffs, tmp;
|
||||
|
||||
if (!MCOperand_isReg(MO1)) { // FIXME: This is for CP entries, but isn't right.
|
||||
printOperand(MI, Op, O);
|
||||
@ -1589,9 +1600,9 @@ static void printThumbAddrModeImm5SOperand(MCInst *MI, unsigned Op, SStream *O,
|
||||
printRegName(MI->csh, O, MCOperand_getReg(MO1));
|
||||
if (MI->csh->detail)
|
||||
MI->flat_insn.arm.operands[MI->flat_insn.arm.op_count].mem.base = MCOperand_getReg(MO1);
|
||||
unsigned ImmOffs = (unsigned int)MCOperand_getImm(MO2);
|
||||
ImmOffs = (unsigned int)MCOperand_getImm(MO2);
|
||||
if (ImmOffs) {
|
||||
unsigned tmp = ImmOffs * Scale;
|
||||
tmp = ImmOffs * Scale;
|
||||
SStream_concat(O, ", %s", markup("<imm:"));
|
||||
if (tmp > HEX_THRESHOLD)
|
||||
SStream_concat(O, "#0x%x", tmp);
|
||||
@ -1782,6 +1793,7 @@ static void printT2AddrModeImm0_1020s4Operand(MCInst *MI, unsigned OpNum, SStrea
|
||||
{
|
||||
MCOperand *MO1 = MCInst_getOperand(MI, OpNum);
|
||||
MCOperand *MO2 = MCInst_getOperand(MI, OpNum+1);
|
||||
unsigned tmp;
|
||||
|
||||
SStream_concat(O, markup("<mem:"));
|
||||
SStream_concat(O, "[");
|
||||
@ -1792,7 +1804,7 @@ static void printT2AddrModeImm0_1020s4Operand(MCInst *MI, unsigned OpNum, SStrea
|
||||
if (MCOperand_getImm(MO2)) {
|
||||
SStream_concat(O, ", ");
|
||||
SStream_concat(O, markup("<imm:"));
|
||||
unsigned tmp = (unsigned int)MCOperand_getImm(MO2) * 4;
|
||||
tmp = (unsigned int)MCOperand_getImm(MO2) * 4;
|
||||
if (tmp > HEX_THRESHOLD)
|
||||
SStream_concat(O, "#0x%x", tmp);
|
||||
else
|
||||
@ -1880,6 +1892,7 @@ static void printT2AddrModeSoRegOperand(MCInst *MI,
|
||||
MCOperand *MO1 = MCInst_getOperand(MI, OpNum);
|
||||
MCOperand *MO2 = MCInst_getOperand(MI, OpNum+1);
|
||||
MCOperand *MO3 = MCInst_getOperand(MI, OpNum+2);
|
||||
unsigned ShAmt;
|
||||
|
||||
SStream_concat(O, "%s[", markup("<mem:"));
|
||||
set_mem_access(MI, true);
|
||||
@ -1893,7 +1906,7 @@ static void printT2AddrModeSoRegOperand(MCInst *MI,
|
||||
if (MI->csh->detail)
|
||||
MI->flat_insn.arm.operands[MI->flat_insn.arm.op_count].mem.index = MCOperand_getReg(MO2);
|
||||
|
||||
unsigned ShAmt = (unsigned int)MCOperand_getImm(MO3);
|
||||
ShAmt = (unsigned int)MCOperand_getImm(MO3);
|
||||
if (ShAmt) {
|
||||
//assert(ShAmt <= 3 && "Not a valid Thumb2 addressing mode!");
|
||||
SStream_concat(O, ", lsl ");
|
||||
@ -1972,8 +1985,10 @@ static void printRotImmOperand(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
|
||||
static void printFBits16(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
{
|
||||
unsigned tmp;
|
||||
|
||||
SStream_concat(O, markup("<imm:"));
|
||||
unsigned tmp = 16 - (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
|
||||
tmp = 16 - (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
|
||||
if (tmp > HEX_THRESHOLD)
|
||||
SStream_concat(O, "#0x%x", tmp);
|
||||
else
|
||||
@ -1988,8 +2003,10 @@ static void printFBits16(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
|
||||
static void printFBits32(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
{
|
||||
unsigned tmp;
|
||||
|
||||
SStream_concat(O, markup("<imm:"));
|
||||
unsigned tmp = 32 - (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
|
||||
tmp = 32 - (unsigned int)MCOperand_getImm(MCInst_getOperand(MI, OpNum));
|
||||
if (tmp > HEX_THRESHOLD)
|
||||
SStream_concat(O, "#0x%x", tmp);
|
||||
else
|
||||
@ -2393,3 +2410,5 @@ static void printVectorListFourSpaced(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
}
|
||||
SStream_concat(O, "}");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* Capstone Unified Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_ARM
|
||||
|
||||
#include <stdio.h> // debug
|
||||
#include <string.h>
|
||||
@ -13633,3 +13635,5 @@ bool ARM_rel_branch(cs_struct *h, unsigned int id)
|
||||
// not found
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* Capstone Disassembler Engine */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Dang Hoang Vu <danghvu@gmail.com> 2013 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_ARM
|
||||
|
||||
#include "../../cs_priv.h"
|
||||
#include "../../MCRegisterInfo.h"
|
||||
#include "ARMDisassembler.h"
|
||||
@ -71,3 +73,5 @@ void ARM_enable(void)
|
||||
// support this arch
|
||||
all_arch |= (1 << CS_ARCH_ARM);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -11,14 +11,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_MIPS
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "../../utils.h"
|
||||
@ -349,10 +349,12 @@ static DecodeStatus DecodeCPU16RegsRegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeGPR64RegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_GPR64RegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_GPR64RegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -360,9 +362,12 @@ static DecodeStatus DecodeGPR64RegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeGPR32RegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
unsigned Reg = getReg(Decoder, Mips_GPR32RegClassID, RegNo);
|
||||
|
||||
Reg = getReg(Decoder, Mips_GPR32RegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -385,10 +390,12 @@ static DecodeStatus DecodeDSPRRegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeFGR64RegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_FGR64RegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_FGR64RegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -396,10 +403,12 @@ static DecodeStatus DecodeFGR64RegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeFGR32RegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_FGR32RegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_FGR32RegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -407,10 +416,12 @@ static DecodeStatus DecodeFGR32RegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeFGRH32RegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_FGRH32RegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_FGRH32RegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -418,10 +429,12 @@ static DecodeStatus DecodeFGRH32RegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeCCRRegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_CCRRegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_CCRRegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -429,10 +442,12 @@ static DecodeStatus DecodeCCRRegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeFCCRegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 7)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_FCCRegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_FCCRegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -570,10 +585,12 @@ static DecodeStatus DecodeHWRegsRegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeAFGR64RegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
if (RegNo > 30 || RegNo %2)
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 30 || RegNo % 2)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_AFGR64RegClassID, RegNo /2);
|
||||
Reg = getReg(Decoder, Mips_AFGR64RegClassID, RegNo /2);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -581,10 +598,12 @@ static DecodeStatus DecodeAFGR64RegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeACC64DSPRegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo >= 4)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_ACC64DSPRegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_ACC64DSPRegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -592,10 +611,12 @@ static DecodeStatus DecodeACC64DSPRegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeHI32DSPRegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo >= 4)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_HI32DSPRegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_HI32DSPRegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -603,10 +624,12 @@ static DecodeStatus DecodeHI32DSPRegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeLO32DSPRegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo >= 4)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_LO32DSPRegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_LO32DSPRegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
@ -614,10 +637,12 @@ static DecodeStatus DecodeLO32DSPRegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeMSA128BRegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_MSA128BRegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_MSA128BRegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
|
||||
return MCDisassembler_Success;
|
||||
@ -626,10 +651,12 @@ static DecodeStatus DecodeMSA128BRegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeMSA128HRegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_MSA128HRegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_MSA128HRegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
|
||||
return MCDisassembler_Success;
|
||||
@ -638,10 +665,12 @@ static DecodeStatus DecodeMSA128HRegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeMSA128WRegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_MSA128WRegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_MSA128WRegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
|
||||
return MCDisassembler_Success;
|
||||
@ -650,10 +679,12 @@ static DecodeStatus DecodeMSA128WRegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeMSA128DRegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 31)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_MSA128DRegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_MSA128DRegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
|
||||
return MCDisassembler_Success;
|
||||
@ -662,10 +693,12 @@ static DecodeStatus DecodeMSA128DRegisterClass(MCInst *Inst,
|
||||
static DecodeStatus DecodeMSACtrlRegisterClass(MCInst *Inst,
|
||||
unsigned RegNo, uint64_t Address, MCRegisterInfo *Decoder)
|
||||
{
|
||||
unsigned Reg;
|
||||
|
||||
if (RegNo > 7)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
unsigned Reg = getReg(Decoder, Mips_MSACtrlRegClassID, RegNo);
|
||||
Reg = getReg(Decoder, Mips_MSACtrlRegClassID, RegNo);
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(Reg));
|
||||
|
||||
return MCDisassembler_Success;
|
||||
@ -737,3 +770,5 @@ static DecodeStatus DecodeExtSize(MCInst *Inst,
|
||||
MCInst_addOperand(Inst, MCOperand_CreateImm(SignExtend32(Size, 16)));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -7,7 +7,7 @@
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
/* Capstone Disassembly Engine, http://www.capstone-engine.org */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
/// printInstruction - This method is automatically generated by tablegen
|
||||
/// from the instruction set description.
|
||||
@ -4408,6 +4408,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
{
|
||||
#define GETREGCLASS_CONTAIN(_class, _reg) MCRegisterClass_contains(MCRegisterInfo_getRegClass(MRI, _class), MCOperand_getReg(MCInst_getOperand(MI, _reg)))
|
||||
const char *AsmString;
|
||||
char *tmp, *AsmMnem, *AsmOps, *c;
|
||||
MCRegisterInfo *MRI = (MCRegisterInfo *)info;
|
||||
switch (MCInst_getOpcode(MI)) {
|
||||
default: return NULL;
|
||||
@ -4586,7 +4587,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *tmp = cs_strdup(AsmString), *AsmMnem, *AsmOps;
|
||||
tmp = cs_strdup(AsmString);
|
||||
AsmMnem = tmp;
|
||||
AsmOps = strchr(tmp, ' ');
|
||||
if (AsmOps) {
|
||||
@ -4596,7 +4597,6 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
SStream_concat(OS, "%s", AsmMnem);
|
||||
if (AsmOps) {
|
||||
SStream_concat(OS, "\t");
|
||||
char *c;
|
||||
for (c = AsmOps; *c; c++) {
|
||||
if (*c == '$') {
|
||||
c += 1;
|
||||
|
@ -7,7 +7,7 @@
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
/* Capstone Disassembly Engine, http://www.capstone-engine.org */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#include "../../MCInst.h"
|
||||
#include "../../LEB128.h"
|
||||
@ -3850,56 +3850,61 @@ static uint8_t DecoderTableMips6432[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static bool getbool(uint64_t b)
|
||||
{
|
||||
return b != 0;
|
||||
}
|
||||
|
||||
static bool checkDecoderPredicate(unsigned Idx, uint64_t Bits)
|
||||
{
|
||||
switch (Idx) {
|
||||
default: // llvm_unreachable("Invalid index!");
|
||||
case 0:
|
||||
return (bool)((Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureMips16));
|
||||
case 1:
|
||||
return (bool)((Bits & Mips_FeatureMicroMips));
|
||||
return getbool((Bits & Mips_FeatureMicroMips));
|
||||
case 2:
|
||||
return (bool)(!(Bits & Mips_FeatureMips16));
|
||||
return getbool(!(Bits & Mips_FeatureMips16));
|
||||
case 3:
|
||||
return (bool)((Bits & Mips_FeatureMips32r2) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureMips32r2) && !(Bits & Mips_FeatureMips16));
|
||||
case 4:
|
||||
return (bool)((Bits & Mips_FeatureMSA));
|
||||
return getbool((Bits & Mips_FeatureMSA));
|
||||
case 5:
|
||||
return (bool)((Bits & Mips_FeatureDSP));
|
||||
return getbool((Bits & Mips_FeatureDSP));
|
||||
case 6:
|
||||
return (bool)((Bits & Mips_FeatureMSA) && (Bits & Mips_FeatureMips64));
|
||||
return getbool((Bits & Mips_FeatureMSA) && (Bits & Mips_FeatureMips64));
|
||||
case 7:
|
||||
return (bool)((Bits & Mips_FeatureMips32) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureMips32) && !(Bits & Mips_FeatureMips16));
|
||||
case 8:
|
||||
return (bool)(!(Bits & Mips_FeatureFP64Bit) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool(!(Bits & Mips_FeatureFP64Bit) && !(Bits & Mips_FeatureMips16));
|
||||
case 9:
|
||||
return (bool)((Bits & Mips_FeatureFPIdx) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureFPIdx) && !(Bits & Mips_FeatureMips16));
|
||||
case 10:
|
||||
return (bool)((Bits & Mips_FeatureFPIdx) && !(Bits & Mips_FeatureFP64Bit) && !(Bits & Mips_FeatureMips16) && !(Bits & Mips_FeatureMicroMips));
|
||||
return getbool((Bits & Mips_FeatureFPIdx) && !(Bits & Mips_FeatureFP64Bit) && !(Bits & Mips_FeatureMips16) && !(Bits & Mips_FeatureMicroMips));
|
||||
case 11:
|
||||
return (bool)((Bits & Mips_FeatureMips32r2) && !(Bits & Mips_FeatureFP64Bit) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureMips32r2) && !(Bits & Mips_FeatureFP64Bit) && !(Bits & Mips_FeatureMips16));
|
||||
case 12:
|
||||
return (bool)((Bits & Mips_FeatureMips32r2) && (Bits & Mips_FeatureMips32) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureMips32r2) && (Bits & Mips_FeatureMips32) && !(Bits & Mips_FeatureMips16));
|
||||
case 13:
|
||||
return (bool)((Bits & Mips_FeatureMips32r2) && !(Bits & Mips_FeatureFP64Bit) && (Bits & Mips_FeatureMips32) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureMips32r2) && !(Bits & Mips_FeatureFP64Bit) && (Bits & Mips_FeatureMips32) && !(Bits & Mips_FeatureMips16));
|
||||
case 14:
|
||||
return (bool)((Bits & Mips_FeatureBitCount) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureBitCount) && !(Bits & Mips_FeatureMips16));
|
||||
case 15:
|
||||
return (bool)((Bits & Mips_FeatureDSPR2));
|
||||
return getbool((Bits & Mips_FeatureDSPR2));
|
||||
case 16:
|
||||
return (bool)((Bits & Mips_FeatureSwap) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureSwap) && !(Bits & Mips_FeatureMips16));
|
||||
case 17:
|
||||
return (bool)((Bits & Mips_FeatureSEInReg) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureSEInReg) && !(Bits & Mips_FeatureMips16));
|
||||
case 18:
|
||||
return (bool)(!(Bits & Mips_FeatureMicroMips));
|
||||
return getbool(!(Bits & Mips_FeatureMicroMips));
|
||||
case 19:
|
||||
return (bool)((Bits & Mips_FeatureMips64r2) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureMips64r2) && !(Bits & Mips_FeatureMips16));
|
||||
case 20:
|
||||
return (bool)((Bits & Mips_FeatureMips64));
|
||||
return getbool((Bits & Mips_FeatureMips64));
|
||||
case 21:
|
||||
return (bool)((Bits & Mips_FeatureFP64Bit) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureFP64Bit) && !(Bits & Mips_FeatureMips16));
|
||||
case 22:
|
||||
return (bool)((Bits & Mips_FeatureFPIdx) && (Bits & Mips_FeatureFP64Bit) && !(Bits & Mips_FeatureMips16));
|
||||
return getbool((Bits & Mips_FeatureFPIdx) && (Bits & Mips_FeatureFP64Bit) && !(Bits & Mips_FeatureMips16));
|
||||
}
|
||||
}
|
||||
|
||||
@ -5501,48 +5506,48 @@ static DecodeStatus fname(uint8_t DecodeTable[], MCInst *MI, \
|
||||
{ \
|
||||
uint64_t Bits = getFeatureBits(feature); \
|
||||
uint8_t *Ptr = DecodeTable; \
|
||||
uint32_t CurFieldValue = 0; \
|
||||
uint32_t CurFieldValue = 0, ExpectedValue; \
|
||||
DecodeStatus S = MCDisassembler_Success; \
|
||||
unsigned Start, Len, NumToSkip, PIdx, Opc, DecodeIdx; \
|
||||
InsnType Val, FieldValue, PositiveMask, NegativeMask; \
|
||||
bool Pred, Fail; \
|
||||
for (;;) { \
|
||||
switch (*Ptr) { \
|
||||
default: \
|
||||
return MCDisassembler_Fail; \
|
||||
case MCD_OPC_ExtractField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
++Ptr; \
|
||||
CurFieldValue = fieldname(insn, Start, Len); \
|
||||
CurFieldValue = (uint32_t)fieldname(insn, Start, Len); \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_FilterValue: { \
|
||||
unsigned Len; \
|
||||
InsnType Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (Val != CurFieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
InsnType FieldValue = fieldname(insn, Start, Len); \
|
||||
uint32_t ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
FieldValue = fieldname(insn, Start, Len); \
|
||||
ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (ExpectedValue != FieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckPredicate: { \
|
||||
unsigned Len; \
|
||||
unsigned PIdx = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
PIdx = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
bool Pred; \
|
||||
Pred = checkDecoderPredicate(PIdx, Bits); \
|
||||
if (!Pred) \
|
||||
Ptr += NumToSkip; \
|
||||
@ -5550,21 +5555,19 @@ static DecodeStatus fname(uint8_t DecodeTable[], MCInst *MI, \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_Decode: { \
|
||||
unsigned Len; \
|
||||
unsigned Opc = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Opc = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned DecodeIdx = (uint32_t)decodeULEB128(Ptr, &Len); \
|
||||
DecodeIdx = (uint32_t)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
MCInst_setOpcode(MI, Opc); \
|
||||
return decoder(S, DecodeIdx, insn, MI, Address, MRI); \
|
||||
} \
|
||||
case MCD_OPC_SoftFail: { \
|
||||
unsigned Len; \
|
||||
InsnType PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
InsnType NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
bool Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
if (Fail) \
|
||||
S = MCDisassembler_SoftFail; \
|
||||
break; \
|
||||
|
@ -11,8 +11,10 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_MIPS
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
@ -446,3 +448,4 @@ static char *printAlias(MCInst *MI, SStream *OS)
|
||||
#define PRINT_ALIAS_INSTR
|
||||
#include "MipsGenAsmWriter.inc"
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* Capstone Unified Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_MIPS
|
||||
|
||||
#include <stdio.h> // debug
|
||||
#include <string.h>
|
||||
@ -7912,10 +7914,10 @@ void Mips_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
|
||||
insn->detail->regs_read_count = (uint8_t)count_positive(insns[i].regs_use);
|
||||
|
||||
memcpy(insn->detail->regs_write, insns[i].regs_mod, sizeof(insns[i].regs_mod));
|
||||
insn->detail->regs_write_count = (uint8_t)count_positive(insns[i].regs_mod);
|
||||
insn->detail->regs_write_count = (uint8_t)count_positive(insns[i].regs_mod);
|
||||
|
||||
memcpy(insn->detail->groups, insns[i].groups, sizeof(insns[i].groups));
|
||||
insn->detail->groups_count = (uint8_t)count_positive(insns[i].groups);
|
||||
insn->detail->groups_count = (uint8_t)count_positive(insns[i].groups);
|
||||
|
||||
if (insns[i].branch || insns[i].indirect_branch) {
|
||||
// this insn also belongs to JUMP group. add JUMP group
|
||||
@ -8509,3 +8511,5 @@ mips_reg Mips_map_register(unsigned int r)
|
||||
// cannot find this register
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* Capstone Disassembler Engine */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Dang Hoang Vu <danghvu@gmail.com> 2013 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_MIPS
|
||||
|
||||
#include "../../utils.h"
|
||||
#include "../../MCRegisterInfo.h"
|
||||
#include "MipsDisassembler.h"
|
||||
@ -60,3 +62,5 @@ void Mips_enable(void)
|
||||
// support this arch
|
||||
all_arch |= (1 << CS_ARCH_MIPS);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,6 +10,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_POWERPC
|
||||
|
||||
#include <stdio.h> // DEBUG
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -270,6 +272,8 @@ static DecodeStatus getInstruction(MCInst *MI,
|
||||
uint16_t *Size,
|
||||
uint64_t Address, MCRegisterInfo *MRI)
|
||||
{
|
||||
uint32_t insn;
|
||||
DecodeStatus result;
|
||||
// Get the four bytes of the instruction.
|
||||
if (code_len < 4) {
|
||||
// not enough data
|
||||
@ -278,7 +282,6 @@ static DecodeStatus getInstruction(MCInst *MI,
|
||||
}
|
||||
|
||||
// The instruction is big-endian encoded.
|
||||
uint32_t insn;
|
||||
if (MI->csh->mode & CS_MODE_BIG_ENDIAN)
|
||||
insn = (code[0] << 24) | (code[1] << 16) |
|
||||
(code[2] << 8) | (code[3] << 0);
|
||||
@ -286,7 +289,7 @@ static DecodeStatus getInstruction(MCInst *MI,
|
||||
insn = (code[3] << 24) | (code[2] << 16) |
|
||||
(code[1] << 8) | (code[0] << 0);
|
||||
|
||||
DecodeStatus result = decodeInstruction_4(DecoderTable32, MI, insn, Address, 4);
|
||||
result = decodeInstruction_4(DecoderTable32, MI, insn, Address, 4);
|
||||
if (result != MCDisassembler_Fail) {
|
||||
*Size = 4;
|
||||
return result;
|
||||
@ -315,16 +318,16 @@ void PPC_init(MCRegisterInfo *MRI)
|
||||
{
|
||||
/*
|
||||
InitMCRegisterInfo( PPCRegDesc, 182, RA, PC,
|
||||
PPCMCRegisterClasses, 15,
|
||||
PPCRegUnitRoots,
|
||||
138,
|
||||
PPCRegDiffLists,
|
||||
PPCRegStrings,
|
||||
PPCSubRegIdxLists,
|
||||
6,
|
||||
PPCSubRegIdxRanges,
|
||||
PPCRegEncodingTable);
|
||||
*/
|
||||
PPCMCRegisterClasses, 15,
|
||||
PPCRegUnitRoots,
|
||||
138,
|
||||
PPCRegDiffLists,
|
||||
PPCRegStrings,
|
||||
PPCSubRegIdxLists,
|
||||
6,
|
||||
PPCSubRegIdxRanges,
|
||||
PPCRegEncodingTable);
|
||||
*/
|
||||
|
||||
MCRegisterInfo_InitMCRegisterInfo(MRI, PPCRegDesc, 182,
|
||||
0, 0,
|
||||
@ -335,3 +338,5 @@ void PPC_init(MCRegisterInfo *MRI)
|
||||
PPCSubRegIdxLists, 6,
|
||||
0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -6,8 +6,8 @@
|
||||
|* *|
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#include "../../MCInst.h"
|
||||
#include "../../LEB128.h"
|
||||
@ -2329,48 +2329,48 @@ static DecodeStatus fname(const uint8_t DecodeTable[], MCInst *MI, \
|
||||
{ \
|
||||
uint64_t Bits = getFeatureBits(feature); \
|
||||
const uint8_t *Ptr = DecodeTable; \
|
||||
uint32_t CurFieldValue = 0; \
|
||||
uint32_t CurFieldValue = 0, ExpectedValue; \
|
||||
DecodeStatus S = MCDisassembler_Success; \
|
||||
unsigned Start, Len, NumToSkip, PIdx, Opc, DecodeIdx; \
|
||||
InsnType Val, FieldValue, PositiveMask, NegativeMask; \
|
||||
bool Pred, Fail; \
|
||||
for (;;) { \
|
||||
switch (*Ptr) { \
|
||||
default: \
|
||||
return MCDisassembler_Fail; \
|
||||
case MCD_OPC_ExtractField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
++Ptr; \
|
||||
CurFieldValue = fieldname(insn, Start, Len); \
|
||||
CurFieldValue = (uint32_t)fieldname(insn, Start, Len); \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_FilterValue: { \
|
||||
unsigned Len; \
|
||||
InsnType Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (Val != CurFieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
InsnType FieldValue = fieldname(insn, Start, Len); \
|
||||
uint32_t ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
FieldValue = fieldname(insn, Start, Len); \
|
||||
ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (ExpectedValue != FieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckPredicate: { \
|
||||
unsigned Len; \
|
||||
unsigned PIdx = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
PIdx = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
bool Pred; \
|
||||
Pred = checkDecoderPredicate(PIdx, Bits); \
|
||||
if (!Pred) \
|
||||
Ptr += NumToSkip; \
|
||||
@ -2378,21 +2378,19 @@ static DecodeStatus fname(const uint8_t DecodeTable[], MCInst *MI, \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_Decode: { \
|
||||
unsigned Len; \
|
||||
unsigned Opc = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Opc = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned DecodeIdx = (uint32_t)decodeULEB128(Ptr, &Len); \
|
||||
DecodeIdx = (uint32_t)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
MCInst_setOpcode(MI, Opc); \
|
||||
return decoder(S, DecodeIdx, insn, MI, Address, 0); \
|
||||
} \
|
||||
case MCD_OPC_SoftFail: { \
|
||||
unsigned Len; \
|
||||
InsnType PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
InsnType NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
bool Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
if (Fail) \
|
||||
S = MCDisassembler_SoftFail; \
|
||||
break; \
|
||||
|
@ -14,6 +14,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_POWERPC
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -374,12 +376,13 @@ static void printBranchOperand(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
|
||||
static void printAbsBranchOperand(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
{
|
||||
int tmp;
|
||||
if (!MCOperand_isImm(MCInst_getOperand(MI, OpNo))) {
|
||||
printOperand(MI, OpNo, O);
|
||||
return;
|
||||
}
|
||||
|
||||
int tmp = (int)MCOperand_getImm(MCInst_getOperand(MI, OpNo)) * 4;
|
||||
tmp = (int)MCOperand_getImm(MCInst_getOperand(MI, OpNo)) * 4;
|
||||
if (tmp >= 0) {
|
||||
if (tmp > HEX_THRESHOLD)
|
||||
SStream_concat(O, "0x%x", tmp);
|
||||
@ -400,7 +403,7 @@ static void printAbsBranchOperand(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
static void printcrbitm(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
{
|
||||
unsigned CCReg = MCOperand_getReg(MCInst_getOperand(MI, OpNo));
|
||||
unsigned RegNo;
|
||||
unsigned RegNo, tmp;
|
||||
switch (CCReg) {
|
||||
default: // llvm_unreachable("Unknown CR register");
|
||||
case PPC_CR0: RegNo = 0; break;
|
||||
@ -413,7 +416,7 @@ static void printcrbitm(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
case PPC_CR7: RegNo = 7; break;
|
||||
}
|
||||
|
||||
unsigned tmp= 0x80 >> RegNo;
|
||||
tmp = 0x80 >> RegNo;
|
||||
if (tmp > HEX_THRESHOLD)
|
||||
SStream_concat(O, "0x%x", tmp);
|
||||
else
|
||||
@ -541,3 +544,4 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
//#define PRINT_ALIAS_INSTR
|
||||
#include "PPCGenAsmWriter.inc"
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* Capstone Unified Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_POWERPC
|
||||
|
||||
#include <stdio.h> // debug
|
||||
#include <string.h>
|
||||
@ -5224,3 +5226,5 @@ ppc_reg PPC_map_register(unsigned int r)
|
||||
// cannot find this register
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013 */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_POWERPC
|
||||
|
||||
#include "../../utils.h"
|
||||
#include "../../MCRegisterInfo.h"
|
||||
@ -53,3 +55,5 @@ void PPC_enable(void)
|
||||
// support this arch
|
||||
all_arch |= (1 << CS_ARCH_PPC);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,6 +10,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_SPARC
|
||||
|
||||
#include <stdio.h> // DEBUG
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -492,3 +494,4 @@ void Sparc_init(MCRegisterInfo *MRI)
|
||||
0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1433,18 +1433,23 @@ static uint8_t DecoderTableSparc32[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static bool getbool(uint64_t b)
|
||||
{
|
||||
return b != 0;
|
||||
}
|
||||
|
||||
static bool checkDecoderPredicate(unsigned Idx, uint64_t Bits)
|
||||
{
|
||||
switch (Idx) {
|
||||
default: // llvm_unreachable("Invalid index!");
|
||||
case 0:
|
||||
return (bool)((Bits & Sparc_FeatureV9));
|
||||
return getbool(Bits & Sparc_FeatureV9);
|
||||
case 1:
|
||||
return (bool)((Bits & Sparc_FeatureVIS3));
|
||||
return getbool(Bits & Sparc_FeatureVIS3);
|
||||
case 2:
|
||||
return (bool)((Bits & Sparc_FeatureVIS));
|
||||
return getbool(Bits & Sparc_FeatureVIS);
|
||||
case 3:
|
||||
return (bool)((Bits & Sparc_FeatureVIS2));
|
||||
return getbool(Bits & Sparc_FeatureVIS2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1939,48 +1944,48 @@ static DecodeStatus fname(uint8_t DecodeTable[], MCInst *MI, \
|
||||
{ \
|
||||
uint64_t Bits = getFeatureBits(feature); \
|
||||
uint8_t *Ptr = DecodeTable; \
|
||||
uint32_t CurFieldValue = 0; \
|
||||
uint32_t CurFieldValue = 0, ExpectedValue; \
|
||||
DecodeStatus S = MCDisassembler_Success; \
|
||||
unsigned Start, Len, NumToSkip, PIdx, Opc, DecodeIdx; \
|
||||
InsnType Val, FieldValue, PositiveMask, NegativeMask; \
|
||||
bool Pred, Fail; \
|
||||
for (;;) { \
|
||||
switch (*Ptr) { \
|
||||
default: \
|
||||
return MCDisassembler_Fail; \
|
||||
case MCD_OPC_ExtractField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
++Ptr; \
|
||||
CurFieldValue = fieldname(insn, Start, Len); \
|
||||
CurFieldValue = (uint32_t)fieldname(insn, Start, Len); \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_FilterValue: { \
|
||||
unsigned Len; \
|
||||
InsnType Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (Val != CurFieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
InsnType FieldValue = fieldname(insn, Start, Len); \
|
||||
uint32_t ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
FieldValue = fieldname(insn, Start, Len); \
|
||||
ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (ExpectedValue != FieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckPredicate: { \
|
||||
unsigned Len; \
|
||||
unsigned PIdx = decodeULEB128(++Ptr, &Len); \
|
||||
PIdx = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
bool Pred; \
|
||||
Pred = checkDecoderPredicate(PIdx, Bits); \
|
||||
if (!Pred) \
|
||||
Ptr += NumToSkip; \
|
||||
@ -1988,21 +1993,19 @@ static DecodeStatus fname(uint8_t DecodeTable[], MCInst *MI, \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_Decode: { \
|
||||
unsigned Len; \
|
||||
unsigned Opc = (unsigned)decodeULEB128(++Ptr, &Len); \
|
||||
Opc = (unsigned)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned DecodeIdx = (unsigned)decodeULEB128(Ptr, &Len); \
|
||||
DecodeIdx = (unsigned)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
MCInst_setOpcode(MI, Opc); \
|
||||
return decoder(S, DecodeIdx, insn, MI, Address, MRI); \
|
||||
} \
|
||||
case MCD_OPC_SoftFail: { \
|
||||
unsigned Len; \
|
||||
InsnType PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
InsnType NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
bool Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
if (Fail) \
|
||||
S = MCDisassembler_SoftFail; \
|
||||
break; \
|
||||
|
@ -14,6 +14,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_SPARC
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -271,3 +273,5 @@ void Sparc_printInst(MCInst *MI, SStream *O, void *Info)
|
||||
printInstruction(MI, O, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* Capstone Unified Disassembly Engine */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_SPARC
|
||||
|
||||
#include <stdio.h> // debug
|
||||
#include <string.h>
|
||||
|
||||
@ -3175,3 +3177,5 @@ sparc_reg Sparc_map_register(unsigned int r)
|
||||
// cannot find this register
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_SPARC
|
||||
|
||||
#include "../../utils.h"
|
||||
#include "../../MCRegisterInfo.h"
|
||||
#include "SparcDisassembler.h"
|
||||
@ -52,3 +54,5 @@ void Sparc_enable(void)
|
||||
// support this arch
|
||||
all_arch |= (1 << CS_ARCH_SPARC);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,6 +10,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_SYSZ
|
||||
|
||||
#include <stdio.h> // DEBUG
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -38,7 +40,7 @@ static DecodeStatus decodeRegisterClass(MCInst *Inst, uint64_t RegNo, const unsi
|
||||
if (RegNo == 0)
|
||||
return MCDisassembler_Fail;
|
||||
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg(RegNo));
|
||||
MCInst_addOperand(Inst, MCOperand_CreateReg((unsigned)RegNo));
|
||||
return MCDisassembler_Success;
|
||||
}
|
||||
|
||||
@ -356,3 +358,4 @@ void SystemZ_init(MCRegisterInfo *MRI)
|
||||
0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1667,20 +1667,25 @@ static uint8_t DecoderTable48[] = {
|
||||
0
|
||||
};
|
||||
|
||||
static bool getbool(uint64_t b)
|
||||
{
|
||||
return b != 0;
|
||||
}
|
||||
|
||||
static bool checkDecoderPredicate(unsigned Idx, uint64_t Bits)
|
||||
{
|
||||
switch (Idx) {
|
||||
default: // llvm_unreachable("Invalid index!");
|
||||
case 0:
|
||||
return (bool)((Bits & SystemZ_FeatureFPExtension));
|
||||
return getbool(Bits & SystemZ_FeatureFPExtension);
|
||||
case 1:
|
||||
return (bool)((Bits & SystemZ_FeatureLoadStoreOnCond));
|
||||
return getbool(Bits & SystemZ_FeatureLoadStoreOnCond);
|
||||
case 2:
|
||||
return (bool)((Bits & SystemZ_FeatureDistinctOps));
|
||||
return getbool(Bits & SystemZ_FeatureDistinctOps);
|
||||
case 3:
|
||||
return (bool)((Bits & SystemZ_FeatureHighWord));
|
||||
return getbool(Bits & SystemZ_FeatureHighWord);
|
||||
case 4:
|
||||
return (bool)((Bits & SystemZ_FeatureInterlockedAccess1));
|
||||
return getbool(Bits & SystemZ_FeatureInterlockedAccess1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2920,48 +2925,48 @@ static DecodeStatus fname(uint8_t DecodeTable[], MCInst *MI, \
|
||||
{ \
|
||||
uint64_t Bits = getFeatureBits(feature); \
|
||||
uint8_t *Ptr = DecodeTable; \
|
||||
uint32_t CurFieldValue = 0; \
|
||||
uint32_t CurFieldValue = 0, ExpectedValue; \
|
||||
DecodeStatus S = MCDisassembler_Success; \
|
||||
unsigned Len, Start, NumToSkip, PIdx, Opc, DecodeIdx; \
|
||||
InsnType FieldValue, Val, PositiveMask, NegativeMask; \
|
||||
bool Pred, Fail; \
|
||||
for (;;) { \
|
||||
switch (*Ptr) { \
|
||||
default: \
|
||||
return MCDisassembler_Fail; \
|
||||
case MCD_OPC_ExtractField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
++Ptr; \
|
||||
CurFieldValue = fieldname(insn, Start, Len); \
|
||||
CurFieldValue = (uint32_t)fieldname(insn, Start, Len); \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_FilterValue: { \
|
||||
unsigned Len; \
|
||||
InsnType Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Val = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (Val != CurFieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckField: { \
|
||||
unsigned Start = *++Ptr; \
|
||||
unsigned Len = *++Ptr; \
|
||||
InsnType FieldValue = fieldname(insn, Start, Len); \
|
||||
uint32_t ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Start = *++Ptr; \
|
||||
Len = *++Ptr; \
|
||||
FieldValue = fieldname(insn, Start, Len); \
|
||||
ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
if (ExpectedValue != FieldValue) \
|
||||
Ptr += NumToSkip; \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_CheckPredicate: { \
|
||||
unsigned Len; \
|
||||
unsigned PIdx = decodeULEB128(++Ptr, &Len); \
|
||||
PIdx = (uint32_t)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned NumToSkip = *Ptr++; \
|
||||
NumToSkip = *Ptr++; \
|
||||
NumToSkip |= (*Ptr++) << 8; \
|
||||
bool Pred; \
|
||||
Pred = checkDecoderPredicate(PIdx, Bits); \
|
||||
if (!Pred) \
|
||||
Ptr += NumToSkip; \
|
||||
@ -2969,21 +2974,19 @@ static DecodeStatus fname(uint8_t DecodeTable[], MCInst *MI, \
|
||||
break; \
|
||||
} \
|
||||
case MCD_OPC_Decode: { \
|
||||
unsigned Len; \
|
||||
unsigned Opc = (unsigned)decodeULEB128(++Ptr, &Len); \
|
||||
Opc = (unsigned)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
unsigned DecodeIdx = (unsigned)decodeULEB128(Ptr, &Len); \
|
||||
DecodeIdx = (unsigned)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
MCInst_setOpcode(MI, Opc); \
|
||||
return decoder(S, DecodeIdx, insn, MI, Address, MRI); \
|
||||
} \
|
||||
case MCD_OPC_SoftFail: { \
|
||||
unsigned Len; \
|
||||
InsnType PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
InsnType NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
|
||||
Ptr += Len; \
|
||||
bool Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
|
||||
if (Fail) \
|
||||
S = MCDisassembler_SoftFail; \
|
||||
break; \
|
||||
|
@ -14,6 +14,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_SYSZ
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -376,3 +378,5 @@ void SystemZ_printInst(MCInst *MI, SStream *O, void *Info)
|
||||
{
|
||||
printInstruction(MI, O, Info);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,6 +10,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_SYSZ
|
||||
|
||||
#include "SystemZMCTargetDesc.h"
|
||||
|
||||
#define GET_REGINFO_ENUM
|
||||
@ -87,3 +89,4 @@ unsigned SystemZMC_getFirstReg(unsigned Reg)
|
||||
return Map[Reg];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* Capstone Unified Disassembly Engine */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_SYSZ
|
||||
|
||||
#include <stdio.h> // debug
|
||||
#include <string.h>
|
||||
|
||||
@ -5065,3 +5067,5 @@ sysz_reg SystemZ_map_register(unsigned int r)
|
||||
// cannot find this register
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_SYSZ
|
||||
|
||||
#include "../../utils.h"
|
||||
#include "../../MCRegisterInfo.h"
|
||||
#include "SystemZDisassembler.h"
|
||||
@ -48,3 +50,5 @@ void SystemZ_enable(void)
|
||||
// support this arch
|
||||
all_arch |= (1 << CS_ARCH_SYSZ);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -15,6 +15,9 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
// this code is only relevant when DIET mode is disable
|
||||
#if defined(CAPSTONE_HAS_X86) && !defined(CAPSTONE_DIET)
|
||||
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
@ -432,6 +435,7 @@ static void printMemReference(MCInst *MI, unsigned Op, SStream *O)
|
||||
MCOperand *IndexReg = MCInst_getOperand(MI, Op+2);
|
||||
MCOperand *DispSpec = MCInst_getOperand(MI, Op+3);
|
||||
MCOperand *SegReg = MCInst_getOperand(MI, Op+4);
|
||||
uint64_t ScaleVal;
|
||||
|
||||
if (MI->csh->detail) {
|
||||
MI->flat_insn.x86.operands[MI->flat_insn.x86.op_count].type = X86_OP_MEM;
|
||||
@ -474,7 +478,7 @@ static void printMemReference(MCInst *MI, unsigned Op, SStream *O)
|
||||
if (MCOperand_getReg(IndexReg)) {
|
||||
SStream_concat(O, ", ");
|
||||
_printOperand(MI, Op+2, O);
|
||||
uint64_t ScaleVal = MCOperand_getImm(MCInst_getOperand(MI, Op+1));
|
||||
ScaleVal = MCOperand_getImm(MCInst_getOperand(MI, Op+1));
|
||||
if (MI->csh->detail)
|
||||
MI->flat_insn.x86.operands[MI->flat_insn.x86.op_count].mem.scale = (int)ScaleVal;
|
||||
if (ScaleVal != 1) {
|
||||
@ -540,3 +544,4 @@ void X86_ATT_printInst(MCInst *MI, SStream *OS, void *info)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -17,6 +17,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_X86
|
||||
|
||||
#include <inttypes.h> // debug
|
||||
#include <string.h>
|
||||
|
||||
@ -67,7 +69,6 @@ enum {
|
||||
/// @param reg - The Reg to append.
|
||||
static void translateRegister(MCInst *mcInst, Reg reg)
|
||||
{
|
||||
//#define ENTRY(x) X86_x,
|
||||
#define ENTRY(x) X86_##x,
|
||||
uint8_t llvmRegnums[] = {
|
||||
ALL_REGS
|
||||
@ -206,8 +207,8 @@ static void translateImmediate(MCInst *mcInst, uint64_t immediate,
|
||||
Opcode != X86_VINSERTPSrr &&
|
||||
#endif
|
||||
Opcode != X86_INT)
|
||||
if(immediate & 0x80)
|
||||
immediate |= ~(0xffull);
|
||||
if(immediate & 0x80)
|
||||
immediate |= ~(0xffull);
|
||||
break;
|
||||
case ENCODING_IW:
|
||||
if(immediate & 0x8000)
|
||||
@ -320,7 +321,7 @@ static bool translateRMMemory(MCInst *mcInst, InternalInstruction *insn)
|
||||
MCOperand *indexReg;
|
||||
MCOperand *displacement;
|
||||
MCOperand *segmentReg;
|
||||
bool IndexIs512;
|
||||
bool IndexIs512, IndexIs128, IndexIs256;
|
||||
#ifndef CAPSTONE_X86_REDUCE
|
||||
uint32_t Opcode;
|
||||
#endif
|
||||
@ -350,7 +351,7 @@ static bool translateRMMemory(MCInst *mcInst, InternalInstruction *insn)
|
||||
#ifndef CAPSTONE_X86_REDUCE
|
||||
Opcode = MCInst_getOpcode(mcInst);
|
||||
#endif
|
||||
bool IndexIs128 = (
|
||||
IndexIs128 = (
|
||||
#ifndef CAPSTONE_X86_REDUCE
|
||||
Opcode == X86_VGATHERDPDrm ||
|
||||
Opcode == X86_VGATHERDPDYrm ||
|
||||
@ -365,7 +366,7 @@ static bool translateRMMemory(MCInst *mcInst, InternalInstruction *insn)
|
||||
#endif
|
||||
false
|
||||
);
|
||||
bool IndexIs256 = (
|
||||
IndexIs256 = (
|
||||
#ifndef CAPSTONE_X86_REDUCE
|
||||
Opcode == X86_VGATHERQPDYrm ||
|
||||
Opcode == X86_VGATHERDPSYrm ||
|
||||
@ -811,3 +812,5 @@ bool X86_getInstruction(csh ud, const uint8_t *code, size_t code_len,
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -78,7 +78,6 @@
|
||||
#define CS_X86_DISASSEMBLER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "../../include/capstone.h"
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_X86
|
||||
|
||||
#include <stdarg.h> /* for va_*() */
|
||||
#include <stdlib.h> /* for exit() */
|
||||
#include <string.h> /* for memset() */
|
||||
@ -46,14 +48,6 @@ static const char *x86DisassemblerGetInstrName(unsigned Opcode)
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#define NDEBUG
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define debug(s) do { x86DisassemblerDebug(__FILE__, __LINE__, s); } while (0)
|
||||
#else
|
||||
#define debug(s) ((void) 0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* contextForAttrs - Client for the instruction context table. Takes a set of
|
||||
* attributes and returns the appropriate decode context.
|
||||
@ -221,7 +215,7 @@ static InstrUID decode(OpcodeType type,
|
||||
|
||||
switch (dec->modrm_type) {
|
||||
default:
|
||||
debug("Corrupt table! Unknown modrm_type");
|
||||
//debug("Corrupt table! Unknown modrm_type");
|
||||
return 0;
|
||||
case MODRM_ONEENTRY:
|
||||
return modRMTable[dec->instructionIDs];
|
||||
@ -493,7 +487,7 @@ static int readPrefixes(struct InternalInstruction* insn)
|
||||
insn->segmentOverride = SEG_OVERRIDE_GS;
|
||||
break;
|
||||
default:
|
||||
debug("Unhandled override");
|
||||
//debug("Unhandled override");
|
||||
return -1;
|
||||
}
|
||||
if (prefixGroups[1])
|
||||
@ -1265,7 +1259,7 @@ static int readSIB(struct InternalInstruction* insn)
|
||||
insn->sibBase = (SIBBase)(sibBaseBase + base);
|
||||
break;
|
||||
case 0x3:
|
||||
debug("Cannot have Mod = 0b11 and a SIB byte");
|
||||
//debug("Cannot have Mod = 0b11 and a SIB byte");
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
@ -1535,7 +1529,6 @@ static int readModRM(struct InternalInstruction* insn)
|
||||
} \
|
||||
switch (type) { \
|
||||
default: \
|
||||
debug("Unhandled register type"); \
|
||||
*valid = 0; \
|
||||
return 0; \
|
||||
case TYPE_Rv: \
|
||||
@ -1621,7 +1614,7 @@ static int fixupReg(struct InternalInstruction *insn,
|
||||
|
||||
switch ((OperandEncoding)op->encoding) {
|
||||
default:
|
||||
debug("Expected a REG or R/M encoding in fixupReg");
|
||||
//debug("Expected a REG or R/M encoding in fixupReg");
|
||||
return -1;
|
||||
case ENCODING_VVVV:
|
||||
insn->vvvv = (Reg)fixupRegValue(insn,
|
||||
@ -1725,7 +1718,7 @@ static int readImmediate(struct InternalInstruction* insn, uint8_t size)
|
||||
// dbgprintf(insn, "readImmediate()");
|
||||
|
||||
if (insn->numImmediatesConsumed == 2) {
|
||||
debug("Already consumed two immediates");
|
||||
//debug("Already consumed two immediates");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -2011,3 +2004,5 @@ int decodeInstruction(struct InternalInstruction* insn,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -13830,6 +13830,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
{
|
||||
#define GETREGCLASS_CONTAIN(_class, _reg) MCRegisterClass_contains(MCRegisterInfo_getRegClass(MRI, _class), MCOperand_getReg(MCInst_getOperand(MI, _reg)))
|
||||
const char *AsmString;
|
||||
char *tmp, *AsmMnem, *AsmOps, *c;
|
||||
// MCRegisterInfo *MRI = (MCRegisterInfo *)info;
|
||||
switch (MCInst_getOpcode(MI)) {
|
||||
default: return 0;
|
||||
@ -13860,7 +13861,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *tmp = cs_strdup(AsmString), *AsmMnem, *AsmOps;
|
||||
tmp = cs_strdup(AsmString);
|
||||
AsmMnem = tmp;
|
||||
AsmOps = strchr(tmp, ' ');
|
||||
if (AsmOps) {
|
||||
@ -13870,7 +13871,6 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
SStream_concat(OS, "%s", AsmMnem);
|
||||
if (AsmOps) {
|
||||
SStream_concat(OS, "\t");
|
||||
char *c;
|
||||
for (c = AsmOps; *c; c++) {
|
||||
if (*c == '$') {
|
||||
c += 1;
|
||||
|
@ -13334,6 +13334,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
{
|
||||
#define GETREGCLASS_CONTAIN(_class, _reg) MCRegisterClass_contains(MCRegisterInfo_getRegClass(MRI, _class), MCOperand_getReg(MCInst_getOperand(MI, _reg)))
|
||||
const char *AsmString;
|
||||
char *tmp, *AsmMnem, *AsmOps, *c;
|
||||
// MCRegisterInfo *MRI = (MCRegisterInfo *)info;
|
||||
switch (MCInst_getOpcode(MI)) {
|
||||
default: return 0;
|
||||
@ -13364,7 +13365,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *tmp = cs_strdup(AsmString), *AsmMnem, *AsmOps;
|
||||
tmp = cs_strdup(AsmString);
|
||||
AsmMnem = tmp;
|
||||
AsmOps = strchr(tmp, ' ');
|
||||
if (AsmOps) {
|
||||
@ -13374,7 +13375,6 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
SStream_concat(OS, "%s", AsmMnem);
|
||||
if (AsmOps) {
|
||||
SStream_concat(OS, "\t");
|
||||
char *c;
|
||||
for (c = AsmOps; *c; c++) {
|
||||
if (*c == '$') {
|
||||
c += 1;
|
||||
|
@ -2842,6 +2842,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
{
|
||||
#define GETREGCLASS_CONTAIN(_class, _reg) MCRegisterClass_contains(MCRegisterInfo_getRegClass(MRI, _class), MCOperand_getReg(MCInst_getOperand(MI, _reg)))
|
||||
const char *AsmString;
|
||||
char *tmp, *AsmMnem, *AsmOps, *c;
|
||||
// MCRegisterInfo *MRI = (MCRegisterInfo *)info;
|
||||
switch (MCInst_getOpcode(MI)) {
|
||||
default: return 0;
|
||||
@ -2872,7 +2873,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *tmp = cs_strdup(AsmString), *AsmMnem, *AsmOps;
|
||||
tmp = cs_strdup(AsmString);
|
||||
AsmMnem = tmp;
|
||||
AsmOps = strchr(tmp, ' ');
|
||||
if (AsmOps) {
|
||||
@ -2882,7 +2883,6 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
SStream_concat(OS, "%s", AsmMnem);
|
||||
if (AsmOps) {
|
||||
SStream_concat(OS, "\t");
|
||||
char *c;
|
||||
for (c = AsmOps; *c; c++) {
|
||||
if (*c == '$') {
|
||||
c += 1;
|
||||
|
@ -3099,6 +3099,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
{
|
||||
#define GETREGCLASS_CONTAIN(_class, _reg) MCRegisterClass_contains(MCRegisterInfo_getRegClass(MRI, _class), MCOperand_getReg(MCInst_getOperand(MI, _reg)))
|
||||
const char *AsmString;
|
||||
char *tmp, *AsmMnem, *AsmOps, *c;
|
||||
// MCRegisterInfo *MRI = (MCRegisterInfo *)info;
|
||||
switch (MCInst_getOpcode(MI)) {
|
||||
default: return 0;
|
||||
@ -3129,7 +3130,7 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *tmp = cs_strdup(AsmString), *AsmMnem, *AsmOps;
|
||||
tmp = cs_strdup(AsmString);
|
||||
AsmMnem = tmp;
|
||||
AsmOps = strchr(tmp, ' ');
|
||||
if (AsmOps) {
|
||||
@ -3139,7 +3140,6 @@ static char *printAliasInstr(MCInst *MI, SStream *OS, void *info)
|
||||
SStream_concat(OS, "%s", AsmMnem);
|
||||
if (AsmOps) {
|
||||
SStream_concat(OS, "\t");
|
||||
char *c;
|
||||
for (c = AsmOps; *c; c++) {
|
||||
if (*c == '$') {
|
||||
c += 1;
|
||||
|
@ -15,6 +15,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_X86
|
||||
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
@ -210,7 +212,7 @@ static void printRoundingControl(MCInst *MI, unsigned Op, SStream *O)
|
||||
static void printSrcIdx(MCInst *MI, unsigned Op, SStream *O)
|
||||
{
|
||||
MCOperand *SegReg;
|
||||
|
||||
|
||||
SegReg = MCInst_getOperand(MI, Op+1);
|
||||
|
||||
// If this has a segment register, print it.
|
||||
@ -472,6 +474,7 @@ static void _printOperand(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
|
||||
static void printMemReference(MCInst *MI, unsigned Op, SStream *O)
|
||||
{
|
||||
bool NeedPlus = false;
|
||||
MCOperand *BaseReg = MCInst_getOperand(MI, Op);
|
||||
uint64_t ScaleVal = MCOperand_getImm(MCInst_getOperand(MI, Op+1));
|
||||
MCOperand *IndexReg = MCInst_getOperand(MI, Op+2);
|
||||
@ -494,7 +497,6 @@ static void printMemReference(MCInst *MI, unsigned Op, SStream *O)
|
||||
|
||||
SStream_concat(O, "[");
|
||||
|
||||
bool NeedPlus = false;
|
||||
if (MCOperand_getReg(BaseReg)) {
|
||||
_printOperand(MI, Op, O);
|
||||
NeedPlus = true;
|
||||
@ -544,3 +546,4 @@ static void printMemReference(MCInst *MI, unsigned Op, SStream *O)
|
||||
#include "X86GenAsmWriter1.inc"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_X86
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "X86Mapping.h"
|
||||
@ -41765,3 +41767,5 @@ bool X86_lockrep(MCInst *MI, SStream *O)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* Capstone Disassembler Engine */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Dang Hoang Vu <danghvu@gmail.com> 2013 */
|
||||
|
||||
#ifdef CAPSTONE_HAS_X86
|
||||
|
||||
#include "../../cs_priv.h"
|
||||
#include "../../MCRegisterInfo.h"
|
||||
#include "X86Disassembler.h"
|
||||
@ -40,8 +42,14 @@ static cs_err option(cs_struct *handle, cs_opt_type type, size_t value)
|
||||
break;
|
||||
|
||||
case CS_OPT_SYNTAX_ATT:
|
||||
#ifndef CAPSTONE_DIET
|
||||
handle->printer = X86_ATT_printInst;
|
||||
break;
|
||||
#else
|
||||
// this is irrelevant in CAPSTONE_DIET mode
|
||||
handle->errnum = CS_ERR_DIET;
|
||||
return CS_ERR_DIET;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,3 +69,5 @@ void X86_enable(void)
|
||||
// support this arch
|
||||
all_arch |= (1 << CS_ARCH_X86);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -58,238 +58,238 @@ public class Arm64_const {
|
||||
public static final int ARM64_REG_INVALID = 0;
|
||||
public static final int ARM64_REG_NZCV = 1;
|
||||
public static final int ARM64_REG_WSP = 2;
|
||||
public static final int ARM64_REG_SP = 3;
|
||||
public static final int ARM64_REG_B0 = 4;
|
||||
public static final int ARM64_REG_B1 = 5;
|
||||
public static final int ARM64_REG_B2 = 6;
|
||||
public static final int ARM64_REG_B3 = 7;
|
||||
public static final int ARM64_REG_B4 = 8;
|
||||
public static final int ARM64_REG_B5 = 9;
|
||||
public static final int ARM64_REG_B6 = 10;
|
||||
public static final int ARM64_REG_B7 = 11;
|
||||
public static final int ARM64_REG_B8 = 12;
|
||||
public static final int ARM64_REG_B9 = 13;
|
||||
public static final int ARM64_REG_B10 = 14;
|
||||
public static final int ARM64_REG_B11 = 15;
|
||||
public static final int ARM64_REG_B12 = 16;
|
||||
public static final int ARM64_REG_B13 = 17;
|
||||
public static final int ARM64_REG_B14 = 18;
|
||||
public static final int ARM64_REG_B15 = 19;
|
||||
public static final int ARM64_REG_B16 = 20;
|
||||
public static final int ARM64_REG_B17 = 21;
|
||||
public static final int ARM64_REG_B18 = 22;
|
||||
public static final int ARM64_REG_B19 = 23;
|
||||
public static final int ARM64_REG_B20 = 24;
|
||||
public static final int ARM64_REG_B21 = 25;
|
||||
public static final int ARM64_REG_B22 = 26;
|
||||
public static final int ARM64_REG_B23 = 27;
|
||||
public static final int ARM64_REG_B24 = 28;
|
||||
public static final int ARM64_REG_B25 = 29;
|
||||
public static final int ARM64_REG_B26 = 30;
|
||||
public static final int ARM64_REG_B27 = 31;
|
||||
public static final int ARM64_REG_B28 = 32;
|
||||
public static final int ARM64_REG_B29 = 33;
|
||||
public static final int ARM64_REG_B30 = 34;
|
||||
public static final int ARM64_REG_B31 = 35;
|
||||
public static final int ARM64_REG_D0 = 36;
|
||||
public static final int ARM64_REG_D1 = 37;
|
||||
public static final int ARM64_REG_D2 = 38;
|
||||
public static final int ARM64_REG_D3 = 39;
|
||||
public static final int ARM64_REG_D4 = 40;
|
||||
public static final int ARM64_REG_D5 = 41;
|
||||
public static final int ARM64_REG_D6 = 42;
|
||||
public static final int ARM64_REG_D7 = 43;
|
||||
public static final int ARM64_REG_D8 = 44;
|
||||
public static final int ARM64_REG_D9 = 45;
|
||||
public static final int ARM64_REG_D10 = 46;
|
||||
public static final int ARM64_REG_D11 = 47;
|
||||
public static final int ARM64_REG_D12 = 48;
|
||||
public static final int ARM64_REG_D13 = 49;
|
||||
public static final int ARM64_REG_D14 = 50;
|
||||
public static final int ARM64_REG_D15 = 51;
|
||||
public static final int ARM64_REG_D16 = 52;
|
||||
public static final int ARM64_REG_D17 = 53;
|
||||
public static final int ARM64_REG_D18 = 54;
|
||||
public static final int ARM64_REG_D19 = 55;
|
||||
public static final int ARM64_REG_D20 = 56;
|
||||
public static final int ARM64_REG_D21 = 57;
|
||||
public static final int ARM64_REG_D22 = 58;
|
||||
public static final int ARM64_REG_D23 = 59;
|
||||
public static final int ARM64_REG_D24 = 60;
|
||||
public static final int ARM64_REG_D25 = 61;
|
||||
public static final int ARM64_REG_D26 = 62;
|
||||
public static final int ARM64_REG_D27 = 63;
|
||||
public static final int ARM64_REG_D28 = 64;
|
||||
public static final int ARM64_REG_D29 = 65;
|
||||
public static final int ARM64_REG_D30 = 66;
|
||||
public static final int ARM64_REG_D31 = 67;
|
||||
public static final int ARM64_REG_H0 = 68;
|
||||
public static final int ARM64_REG_H1 = 69;
|
||||
public static final int ARM64_REG_H2 = 70;
|
||||
public static final int ARM64_REG_H3 = 71;
|
||||
public static final int ARM64_REG_H4 = 72;
|
||||
public static final int ARM64_REG_H5 = 73;
|
||||
public static final int ARM64_REG_H6 = 74;
|
||||
public static final int ARM64_REG_H7 = 75;
|
||||
public static final int ARM64_REG_H8 = 76;
|
||||
public static final int ARM64_REG_H9 = 77;
|
||||
public static final int ARM64_REG_H10 = 78;
|
||||
public static final int ARM64_REG_H11 = 79;
|
||||
public static final int ARM64_REG_H12 = 80;
|
||||
public static final int ARM64_REG_H13 = 81;
|
||||
public static final int ARM64_REG_H14 = 82;
|
||||
public static final int ARM64_REG_H15 = 83;
|
||||
public static final int ARM64_REG_H16 = 84;
|
||||
public static final int ARM64_REG_H17 = 85;
|
||||
public static final int ARM64_REG_H18 = 86;
|
||||
public static final int ARM64_REG_H19 = 87;
|
||||
public static final int ARM64_REG_H20 = 88;
|
||||
public static final int ARM64_REG_H21 = 89;
|
||||
public static final int ARM64_REG_H22 = 90;
|
||||
public static final int ARM64_REG_H23 = 91;
|
||||
public static final int ARM64_REG_H24 = 92;
|
||||
public static final int ARM64_REG_H25 = 93;
|
||||
public static final int ARM64_REG_H26 = 94;
|
||||
public static final int ARM64_REG_H27 = 95;
|
||||
public static final int ARM64_REG_H28 = 96;
|
||||
public static final int ARM64_REG_H29 = 97;
|
||||
public static final int ARM64_REG_H30 = 98;
|
||||
public static final int ARM64_REG_H31 = 99;
|
||||
public static final int ARM64_REG_Q0 = 100;
|
||||
public static final int ARM64_REG_Q1 = 101;
|
||||
public static final int ARM64_REG_Q2 = 102;
|
||||
public static final int ARM64_REG_Q3 = 103;
|
||||
public static final int ARM64_REG_Q4 = 104;
|
||||
public static final int ARM64_REG_Q5 = 105;
|
||||
public static final int ARM64_REG_Q6 = 106;
|
||||
public static final int ARM64_REG_Q7 = 107;
|
||||
public static final int ARM64_REG_Q8 = 108;
|
||||
public static final int ARM64_REG_Q9 = 109;
|
||||
public static final int ARM64_REG_Q10 = 110;
|
||||
public static final int ARM64_REG_Q11 = 111;
|
||||
public static final int ARM64_REG_Q12 = 112;
|
||||
public static final int ARM64_REG_Q13 = 113;
|
||||
public static final int ARM64_REG_Q14 = 114;
|
||||
public static final int ARM64_REG_Q15 = 115;
|
||||
public static final int ARM64_REG_Q16 = 116;
|
||||
public static final int ARM64_REG_Q17 = 117;
|
||||
public static final int ARM64_REG_Q18 = 118;
|
||||
public static final int ARM64_REG_Q19 = 119;
|
||||
public static final int ARM64_REG_Q20 = 120;
|
||||
public static final int ARM64_REG_Q21 = 121;
|
||||
public static final int ARM64_REG_Q22 = 122;
|
||||
public static final int ARM64_REG_Q23 = 123;
|
||||
public static final int ARM64_REG_Q24 = 124;
|
||||
public static final int ARM64_REG_Q25 = 125;
|
||||
public static final int ARM64_REG_Q26 = 126;
|
||||
public static final int ARM64_REG_Q27 = 127;
|
||||
public static final int ARM64_REG_Q28 = 128;
|
||||
public static final int ARM64_REG_Q29 = 129;
|
||||
public static final int ARM64_REG_Q30 = 130;
|
||||
public static final int ARM64_REG_Q31 = 131;
|
||||
public static final int ARM64_REG_S0 = 132;
|
||||
public static final int ARM64_REG_S1 = 133;
|
||||
public static final int ARM64_REG_S2 = 134;
|
||||
public static final int ARM64_REG_S3 = 135;
|
||||
public static final int ARM64_REG_S4 = 136;
|
||||
public static final int ARM64_REG_S5 = 137;
|
||||
public static final int ARM64_REG_S6 = 138;
|
||||
public static final int ARM64_REG_S7 = 139;
|
||||
public static final int ARM64_REG_S8 = 140;
|
||||
public static final int ARM64_REG_S9 = 141;
|
||||
public static final int ARM64_REG_S10 = 142;
|
||||
public static final int ARM64_REG_S11 = 143;
|
||||
public static final int ARM64_REG_S12 = 144;
|
||||
public static final int ARM64_REG_S13 = 145;
|
||||
public static final int ARM64_REG_S14 = 146;
|
||||
public static final int ARM64_REG_S15 = 147;
|
||||
public static final int ARM64_REG_S16 = 148;
|
||||
public static final int ARM64_REG_S17 = 149;
|
||||
public static final int ARM64_REG_S18 = 150;
|
||||
public static final int ARM64_REG_S19 = 151;
|
||||
public static final int ARM64_REG_S20 = 152;
|
||||
public static final int ARM64_REG_S21 = 153;
|
||||
public static final int ARM64_REG_S22 = 154;
|
||||
public static final int ARM64_REG_S23 = 155;
|
||||
public static final int ARM64_REG_S24 = 156;
|
||||
public static final int ARM64_REG_S25 = 157;
|
||||
public static final int ARM64_REG_S26 = 158;
|
||||
public static final int ARM64_REG_S27 = 159;
|
||||
public static final int ARM64_REG_S28 = 160;
|
||||
public static final int ARM64_REG_S29 = 161;
|
||||
public static final int ARM64_REG_S30 = 162;
|
||||
public static final int ARM64_REG_S31 = 163;
|
||||
public static final int ARM64_REG_W0 = 164;
|
||||
public static final int ARM64_REG_W1 = 165;
|
||||
public static final int ARM64_REG_W2 = 166;
|
||||
public static final int ARM64_REG_W3 = 167;
|
||||
public static final int ARM64_REG_W4 = 168;
|
||||
public static final int ARM64_REG_W5 = 169;
|
||||
public static final int ARM64_REG_W6 = 170;
|
||||
public static final int ARM64_REG_W7 = 171;
|
||||
public static final int ARM64_REG_W8 = 172;
|
||||
public static final int ARM64_REG_W9 = 173;
|
||||
public static final int ARM64_REG_W10 = 174;
|
||||
public static final int ARM64_REG_W11 = 175;
|
||||
public static final int ARM64_REG_W12 = 176;
|
||||
public static final int ARM64_REG_W13 = 177;
|
||||
public static final int ARM64_REG_W14 = 178;
|
||||
public static final int ARM64_REG_W15 = 179;
|
||||
public static final int ARM64_REG_W16 = 180;
|
||||
public static final int ARM64_REG_W17 = 181;
|
||||
public static final int ARM64_REG_W18 = 182;
|
||||
public static final int ARM64_REG_W19 = 183;
|
||||
public static final int ARM64_REG_W20 = 184;
|
||||
public static final int ARM64_REG_W21 = 185;
|
||||
public static final int ARM64_REG_W22 = 186;
|
||||
public static final int ARM64_REG_W23 = 187;
|
||||
public static final int ARM64_REG_W24 = 188;
|
||||
public static final int ARM64_REG_W25 = 189;
|
||||
public static final int ARM64_REG_W26 = 190;
|
||||
public static final int ARM64_REG_W27 = 191;
|
||||
public static final int ARM64_REG_W28 = 192;
|
||||
public static final int ARM64_REG_W29 = 193;
|
||||
public static final int ARM64_REG_W30 = 194;
|
||||
public static final int ARM64_REG_X0 = 195;
|
||||
public static final int ARM64_REG_X1 = 196;
|
||||
public static final int ARM64_REG_X2 = 197;
|
||||
public static final int ARM64_REG_X3 = 198;
|
||||
public static final int ARM64_REG_X4 = 199;
|
||||
public static final int ARM64_REG_X5 = 200;
|
||||
public static final int ARM64_REG_X6 = 201;
|
||||
public static final int ARM64_REG_X7 = 202;
|
||||
public static final int ARM64_REG_X8 = 203;
|
||||
public static final int ARM64_REG_X9 = 204;
|
||||
public static final int ARM64_REG_X10 = 205;
|
||||
public static final int ARM64_REG_X11 = 206;
|
||||
public static final int ARM64_REG_X12 = 207;
|
||||
public static final int ARM64_REG_X13 = 208;
|
||||
public static final int ARM64_REG_X14 = 209;
|
||||
public static final int ARM64_REG_X15 = 210;
|
||||
public static final int ARM64_REG_X16 = 211;
|
||||
public static final int ARM64_REG_X17 = 212;
|
||||
public static final int ARM64_REG_X18 = 213;
|
||||
public static final int ARM64_REG_X19 = 214;
|
||||
public static final int ARM64_REG_X20 = 215;
|
||||
public static final int ARM64_REG_X21 = 216;
|
||||
public static final int ARM64_REG_X22 = 217;
|
||||
public static final int ARM64_REG_X23 = 218;
|
||||
public static final int ARM64_REG_X24 = 219;
|
||||
public static final int ARM64_REG_X25 = 220;
|
||||
public static final int ARM64_REG_X26 = 221;
|
||||
public static final int ARM64_REG_X27 = 222;
|
||||
public static final int ARM64_REG_X28 = 223;
|
||||
public static final int ARM64_REG_X29 = 224;
|
||||
public static final int ARM64_REG_X30 = 225;
|
||||
public static final int ARM64_REG_MAX = 226;
|
||||
public static final int ARM64_REG_WZR = 3;
|
||||
public static final int ARM64_REG_SP = 4;
|
||||
public static final int ARM64_REG_XZR = 5;
|
||||
public static final int ARM64_REG_B0 = 6;
|
||||
public static final int ARM64_REG_B1 = 7;
|
||||
public static final int ARM64_REG_B2 = 8;
|
||||
public static final int ARM64_REG_B3 = 9;
|
||||
public static final int ARM64_REG_B4 = 10;
|
||||
public static final int ARM64_REG_B5 = 11;
|
||||
public static final int ARM64_REG_B6 = 12;
|
||||
public static final int ARM64_REG_B7 = 13;
|
||||
public static final int ARM64_REG_B8 = 14;
|
||||
public static final int ARM64_REG_B9 = 15;
|
||||
public static final int ARM64_REG_B10 = 16;
|
||||
public static final int ARM64_REG_B11 = 17;
|
||||
public static final int ARM64_REG_B12 = 18;
|
||||
public static final int ARM64_REG_B13 = 19;
|
||||
public static final int ARM64_REG_B14 = 20;
|
||||
public static final int ARM64_REG_B15 = 21;
|
||||
public static final int ARM64_REG_B16 = 22;
|
||||
public static final int ARM64_REG_B17 = 23;
|
||||
public static final int ARM64_REG_B18 = 24;
|
||||
public static final int ARM64_REG_B19 = 25;
|
||||
public static final int ARM64_REG_B20 = 26;
|
||||
public static final int ARM64_REG_B21 = 27;
|
||||
public static final int ARM64_REG_B22 = 28;
|
||||
public static final int ARM64_REG_B23 = 29;
|
||||
public static final int ARM64_REG_B24 = 30;
|
||||
public static final int ARM64_REG_B25 = 31;
|
||||
public static final int ARM64_REG_B26 = 32;
|
||||
public static final int ARM64_REG_B27 = 33;
|
||||
public static final int ARM64_REG_B28 = 34;
|
||||
public static final int ARM64_REG_B29 = 35;
|
||||
public static final int ARM64_REG_B30 = 36;
|
||||
public static final int ARM64_REG_B31 = 37;
|
||||
public static final int ARM64_REG_D0 = 38;
|
||||
public static final int ARM64_REG_D1 = 39;
|
||||
public static final int ARM64_REG_D2 = 40;
|
||||
public static final int ARM64_REG_D3 = 41;
|
||||
public static final int ARM64_REG_D4 = 42;
|
||||
public static final int ARM64_REG_D5 = 43;
|
||||
public static final int ARM64_REG_D6 = 44;
|
||||
public static final int ARM64_REG_D7 = 45;
|
||||
public static final int ARM64_REG_D8 = 46;
|
||||
public static final int ARM64_REG_D9 = 47;
|
||||
public static final int ARM64_REG_D10 = 48;
|
||||
public static final int ARM64_REG_D11 = 49;
|
||||
public static final int ARM64_REG_D12 = 50;
|
||||
public static final int ARM64_REG_D13 = 51;
|
||||
public static final int ARM64_REG_D14 = 52;
|
||||
public static final int ARM64_REG_D15 = 53;
|
||||
public static final int ARM64_REG_D16 = 54;
|
||||
public static final int ARM64_REG_D17 = 55;
|
||||
public static final int ARM64_REG_D18 = 56;
|
||||
public static final int ARM64_REG_D19 = 57;
|
||||
public static final int ARM64_REG_D20 = 58;
|
||||
public static final int ARM64_REG_D21 = 59;
|
||||
public static final int ARM64_REG_D22 = 60;
|
||||
public static final int ARM64_REG_D23 = 61;
|
||||
public static final int ARM64_REG_D24 = 62;
|
||||
public static final int ARM64_REG_D25 = 63;
|
||||
public static final int ARM64_REG_D26 = 64;
|
||||
public static final int ARM64_REG_D27 = 65;
|
||||
public static final int ARM64_REG_D28 = 66;
|
||||
public static final int ARM64_REG_D29 = 67;
|
||||
public static final int ARM64_REG_D30 = 68;
|
||||
public static final int ARM64_REG_D31 = 69;
|
||||
public static final int ARM64_REG_H0 = 70;
|
||||
public static final int ARM64_REG_H1 = 71;
|
||||
public static final int ARM64_REG_H2 = 72;
|
||||
public static final int ARM64_REG_H3 = 73;
|
||||
public static final int ARM64_REG_H4 = 74;
|
||||
public static final int ARM64_REG_H5 = 75;
|
||||
public static final int ARM64_REG_H6 = 76;
|
||||
public static final int ARM64_REG_H7 = 77;
|
||||
public static final int ARM64_REG_H8 = 78;
|
||||
public static final int ARM64_REG_H9 = 79;
|
||||
public static final int ARM64_REG_H10 = 80;
|
||||
public static final int ARM64_REG_H11 = 81;
|
||||
public static final int ARM64_REG_H12 = 82;
|
||||
public static final int ARM64_REG_H13 = 83;
|
||||
public static final int ARM64_REG_H14 = 84;
|
||||
public static final int ARM64_REG_H15 = 85;
|
||||
public static final int ARM64_REG_H16 = 86;
|
||||
public static final int ARM64_REG_H17 = 87;
|
||||
public static final int ARM64_REG_H18 = 88;
|
||||
public static final int ARM64_REG_H19 = 89;
|
||||
public static final int ARM64_REG_H20 = 90;
|
||||
public static final int ARM64_REG_H21 = 91;
|
||||
public static final int ARM64_REG_H22 = 92;
|
||||
public static final int ARM64_REG_H23 = 93;
|
||||
public static final int ARM64_REG_H24 = 94;
|
||||
public static final int ARM64_REG_H25 = 95;
|
||||
public static final int ARM64_REG_H26 = 96;
|
||||
public static final int ARM64_REG_H27 = 97;
|
||||
public static final int ARM64_REG_H28 = 98;
|
||||
public static final int ARM64_REG_H29 = 99;
|
||||
public static final int ARM64_REG_H30 = 100;
|
||||
public static final int ARM64_REG_H31 = 101;
|
||||
public static final int ARM64_REG_Q0 = 102;
|
||||
public static final int ARM64_REG_Q1 = 103;
|
||||
public static final int ARM64_REG_Q2 = 104;
|
||||
public static final int ARM64_REG_Q3 = 105;
|
||||
public static final int ARM64_REG_Q4 = 106;
|
||||
public static final int ARM64_REG_Q5 = 107;
|
||||
public static final int ARM64_REG_Q6 = 108;
|
||||
public static final int ARM64_REG_Q7 = 109;
|
||||
public static final int ARM64_REG_Q8 = 110;
|
||||
public static final int ARM64_REG_Q9 = 111;
|
||||
public static final int ARM64_REG_Q10 = 112;
|
||||
public static final int ARM64_REG_Q11 = 113;
|
||||
public static final int ARM64_REG_Q12 = 114;
|
||||
public static final int ARM64_REG_Q13 = 115;
|
||||
public static final int ARM64_REG_Q14 = 116;
|
||||
public static final int ARM64_REG_Q15 = 117;
|
||||
public static final int ARM64_REG_Q16 = 118;
|
||||
public static final int ARM64_REG_Q17 = 119;
|
||||
public static final int ARM64_REG_Q18 = 120;
|
||||
public static final int ARM64_REG_Q19 = 121;
|
||||
public static final int ARM64_REG_Q20 = 122;
|
||||
public static final int ARM64_REG_Q21 = 123;
|
||||
public static final int ARM64_REG_Q22 = 124;
|
||||
public static final int ARM64_REG_Q23 = 125;
|
||||
public static final int ARM64_REG_Q24 = 126;
|
||||
public static final int ARM64_REG_Q25 = 127;
|
||||
public static final int ARM64_REG_Q26 = 128;
|
||||
public static final int ARM64_REG_Q27 = 129;
|
||||
public static final int ARM64_REG_Q28 = 130;
|
||||
public static final int ARM64_REG_Q29 = 131;
|
||||
public static final int ARM64_REG_Q30 = 132;
|
||||
public static final int ARM64_REG_Q31 = 133;
|
||||
public static final int ARM64_REG_S0 = 134;
|
||||
public static final int ARM64_REG_S1 = 135;
|
||||
public static final int ARM64_REG_S2 = 136;
|
||||
public static final int ARM64_REG_S3 = 137;
|
||||
public static final int ARM64_REG_S4 = 138;
|
||||
public static final int ARM64_REG_S5 = 139;
|
||||
public static final int ARM64_REG_S6 = 140;
|
||||
public static final int ARM64_REG_S7 = 141;
|
||||
public static final int ARM64_REG_S8 = 142;
|
||||
public static final int ARM64_REG_S9 = 143;
|
||||
public static final int ARM64_REG_S10 = 144;
|
||||
public static final int ARM64_REG_S11 = 145;
|
||||
public static final int ARM64_REG_S12 = 146;
|
||||
public static final int ARM64_REG_S13 = 147;
|
||||
public static final int ARM64_REG_S14 = 148;
|
||||
public static final int ARM64_REG_S15 = 149;
|
||||
public static final int ARM64_REG_S16 = 150;
|
||||
public static final int ARM64_REG_S17 = 151;
|
||||
public static final int ARM64_REG_S18 = 152;
|
||||
public static final int ARM64_REG_S19 = 153;
|
||||
public static final int ARM64_REG_S20 = 154;
|
||||
public static final int ARM64_REG_S21 = 155;
|
||||
public static final int ARM64_REG_S22 = 156;
|
||||
public static final int ARM64_REG_S23 = 157;
|
||||
public static final int ARM64_REG_S24 = 158;
|
||||
public static final int ARM64_REG_S25 = 159;
|
||||
public static final int ARM64_REG_S26 = 160;
|
||||
public static final int ARM64_REG_S27 = 161;
|
||||
public static final int ARM64_REG_S28 = 162;
|
||||
public static final int ARM64_REG_S29 = 163;
|
||||
public static final int ARM64_REG_S30 = 164;
|
||||
public static final int ARM64_REG_S31 = 165;
|
||||
public static final int ARM64_REG_W0 = 166;
|
||||
public static final int ARM64_REG_W1 = 167;
|
||||
public static final int ARM64_REG_W2 = 168;
|
||||
public static final int ARM64_REG_W3 = 169;
|
||||
public static final int ARM64_REG_W4 = 170;
|
||||
public static final int ARM64_REG_W5 = 171;
|
||||
public static final int ARM64_REG_W6 = 172;
|
||||
public static final int ARM64_REG_W7 = 173;
|
||||
public static final int ARM64_REG_W8 = 174;
|
||||
public static final int ARM64_REG_W9 = 175;
|
||||
public static final int ARM64_REG_W10 = 176;
|
||||
public static final int ARM64_REG_W11 = 177;
|
||||
public static final int ARM64_REG_W12 = 178;
|
||||
public static final int ARM64_REG_W13 = 179;
|
||||
public static final int ARM64_REG_W14 = 180;
|
||||
public static final int ARM64_REG_W15 = 181;
|
||||
public static final int ARM64_REG_W16 = 182;
|
||||
public static final int ARM64_REG_W17 = 183;
|
||||
public static final int ARM64_REG_W18 = 184;
|
||||
public static final int ARM64_REG_W19 = 185;
|
||||
public static final int ARM64_REG_W20 = 186;
|
||||
public static final int ARM64_REG_W21 = 187;
|
||||
public static final int ARM64_REG_W22 = 188;
|
||||
public static final int ARM64_REG_W23 = 189;
|
||||
public static final int ARM64_REG_W24 = 190;
|
||||
public static final int ARM64_REG_W25 = 191;
|
||||
public static final int ARM64_REG_W26 = 192;
|
||||
public static final int ARM64_REG_W27 = 193;
|
||||
public static final int ARM64_REG_W28 = 194;
|
||||
public static final int ARM64_REG_W29 = 195;
|
||||
public static final int ARM64_REG_W30 = 196;
|
||||
public static final int ARM64_REG_X0 = 197;
|
||||
public static final int ARM64_REG_X1 = 198;
|
||||
public static final int ARM64_REG_X2 = 199;
|
||||
public static final int ARM64_REG_X3 = 200;
|
||||
public static final int ARM64_REG_X4 = 201;
|
||||
public static final int ARM64_REG_X5 = 202;
|
||||
public static final int ARM64_REG_X6 = 203;
|
||||
public static final int ARM64_REG_X7 = 204;
|
||||
public static final int ARM64_REG_X8 = 205;
|
||||
public static final int ARM64_REG_X9 = 206;
|
||||
public static final int ARM64_REG_X10 = 207;
|
||||
public static final int ARM64_REG_X11 = 208;
|
||||
public static final int ARM64_REG_X12 = 209;
|
||||
public static final int ARM64_REG_X13 = 210;
|
||||
public static final int ARM64_REG_X14 = 211;
|
||||
public static final int ARM64_REG_X15 = 212;
|
||||
public static final int ARM64_REG_X16 = 213;
|
||||
public static final int ARM64_REG_X17 = 214;
|
||||
public static final int ARM64_REG_X18 = 215;
|
||||
public static final int ARM64_REG_X19 = 216;
|
||||
public static final int ARM64_REG_X20 = 217;
|
||||
public static final int ARM64_REG_X21 = 218;
|
||||
public static final int ARM64_REG_X22 = 219;
|
||||
public static final int ARM64_REG_X23 = 220;
|
||||
public static final int ARM64_REG_X24 = 221;
|
||||
public static final int ARM64_REG_X25 = 222;
|
||||
public static final int ARM64_REG_X26 = 223;
|
||||
public static final int ARM64_REG_X27 = 224;
|
||||
public static final int ARM64_REG_X28 = 225;
|
||||
public static final int ARM64_REG_X29 = 226;
|
||||
public static final int ARM64_REG_X30 = 227;
|
||||
public static final int ARM64_REG_MAX = 228;
|
||||
|
||||
// alias registers
|
||||
public static final int ARM64_REG_IP1 = ARM64_REG_X16;
|
||||
public static final int ARM64_REG_IP0 = ARM64_REG_X17;
|
||||
public static final int ARM64_REG_FP = ARM64_REG_X29;
|
||||
public static final int ARM64_REG_LR = ARM64_REG_X30;
|
||||
public static final int ARM64_REG_XZR = ARM64_REG_SP;
|
||||
public static final int ARM64_REG_WZR = ARM64_REG_WSP;
|
||||
|
||||
// ARM64 instruction
|
||||
|
||||
|
@ -502,6 +502,9 @@ class CsInsn(object):
|
||||
# Diet engine cannot provide register name
|
||||
raise CsError(CS_ERR_DIET)
|
||||
|
||||
if reg_id == 0:
|
||||
return "(invalid)"
|
||||
|
||||
return _cs.cs_reg_name(self._cs.csh, reg_id).decode('ascii')
|
||||
|
||||
# get the instruction string
|
||||
@ -510,6 +513,9 @@ class CsInsn(object):
|
||||
# Diet engine cannot provide instruction name
|
||||
raise CsError(CS_ERR_DIET)
|
||||
|
||||
if self._raw.id == 0:
|
||||
return "(invalid)"
|
||||
|
||||
return _cs.cs_insn_name(self._cs.csh, self.id).decode('ascii')
|
||||
|
||||
# verify if this insn belong to group with id as @group_id
|
||||
|
@ -55,238 +55,238 @@ ARM64_OP_MEM = 5
|
||||
ARM64_REG_INVALID = 0
|
||||
ARM64_REG_NZCV = 1
|
||||
ARM64_REG_WSP = 2
|
||||
ARM64_REG_SP = 3
|
||||
ARM64_REG_B0 = 4
|
||||
ARM64_REG_B1 = 5
|
||||
ARM64_REG_B2 = 6
|
||||
ARM64_REG_B3 = 7
|
||||
ARM64_REG_B4 = 8
|
||||
ARM64_REG_B5 = 9
|
||||
ARM64_REG_B6 = 10
|
||||
ARM64_REG_B7 = 11
|
||||
ARM64_REG_B8 = 12
|
||||
ARM64_REG_B9 = 13
|
||||
ARM64_REG_B10 = 14
|
||||
ARM64_REG_B11 = 15
|
||||
ARM64_REG_B12 = 16
|
||||
ARM64_REG_B13 = 17
|
||||
ARM64_REG_B14 = 18
|
||||
ARM64_REG_B15 = 19
|
||||
ARM64_REG_B16 = 20
|
||||
ARM64_REG_B17 = 21
|
||||
ARM64_REG_B18 = 22
|
||||
ARM64_REG_B19 = 23
|
||||
ARM64_REG_B20 = 24
|
||||
ARM64_REG_B21 = 25
|
||||
ARM64_REG_B22 = 26
|
||||
ARM64_REG_B23 = 27
|
||||
ARM64_REG_B24 = 28
|
||||
ARM64_REG_B25 = 29
|
||||
ARM64_REG_B26 = 30
|
||||
ARM64_REG_B27 = 31
|
||||
ARM64_REG_B28 = 32
|
||||
ARM64_REG_B29 = 33
|
||||
ARM64_REG_B30 = 34
|
||||
ARM64_REG_B31 = 35
|
||||
ARM64_REG_D0 = 36
|
||||
ARM64_REG_D1 = 37
|
||||
ARM64_REG_D2 = 38
|
||||
ARM64_REG_D3 = 39
|
||||
ARM64_REG_D4 = 40
|
||||
ARM64_REG_D5 = 41
|
||||
ARM64_REG_D6 = 42
|
||||
ARM64_REG_D7 = 43
|
||||
ARM64_REG_D8 = 44
|
||||
ARM64_REG_D9 = 45
|
||||
ARM64_REG_D10 = 46
|
||||
ARM64_REG_D11 = 47
|
||||
ARM64_REG_D12 = 48
|
||||
ARM64_REG_D13 = 49
|
||||
ARM64_REG_D14 = 50
|
||||
ARM64_REG_D15 = 51
|
||||
ARM64_REG_D16 = 52
|
||||
ARM64_REG_D17 = 53
|
||||
ARM64_REG_D18 = 54
|
||||
ARM64_REG_D19 = 55
|
||||
ARM64_REG_D20 = 56
|
||||
ARM64_REG_D21 = 57
|
||||
ARM64_REG_D22 = 58
|
||||
ARM64_REG_D23 = 59
|
||||
ARM64_REG_D24 = 60
|
||||
ARM64_REG_D25 = 61
|
||||
ARM64_REG_D26 = 62
|
||||
ARM64_REG_D27 = 63
|
||||
ARM64_REG_D28 = 64
|
||||
ARM64_REG_D29 = 65
|
||||
ARM64_REG_D30 = 66
|
||||
ARM64_REG_D31 = 67
|
||||
ARM64_REG_H0 = 68
|
||||
ARM64_REG_H1 = 69
|
||||
ARM64_REG_H2 = 70
|
||||
ARM64_REG_H3 = 71
|
||||
ARM64_REG_H4 = 72
|
||||
ARM64_REG_H5 = 73
|
||||
ARM64_REG_H6 = 74
|
||||
ARM64_REG_H7 = 75
|
||||
ARM64_REG_H8 = 76
|
||||
ARM64_REG_H9 = 77
|
||||
ARM64_REG_H10 = 78
|
||||
ARM64_REG_H11 = 79
|
||||
ARM64_REG_H12 = 80
|
||||
ARM64_REG_H13 = 81
|
||||
ARM64_REG_H14 = 82
|
||||
ARM64_REG_H15 = 83
|
||||
ARM64_REG_H16 = 84
|
||||
ARM64_REG_H17 = 85
|
||||
ARM64_REG_H18 = 86
|
||||
ARM64_REG_H19 = 87
|
||||
ARM64_REG_H20 = 88
|
||||
ARM64_REG_H21 = 89
|
||||
ARM64_REG_H22 = 90
|
||||
ARM64_REG_H23 = 91
|
||||
ARM64_REG_H24 = 92
|
||||
ARM64_REG_H25 = 93
|
||||
ARM64_REG_H26 = 94
|
||||
ARM64_REG_H27 = 95
|
||||
ARM64_REG_H28 = 96
|
||||
ARM64_REG_H29 = 97
|
||||
ARM64_REG_H30 = 98
|
||||
ARM64_REG_H31 = 99
|
||||
ARM64_REG_Q0 = 100
|
||||
ARM64_REG_Q1 = 101
|
||||
ARM64_REG_Q2 = 102
|
||||
ARM64_REG_Q3 = 103
|
||||
ARM64_REG_Q4 = 104
|
||||
ARM64_REG_Q5 = 105
|
||||
ARM64_REG_Q6 = 106
|
||||
ARM64_REG_Q7 = 107
|
||||
ARM64_REG_Q8 = 108
|
||||
ARM64_REG_Q9 = 109
|
||||
ARM64_REG_Q10 = 110
|
||||
ARM64_REG_Q11 = 111
|
||||
ARM64_REG_Q12 = 112
|
||||
ARM64_REG_Q13 = 113
|
||||
ARM64_REG_Q14 = 114
|
||||
ARM64_REG_Q15 = 115
|
||||
ARM64_REG_Q16 = 116
|
||||
ARM64_REG_Q17 = 117
|
||||
ARM64_REG_Q18 = 118
|
||||
ARM64_REG_Q19 = 119
|
||||
ARM64_REG_Q20 = 120
|
||||
ARM64_REG_Q21 = 121
|
||||
ARM64_REG_Q22 = 122
|
||||
ARM64_REG_Q23 = 123
|
||||
ARM64_REG_Q24 = 124
|
||||
ARM64_REG_Q25 = 125
|
||||
ARM64_REG_Q26 = 126
|
||||
ARM64_REG_Q27 = 127
|
||||
ARM64_REG_Q28 = 128
|
||||
ARM64_REG_Q29 = 129
|
||||
ARM64_REG_Q30 = 130
|
||||
ARM64_REG_Q31 = 131
|
||||
ARM64_REG_S0 = 132
|
||||
ARM64_REG_S1 = 133
|
||||
ARM64_REG_S2 = 134
|
||||
ARM64_REG_S3 = 135
|
||||
ARM64_REG_S4 = 136
|
||||
ARM64_REG_S5 = 137
|
||||
ARM64_REG_S6 = 138
|
||||
ARM64_REG_S7 = 139
|
||||
ARM64_REG_S8 = 140
|
||||
ARM64_REG_S9 = 141
|
||||
ARM64_REG_S10 = 142
|
||||
ARM64_REG_S11 = 143
|
||||
ARM64_REG_S12 = 144
|
||||
ARM64_REG_S13 = 145
|
||||
ARM64_REG_S14 = 146
|
||||
ARM64_REG_S15 = 147
|
||||
ARM64_REG_S16 = 148
|
||||
ARM64_REG_S17 = 149
|
||||
ARM64_REG_S18 = 150
|
||||
ARM64_REG_S19 = 151
|
||||
ARM64_REG_S20 = 152
|
||||
ARM64_REG_S21 = 153
|
||||
ARM64_REG_S22 = 154
|
||||
ARM64_REG_S23 = 155
|
||||
ARM64_REG_S24 = 156
|
||||
ARM64_REG_S25 = 157
|
||||
ARM64_REG_S26 = 158
|
||||
ARM64_REG_S27 = 159
|
||||
ARM64_REG_S28 = 160
|
||||
ARM64_REG_S29 = 161
|
||||
ARM64_REG_S30 = 162
|
||||
ARM64_REG_S31 = 163
|
||||
ARM64_REG_W0 = 164
|
||||
ARM64_REG_W1 = 165
|
||||
ARM64_REG_W2 = 166
|
||||
ARM64_REG_W3 = 167
|
||||
ARM64_REG_W4 = 168
|
||||
ARM64_REG_W5 = 169
|
||||
ARM64_REG_W6 = 170
|
||||
ARM64_REG_W7 = 171
|
||||
ARM64_REG_W8 = 172
|
||||
ARM64_REG_W9 = 173
|
||||
ARM64_REG_W10 = 174
|
||||
ARM64_REG_W11 = 175
|
||||
ARM64_REG_W12 = 176
|
||||
ARM64_REG_W13 = 177
|
||||
ARM64_REG_W14 = 178
|
||||
ARM64_REG_W15 = 179
|
||||
ARM64_REG_W16 = 180
|
||||
ARM64_REG_W17 = 181
|
||||
ARM64_REG_W18 = 182
|
||||
ARM64_REG_W19 = 183
|
||||
ARM64_REG_W20 = 184
|
||||
ARM64_REG_W21 = 185
|
||||
ARM64_REG_W22 = 186
|
||||
ARM64_REG_W23 = 187
|
||||
ARM64_REG_W24 = 188
|
||||
ARM64_REG_W25 = 189
|
||||
ARM64_REG_W26 = 190
|
||||
ARM64_REG_W27 = 191
|
||||
ARM64_REG_W28 = 192
|
||||
ARM64_REG_W29 = 193
|
||||
ARM64_REG_W30 = 194
|
||||
ARM64_REG_X0 = 195
|
||||
ARM64_REG_X1 = 196
|
||||
ARM64_REG_X2 = 197
|
||||
ARM64_REG_X3 = 198
|
||||
ARM64_REG_X4 = 199
|
||||
ARM64_REG_X5 = 200
|
||||
ARM64_REG_X6 = 201
|
||||
ARM64_REG_X7 = 202
|
||||
ARM64_REG_X8 = 203
|
||||
ARM64_REG_X9 = 204
|
||||
ARM64_REG_X10 = 205
|
||||
ARM64_REG_X11 = 206
|
||||
ARM64_REG_X12 = 207
|
||||
ARM64_REG_X13 = 208
|
||||
ARM64_REG_X14 = 209
|
||||
ARM64_REG_X15 = 210
|
||||
ARM64_REG_X16 = 211
|
||||
ARM64_REG_X17 = 212
|
||||
ARM64_REG_X18 = 213
|
||||
ARM64_REG_X19 = 214
|
||||
ARM64_REG_X20 = 215
|
||||
ARM64_REG_X21 = 216
|
||||
ARM64_REG_X22 = 217
|
||||
ARM64_REG_X23 = 218
|
||||
ARM64_REG_X24 = 219
|
||||
ARM64_REG_X25 = 220
|
||||
ARM64_REG_X26 = 221
|
||||
ARM64_REG_X27 = 222
|
||||
ARM64_REG_X28 = 223
|
||||
ARM64_REG_X29 = 224
|
||||
ARM64_REG_X30 = 225
|
||||
ARM64_REG_MAX = 226
|
||||
ARM64_REG_WZR = 3
|
||||
ARM64_REG_SP = 4
|
||||
ARM64_REG_XZR = 5
|
||||
ARM64_REG_B0 = 6
|
||||
ARM64_REG_B1 = 7
|
||||
ARM64_REG_B2 = 8
|
||||
ARM64_REG_B3 = 9
|
||||
ARM64_REG_B4 = 10
|
||||
ARM64_REG_B5 = 11
|
||||
ARM64_REG_B6 = 12
|
||||
ARM64_REG_B7 = 13
|
||||
ARM64_REG_B8 = 14
|
||||
ARM64_REG_B9 = 15
|
||||
ARM64_REG_B10 = 16
|
||||
ARM64_REG_B11 = 17
|
||||
ARM64_REG_B12 = 18
|
||||
ARM64_REG_B13 = 19
|
||||
ARM64_REG_B14 = 20
|
||||
ARM64_REG_B15 = 21
|
||||
ARM64_REG_B16 = 22
|
||||
ARM64_REG_B17 = 23
|
||||
ARM64_REG_B18 = 24
|
||||
ARM64_REG_B19 = 25
|
||||
ARM64_REG_B20 = 26
|
||||
ARM64_REG_B21 = 27
|
||||
ARM64_REG_B22 = 28
|
||||
ARM64_REG_B23 = 29
|
||||
ARM64_REG_B24 = 30
|
||||
ARM64_REG_B25 = 31
|
||||
ARM64_REG_B26 = 32
|
||||
ARM64_REG_B27 = 33
|
||||
ARM64_REG_B28 = 34
|
||||
ARM64_REG_B29 = 35
|
||||
ARM64_REG_B30 = 36
|
||||
ARM64_REG_B31 = 37
|
||||
ARM64_REG_D0 = 38
|
||||
ARM64_REG_D1 = 39
|
||||
ARM64_REG_D2 = 40
|
||||
ARM64_REG_D3 = 41
|
||||
ARM64_REG_D4 = 42
|
||||
ARM64_REG_D5 = 43
|
||||
ARM64_REG_D6 = 44
|
||||
ARM64_REG_D7 = 45
|
||||
ARM64_REG_D8 = 46
|
||||
ARM64_REG_D9 = 47
|
||||
ARM64_REG_D10 = 48
|
||||
ARM64_REG_D11 = 49
|
||||
ARM64_REG_D12 = 50
|
||||
ARM64_REG_D13 = 51
|
||||
ARM64_REG_D14 = 52
|
||||
ARM64_REG_D15 = 53
|
||||
ARM64_REG_D16 = 54
|
||||
ARM64_REG_D17 = 55
|
||||
ARM64_REG_D18 = 56
|
||||
ARM64_REG_D19 = 57
|
||||
ARM64_REG_D20 = 58
|
||||
ARM64_REG_D21 = 59
|
||||
ARM64_REG_D22 = 60
|
||||
ARM64_REG_D23 = 61
|
||||
ARM64_REG_D24 = 62
|
||||
ARM64_REG_D25 = 63
|
||||
ARM64_REG_D26 = 64
|
||||
ARM64_REG_D27 = 65
|
||||
ARM64_REG_D28 = 66
|
||||
ARM64_REG_D29 = 67
|
||||
ARM64_REG_D30 = 68
|
||||
ARM64_REG_D31 = 69
|
||||
ARM64_REG_H0 = 70
|
||||
ARM64_REG_H1 = 71
|
||||
ARM64_REG_H2 = 72
|
||||
ARM64_REG_H3 = 73
|
||||
ARM64_REG_H4 = 74
|
||||
ARM64_REG_H5 = 75
|
||||
ARM64_REG_H6 = 76
|
||||
ARM64_REG_H7 = 77
|
||||
ARM64_REG_H8 = 78
|
||||
ARM64_REG_H9 = 79
|
||||
ARM64_REG_H10 = 80
|
||||
ARM64_REG_H11 = 81
|
||||
ARM64_REG_H12 = 82
|
||||
ARM64_REG_H13 = 83
|
||||
ARM64_REG_H14 = 84
|
||||
ARM64_REG_H15 = 85
|
||||
ARM64_REG_H16 = 86
|
||||
ARM64_REG_H17 = 87
|
||||
ARM64_REG_H18 = 88
|
||||
ARM64_REG_H19 = 89
|
||||
ARM64_REG_H20 = 90
|
||||
ARM64_REG_H21 = 91
|
||||
ARM64_REG_H22 = 92
|
||||
ARM64_REG_H23 = 93
|
||||
ARM64_REG_H24 = 94
|
||||
ARM64_REG_H25 = 95
|
||||
ARM64_REG_H26 = 96
|
||||
ARM64_REG_H27 = 97
|
||||
ARM64_REG_H28 = 98
|
||||
ARM64_REG_H29 = 99
|
||||
ARM64_REG_H30 = 100
|
||||
ARM64_REG_H31 = 101
|
||||
ARM64_REG_Q0 = 102
|
||||
ARM64_REG_Q1 = 103
|
||||
ARM64_REG_Q2 = 104
|
||||
ARM64_REG_Q3 = 105
|
||||
ARM64_REG_Q4 = 106
|
||||
ARM64_REG_Q5 = 107
|
||||
ARM64_REG_Q6 = 108
|
||||
ARM64_REG_Q7 = 109
|
||||
ARM64_REG_Q8 = 110
|
||||
ARM64_REG_Q9 = 111
|
||||
ARM64_REG_Q10 = 112
|
||||
ARM64_REG_Q11 = 113
|
||||
ARM64_REG_Q12 = 114
|
||||
ARM64_REG_Q13 = 115
|
||||
ARM64_REG_Q14 = 116
|
||||
ARM64_REG_Q15 = 117
|
||||
ARM64_REG_Q16 = 118
|
||||
ARM64_REG_Q17 = 119
|
||||
ARM64_REG_Q18 = 120
|
||||
ARM64_REG_Q19 = 121
|
||||
ARM64_REG_Q20 = 122
|
||||
ARM64_REG_Q21 = 123
|
||||
ARM64_REG_Q22 = 124
|
||||
ARM64_REG_Q23 = 125
|
||||
ARM64_REG_Q24 = 126
|
||||
ARM64_REG_Q25 = 127
|
||||
ARM64_REG_Q26 = 128
|
||||
ARM64_REG_Q27 = 129
|
||||
ARM64_REG_Q28 = 130
|
||||
ARM64_REG_Q29 = 131
|
||||
ARM64_REG_Q30 = 132
|
||||
ARM64_REG_Q31 = 133
|
||||
ARM64_REG_S0 = 134
|
||||
ARM64_REG_S1 = 135
|
||||
ARM64_REG_S2 = 136
|
||||
ARM64_REG_S3 = 137
|
||||
ARM64_REG_S4 = 138
|
||||
ARM64_REG_S5 = 139
|
||||
ARM64_REG_S6 = 140
|
||||
ARM64_REG_S7 = 141
|
||||
ARM64_REG_S8 = 142
|
||||
ARM64_REG_S9 = 143
|
||||
ARM64_REG_S10 = 144
|
||||
ARM64_REG_S11 = 145
|
||||
ARM64_REG_S12 = 146
|
||||
ARM64_REG_S13 = 147
|
||||
ARM64_REG_S14 = 148
|
||||
ARM64_REG_S15 = 149
|
||||
ARM64_REG_S16 = 150
|
||||
ARM64_REG_S17 = 151
|
||||
ARM64_REG_S18 = 152
|
||||
ARM64_REG_S19 = 153
|
||||
ARM64_REG_S20 = 154
|
||||
ARM64_REG_S21 = 155
|
||||
ARM64_REG_S22 = 156
|
||||
ARM64_REG_S23 = 157
|
||||
ARM64_REG_S24 = 158
|
||||
ARM64_REG_S25 = 159
|
||||
ARM64_REG_S26 = 160
|
||||
ARM64_REG_S27 = 161
|
||||
ARM64_REG_S28 = 162
|
||||
ARM64_REG_S29 = 163
|
||||
ARM64_REG_S30 = 164
|
||||
ARM64_REG_S31 = 165
|
||||
ARM64_REG_W0 = 166
|
||||
ARM64_REG_W1 = 167
|
||||
ARM64_REG_W2 = 168
|
||||
ARM64_REG_W3 = 169
|
||||
ARM64_REG_W4 = 170
|
||||
ARM64_REG_W5 = 171
|
||||
ARM64_REG_W6 = 172
|
||||
ARM64_REG_W7 = 173
|
||||
ARM64_REG_W8 = 174
|
||||
ARM64_REG_W9 = 175
|
||||
ARM64_REG_W10 = 176
|
||||
ARM64_REG_W11 = 177
|
||||
ARM64_REG_W12 = 178
|
||||
ARM64_REG_W13 = 179
|
||||
ARM64_REG_W14 = 180
|
||||
ARM64_REG_W15 = 181
|
||||
ARM64_REG_W16 = 182
|
||||
ARM64_REG_W17 = 183
|
||||
ARM64_REG_W18 = 184
|
||||
ARM64_REG_W19 = 185
|
||||
ARM64_REG_W20 = 186
|
||||
ARM64_REG_W21 = 187
|
||||
ARM64_REG_W22 = 188
|
||||
ARM64_REG_W23 = 189
|
||||
ARM64_REG_W24 = 190
|
||||
ARM64_REG_W25 = 191
|
||||
ARM64_REG_W26 = 192
|
||||
ARM64_REG_W27 = 193
|
||||
ARM64_REG_W28 = 194
|
||||
ARM64_REG_W29 = 195
|
||||
ARM64_REG_W30 = 196
|
||||
ARM64_REG_X0 = 197
|
||||
ARM64_REG_X1 = 198
|
||||
ARM64_REG_X2 = 199
|
||||
ARM64_REG_X3 = 200
|
||||
ARM64_REG_X4 = 201
|
||||
ARM64_REG_X5 = 202
|
||||
ARM64_REG_X6 = 203
|
||||
ARM64_REG_X7 = 204
|
||||
ARM64_REG_X8 = 205
|
||||
ARM64_REG_X9 = 206
|
||||
ARM64_REG_X10 = 207
|
||||
ARM64_REG_X11 = 208
|
||||
ARM64_REG_X12 = 209
|
||||
ARM64_REG_X13 = 210
|
||||
ARM64_REG_X14 = 211
|
||||
ARM64_REG_X15 = 212
|
||||
ARM64_REG_X16 = 213
|
||||
ARM64_REG_X17 = 214
|
||||
ARM64_REG_X18 = 215
|
||||
ARM64_REG_X19 = 216
|
||||
ARM64_REG_X20 = 217
|
||||
ARM64_REG_X21 = 218
|
||||
ARM64_REG_X22 = 219
|
||||
ARM64_REG_X23 = 220
|
||||
ARM64_REG_X24 = 221
|
||||
ARM64_REG_X25 = 222
|
||||
ARM64_REG_X26 = 223
|
||||
ARM64_REG_X27 = 224
|
||||
ARM64_REG_X28 = 225
|
||||
ARM64_REG_X29 = 226
|
||||
ARM64_REG_X30 = 227
|
||||
ARM64_REG_MAX = 228
|
||||
|
||||
# alias registers
|
||||
ARM64_REG_IP1 = ARM64_REG_X16
|
||||
ARM64_REG_IP0 = ARM64_REG_X17
|
||||
ARM64_REG_FP = ARM64_REG_X29
|
||||
ARM64_REG_LR = ARM64_REG_X30
|
||||
ARM64_REG_XZR = ARM64_REG_SP
|
||||
ARM64_REG_WZR = ARM64_REG_WSP
|
||||
|
||||
# ARM64 instruction
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
|
||||
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
import binascii
|
||||
import sys
|
||||
|
||||
from xprint import to_hex, to_x, to_x_32
|
||||
|
||||
_python3 = sys.version_info.major == 3
|
||||
|
||||
|
||||
@ -43,38 +46,6 @@ all_tests = (
|
||||
)
|
||||
|
||||
|
||||
def to_hex(s):
|
||||
if _python3:
|
||||
return " ".join("0x{0:02x}".format(c) for c in s) # <-- Python 3 is OK
|
||||
else:
|
||||
return " ".join("0x{0:02x}".format(ord(c)) for c in s)
|
||||
|
||||
def to_x(s):
|
||||
from struct import pack
|
||||
if not s: return '0'
|
||||
x = pack(">q", s)
|
||||
while x[0] in ('\0', 0): x = x[1:]
|
||||
if _python3:
|
||||
ret = "".join("{0:02x}".format(c) for c in x) # <-- Python 3 is OK
|
||||
else:
|
||||
ret = "".join("{0:02x}".format(ord(c)) for c in x)
|
||||
if len(ret) > 1 and ret[0] == '0': # 01234 -> 1234
|
||||
ret = ret[1:]
|
||||
return ret
|
||||
|
||||
def to_x_32(s):
|
||||
from struct import pack
|
||||
if not s: return '0'
|
||||
x = pack(">i", s)
|
||||
while x[0] in ('\0', 0): x = x[1:]
|
||||
if _python3:
|
||||
ret = "".join("{0:02x}".format(c) for c in x) # <-- Python 3 is OK
|
||||
else:
|
||||
ret = "".join("{0:02x}".format(ord(c)) for c in x)
|
||||
if len(ret) > 1 and ret[0] == '0':
|
||||
ret = ret[1:]
|
||||
return ret
|
||||
|
||||
# ## Test cs_disasm_quick()
|
||||
def test_cs_disasm_quick():
|
||||
for arch, mode, code, comment, syntax in all_tests:
|
||||
|
9
bindings/python/test_all.py
Normal file → Executable file
9
bindings/python/test_all.py
Normal file → Executable file
@ -1,6 +1,8 @@
|
||||
#!/bin/env python
|
||||
#!/usr/bin/env python
|
||||
|
||||
import test, test_arm, test_arm64, test_detail, test_lite, test_mips, test_ppc, \
|
||||
test_x86
|
||||
test_x86, test_skipdata, test_sparc, test_systemz
|
||||
|
||||
|
||||
test.test_class()
|
||||
test_arm.test_class()
|
||||
@ -9,4 +11,7 @@ test_detail.test_class()
|
||||
test_lite.test_class()
|
||||
test_mips.test_class()
|
||||
test_ppc.test_class()
|
||||
test_sparc.test_class()
|
||||
test_systemz.test_class()
|
||||
test_x86.test_class()
|
||||
test_skipdata.test_class()
|
||||
|
@ -1,11 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
|
||||
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
from capstone.arm import *
|
||||
from test import to_hex, to_x, to_x_32
|
||||
from xprint import to_hex, to_x, to_x_32
|
||||
|
||||
|
||||
ARM_CODE = b"\xED\xFF\xFF\xEB\x04\xe0\x2d\xe5\x00\x00\x00\x00\xe0\x83\x22\xe5\xf1\x02\x03\x0e\x00\x00\xa0\xe3\x02\x30\xc1\xe7\x00\x00\x53\xe3"
|
||||
ARM_CODE2 = b"\xd1\xe8\x00\xf0\xf0\x24\x04\x07\x1f\x3c\xf2\xc0\x00\x00\x4f\xf0\x00\x01\x46\x6c"
|
||||
@ -19,56 +20,59 @@ all_tests = (
|
||||
(CS_ARCH_ARM, CS_MODE_THUMB, THUMB_CODE2, "Thumb-2 & register named with numbers", CS_OPT_SYNTAX_NOREGNAME),
|
||||
)
|
||||
|
||||
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = 0
|
||||
for i in insn.operands:
|
||||
if i.type == ARM_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == ARM_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x_32(i.imm)))
|
||||
if i.type == ARM_OP_PIMM:
|
||||
print("\t\toperands[%u].type: P-IMM = %u" % (c, i.imm))
|
||||
if i.type == ARM_OP_CIMM:
|
||||
print("\t\toperands[%u].type: C-IMM = %u" % (c, i.imm))
|
||||
if i.type == ARM_OP_FP:
|
||||
print("\t\toperands[%u].type: FP = %f" % (c, i.fp))
|
||||
if i.type == ARM_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.index != 0:
|
||||
print("\t\t\toperands[%u].mem.index: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.index)))
|
||||
if i.mem.scale != 1:
|
||||
print("\t\t\toperands[%u].mem.scale: %u" \
|
||||
% (c, i.mem.scale))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x_32(i.mem.disp)))
|
||||
|
||||
if i.shift.type != ARM_SFT_INVALID and i.shift.value:
|
||||
print("\t\t\tShift: type = %u, value = %u\n" \
|
||||
% (i.shift.type, i.shift.value))
|
||||
c += 1
|
||||
|
||||
if insn.update_flags:
|
||||
print("\tUpdate-flags: True")
|
||||
if insn.writeback:
|
||||
print("\tWrite-back: True")
|
||||
if not insn.cc in [ARM_CC_AL, ARM_CC_INVALID]:
|
||||
print("\tCode condition: %u" % insn.cc)
|
||||
|
||||
|
||||
# ## Test class Cs
|
||||
def test_class():
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = 0
|
||||
for i in insn.operands:
|
||||
if i.type == ARM_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == ARM_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x_32(i.imm)))
|
||||
if i.type == ARM_OP_PIMM:
|
||||
print("\t\toperands[%u].type: P-IMM = %u" % (c, i.imm))
|
||||
if i.type == ARM_OP_CIMM:
|
||||
print("\t\toperands[%u].type: C-IMM = %u" % (c, i.imm))
|
||||
if i.type == ARM_OP_FP:
|
||||
print("\t\toperands[%u].type: FP = %f" % (c, i.fp))
|
||||
if i.type == ARM_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.index != 0:
|
||||
print("\t\t\toperands[%u].mem.index: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.index)))
|
||||
if i.mem.scale != 1:
|
||||
print("\t\t\toperands[%u].mem.scale: %u" \
|
||||
% (c, i.mem.scale))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x_32(i.mem.disp)))
|
||||
|
||||
if i.shift.type != ARM_SFT_INVALID and i.shift.value:
|
||||
print("\t\t\tShift: type = %u, value = %u\n" \
|
||||
% (i.shift.type, i.shift.value))
|
||||
c += 1
|
||||
|
||||
if insn.update_flags:
|
||||
print("\tUpdate-flags: True")
|
||||
if insn.writeback:
|
||||
print("\tWrite-back: True")
|
||||
if not insn.cc in [ARM_CC_AL, ARM_CC_INVALID]:
|
||||
print("\tCode condition: %u" % insn.cc)
|
||||
|
||||
for (arch, mode, code, comment, syntax) in all_tests:
|
||||
print("*" * 16)
|
||||
@ -88,5 +92,6 @@ def test_class():
|
||||
except CsError as e:
|
||||
print("ERROR: %s" % e)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_class()
|
||||
|
@ -1,63 +1,69 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
|
||||
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
from capstone.arm64 import *
|
||||
from test import to_hex, to_x
|
||||
from xprint import to_hex, to_x
|
||||
|
||||
|
||||
ARM64_CODE = b"\x21\x7c\x02\x9b\x21\x7c\x00\x53\x00\x40\x21\x4b\xe1\x0b\x40\xb9\x20\x04\x81\xda\x20\x08\x02\x8b"
|
||||
|
||||
all_tests = (
|
||||
(CS_ARCH_ARM64, CS_MODE_ARM, ARM64_CODE, "ARM-64"),
|
||||
)
|
||||
|
||||
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = -1
|
||||
for i in insn.operands:
|
||||
c += 1
|
||||
if i.type == ARM64_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == ARM64_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x(i.imm)))
|
||||
if i.type == ARM64_OP_CIMM:
|
||||
print("\t\toperands[%u].type: C-IMM = %u" % (c, i.imm))
|
||||
if i.type == ARM64_OP_FP:
|
||||
print("\t\toperands[%u].type: FP = %f" % (c, i.fp))
|
||||
if i.type == ARM64_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.index != 0:
|
||||
print("\t\t\toperands[%u].mem.index: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.index)))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x(i.mem.disp)))
|
||||
|
||||
if i.shift.type != ARM64_SFT_INVALID and i.shift.value:
|
||||
print("\t\t\tShift: type = %u, value = %u" % (i.shift.type, i.shift.value))
|
||||
|
||||
if i.ext != ARM64_EXT_INVALID:
|
||||
print("\t\t\tExt: %u" % i.ext)
|
||||
|
||||
if insn.writeback:
|
||||
print("\tWrite-back: True")
|
||||
if not insn.cc in [ARM64_CC_AL, ARM64_CC_INVALID]:
|
||||
print("\tCode condition: %u" % insn.cc)
|
||||
if insn.update_flags:
|
||||
print("\tUpdate-flags: True")
|
||||
|
||||
|
||||
# ## Test class Cs
|
||||
def test_class():
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = -1
|
||||
for i in insn.operands:
|
||||
c += 1
|
||||
if i.type == ARM64_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == ARM64_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x(i.imm)))
|
||||
if i.type == ARM64_OP_CIMM:
|
||||
print("\t\toperands[%u].type: C-IMM = %u" % (c, i.imm))
|
||||
if i.type == ARM64_OP_FP:
|
||||
print("\t\toperands[%u].type: FP = %f" % (c, i.fp))
|
||||
if i.type == ARM64_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.index != 0:
|
||||
print("\t\t\toperands[%u].mem.index: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.index)))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x(i.mem.disp)))
|
||||
|
||||
if i.shift.type != ARM64_SFT_INVALID and i.shift.value:
|
||||
print("\t\t\tShift: type = %u, value = %u" % (i.shift.type, i.shift.value))
|
||||
|
||||
if i.ext != ARM64_EXT_INVALID:
|
||||
print("\t\t\tExt: %u" % i.ext)
|
||||
|
||||
if insn.writeback:
|
||||
print("\tWrite-back: True")
|
||||
if not insn.cc in [ARM64_CC_AL, ARM64_CC_INVALID]:
|
||||
print("\tCode condition: %u" % insn.cc)
|
||||
if insn.update_flags:
|
||||
print("\tUpdate-flags: True")
|
||||
|
||||
for (arch, mode, code, comment) in all_tests:
|
||||
print("*" * 16)
|
||||
@ -75,5 +81,6 @@ def test_class():
|
||||
except CsError as e:
|
||||
print("ERROR: %s" % e)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_class()
|
||||
|
@ -4,6 +4,7 @@
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
|
||||
|
||||
X86_CODE16 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00"
|
||||
X86_CODE32 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00"
|
||||
X86_CODE64 = b"\x55\x48\x8b\x05\xb8\x13\x00\x00"
|
||||
|
@ -4,7 +4,8 @@
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
import binascii
|
||||
from test import to_hex
|
||||
from xprint import to_hex
|
||||
|
||||
|
||||
X86_CODE16 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00"
|
||||
X86_CODE32 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00"
|
||||
|
@ -4,7 +4,8 @@
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
from capstone.mips import *
|
||||
from test import to_hex, to_x
|
||||
from xprint import to_hex, to_x
|
||||
|
||||
|
||||
MIPS_CODE = b"\x0C\x10\x00\x97\x00\x00\x00\x00\x24\x02\x00\x0c\x8f\xa2\x00\x00\x34\x21\x34\x56"
|
||||
MIPS_CODE2 = b"\x56\x34\x21\x34\xc2\x17\x01\x00"
|
||||
@ -14,35 +15,36 @@ all_tests = (
|
||||
(CS_ARCH_MIPS, CS_MODE_64 + CS_MODE_LITTLE_ENDIAN, MIPS_CODE2, "MIPS-64-EL (Little-endian)"),
|
||||
)
|
||||
|
||||
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = -1
|
||||
for i in insn.operands:
|
||||
c += 1
|
||||
if i.type == MIPS_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == MIPS_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x(i.imm)))
|
||||
if i.type == MIPS_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x(i.mem.disp)))
|
||||
|
||||
|
||||
# ## Test class Cs
|
||||
def test_class():
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = -1
|
||||
for i in insn.operands:
|
||||
c += 1
|
||||
if i.type == MIPS_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == MIPS_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x(i.imm)))
|
||||
if i.type == MIPS_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x(i.mem.disp)))
|
||||
|
||||
|
||||
for (arch, mode, code, comment) in all_tests:
|
||||
print("*" * 16)
|
||||
print("Platform: %s" % comment)
|
||||
|
@ -4,47 +4,50 @@
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
from capstone.ppc import *
|
||||
from test import to_x, to_hex, to_x_32
|
||||
from xprint import to_x, to_hex, to_x_32
|
||||
PPC_CODE = b"\x80\x20\x00\x00\x80\x3f\x00\x00\x10\x43\x23\x0e\xd0\x44\x00\x80\x4c\x43\x22\x02\x2d\x03\x00\x80\x7c\x43\x20\x14\x7c\x43\x20\x93\x4f\x20\x00\x21\x4c\xc8\x00\x21"
|
||||
|
||||
all_tests = (
|
||||
(CS_ARCH_PPC, CS_MODE_BIG_ENDIAN, PPC_CODE, "PPC-64"),
|
||||
)
|
||||
|
||||
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = 0
|
||||
for i in insn.operands:
|
||||
if i.type == PPC_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == PPC_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x_32(i.imm)))
|
||||
if i.type == PPC_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x_32(i.mem.disp)))
|
||||
c += 1
|
||||
|
||||
if insn.bc:
|
||||
print("\tBranch code: %u" % insn.bc)
|
||||
if insn.bh:
|
||||
print("\tBranch hint: %u" % insn.bh)
|
||||
if insn.update_cr0:
|
||||
print("\tUpdate-CR0: True")
|
||||
|
||||
|
||||
# ## Test class Cs
|
||||
def test_class():
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = 0
|
||||
for i in insn.operands:
|
||||
if i.type == PPC_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == PPC_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x_32(i.imm)))
|
||||
if i.type == PPC_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x_32(i.mem.disp)))
|
||||
c += 1
|
||||
|
||||
if insn.bc:
|
||||
print("\tBranch code: %u" % insn.bc)
|
||||
if insn.bh:
|
||||
print("\tBranch hint: %u" % insn.bh)
|
||||
if insn.update_cr0:
|
||||
print("\tUpdate-CR0: True")
|
||||
|
||||
for (arch, mode, code, comment) in all_tests:
|
||||
print("*" * 16)
|
||||
|
@ -5,8 +5,8 @@
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
import binascii
|
||||
from xprint import to_x, to_hex, to_x_32
|
||||
|
||||
from test import to_x, to_hex, to_x_32
|
||||
|
||||
X86_CODE32 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00\x00\x91\x92"
|
||||
RANDOM_CODE = b"\xed\x00\x00\x00\x00\x1a\x5a\x0f\x1f\xff\xc2\x09\x80\x00\x00\x00\x07\xf7\xeb\x2a\xff\xff\x7f\x57\xe3\x01\xff\xff\x7f\x57\xeb\x00\xf0\x00\x00\x24\xb2\x4f\x00\x78"
|
||||
|
@ -5,8 +5,8 @@
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
from capstone.sparc import *
|
||||
from xprint import to_x, to_hex, to_x_32
|
||||
|
||||
from test import to_x, to_hex, to_x_32
|
||||
|
||||
SPARC_CODE = b"\x80\xa0\x40\x02\x85\xc2\x60\x08\x85\xe8\x20\x01\x81\xe8\x00\x00\x90\x10\x20\x01\xd5\xf6\x10\x16\x21\x00\x00\x0a\x86\x00\x40\x02\x01\x00\x00\x00\x12\xbf\xff\xff\x10\xbf\xff\xff\xa0\x02\x00\x09\x0d\xbf\xff\xff\xd4\x20\x60\x00\xd4\x4e\x00\x16\x2a\xc2\x80\x03"
|
||||
SPARCV9_CODE = b"\x81\xa8\x0a\x24\x89\xa0\x10\x20\x89\xa0\x1a\x60\x89\xa0\x00\xe0"
|
||||
@ -16,42 +16,41 @@ all_tests = (
|
||||
(CS_ARCH_SPARC, CS_MODE_BIG_ENDIAN+CS_MODE_V9, SPARCV9_CODE, "SparcV9"),
|
||||
)
|
||||
|
||||
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = 0
|
||||
for i in insn.operands:
|
||||
if i.type == SPARC_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == SPARC_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x_32(i.imm)))
|
||||
if i.type == SPARC_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x_32(i.mem.disp)))
|
||||
c += 1
|
||||
|
||||
if insn.cc:
|
||||
print("\tCode condition: %u" % insn.cc)
|
||||
if insn.hint:
|
||||
print("\tBranch hint: %u" % insn.hint)
|
||||
|
||||
|
||||
# ## Test class Cs
|
||||
def test_class():
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = 0
|
||||
for i in insn.operands:
|
||||
if i.type == SPARC_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == SPARC_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x_32(i.imm)))
|
||||
if i.type == SPARC_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.index != 0:
|
||||
print("\t\t\toperands[%u].mem.index: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.index)))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x_32(i.mem.disp)))
|
||||
c += 1
|
||||
|
||||
if insn.cc:
|
||||
print("\tCode condition: %u" % insn.cc)
|
||||
if insn.hint:
|
||||
print("\tHint code: %u" % insn.hint)
|
||||
|
||||
for (arch, mode, code, comment) in all_tests:
|
||||
print("*" * 16)
|
||||
print("Platform: %s" % comment)
|
||||
|
@ -5,8 +5,8 @@
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
from capstone.systemz import *
|
||||
from xprint import to_x, to_hex, to_x_32
|
||||
|
||||
from test import to_x, to_hex, to_x_32
|
||||
|
||||
SYSZ_CODE = b"\xed\x00\x00\x00\x00\x1a\x5a\x0f\x1f\xff\xc2\x09\x80\x00\x00\x00\x07\xf7\xeb\x2a\xff\xff\x7f\x57\xe3\x01\xff\xff\x7f\x57\xeb\x00\xf0\x00\x00\x24\xb2\x4f\x00\x78\xec\x18\x00\x00\xc1\x7f"
|
||||
|
||||
@ -14,44 +14,47 @@ all_tests = (
|
||||
(CS_ARCH_SYSZ, 0, SYSZ_CODE, "SystemZ"),
|
||||
)
|
||||
|
||||
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = 0
|
||||
for i in insn.operands:
|
||||
if i.type == SYSZ_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == SYSZ_OP_ACREG:
|
||||
print("\t\toperands[%u].type: ACREG = %u" % (c, i.reg))
|
||||
if i.type == SYSZ_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x(i.imm)))
|
||||
if i.type == SYSZ_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.index != 0:
|
||||
print("\t\t\toperands[%u].mem.index: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.index)))
|
||||
if i.mem.length != 0:
|
||||
print("\t\t\toperands[%u].mem.length: 0x%s" \
|
||||
% (c, to_x(i.mem.length)))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x(i.mem.disp)))
|
||||
c += 1
|
||||
|
||||
if insn.cc:
|
||||
print("\tConditional code: %u" % insn.cc)
|
||||
|
||||
|
||||
# ## Test class Cs
|
||||
def test_class():
|
||||
def print_insn_detail(insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = 0
|
||||
for i in insn.operands:
|
||||
if i.type == SYSZ_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == SYSZ_OP_ACREG:
|
||||
print("\t\toperands[%u].type: ACREG = %u" % (c, i.reg))
|
||||
if i.type == SYSZ_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x(i.imm)))
|
||||
if i.type == SYSZ_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.index != 0:
|
||||
print("\t\t\toperands[%u].mem.index: REG = %s" \
|
||||
% (c, insn.reg_name(i.mem.index)))
|
||||
if i.mem.length != 0:
|
||||
print("\t\t\toperands[%u].mem.length: 0x%s" \
|
||||
% (c, to_x(i.mem.length)))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" \
|
||||
% (c, to_x(i.mem.disp)))
|
||||
c += 1
|
||||
|
||||
if insn.cc:
|
||||
print("\tConditional code: %u" % insn.cc)
|
||||
|
||||
for (arch, mode, code, comment) in all_tests:
|
||||
print("*" * 16)
|
||||
|
@ -4,7 +4,8 @@
|
||||
from __future__ import print_function
|
||||
from capstone import *
|
||||
from capstone.x86 import *
|
||||
from test import to_hex, to_x, to_x_32
|
||||
from xprint import to_hex, to_x, to_x_32
|
||||
|
||||
|
||||
X86_CODE64 = b"\x55\x48\x8b\x05\xb8\x13\x00\x00"
|
||||
X86_CODE16 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00\x05\x23\x01\x00\x00\x36\x8b\x84\x91\x23\x01\x00\x00\x41\x8d\x84\x39\x89\x67\x00\x00\x8d\x87\x89\x67\x00\x00\xb4\xc6"
|
||||
@ -17,79 +18,86 @@ all_tests = (
|
||||
(CS_ARCH_X86, CS_MODE_64, X86_CODE64, "X86 64 (Intel syntax)", 0),
|
||||
)
|
||||
|
||||
# ## Test class Cs
|
||||
def test_class():
|
||||
|
||||
def print_insn_detail(mode, insn):
|
||||
def print_string_hex(comment, str):
|
||||
print(comment, end=' '),
|
||||
for c in str:
|
||||
print("0x%02x" % c, end=''),
|
||||
print()
|
||||
|
||||
def print_insn_detail(mode, insn):
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
# print address, mnemonic and operands
|
||||
print("0x%x:\t%s\t%s" % (insn.address, insn.mnemonic, insn.op_str))
|
||||
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
# "data" instruction generated by SKIPDATA option has no detail
|
||||
if insn.id == 0:
|
||||
return
|
||||
|
||||
# print instruction prefix
|
||||
print_string_hex("\tPrefix:", insn.prefix)
|
||||
# print instruction prefix
|
||||
print_string_hex("\tPrefix:", insn.prefix)
|
||||
|
||||
# print segment override (if applicable)
|
||||
if insn.segment != X86_REG_INVALID:
|
||||
print("\tSegment override: %s" % insn.reg_name(insn.segment))
|
||||
# print segment override (if applicable)
|
||||
if insn.segment != X86_REG_INVALID:
|
||||
print("\tSegment override: %s" % insn.reg_name(insn.segment))
|
||||
|
||||
# print instruction's opcode
|
||||
print_string_hex("\tOpcode:", insn.opcode)
|
||||
# print instruction's opcode
|
||||
print_string_hex("\tOpcode:", insn.opcode)
|
||||
|
||||
# print operand's size, address size, displacement size & immediate size
|
||||
print("\top_size: %u, addr_size: %u, disp_size: %u, imm_size: %u" \
|
||||
% (insn.op_size, insn.addr_size, insn.disp_size, insn.imm_size))
|
||||
# print operand's size, address size, displacement size & immediate size
|
||||
print("\top_size: %u, addr_size: %u, disp_size: %u, imm_size: %u" \
|
||||
% (insn.op_size, insn.addr_size, insn.disp_size, insn.imm_size))
|
||||
|
||||
# print modRM byte
|
||||
print("\tmodrm: 0x%x" % (insn.modrm))
|
||||
# print modRM byte
|
||||
print("\tmodrm: 0x%x" % (insn.modrm))
|
||||
|
||||
# print displacement value
|
||||
print("\tdisp: 0x%s" % to_x_32(insn.disp))
|
||||
# print displacement value
|
||||
print("\tdisp: 0x%s" % to_x_32(insn.disp))
|
||||
|
||||
# SIB is not available in 16-bit mode
|
||||
if (mode & CS_MODE_16 == 0):
|
||||
# print SIB byte
|
||||
print("\tsib: 0x%x" % (insn.sib))
|
||||
if (insn.sib):
|
||||
print("\tsib_index: %s, sib_scale: %d, sib_base: %s" % (insn.reg_name(insn.sib_index), insn.sib_scale, insn.reg_name(insn.sib_base)))
|
||||
# SIB is not available in 16-bit mode
|
||||
if (mode & CS_MODE_16 == 0):
|
||||
# print SIB byte
|
||||
print("\tsib: 0x%x" % (insn.sib))
|
||||
if (insn.sib):
|
||||
if insn.sib_base != 0:
|
||||
print("\t\tsib_base: %s" % (insn.reg_name(insn.sib_base)))
|
||||
if insn.sib_index != 0:
|
||||
print("\t\tsib_index: %s" % (insn.reg_name(insn.sib_index)))
|
||||
if insn.sib_scale != 0:
|
||||
print("\t\tsib_scale: %d" % (insn.sib_scale))
|
||||
|
||||
count = insn.op_count(X86_OP_IMM)
|
||||
if count > 0:
|
||||
print("\timm_count: %u" % count)
|
||||
for i in range(count):
|
||||
op = insn.op_find(X86_OP_IMM, i + 1)
|
||||
print("\t\timms[%u]: 0x%s" % (i + 1, to_x(op.imm)))
|
||||
count = insn.op_count(X86_OP_IMM)
|
||||
if count > 0:
|
||||
print("\timm_count: %u" % count)
|
||||
for i in range(count):
|
||||
op = insn.op_find(X86_OP_IMM, i + 1)
|
||||
print("\t\timms[%u]: 0x%s" % (i + 1, to_x(op.imm)))
|
||||
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = -1
|
||||
for i in insn.operands:
|
||||
c += 1
|
||||
if i.type == X86_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == X86_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x(i.imm)))
|
||||
if i.type == X86_OP_FP:
|
||||
print("\t\toperands[%u].type: FP = %f" % (c, i.fp))
|
||||
if i.type == X86_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" % (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.index != 0:
|
||||
print("\t\t\toperands[%u].mem.index: REG = %s" % (c, insn.reg_name(i.mem.index)))
|
||||
if i.mem.scale != 1:
|
||||
print("\t\t\toperands[%u].mem.scale: %u" % (c, i.mem.scale))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" % (c, to_x(i.mem.disp)))
|
||||
if len(insn.operands) > 0:
|
||||
print("\top_count: %u" % len(insn.operands))
|
||||
c = -1
|
||||
for i in insn.operands:
|
||||
c += 1
|
||||
if i.type == X86_OP_REG:
|
||||
print("\t\toperands[%u].type: REG = %s" % (c, insn.reg_name(i.reg)))
|
||||
if i.type == X86_OP_IMM:
|
||||
print("\t\toperands[%u].type: IMM = 0x%s" % (c, to_x(i.imm)))
|
||||
if i.type == X86_OP_FP:
|
||||
print("\t\toperands[%u].type: FP = %f" % (c, i.fp))
|
||||
if i.type == X86_OP_MEM:
|
||||
print("\t\toperands[%u].type: MEM" % c)
|
||||
if i.mem.base != 0:
|
||||
print("\t\t\toperands[%u].mem.base: REG = %s" % (c, insn.reg_name(i.mem.base)))
|
||||
if i.mem.index != 0:
|
||||
print("\t\t\toperands[%u].mem.index: REG = %s" % (c, insn.reg_name(i.mem.index)))
|
||||
if i.mem.scale != 1:
|
||||
print("\t\t\toperands[%u].mem.scale: %u" % (c, i.mem.scale))
|
||||
if i.mem.disp != 0:
|
||||
print("\t\t\toperands[%u].mem.disp: 0x%s" % (c, to_x(i.mem.disp)))
|
||||
|
||||
|
||||
# ## Test class Cs
|
||||
def test_class():
|
||||
|
||||
for (arch, mode, code, comment, syntax) in all_tests:
|
||||
print("*" * 16)
|
||||
print("Platform: %s" % comment)
|
||||
|
35
bindings/python/xprint.py
Executable file
35
bindings/python/xprint.py
Executable file
@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python
|
||||
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
_python3 = sys.version_info.major == 3
|
||||
|
||||
|
||||
def to_hex(s):
|
||||
if _python3:
|
||||
return " ".join("0x{0:02x}".format(c) for c in s) # <-- Python 3 is OK
|
||||
else:
|
||||
return " ".join("0x{0:02x}".format(ord(c)) for c in s)
|
||||
|
||||
|
||||
def to_x(s):
|
||||
from struct import pack
|
||||
if not s: return '0'
|
||||
x = pack(">q", s)
|
||||
while x[0] in ('\0', 0): x = x[1:]
|
||||
if _python3:
|
||||
return "".join("{0:02x}".format(c) for c in x) # <-- Python 3 is OK
|
||||
else:
|
||||
return "".join("{0:02x}".format(ord(c)) for c in x)
|
||||
|
||||
|
||||
def to_x_32(s):
|
||||
from struct import pack
|
||||
if not s: return '0'
|
||||
x = pack(">i", s)
|
||||
while x[0] in ('\0', 0): x = x[1:]
|
||||
if _python3:
|
||||
return "".join("{0:02x}".format(c) for c in x) # <-- Python 3 is OK
|
||||
else:
|
||||
return "".join("{0:02x}".format(ord(c)) for c in x)
|
53
cs.c
53
cs.c
@ -1,6 +1,8 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64)
|
||||
#pragma warning(disable:4996)
|
||||
#endif
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -10,7 +12,7 @@
|
||||
#include "utils.h"
|
||||
#include "MCRegisterInfo.h"
|
||||
|
||||
#ifdef USE_SYS_DYN_MEM
|
||||
#ifdef CAPSTONE_USE_SYS_DYN_MEM
|
||||
#define INSN_CACHE_SIZE 32
|
||||
#else
|
||||
// reduce stack variable size for kernel/firmware
|
||||
@ -66,7 +68,7 @@ static void archs_enable(void)
|
||||
|
||||
unsigned int all_arch = 0;
|
||||
|
||||
#ifdef USE_SYS_DYN_MEM
|
||||
#ifdef CAPSTONE_USE_SYS_DYN_MEM
|
||||
cs_malloc_t cs_mem_malloc = malloc;
|
||||
cs_calloc_t cs_mem_calloc = calloc;
|
||||
cs_realloc_t cs_mem_realloc = realloc;
|
||||
@ -127,10 +129,11 @@ bool cs_support(int query)
|
||||
|
||||
cs_err cs_errno(csh handle)
|
||||
{
|
||||
struct cs_struct *ud;
|
||||
if (!handle)
|
||||
return CS_ERR_CSH;
|
||||
|
||||
struct cs_struct *ud = (struct cs_struct *)(uintptr_t)handle;
|
||||
ud = (struct cs_struct *)(uintptr_t)handle;
|
||||
|
||||
return ud->errnum;
|
||||
}
|
||||
@ -169,6 +172,8 @@ const char *cs_strerror(cs_err code)
|
||||
|
||||
cs_err cs_open(cs_arch arch, cs_mode mode, csh *handle)
|
||||
{
|
||||
cs_err err;
|
||||
struct cs_struct *ud;
|
||||
if (!cs_mem_malloc || !cs_mem_calloc || !cs_mem_realloc || !cs_mem_free || !cs_vsnprintf)
|
||||
// Error: before cs_open(), dynamic memory management must be initialized
|
||||
// with cs_option(CS_OPT_MEM)
|
||||
@ -177,8 +182,6 @@ cs_err cs_open(cs_arch arch, cs_mode mode, csh *handle)
|
||||
archs_enable();
|
||||
|
||||
if (arch < CS_ARCH_MAX && arch_init[arch]) {
|
||||
struct cs_struct *ud;
|
||||
|
||||
ud = cs_mem_calloc(1, sizeof(*ud));
|
||||
if (!ud) {
|
||||
// memory insufficient
|
||||
@ -195,7 +198,7 @@ cs_err cs_open(cs_arch arch, cs_mode mode, csh *handle)
|
||||
// default skipdata setup
|
||||
ud->skipdata_setup.mnemonic = SKIPDATA_MNEM;
|
||||
|
||||
cs_err err = arch_init[ud->arch](ud);
|
||||
err = arch_init[ud->arch](ud);
|
||||
if (err) {
|
||||
cs_mem_free(ud);
|
||||
*handle = 0;
|
||||
@ -213,11 +216,13 @@ cs_err cs_open(cs_arch arch, cs_mode mode, csh *handle)
|
||||
|
||||
cs_err cs_close(csh *handle)
|
||||
{
|
||||
struct cs_struct *ud;
|
||||
|
||||
if (*handle == 0)
|
||||
// invalid handle
|
||||
return CS_ERR_CSH;
|
||||
|
||||
struct cs_struct *ud = (struct cs_struct *)(*handle);
|
||||
ud = (struct cs_struct *)(*handle);
|
||||
|
||||
if (ud->printer_info)
|
||||
cs_mem_free(ud->printer_info);
|
||||
@ -239,13 +244,17 @@ cs_err cs_close(csh *handle)
|
||||
static void fill_insn(struct cs_struct *handle, cs_insn *insn, char *buffer, MCInst *mci,
|
||||
PostPrinter_t postprinter, const uint8_t *code)
|
||||
{
|
||||
#ifndef CAPSTONE_DIET
|
||||
char *sp;
|
||||
#endif
|
||||
|
||||
if (handle->detail) {
|
||||
// avoiding copy insn->detail
|
||||
memcpy(insn, &mci->flat_insn, sizeof(*insn) - sizeof(insn->detail));
|
||||
|
||||
// NOTE: copy details in 2 chunks, since union is always put at address divisible by 8
|
||||
// copy from @regs_read until @arm
|
||||
memcpy(insn->detail, (void *)(&(mci->flat_insn)) + offsetof(cs_insn_flat, regs_read),
|
||||
memcpy(insn->detail, (void *)((uintptr_t)(&(mci->flat_insn)) + offsetof(cs_insn_flat, regs_read)),
|
||||
offsetof(cs_detail, arm) - offsetof(cs_detail, regs_read));
|
||||
// then copy from @arm until end
|
||||
memcpy((void *)((uintptr_t)(insn->detail) + offsetof(cs_detail, arm)),
|
||||
@ -274,7 +283,7 @@ static void fill_insn(struct cs_struct *handle, cs_insn *insn, char *buffer, MCI
|
||||
#ifndef CAPSTONE_DIET
|
||||
// fill in mnemonic & operands
|
||||
// find first space or tab
|
||||
char *sp = buffer;
|
||||
sp = buffer;
|
||||
for (sp = buffer; *sp; sp++) {
|
||||
if (*sp == ' '||*sp == '\t')
|
||||
break;
|
||||
@ -329,6 +338,7 @@ static uint8_t skipdata_size(cs_struct *handle)
|
||||
|
||||
cs_err cs_option(csh ud, cs_opt_type type, size_t value)
|
||||
{
|
||||
struct cs_struct *handle;
|
||||
archs_enable();
|
||||
|
||||
// cs_option() can be called with NULL handle just for CS_OPT_MEM
|
||||
@ -345,7 +355,7 @@ cs_err cs_option(csh ud, cs_opt_type type, size_t value)
|
||||
return CS_ERR_OK;
|
||||
}
|
||||
|
||||
struct cs_struct *handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
if (!handle)
|
||||
return CS_ERR_CSH;
|
||||
|
||||
@ -599,10 +609,11 @@ static bool arr_exist(unsigned char *arr, unsigned char max, unsigned int id)
|
||||
|
||||
bool cs_insn_group(csh ud, cs_insn *insn, unsigned int group_id)
|
||||
{
|
||||
struct cs_struct *handle;
|
||||
if (!ud)
|
||||
return false;
|
||||
|
||||
struct cs_struct *handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
|
||||
if (!handle->detail) {
|
||||
handle->errnum = CS_ERR_DETAIL;
|
||||
@ -624,10 +635,11 @@ bool cs_insn_group(csh ud, cs_insn *insn, unsigned int group_id)
|
||||
|
||||
bool cs_reg_read(csh ud, cs_insn *insn, unsigned int reg_id)
|
||||
{
|
||||
struct cs_struct *handle;
|
||||
if (!ud)
|
||||
return false;
|
||||
|
||||
struct cs_struct *handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
|
||||
if (!handle->detail) {
|
||||
handle->errnum = CS_ERR_DETAIL;
|
||||
@ -649,10 +661,11 @@ bool cs_reg_read(csh ud, cs_insn *insn, unsigned int reg_id)
|
||||
|
||||
bool cs_reg_write(csh ud, cs_insn *insn, unsigned int reg_id)
|
||||
{
|
||||
struct cs_struct *handle;
|
||||
if (!ud)
|
||||
return false;
|
||||
|
||||
struct cs_struct *handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
|
||||
if (!handle->detail) {
|
||||
handle->errnum = CS_ERR_DETAIL;
|
||||
@ -674,10 +687,12 @@ bool cs_reg_write(csh ud, cs_insn *insn, unsigned int reg_id)
|
||||
|
||||
int cs_op_count(csh ud, cs_insn *insn, unsigned int op_type)
|
||||
{
|
||||
struct cs_struct *handle;
|
||||
unsigned int count = 0, i;
|
||||
if (!ud)
|
||||
return -1;
|
||||
|
||||
struct cs_struct *handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
|
||||
if (!handle->detail) {
|
||||
handle->errnum = CS_ERR_DETAIL;
|
||||
@ -694,8 +709,6 @@ int cs_op_count(csh ud, cs_insn *insn, unsigned int op_type)
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned int count = 0, i;
|
||||
|
||||
handle->errnum = CS_ERR_OK;
|
||||
|
||||
switch (handle->arch) {
|
||||
@ -745,10 +758,12 @@ int cs_op_count(csh ud, cs_insn *insn, unsigned int op_type)
|
||||
int cs_op_index(csh ud, cs_insn *insn, unsigned int op_type,
|
||||
unsigned int post)
|
||||
{
|
||||
struct cs_struct *handle;
|
||||
unsigned int count = 0, i;
|
||||
if (!ud)
|
||||
return -1;
|
||||
|
||||
struct cs_struct *handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
handle = (struct cs_struct *)(uintptr_t)ud;
|
||||
|
||||
if (!handle->detail) {
|
||||
handle->errnum = CS_ERR_DETAIL;
|
||||
@ -765,8 +780,6 @@ int cs_op_index(csh ud, cs_insn *insn, unsigned int op_type,
|
||||
return -1;
|
||||
}
|
||||
|
||||
unsigned int count = 0, i;
|
||||
|
||||
handle->errnum = CS_ERR_OK;
|
||||
|
||||
switch (handle->arch) {
|
||||
|
@ -9,7 +9,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
|
@ -9,7 +9,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
@ -114,7 +114,9 @@ typedef enum arm64_reg {
|
||||
|
||||
ARM64_REG_NZCV,
|
||||
ARM64_REG_WSP,
|
||||
ARM64_REG_WZR,
|
||||
ARM64_REG_SP,
|
||||
ARM64_REG_XZR,
|
||||
ARM64_REG_B0,
|
||||
ARM64_REG_B1,
|
||||
ARM64_REG_B2,
|
||||
@ -346,8 +348,6 @@ typedef enum arm64_reg {
|
||||
ARM64_REG_IP0 = ARM64_REG_X17,
|
||||
ARM64_REG_FP = ARM64_REG_X29,
|
||||
ARM64_REG_LR = ARM64_REG_X30,
|
||||
ARM64_REG_XZR = ARM64_REG_SP,
|
||||
ARM64_REG_WZR = ARM64_REG_WSP,
|
||||
} arm64_reg;
|
||||
|
||||
//> ARM64 instruction
|
||||
|
@ -11,9 +11,10 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
#pragma warning(disable:4100)
|
||||
@ -112,7 +113,7 @@ typedef enum cs_opt_value {
|
||||
// @user_data: user-data passed to cs_option() via @user_data field in
|
||||
// cs_opt_skipdata struct below.
|
||||
// @return: return number of bytes to skip, or 0 to immediately stop disassembling.
|
||||
typedef size_t (*cs_skipdata_cb_t)(const uint8_t *code, size_t offset, void* user_data);
|
||||
typedef size_t (*cs_skipdata_cb_t)(const uint8_t *code, uint64_t offset, void* user_data);
|
||||
|
||||
// User-customized setup for SKIPDATA option
|
||||
typedef struct cs_opt_skipdata {
|
||||
|
@ -9,7 +9,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
|
28
include/platform.h
Normal file
28
include/platform.h
Normal file
@ -0,0 +1,28 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Axel Souchet & Nguyen Anh Quynh, 2014 */
|
||||
|
||||
// handle C99 issue (for pre-2013 VisualStudio)
|
||||
#ifndef CAPSTONE_PLATFORM_H
|
||||
#define CAPSTONE_PLATFORM_H
|
||||
|
||||
#if !defined(__MINGW32__) && !defined(__MINGW64__) && (defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64))
|
||||
// MSVC
|
||||
|
||||
// stdbool.h
|
||||
#if (_MSC_VER < 1800)
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned char bool;
|
||||
#define false 0
|
||||
#define true 1
|
||||
#endif
|
||||
|
||||
#else
|
||||
// VisualStudio 2013+ -> C99 is supported
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#else // not MSVC -> C99 is supported
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#endif
|
@ -9,7 +9,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
|
@ -9,7 +9,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
|
@ -9,7 +9,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4201)
|
||||
|
16
msvc/README
Normal file
16
msvc/README
Normal file
@ -0,0 +1,16 @@
|
||||
This directory includes all the necessary files to compile Capstone on Windows
|
||||
using Microsoft Visual Studio (VS).
|
||||
|
||||
|
||||
NOTE:
|
||||
|
||||
(1) Visual Studio 2010 or newer versions is required. Open "capstone.sln" to
|
||||
build the libraries & test code with Visual Studio. The resulted binaries
|
||||
are put under either msvc/Debug or msvc/Release, depending on how you choose
|
||||
to compile them.
|
||||
|
||||
(2) The solution (capstone.sln) & all project files (*.vcxproj) are made in
|
||||
Visual Studio 2010, so if you open them using newer version, an extra step
|
||||
is needed to convert them to current version. Just accept this when
|
||||
asked at the initial dialog, and proceed to build the solution normally
|
||||
afterwards.
|
166
msvc/capstone.sln
Normal file
166
msvc/capstone.sln
Normal file
@ -0,0 +1,166 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "capstone_static", "capstone_static\capstone_static.vcxproj", "{5B01D900-2359-44CA-9914-6B0C6AFB7BE7}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcxproj", "{B291E0D9-4B39-4AF8-971D-A015B78D54A1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7} = {5B01D900-2359-44CA-9914-6B0C6AFB7BE7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86", "test_x86\test_x86.vcxproj", "{9C69243E-C7DC-42A4-AB86-0696E51697C8}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7} = {5B01D900-2359-44CA-9914-6B0C6AFB7BE7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_arm", "test_arm\test_arm.vcxproj", "{349B99E4-2E79-44FE-96F9-02D9B4EC0584}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7} = {5B01D900-2359-44CA-9914-6B0C6AFB7BE7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_arm64", "test_arm64\test_arm64.vcxproj", "{CBE31473-7D0E-41F5-AFCB-8C8422ED8908}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7} = {5B01D900-2359-44CA-9914-6B0C6AFB7BE7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_mips", "test_mips\test_mips.vcxproj", "{28B2D82F-3E95-4ECE-8118-0E891BD453E0}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7} = {5B01D900-2359-44CA-9914-6B0C6AFB7BE7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_ppc", "test_ppc\test_ppc.vcxproj", "{0B78E956-F897-4149-BFB2-BE87DA3A6F0D}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7} = {5B01D900-2359-44CA-9914-6B0C6AFB7BE7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_sparc", "test_sparc\test_sparc.vcxproj", "{9E735ABA-00D9-4114-A9E7-0568D8DFF94B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7} = {5B01D900-2359-44CA-9914-6B0C6AFB7BE7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_systemz", "test_systemz\test_systemz.vcxproj", "{D83F2A2D-D5F1-421E-A5B7-B47F1ECABAD2}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7} = {5B01D900-2359-44CA-9914-6B0C6AFB7BE7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_detail", "test_detail\test_detail.vcxproj", "{A510F308-3094-4FF6-9DFC-539CC5260BA4}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7} = {5B01D900-2359-44CA-9914-6B0C6AFB7BE7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_skipdata", "test_skipdata\test_skipdata.vcxproj", "{B09819BB-7EF1-4B04-945D-58117E6940A1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7} = {5B01D900-2359-44CA-9914-6B0C6AFB7BE7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "capstone_dll", "capstone_dll\capstone_dll.vcxproj", "{2171C0E8-4915-49B9-AC23-A484FA08C126}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7}.Debug|x64.Build.0 = Debug|x64
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7}.Release|Win32.Build.0 = Release|Win32
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7}.Release|x64.ActiveCfg = Release|x64
|
||||
{5B01D900-2359-44CA-9914-6B0C6AFB7BE7}.Release|x64.Build.0 = Release|x64
|
||||
{B291E0D9-4B39-4AF8-971D-A015B78D54A1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B291E0D9-4B39-4AF8-971D-A015B78D54A1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B291E0D9-4B39-4AF8-971D-A015B78D54A1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B291E0D9-4B39-4AF8-971D-A015B78D54A1}.Debug|x64.Build.0 = Debug|x64
|
||||
{B291E0D9-4B39-4AF8-971D-A015B78D54A1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B291E0D9-4B39-4AF8-971D-A015B78D54A1}.Release|Win32.Build.0 = Release|Win32
|
||||
{B291E0D9-4B39-4AF8-971D-A015B78D54A1}.Release|x64.ActiveCfg = Release|x64
|
||||
{B291E0D9-4B39-4AF8-971D-A015B78D54A1}.Release|x64.Build.0 = Release|x64
|
||||
{9C69243E-C7DC-42A4-AB86-0696E51697C8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9C69243E-C7DC-42A4-AB86-0696E51697C8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9C69243E-C7DC-42A4-AB86-0696E51697C8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9C69243E-C7DC-42A4-AB86-0696E51697C8}.Debug|x64.Build.0 = Debug|x64
|
||||
{9C69243E-C7DC-42A4-AB86-0696E51697C8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9C69243E-C7DC-42A4-AB86-0696E51697C8}.Release|Win32.Build.0 = Release|Win32
|
||||
{9C69243E-C7DC-42A4-AB86-0696E51697C8}.Release|x64.ActiveCfg = Release|x64
|
||||
{9C69243E-C7DC-42A4-AB86-0696E51697C8}.Release|x64.Build.0 = Release|x64
|
||||
{349B99E4-2E79-44FE-96F9-02D9B4EC0584}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{349B99E4-2E79-44FE-96F9-02D9B4EC0584}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{349B99E4-2E79-44FE-96F9-02D9B4EC0584}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{349B99E4-2E79-44FE-96F9-02D9B4EC0584}.Debug|x64.Build.0 = Debug|x64
|
||||
{349B99E4-2E79-44FE-96F9-02D9B4EC0584}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{349B99E4-2E79-44FE-96F9-02D9B4EC0584}.Release|Win32.Build.0 = Release|Win32
|
||||
{349B99E4-2E79-44FE-96F9-02D9B4EC0584}.Release|x64.ActiveCfg = Release|x64
|
||||
{349B99E4-2E79-44FE-96F9-02D9B4EC0584}.Release|x64.Build.0 = Release|x64
|
||||
{CBE31473-7D0E-41F5-AFCB-8C8422ED8908}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{CBE31473-7D0E-41F5-AFCB-8C8422ED8908}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{CBE31473-7D0E-41F5-AFCB-8C8422ED8908}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{CBE31473-7D0E-41F5-AFCB-8C8422ED8908}.Debug|x64.Build.0 = Debug|x64
|
||||
{CBE31473-7D0E-41F5-AFCB-8C8422ED8908}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CBE31473-7D0E-41F5-AFCB-8C8422ED8908}.Release|Win32.Build.0 = Release|Win32
|
||||
{CBE31473-7D0E-41F5-AFCB-8C8422ED8908}.Release|x64.ActiveCfg = Release|x64
|
||||
{CBE31473-7D0E-41F5-AFCB-8C8422ED8908}.Release|x64.Build.0 = Release|x64
|
||||
{28B2D82F-3E95-4ECE-8118-0E891BD453E0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{28B2D82F-3E95-4ECE-8118-0E891BD453E0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{28B2D82F-3E95-4ECE-8118-0E891BD453E0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{28B2D82F-3E95-4ECE-8118-0E891BD453E0}.Debug|x64.Build.0 = Debug|x64
|
||||
{28B2D82F-3E95-4ECE-8118-0E891BD453E0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{28B2D82F-3E95-4ECE-8118-0E891BD453E0}.Release|Win32.Build.0 = Release|Win32
|
||||
{28B2D82F-3E95-4ECE-8118-0E891BD453E0}.Release|x64.ActiveCfg = Release|x64
|
||||
{28B2D82F-3E95-4ECE-8118-0E891BD453E0}.Release|x64.Build.0 = Release|x64
|
||||
{0B78E956-F897-4149-BFB2-BE87DA3A6F0D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0B78E956-F897-4149-BFB2-BE87DA3A6F0D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0B78E956-F897-4149-BFB2-BE87DA3A6F0D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0B78E956-F897-4149-BFB2-BE87DA3A6F0D}.Debug|x64.Build.0 = Debug|x64
|
||||
{0B78E956-F897-4149-BFB2-BE87DA3A6F0D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0B78E956-F897-4149-BFB2-BE87DA3A6F0D}.Release|Win32.Build.0 = Release|Win32
|
||||
{0B78E956-F897-4149-BFB2-BE87DA3A6F0D}.Release|x64.ActiveCfg = Release|x64
|
||||
{0B78E956-F897-4149-BFB2-BE87DA3A6F0D}.Release|x64.Build.0 = Release|x64
|
||||
{9E735ABA-00D9-4114-A9E7-0568D8DFF94B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9E735ABA-00D9-4114-A9E7-0568D8DFF94B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9E735ABA-00D9-4114-A9E7-0568D8DFF94B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9E735ABA-00D9-4114-A9E7-0568D8DFF94B}.Debug|x64.Build.0 = Debug|x64
|
||||
{9E735ABA-00D9-4114-A9E7-0568D8DFF94B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9E735ABA-00D9-4114-A9E7-0568D8DFF94B}.Release|Win32.Build.0 = Release|Win32
|
||||
{9E735ABA-00D9-4114-A9E7-0568D8DFF94B}.Release|x64.ActiveCfg = Release|x64
|
||||
{9E735ABA-00D9-4114-A9E7-0568D8DFF94B}.Release|x64.Build.0 = Release|x64
|
||||
{D83F2A2D-D5F1-421E-A5B7-B47F1ECABAD2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D83F2A2D-D5F1-421E-A5B7-B47F1ECABAD2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D83F2A2D-D5F1-421E-A5B7-B47F1ECABAD2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D83F2A2D-D5F1-421E-A5B7-B47F1ECABAD2}.Debug|x64.Build.0 = Debug|x64
|
||||
{D83F2A2D-D5F1-421E-A5B7-B47F1ECABAD2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D83F2A2D-D5F1-421E-A5B7-B47F1ECABAD2}.Release|Win32.Build.0 = Release|Win32
|
||||
{D83F2A2D-D5F1-421E-A5B7-B47F1ECABAD2}.Release|x64.ActiveCfg = Release|x64
|
||||
{D83F2A2D-D5F1-421E-A5B7-B47F1ECABAD2}.Release|x64.Build.0 = Release|x64
|
||||
{A510F308-3094-4FF6-9DFC-539CC5260BA4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A510F308-3094-4FF6-9DFC-539CC5260BA4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A510F308-3094-4FF6-9DFC-539CC5260BA4}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A510F308-3094-4FF6-9DFC-539CC5260BA4}.Debug|x64.Build.0 = Debug|x64
|
||||
{A510F308-3094-4FF6-9DFC-539CC5260BA4}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A510F308-3094-4FF6-9DFC-539CC5260BA4}.Release|Win32.Build.0 = Release|Win32
|
||||
{A510F308-3094-4FF6-9DFC-539CC5260BA4}.Release|x64.ActiveCfg = Release|x64
|
||||
{A510F308-3094-4FF6-9DFC-539CC5260BA4}.Release|x64.Build.0 = Release|x64
|
||||
{B09819BB-7EF1-4B04-945D-58117E6940A1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B09819BB-7EF1-4B04-945D-58117E6940A1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B09819BB-7EF1-4B04-945D-58117E6940A1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B09819BB-7EF1-4B04-945D-58117E6940A1}.Debug|x64.Build.0 = Debug|x64
|
||||
{B09819BB-7EF1-4B04-945D-58117E6940A1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B09819BB-7EF1-4B04-945D-58117E6940A1}.Release|Win32.Build.0 = Release|Win32
|
||||
{B09819BB-7EF1-4B04-945D-58117E6940A1}.Release|x64.ActiveCfg = Release|x64
|
||||
{B09819BB-7EF1-4B04-945D-58117E6940A1}.Release|x64.Build.0 = Release|x64
|
||||
{2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2171C0E8-4915-49B9-AC23-A484FA08C126}.Debug|x64.Build.0 = Debug|x64
|
||||
{2171C0E8-4915-49B9-AC23-A484FA08C126}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2171C0E8-4915-49B9-AC23-A484FA08C126}.Release|Win32.Build.0 = Release|Win32
|
||||
{2171C0E8-4915-49B9-AC23-A484FA08C126}.Release|x64.ActiveCfg = Release|x64
|
||||
{2171C0E8-4915-49B9-AC23-A484FA08C126}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
196
msvc/capstone_dll/capstone_dll.vcxproj
Normal file
196
msvc/capstone_dll/capstone_dll.vcxproj
Normal file
@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{2171C0E8-4915-49B9-AC23-A484FA08C126}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonedll</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetName>libcapstone</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetName>libcapstone</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>libcapstone</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>libcapstone</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>CAPSTONE_DIET_NO;CAPSTONE_X86_REDUCE_NO;CAPSTONE_HAS_ARM;CAPSTONE_HAS_ARM64;CAPSTONE_HAS_MIPS;CAPSTONE_HAS_POWERPC;CAPSTONE_HAS_SPARC;CAPSTONE_HAS_SYSZ;CAPSTONE_HAS_X86;CAPSTONE_USE_SYS_DYN_MEM;WIN32;_DEBUG;_WINDOWS;_USRDLL;CAPSTONEDLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>CAPSTONE_DIET_NO;CAPSTONE_X86_REDUCE_NO;CAPSTONE_HAS_ARM;CAPSTONE_HAS_ARM64;CAPSTONE_HAS_MIPS;CAPSTONE_HAS_POWERPC;CAPSTONE_HAS_SPARC;CAPSTONE_HAS_SYSZ;CAPSTONE_HAS_X86;CAPSTONE_USE_SYS_DYN_MEM;WIN32;_DEBUG;_WINDOWS;_USRDLL;CAPSTONEDLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>CAPSTONE_DIET_NO;CAPSTONE_X86_REDUCE_NO;CAPSTONE_HAS_ARM;CAPSTONE_HAS_ARM64;CAPSTONE_HAS_MIPS;CAPSTONE_HAS_POWERPC;CAPSTONE_HAS_SPARC;CAPSTONE_HAS_SYSZ;CAPSTONE_HAS_X86;CAPSTONE_USE_SYS_DYN_MEM;WIN32;NDEBUG;_WINDOWS;_USRDLL;CAPSTONEDLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>CAPSTONE_DIET_NO;CAPSTONE_X86_REDUCE_NO;CAPSTONE_HAS_ARM;CAPSTONE_HAS_ARM64;CAPSTONE_HAS_MIPS;CAPSTONE_HAS_POWERPC;CAPSTONE_HAS_SPARC;CAPSTONE_HAS_SYSZ;CAPSTONE_HAS_X86;CAPSTONE_USE_SYS_DYN_MEM;WIN32;NDEBUG;_WINDOWS;_USRDLL;CAPSTONEDLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\arch\AArch64\AArch64BaseInfo.c" />
|
||||
<ClCompile Include="..\..\arch\AArch64\AArch64Disassembler.c" />
|
||||
<ClCompile Include="..\..\arch\AArch64\AArch64InstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\AArch64\AArch64Mapping.c" />
|
||||
<ClCompile Include="..\..\arch\AArch64\AArch64Module.c" />
|
||||
<ClCompile Include="..\..\arch\ARM\ARMDisassembler.c" />
|
||||
<ClCompile Include="..\..\arch\ARM\ARMInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\ARM\ARMMapping.c" />
|
||||
<ClCompile Include="..\..\arch\ARM\ARMModule.c" />
|
||||
<ClCompile Include="..\..\arch\Mips\MipsDisassembler.c" />
|
||||
<ClCompile Include="..\..\arch\Mips\MipsInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\Mips\MipsMapping.c" />
|
||||
<ClCompile Include="..\..\arch\Mips\MipsModule.c" />
|
||||
<ClCompile Include="..\..\arch\PowerPC\PPCDisassembler.c" />
|
||||
<ClCompile Include="..\..\arch\PowerPC\PPCInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\PowerPC\PPCMapping.c" />
|
||||
<ClCompile Include="..\..\arch\PowerPC\PPCModule.c" />
|
||||
<ClCompile Include="..\..\arch\Sparc\SparcDisassembler.c" />
|
||||
<ClCompile Include="..\..\arch\Sparc\SparcInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\Sparc\SparcMapping.c" />
|
||||
<ClCompile Include="..\..\arch\Sparc\SparcModule.c" />
|
||||
<ClCompile Include="..\..\arch\SystemZ\SystemZDisassembler.c" />
|
||||
<ClCompile Include="..\..\arch\SystemZ\SystemZInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\SystemZ\SystemZMapping.c" />
|
||||
<ClCompile Include="..\..\arch\SystemZ\SystemZMCTargetDesc.c" />
|
||||
<ClCompile Include="..\..\arch\SystemZ\SystemZModule.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86ATTInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86Disassembler.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86DisassemblerDecoder.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86IntelInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86Mapping.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86Module.c" />
|
||||
<ClCompile Include="..\..\cs.c" />
|
||||
<ClCompile Include="..\..\MCInst.c" />
|
||||
<ClCompile Include="..\..\MCInstrDesc.c" />
|
||||
<ClCompile Include="..\..\MCRegisterInfo.c" />
|
||||
<ClCompile Include="..\..\SStream.c" />
|
||||
<ClCompile Include="..\..\utils.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
189
msvc/capstone_static/capstone_static.vcxproj
Normal file
189
msvc/capstone_static/capstone_static.vcxproj
Normal file
@ -0,0 +1,189 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\arch\AArch64\AArch64BaseInfo.c" />
|
||||
<ClCompile Include="..\..\arch\AArch64\AArch64Disassembler.c" />
|
||||
<ClCompile Include="..\..\arch\AArch64\AArch64InstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\AArch64\AArch64Mapping.c" />
|
||||
<ClCompile Include="..\..\arch\AArch64\AArch64Module.c" />
|
||||
<ClCompile Include="..\..\arch\ARM\ARMDisassembler.c" />
|
||||
<ClCompile Include="..\..\arch\ARM\ARMInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\ARM\ARMMapping.c" />
|
||||
<ClCompile Include="..\..\arch\ARM\ARMModule.c" />
|
||||
<ClCompile Include="..\..\arch\Mips\MipsDisassembler.c" />
|
||||
<ClCompile Include="..\..\arch\Mips\MipsInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\Mips\MipsMapping.c" />
|
||||
<ClCompile Include="..\..\arch\Mips\MipsModule.c" />
|
||||
<ClCompile Include="..\..\arch\PowerPC\PPCDisassembler.c" />
|
||||
<ClCompile Include="..\..\arch\PowerPC\PPCInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\PowerPC\PPCMapping.c" />
|
||||
<ClCompile Include="..\..\arch\PowerPC\PPCModule.c" />
|
||||
<ClCompile Include="..\..\arch\Sparc\SparcDisassembler.c" />
|
||||
<ClCompile Include="..\..\arch\Sparc\SparcInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\Sparc\SparcMapping.c" />
|
||||
<ClCompile Include="..\..\arch\Sparc\SparcModule.c" />
|
||||
<ClCompile Include="..\..\arch\SystemZ\SystemZDisassembler.c" />
|
||||
<ClCompile Include="..\..\arch\SystemZ\SystemZInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\SystemZ\SystemZMapping.c" />
|
||||
<ClCompile Include="..\..\arch\SystemZ\SystemZMCTargetDesc.c" />
|
||||
<ClCompile Include="..\..\arch\SystemZ\SystemZModule.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86ATTInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86Disassembler.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86DisassemblerDecoder.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86IntelInstPrinter.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86Mapping.c" />
|
||||
<ClCompile Include="..\..\arch\X86\X86Module.c" />
|
||||
<ClCompile Include="..\..\cs.c" />
|
||||
<ClCompile Include="..\..\MCInst.c" />
|
||||
<ClCompile Include="..\..\MCInstrDesc.c" />
|
||||
<ClCompile Include="..\..\MCRegisterInfo.c" />
|
||||
<ClCompile Include="..\..\SStream.c" />
|
||||
<ClCompile Include="..\..\utils.c" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{5B01D900-2359-44CA-9914-6B0C6AFB7BE7}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonewin32</RootNamespace>
|
||||
<ProjectName>capstone_static</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<TargetName>libcapstone</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<TargetName>libcapstone</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<TargetName>libcapstone</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<TargetName>libcapstone</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>CAPSTONE_DIET_NO;CAPSTONE_X86_REDUCE_NO;CAPSTONE_HAS_ARM;CAPSTONE_HAS_ARM64;CAPSTONE_HAS_MIPS;CAPSTONE_HAS_POWERPC;CAPSTONE_HAS_SPARC;CAPSTONE_HAS_SYSZ;CAPSTONE_HAS_X86;CAPSTONE_USE_SYS_DYN_MEM;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>CAPSTONE_DIET_NO;CAPSTONE_X86_REDUCE_NO;CAPSTONE_HAS_ARM;CAPSTONE_HAS_ARM64;CAPSTONE_HAS_MIPS;CAPSTONE_HAS_POWERPC;CAPSTONE_HAS_SPARC;CAPSTONE_HAS_SYSZ;CAPSTONE_HAS_X86;CAPSTONE_USE_SYS_DYN_MEM;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>CAPSTONE_DIET_NO;CAPSTONE_X86_REDUCE_NO;CAPSTONE_HAS_ARM;CAPSTONE_HAS_ARM64;CAPSTONE_HAS_MIPS;CAPSTONE_HAS_POWERPC;CAPSTONE_HAS_SPARC;CAPSTONE_HAS_SYSZ;CAPSTONE_HAS_X86;CAPSTONE_USE_SYS_DYN_MEM;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>CAPSTONE_DIET_NO;CAPSTONE_X86_REDUCE_NO;CAPSTONE_HAS_ARM;CAPSTONE_HAS_ARM64;CAPSTONE_HAS_MIPS;CAPSTONE_HAS_POWERPC;CAPSTONE_HAS_SPARC;CAPSTONE_HAS_SYSZ;CAPSTONE_HAS_X86;CAPSTONE_USE_SYS_DYN_MEM;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
44
msvc/headers/inttypes.h
Normal file
44
msvc/headers/inttypes.h
Normal file
@ -0,0 +1,44 @@
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Axel Souchet, 2014 */
|
||||
|
||||
#pragma once
|
||||
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
#define __PRI_8_LENGTH_MODIFIER__ "hh"
|
||||
#define __PRI_64_LENGTH_MODIFIER__ "ll"
|
||||
|
||||
#define PRId8 __PRI_8_LENGTH_MODIFIER__ "d"
|
||||
#define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i"
|
||||
#define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o"
|
||||
#define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u"
|
||||
#define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x"
|
||||
#define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X"
|
||||
|
||||
#define PRId16 "hd"
|
||||
#define PRIi16 "hi"
|
||||
#define PRIo16 "ho"
|
||||
#define PRIu16 "hu"
|
||||
#define PRIx16 "hx"
|
||||
#define PRIX16 "hX"
|
||||
|
||||
#define PRId32 "ld"
|
||||
#define PRIi32 "li"
|
||||
#define PRIo32 "lo"
|
||||
#define PRIu32 "lu"
|
||||
#define PRIx32 "lx"
|
||||
#define PRIX32 "lX"
|
||||
|
||||
#define PRId64 __PRI_64_LENGTH_MODIFIER__ "d"
|
||||
#define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i"
|
||||
#define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o"
|
||||
#define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u"
|
||||
#define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x"
|
||||
#define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X"
|
160
msvc/test/test.vcxproj
Normal file
160
msvc/test/test.vcxproj
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B291E0D9-4B39-4AF8-971D-A015B78D54A1}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonetest</RootNamespace>
|
||||
<ProjectName>test</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\tests\test.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
160
msvc/test_arm/test_arm.vcxproj
Normal file
160
msvc/test_arm/test_arm.vcxproj
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{349B99E4-2E79-44FE-96F9-02D9B4EC0584}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonetestarm</RootNamespace>
|
||||
<ProjectName>test_arm</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\tests\test_arm.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
160
msvc/test_arm64/test_arm64.vcxproj
Normal file
160
msvc/test_arm64/test_arm64.vcxproj
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{CBE31473-7D0E-41F5-AFCB-8C8422ED8908}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonetestarm64</RootNamespace>
|
||||
<ProjectName>test_arm64</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\tests\test_arm64.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
160
msvc/test_detail/test_detail.vcxproj
Normal file
160
msvc/test_detail/test_detail.vcxproj
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{A510F308-3094-4FF6-9DFC-539CC5260BA4}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonetestdetail</RootNamespace>
|
||||
<ProjectName>test_detail</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\tests\test_detail.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
160
msvc/test_mips/test_mips.vcxproj
Normal file
160
msvc/test_mips/test_mips.vcxproj
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{28B2D82F-3E95-4ECE-8118-0E891BD453E0}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonetestmips</RootNamespace>
|
||||
<ProjectName>test_mips</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\tests\test_mips.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
160
msvc/test_ppc/test_ppc.vcxproj
Normal file
160
msvc/test_ppc/test_ppc.vcxproj
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\tests\test_ppc.c" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{0B78E956-F897-4149-BFB2-BE87DA3A6F0D}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonetestppc</RootNamespace>
|
||||
<ProjectName>test_ppc</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
160
msvc/test_skipdata/test_skipdata.vcxproj
Normal file
160
msvc/test_skipdata/test_skipdata.vcxproj
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B09819BB-7EF1-4B04-945D-58117E6940A1}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonetestskipdata</RootNamespace>
|
||||
<ProjectName>test_skipdata</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\tests\test_skipdata.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
160
msvc/test_sparc/test_sparc.vcxproj
Normal file
160
msvc/test_sparc/test_sparc.vcxproj
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{9E735ABA-00D9-4114-A9E7-0568D8DFF94B}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonetestsparc</RootNamespace>
|
||||
<ProjectName>test_sparc</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\tests\test_sparc.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
160
msvc/test_systemz/test_systemz.vcxproj
Normal file
160
msvc/test_systemz/test_systemz.vcxproj
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\tests\test_systemz.c" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{D83F2A2D-D5F1-421E-A5B7-B47F1ECABAD2}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonetestsystemz</RootNamespace>
|
||||
<ProjectName>test_systemz</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
160
msvc/test_x86/test_x86.vcxproj
Normal file
160
msvc/test_x86/test_x86.vcxproj
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{9C69243E-C7DC-42A4-AB86-0696E51697C8}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>capstonetestx86</RootNamespace>
|
||||
<ProjectName>test_x86</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>..\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>..\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libcapstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\tests\test_x86.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -38,14 +38,14 @@ IS_CYGWIN := $(shell $(CC) -dumpmachine | grep -i cygwin | wc -l)
|
||||
ifeq ($(IS_CYGWIN),1)
|
||||
CFLAGS := $(CFLAGS:-fPIC=)
|
||||
BIN_EXT = .exe
|
||||
AR_EXT = dll.a
|
||||
AR_EXT = lib
|
||||
else
|
||||
# mingw?
|
||||
IS_MINGW := $(shell $(CC) --version | grep -i mingw | wc -l)
|
||||
ifeq ($(IS_MINGW),1)
|
||||
CFLAGS := $(CFLAGS:-fPIC=)
|
||||
BIN_EXT = .exe
|
||||
AR_EXT = dll.a
|
||||
AR_EXT = lib
|
||||
endif
|
||||
endif
|
||||
|
||||
|
180
tests/test.c
180
tests/test.c
@ -50,123 +50,131 @@ static void test()
|
||||
#define SPARC_CODE "\x80\xa0\x40\x02\x85\xc2\x60\x08\x85\xe8\x20\x01\x81\xe8\x00\x00\x90\x10\x20\x01\xd5\xf6\x10\x16\x21\x00\x00\x0a\x86\x00\x40\x02\x01\x00\x00\x00\x12\xbf\xff\xff\x10\xbf\xff\xff\xa0\x02\x00\x09\x0d\xbf\xff\xff\xd4\x20\x60\x00\xd4\x4e\x00\x16\x2a\xc2\x80\x03"
|
||||
#define SPARCV9_CODE "\x81\xa8\x0a\x24\x89\xa0\x10\x20\x89\xa0\x1a\x60\x89\xa0\x00\xe0"
|
||||
#define SYSZ_CODE "\xed\x00\x00\x00\x00\x1a\x5a\x0f\x1f\xff\xc2\x09\x80\x00\x00\x00\x07\xf7\xeb\x2a\xff\xff\x7f\x57\xe3\x01\xff\xff\x7f\x57\xeb\x00\xf0\x00\x00\x24\xb2\x4f\x00\x78"
|
||||
|
||||
struct platform {
|
||||
cs_arch arch;
|
||||
cs_mode mode;
|
||||
unsigned char *code;
|
||||
size_t size;
|
||||
char *comment;
|
||||
cs_opt_type opt_type;
|
||||
cs_opt_value opt_value;
|
||||
};
|
||||
struct platform platforms[] = {
|
||||
{
|
||||
.arch = CS_ARCH_X86,
|
||||
.mode = CS_MODE_16,
|
||||
.code = (unsigned char*)X86_CODE16,
|
||||
.size = sizeof(X86_CODE16) - 1,
|
||||
.comment = "X86 16bit (Intel syntax)"
|
||||
CS_ARCH_X86,
|
||||
CS_MODE_16,
|
||||
(unsigned char*)X86_CODE16,
|
||||
sizeof(X86_CODE16) - 1,
|
||||
"X86 16bit (Intel syntax)"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_X86,
|
||||
.mode = CS_MODE_32,
|
||||
.code = (unsigned char*)X86_CODE32,
|
||||
.size = sizeof(X86_CODE32) - 1,
|
||||
.comment = "X86 32bit (ATT syntax)",
|
||||
.opt_type = CS_OPT_SYNTAX,
|
||||
.opt_value = CS_OPT_SYNTAX_ATT,
|
||||
CS_ARCH_X86,
|
||||
CS_MODE_32,
|
||||
(unsigned char*)X86_CODE32,
|
||||
sizeof(X86_CODE32) - 1,
|
||||
"X86 32bit (ATT syntax)",
|
||||
CS_OPT_SYNTAX,
|
||||
CS_OPT_SYNTAX_ATT,
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_X86,
|
||||
.mode = CS_MODE_32,
|
||||
.code = (unsigned char*)X86_CODE32,
|
||||
.size = sizeof(X86_CODE32) - 1,
|
||||
.comment = "X86 32 (Intel syntax)"
|
||||
CS_ARCH_X86,
|
||||
CS_MODE_32,
|
||||
(unsigned char*)X86_CODE32,
|
||||
sizeof(X86_CODE32) - 1,
|
||||
"X86 32 (Intel syntax)"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_X86,
|
||||
.mode = CS_MODE_64,
|
||||
.code = (unsigned char*)X86_CODE64,
|
||||
.size = sizeof(X86_CODE64) - 1,
|
||||
.comment = "X86 64 (Intel syntax)"
|
||||
CS_ARCH_X86,
|
||||
CS_MODE_64,
|
||||
(unsigned char*)X86_CODE64,
|
||||
sizeof(X86_CODE64) - 1,
|
||||
"X86 64 (Intel syntax)"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_ARM,
|
||||
.mode = CS_MODE_ARM,
|
||||
.code = (unsigned char*)ARM_CODE,
|
||||
.size = sizeof(ARM_CODE) - 1,
|
||||
.comment = "ARM"
|
||||
CS_ARCH_ARM,
|
||||
CS_MODE_ARM,
|
||||
(unsigned char*)ARM_CODE,
|
||||
sizeof(ARM_CODE) - 1,
|
||||
"ARM"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_ARM,
|
||||
.mode = CS_MODE_THUMB,
|
||||
.code = (unsigned char*)THUMB_CODE2,
|
||||
.size = sizeof(THUMB_CODE2) - 1,
|
||||
.comment = "THUMB-2"
|
||||
CS_ARCH_ARM,
|
||||
CS_MODE_THUMB,
|
||||
(unsigned char*)THUMB_CODE2,
|
||||
sizeof(THUMB_CODE2) - 1,
|
||||
"THUMB-2"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_ARM,
|
||||
.mode = CS_MODE_ARM,
|
||||
.code = (unsigned char*)ARM_CODE2,
|
||||
.size = sizeof(ARM_CODE2) - 1,
|
||||
.comment = "ARM: Cortex-A15 + NEON"
|
||||
CS_ARCH_ARM,
|
||||
CS_MODE_ARM,
|
||||
(unsigned char*)ARM_CODE2,
|
||||
sizeof(ARM_CODE2) - 1,
|
||||
"ARM: Cortex-A15 + NEON"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_ARM,
|
||||
.mode = CS_MODE_THUMB,
|
||||
.code = (unsigned char*)THUMB_CODE,
|
||||
.size = sizeof(THUMB_CODE) - 1,
|
||||
.comment = "THUMB"
|
||||
CS_ARCH_ARM,
|
||||
CS_MODE_THUMB,
|
||||
(unsigned char*)THUMB_CODE,
|
||||
sizeof(THUMB_CODE) - 1,
|
||||
"THUMB"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_MIPS,
|
||||
.mode = CS_MODE_32 + CS_MODE_BIG_ENDIAN,
|
||||
.code = (unsigned char*)MIPS_CODE,
|
||||
.size = sizeof(MIPS_CODE) - 1,
|
||||
.comment = "MIPS-32 (Big-endian)"
|
||||
CS_ARCH_MIPS,
|
||||
(cs_mode)(CS_MODE_32 + CS_MODE_BIG_ENDIAN),
|
||||
(unsigned char*)MIPS_CODE,
|
||||
sizeof(MIPS_CODE) - 1,
|
||||
"MIPS-32 (Big-endian)"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_MIPS,
|
||||
.mode = CS_MODE_64+ CS_MODE_LITTLE_ENDIAN,
|
||||
.code = (unsigned char*)MIPS_CODE2,
|
||||
.size = sizeof(MIPS_CODE2) - 1,
|
||||
.comment = "MIPS-64-EL (Little-endian)"
|
||||
CS_ARCH_MIPS,
|
||||
(cs_mode)(CS_MODE_64 + CS_MODE_LITTLE_ENDIAN),
|
||||
(unsigned char*)MIPS_CODE2,
|
||||
sizeof(MIPS_CODE2) - 1,
|
||||
"MIPS-64-EL (Little-endian)"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_ARM64,
|
||||
.mode = CS_MODE_ARM,
|
||||
.code = (unsigned char*)ARM64_CODE,
|
||||
.size = sizeof(ARM64_CODE) - 1,
|
||||
.comment = "ARM-64"
|
||||
CS_ARCH_ARM64,
|
||||
CS_MODE_ARM,
|
||||
(unsigned char*)ARM64_CODE,
|
||||
sizeof(ARM64_CODE) - 1,
|
||||
"ARM-64"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_PPC,
|
||||
.mode = CS_MODE_BIG_ENDIAN,
|
||||
.code = (unsigned char*)PPC_CODE,
|
||||
.size = sizeof(PPC_CODE) - 1,
|
||||
.comment = "PPC-64"
|
||||
CS_ARCH_PPC,
|
||||
CS_MODE_BIG_ENDIAN,
|
||||
(unsigned char*)PPC_CODE,
|
||||
sizeof(PPC_CODE) - 1,
|
||||
"PPC-64"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_PPC,
|
||||
.mode = CS_MODE_BIG_ENDIAN,
|
||||
.code = (unsigned char*)PPC_CODE,
|
||||
.size = sizeof(PPC_CODE) - 1,
|
||||
.opt_type = CS_OPT_SYNTAX,
|
||||
.opt_value = CS_OPT_SYNTAX_NOREGNAME,
|
||||
.comment = "PPC-64, print register with number only"
|
||||
CS_ARCH_PPC,
|
||||
CS_MODE_BIG_ENDIAN,
|
||||
(unsigned char*)PPC_CODE,
|
||||
sizeof(PPC_CODE) - 1,
|
||||
"PPC-64, print register with number only",
|
||||
CS_OPT_SYNTAX,
|
||||
CS_OPT_SYNTAX_NOREGNAME
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_SPARC,
|
||||
.mode = CS_MODE_BIG_ENDIAN,
|
||||
.code = (unsigned char*)SPARC_CODE,
|
||||
.size = sizeof(SPARC_CODE) - 1,
|
||||
.comment = "Sparc"
|
||||
CS_ARCH_SPARC,
|
||||
CS_MODE_BIG_ENDIAN,
|
||||
(unsigned char*)SPARC_CODE,
|
||||
sizeof(SPARC_CODE) - 1,
|
||||
"Sparc"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_SPARC,
|
||||
.mode = CS_MODE_BIG_ENDIAN + CS_MODE_V9,
|
||||
.code = (unsigned char*)SPARCV9_CODE,
|
||||
.size = sizeof(SPARCV9_CODE) - 1,
|
||||
.comment = "SparcV9"
|
||||
CS_ARCH_SPARC,
|
||||
(cs_mode)(CS_MODE_BIG_ENDIAN + CS_MODE_V9),
|
||||
(unsigned char*)SPARCV9_CODE,
|
||||
sizeof(SPARCV9_CODE) - 1,
|
||||
"SparcV9"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_SYSZ,
|
||||
.mode = 0,
|
||||
.code = (unsigned char*)SYSZ_CODE,
|
||||
.size = sizeof(SYSZ_CODE) - 1,
|
||||
.comment = "SystemZ"
|
||||
CS_ARCH_SYSZ,
|
||||
(cs_mode)0,
|
||||
(unsigned char*)SYSZ_CODE,
|
||||
sizeof(SYSZ_CODE) - 1,
|
||||
"SystemZ"
|
||||
},
|
||||
};
|
||||
|
||||
@ -224,7 +232,7 @@ int main()
|
||||
test();
|
||||
|
||||
#if 0
|
||||
#define offsetof(st, m) __builtin_offsetof(st, m)
|
||||
#define offsetof(st, m) __builtin_offsetof(st, m)
|
||||
|
||||
cs_insn insn;
|
||||
printf("size: %lu\n", sizeof(insn));
|
||||
|
@ -166,33 +166,33 @@ static void test()
|
||||
|
||||
struct platform platforms[] = {
|
||||
{
|
||||
.arch = CS_ARCH_ARM,
|
||||
.mode = CS_MODE_ARM,
|
||||
.code = (unsigned char *)ARM_CODE,
|
||||
.size = sizeof(ARM_CODE) - 1,
|
||||
.comment = "ARM"
|
||||
CS_ARCH_ARM,
|
||||
CS_MODE_ARM,
|
||||
(unsigned char *)ARM_CODE,
|
||||
sizeof(ARM_CODE) - 1,
|
||||
"ARM"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_ARM,
|
||||
.mode = CS_MODE_THUMB,
|
||||
.code = (unsigned char *)THUMB_CODE,
|
||||
.size = sizeof(THUMB_CODE) - 1,
|
||||
.comment = "Thumb"
|
||||
CS_ARCH_ARM,
|
||||
CS_MODE_THUMB,
|
||||
(unsigned char *)THUMB_CODE,
|
||||
sizeof(THUMB_CODE) - 1,
|
||||
"Thumb"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_ARM,
|
||||
.mode = CS_MODE_THUMB,
|
||||
.code = (unsigned char *)ARM_CODE2,
|
||||
.size = sizeof(ARM_CODE2) - 1,
|
||||
.comment = "Thumb-mixed"
|
||||
CS_ARCH_ARM,
|
||||
CS_MODE_THUMB,
|
||||
(unsigned char *)ARM_CODE2,
|
||||
sizeof(ARM_CODE2) - 1,
|
||||
"Thumb-mixed"
|
||||
},
|
||||
{
|
||||
.arch = CS_ARCH_ARM,
|
||||
.mode = CS_MODE_THUMB,
|
||||
.code = (unsigned char *)THUMB_CODE2,
|
||||
.size = sizeof(THUMB_CODE2) - 1,
|
||||
.comment = "Thumb-2 & register named with numbers",
|
||||
.syntax = CS_OPT_SYNTAX_NOREGNAME
|
||||
CS_ARCH_ARM,
|
||||
CS_MODE_THUMB,
|
||||
(unsigned char *)THUMB_CODE2,
|
||||
sizeof(THUMB_CODE2) - 1,
|
||||
"Thumb-2 & register named with numbers",
|
||||
CS_OPT_SYNTAX_NOREGNAME
|
||||
},
|
||||
};
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user