Nguyen Anh Quynh
46b6693d36
x86: save prefixes to avoid expensive copying loop. based on idea of Dang Hoang Vu
2014-06-04 19:04:46 +08:00
Nguyen Anh Quynh
b76233c648
avoid using vsnprintf when possible for SStream_concat() to improve performance. based on the idea of Dang Hoang Vu.
2014-06-04 18:31:02 +08:00
Jay Oster
368c45b4c6
x86 instruction groups: Add SYSEXIT and SYSRET to the X86_GRP_IRET group
2014-06-04 00:08:46 -07:00
Nguyen Anh Quynh
a19d3f0b60
Merge branch 'feature/x86-groups' of https://github.com/parasyte/capstone into test
2014-06-04 13:35:12 +07:00
Jay Oster
6b00344f23
x86 instruction groups: Fix RET/IRET mapping.
2014-06-03 23:31:58 -07:00
Nguyen Anh Quynh
0577bb728c
x86: ATT syntax does not print word size pointer like Intel syntax
2014-06-03 13:50:35 +07:00
Jay Oster
6f74ccc97a
Add new x86 instruction groups
...
- VM: Virtual Machine
- INT: Interrupts
- IRET: Interupt returns
- CALL: Subroutine call
- RET: Subroutine return
Includes a special case for writes to port 0xb2, which triggers an SMI
2014-06-02 22:21:41 -07:00
Nguyen Anh Quynh
c70442edc6
arm: shift info associates with the right op in LDR instruction. bug reported by Daniel Colascione
2014-06-01 11:35:34 +07:00
Nguyen Anh Quynh
a04ee4feb8
arm: add missing the check for detail mode in the last commit
2014-06-01 10:52:01 +07:00
Nguyen Anh Quynh
b79d915a38
arm: add missing operand info for Thumb instruction vldr. bug reported by Daniel Colascione
2014-06-01 10:48:55 +07:00
Nguyen Anh Quynh
bb71c13098
arm: add missing operand info for Thumb instruction LDR involving label. bug reported by Daniel Colascione
2014-06-01 10:14:31 +07:00
Nguyen Anh Quynh
6eb55cf52e
arm: add operand details for 'mov pc, lr'. bug reported by Daniel Colascione
2014-06-01 10:03:14 +07:00
Nguyen Anh Quynh
48b6cb4ce5
arm: CC_AL is the default code condition for instructions without CC. bug reported by Daniel Colascione
2014-06-01 09:45:19 +07:00
Nguyen Anh Quynh
5e2e660be7
fix some warnings reported by Coverity
2014-05-30 17:43:36 +08:00
Nguyen Anh Quynh
2c20a1b5a3
ppc: wrong comparison in printOperand(). bug found by Coverity
2014-05-30 17:00:20 +08:00
Nguyen Anh Quynh
b70e121ce3
x86: FP instructions are only available when X86_REDUCE mode is off
2014-05-28 15:57:51 +08:00
Nguyen Anh Quynh
d0023197eb
cmake: support Sparc, SystemZ & XCore
2014-05-28 15:15:00 +08:00
Nguyen Anh Quynh
3a5965eb05
xcore: fix some warnings with Diet mode
2014-05-28 15:14:28 +08:00
Nguyen Anh Quynh
0150f06553
x86: fix a warning on Diet mode
2014-05-28 15:04:15 +08:00
Nguyen Anh Quynh
9148420b0d
replace strcasecmp() with strcmp()
2014-05-28 12:57:46 +08:00
Nguyen Anh Quynh
d69f9ded5b
x86: delete dead code
2014-05-28 12:39:11 +08:00
Nguyen Anh Quynh
b2e566ac88
xcore: use strcpy() rather than strncpy()
2014-05-28 11:35:19 +08:00
Nguyen Anh Quynh
2a33afe6e8
msvc: make MSVC shutup on strncpy()
2014-05-28 00:24:33 +08:00
Nguyen Anh Quynh
dc1af545c0
msvc: fix warnings
2014-05-28 00:14:22 +08:00
Nguyen Anh Quynh
be2b788dc1
xcore: handle details for some special tricky instructions
2014-05-27 23:34:03 +08:00
Nguyen Anh Quynh
f721e3124d
Disassembler -> Disassembly
2014-05-27 10:45:58 +08:00
Nguyen Anh Quynh
8f50ba894c
Merge branch 'next' into xcore
2014-05-27 10:39:11 +08:00
Nguyen Anh Quynh
04f2ec6d0f
cleanup redundant headers included
2014-05-27 10:39:04 +08:00
Nguyen Anh Quynh
2cf9c524da
x86: MOV64rr belongs to GRP_MODE64 group. bug reported by Jason Oster
2014-05-27 07:23:53 +08:00
Nguyen Anh Quynh
553bb488d7
python: support XCore
2014-05-26 23:47:45 +08:00
Nguyen Anh Quynh
c80d840ffc
add XCore architecture
2014-05-26 23:02:48 +08:00
Nguyen Anh Quynh
3dc080c2b6
systemz: cleanup SystemZGenDisassemblerTables.inc
2014-05-26 15:54:16 +08:00
Nguyen Anh Quynh
5d6383e335
sparc: SPARC_CC_ICC_N should not have the same value as SPARC_CC_INVALID. bug reported by Jason Oster
2014-05-25 13:48:06 +08:00
Jason Oster
6380446222
Add `r0l` register to SystemZMapping.c
2014-05-24 21:26:12 -07:00
Nguyen Anh Quynh
4ebd062ee3
x86: cleanup unused code
2014-05-22 12:11:35 +08:00
Nguyen Anh Quynh
fed098f9a7
x86: eliminate irrelevant prefixes in x86.prefix[] - such as f2/f3 prefixed irrelevant instructions
2014-05-22 12:10:21 +08:00
Nguyen Anh Quynh
1e93adf5c3
x86: add CL operand into details for 'SHL *, CL' instruction
2014-05-21 17:10:10 +08:00
Nguyen Anh Quynh
7a65ad7e4b
x86: detail operands for 'fstpnce st(0), st(0)' & 'fstpst(7), st(0)'
2014-05-21 16:18:56 +08:00
Nguyen Anh Quynh
b6e3f01bb8
x86: handle REP MOVSD/CMPSD/SCASD/LODSD/STOSD properly (due to confused 128bit media instructions having the same mnemonics)
2014-05-21 15:11:58 +08:00
Nguyen Anh Quynh
3a86d92e7c
x86: correct instructions related to REP prefix
2014-05-21 14:12:24 +08:00
Nguyen Anh Quynh
1d6f7ee50e
x86: prefix REP/REPNE are only relevant for MOVS/CMPS/SCAS/LDOS/STOS/INS/OUTS instructions
2014-05-21 12:38:10 +08:00
Jason Oster
984ed7e9e8
MIPS: Add HI, LO, and PC registers to MipsMapping.c
...
- Using MIPS_REG_HI, MIPS_REG_LO, and MIPS_REG_PC with cs_reg_name() caused out-of-bounds reads
2014-05-19 22:56:19 -07:00
Nguyen Anh Quynh
6456481508
x86: add immediate operand (1) for SHL/SHR/ROR/ROL/SAR/SAL in detail mode & Intel syntax
2014-05-19 16:46:31 +08:00
Nguyen Anh Quynh
f338657f17
x86: set syntax variable when changing syntax with cs_option()
2014-05-19 16:34:54 +08:00
Nguyen Anh Quynh
1922b2f74b
arm64: clean reg_name_maps[]
2014-05-18 10:30:09 +08:00
Nguyen Anh Quynh
c5cad6cab3
avoid using stdbool.h to support compilers without C99 support
2014-05-15 21:40:24 +08:00
Nguyen Anh Quynh
1d2e69b869
msvc: remove headers/ directory & replace it with include/platform.h
2014-05-15 13:56:54 +08:00
Nguyen Anh Quynh
7bab8dc12e
x86: AT&T syntax is irrelevant in Diet mode, so setting this syntax should return CS_ERR_DIET error
2014-05-14 23:48:17 +08:00
Nguyen Anh Quynh
f7850266d5
x86: enable AT&T code only when DIET mode is off
2014-05-14 22:03:06 +08:00
Nguyen Anh Quynh
0ffd811d67
merge next branch
2014-05-14 14:33:03 +08:00
Nguyen Anh Quynh
b2a88df20f
MSVC added some code picked up by MingW, so cross-win32/74 compile is broken. this fixes the issue
2014-05-14 14:28:40 +08:00
Nguyen Anh Quynh
506890863c
x86: assembly syntax is irrelevant in Diet mode. this optimization reduces library size to only 180KB on OSX
2014-05-14 12:26:53 +08:00
Nguyen Anh Quynh
8598a219f3
enable arch code from source with CAPSTONE_HAS_* for MSVC to pick up
2014-05-14 11:26:41 +08:00
Nguyen Anh Quynh
eb2e840887
x86: fix C89 issues for X86GenAsmWriter1_reduce.inc & X86GenAsmWriter_reduce.inc
2014-05-12 21:53:53 +08:00
Nguyen Anh Quynh
cfcace3f43
arm: make checkDecoderPredicate() handle boolean casting for MSVC (redone in more systematic way for autogen code)
2014-05-12 21:38:05 +08:00
Nguyen Anh Quynh
805fed5162
make checkDecoderPredicate() handle boolean casting for MSVC
2014-05-12 21:29:04 +08:00
Nguyen Anh Quynh
ef3e450f1a
arm: checkDecoderPredicate() needs to handle Bool data type in the way that MSVC can understand
2014-05-12 18:15:18 +08:00
Nguyen Anh Quynh
043702e9ef
more fixes for warnings reported by MSVC
2014-05-12 16:17:00 +08:00
Nguyen Anh Quynh
6893ec535e
more warnings fixed reported by MSVC
2014-05-12 15:36:38 +08:00
Nguyen Anh Quynh
638835a1d5
fix some warnings reported by MSVC
2014-05-12 15:15:32 +08:00
Nguyen Anh Quynh
abffe02a46
sparc: recover autogen code in arch/Sparc/SparcGenDisassemblerTables.inc
2014-05-12 13:48:22 +08:00
Nguyen Anh Quynh
bb0744df5d
do not initialize some local vars unnecessarily. this problem was introduced when we fixed C89 issues for MSVC
2014-05-12 13:41:49 +08:00
Nguyen Anh Quynh
2d34251889
x86: handle 16bit segment bound for JMP. bug reported by Pancake & Anton Kochkov
2014-05-11 15:33:11 +08:00
Nguyen Anh Quynh
0596e11bd5
arm64: fix a wrong int type of a local var in printLabelOperand. this bug was introduced when we fixed C89 issue for MSVC
2014-05-10 09:17:48 +08:00
Axel 0vercl0k Souchet
35c8467275
still want that to compile on other systems
2014-05-09 20:51:02 +01:00
Axel 0vercl0k Souchet
605faf1db9
moved the hardcoded macros in the vcproj & just disable the warning for the crt
2014-05-09 20:40:00 +01:00
Nguyen Anh Quynh
b5e7db57ee
Merge branch 'next' into msvc2
2014-05-09 17:38:31 +08:00
Nguyen Anh Quynh
d27b0155ef
arm: add BLX_pred into the list of relative branch instructions
2014-05-09 17:34:54 +08:00
Nguyen Anh Quynh
bc80b3dc24
arm: fix some more Thumb relative branch instructions. bug reported by Giovanni Nanomad Condello
2014-05-09 17:31:41 +08:00
Nguyen Anh Quynh
42706a39e2
indentation with tab
2014-05-09 07:33:35 +08:00
Nguyen Anh Quynh
336bf29230
Merge branch 'next' of https://github.com/0vercl0k/capstone into msvc2
2014-05-09 07:10:47 +08:00
Nguyen Anh Quynh
d43187d4f9
arm: BLXi is another relative branch instruction to be fixed. bug reported by Giovanni Nanomad Condello
2014-05-09 07:02:51 +08:00
Axel 0vercl0k Souchet
779d4c75d9
first changes to get a successfully compiled version of capstone on VS2012
2014-05-08 23:44:49 +01:00
Nguyen Anh Quynh
49a1cb374c
arm: fix another relative jump issue. bug reported by Giovanni Nanomad Condello
2014-05-08 23:42:06 +08:00
Nguyen Anh Quynh
958927eb56
clean up after the last removal of SubtargetFeature.h
2014-05-08 22:59:28 +08:00
Nguyen Anh Quynh
79e1dcb5f1
arm: update target branch having relative offset. issue reported by Giovanni Condello
2014-05-07 14:12:50 +08:00
Nguyen Anh Quynh
e68ee701c4
x86: simplify code handling LOCK/REP by remembering this prefix status when decoding it
2014-05-07 13:57:09 +08:00
Nguyen Anh Quynh
16837f8431
x86: MULPD instruction is unavailable in X86_REDUCE mode
2014-05-07 12:34:27 +08:00
Nguyen Anh Quynh
288d6b3c8a
x86: properly handle lock/rep prefixes when DIET option is enable
2014-05-07 12:26:55 +08:00
Nguyen Anh Quynh
9bcca47a98
x86: avoid duplicating code when handling prefixes in X86_getInstruction()
2014-05-07 11:45:02 +08:00
Nguyen Anh Quynh
45c77aeadd
x86: handle tricky instructions related to MULPD at http://habrahabr.ru/company/intel/blog/200658/
2014-05-07 11:39:41 +08:00
Nguyen Anh Quynh
5c7f0c3e0d
x86: REP & REPNE are mutually exclusive prefixes
2014-05-07 10:06:24 +08:00
Nguyen Anh Quynh
a5ffdc3a80
x86: properly handle LOCK/REP in the core, so remove buch of hacks
2014-05-07 08:25:24 +08:00
Nguyen Anh Quynh
e106f701ef
x86: only handle 3DNow instructions when X86_REDUCE mode is disable
2014-05-06 17:09:21 +08:00
Nguyen Anh Quynh
13d8c6f205
x86: support 3DNow instructions
2014-05-06 15:02:21 +08:00
Nguyen Anh Quynh
57e784b865
x86: cleanup unused opcode tables for X86_REDUCE
2014-05-06 12:22:42 +08:00
Giovanni Condello
7c78778cfc
Make capstone library compile with arm-none-eabi-gcc 4.8
2014-05-02 20:15:53 +02:00
Nguyen Anh Quynh
ca057fa8f6
x86: identation
2014-04-30 14:26:10 +08:00
Nguyen Anh Quynh
17874d084e
x86: handle NOP instruction 0f18*
2014-04-29 11:16:21 +08:00
Nguyen Anh Quynh
2c5e3e5833
x86: allow 0x66 & 0x67 prefixes to be put anywhere in front of an instruction
2014-04-28 15:46:52 +08:00
Nguyen Anh Quynh
2cff6f61fc
x86: handle instructions with LOCK/REP/REPNE prefix after other prefixes. bear with this until we have a better approach
2014-04-28 11:19:44 +08:00
Nguyen Anh Quynh
1b4864ac46
x86: fix comments on MOVcr, MOVdr, MOVrc, MOVrd
2014-04-25 13:44:31 +08:00
Nguyen Anh Quynh
e93179b851
x86: BOUND instruction uses dword & qword for boundary array, but not memory reference
2014-04-25 11:18:40 +08:00
Nguyen Anh Quynh
7437a41bfa
x86: minor fixes for comments on MOV32cr etc: this is related to 64bit code as well
2014-04-25 10:51:37 +08:00
Nguyen Anh Quynh
fe94c2b270
x86: BOUND opcode is reused by EVEX instruction set, so must be handled properly
2014-04-25 10:47:50 +08:00
Nguyen Anh Quynh
96bda4f8b4
x86: MOV32cr & co. work for x64, not only x86. thank Joxean Koret for the help to verify this.
2014-04-24 23:03:26 +08:00
Nguyen Anh Quynh
0902bf2a25
x86: handle MOV32cr, MOV32dr, MOV32rc, MOV32rd
2014-04-24 22:46:25 +08:00
Nguyen Anh Quynh
2a9c0e0396
x86: fix a bug when sign-extend immediate for Ev. backport from upstream LLVM
2014-04-23 16:19:15 +08:00
Nguyen Anh Quynh
fa697076b1
x86: handle more tricky instructions.
...
- support undocumented instructions FSTP & FSTPNCE. see http://blogs.technet.com/b/mmpc/archive/2013/06/24/investigation-of-a-new-undocumented-instruction-trick.aspx
- TEST instructions with opcode 0xF6, 0xF7 (MRM1r)
2014-04-23 12:41:16 +08:00
Nguyen Anh Quynh
2ce77133f5
x86: support some tricky instructions
...
- NOP instructions with encoding 0f {19-1f}. see http://code.google.com/p/corkami/wiki/x86oddities?show=content
- TEST instructions with opcode 0xF6, 0xF7 (MRM1m)
- Fix arithmetic instructions with opcode 0x82: only available in Non64bit mode
2014-04-22 17:49:54 +08:00
Nguyen Anh Quynh
33e16362d6
x86: support 0x82 opcode for Arithmetic instructions
2014-04-20 11:32:00 +08:00
Nguyen Anh Quynh
6f56ff5663
x86: handle SAL instructions. bug reported by Attila Suszter & Ange Albertini
2014-04-16 17:29:34 +08:00
Nguyen Anh Quynh
a247dc187d
arm: print address Imm without prefix 0x for Imm >= -9
2014-04-12 00:19:42 +08:00
Nguyen Anh Quynh
9df79afc77
systemz: cleanup
2014-04-10 22:17:07 +08:00
Nguyen Anh Quynh
2579a3fae9
systemz: add a missing operand for instructions involving PCRel
2014-04-10 18:14:08 +08:00
Nguyen Anh Quynh
81a6df4d00
x86: temporarily revert a part of commit 2be9b8791a
due to some broken output
2014-04-01 07:24:33 +08:00
Nguyen Anh Quynh
40f72fde6f
arm: do not update target branch with relative offset
2014-03-31 22:07:40 +08:00
Nguyen Anh Quynh
7626808de6
Merge branch 'x86imm' into next
2014-03-29 21:38:31 +08:00
Nguyen Anh Quynh
6d3d8005aa
x86: do not print memory offset in negative form. bug reported by Le Dinh Long
2014-03-29 17:26:51 +08:00
Nguyen Anh Quynh
125f504174
x86: print offset value in memory reference instruction properly when offset is negative. bug reported by Le Dinh Long
2014-03-29 12:02:21 +08:00
Nguyen Anh Quynh
2eb37ee02a
ppc: disable some redundant functions when Diet option is enable
2014-03-28 10:38:55 +08:00
Nguyen Anh Quynh
d325b1a94b
x86: reduce mode support VMX/SVM instructions now
2014-03-27 14:44:38 +08:00
Nguyen Anh Quynh
e51cf36636
x86: do not print negative immediate. request of Le Dinh Long
2014-03-27 12:36:46 +08:00
Nguyen Anh Quynh
59b5489d8e
x86: rename X86_COMPACT to X86_REDUCE. suggested by Pancake
2014-03-27 10:54:44 +08:00
Nguyen Anh Quynh
a3c9bd678f
sparc: more fix to print negative numbers in more friendly way
2014-03-26 16:22:16 +08:00
Nguyen Anh Quynh
ffff756d21
arm: more fix to print negative numbers in more friendly way
2014-03-26 16:21:31 +08:00
Nguyen Anh Quynh
6211ab8e5e
arm64: fix the rest code printing out negative numbers like big decimal positive numbers
2014-03-26 11:53:00 +08:00
Nguyen Anh Quynh
6f4840270a
arm64: properly print immediate in friendly format in printSImm7ScaledOperand(). bug reported by Amanieu
2014-03-25 23:41:10 +08:00
Nguyen Anh Quynh
9518148e6f
add X86_COMPACT option. also add CS_SUPPORT_X86_COMPACT. made Python support this change
2014-03-25 23:20:41 +08:00
Nguyen Anh Quynh
6db860a246
systemz: indentation
2014-03-25 06:35:51 +08:00
pancake
d889290a02
Remove C++ dependency and fix SystemZ initialization
2014-02-04 08:11:07 +01:00
Nguyen Anh Quynh
7e92884f41
systemz: fix for details
2014-03-24 17:27:32 +08:00
Nguyen Anh Quynh
d04aad77f6
systemz: support Diet option
2014-03-24 17:26:14 +08:00
Nguyen Anh Quynh
f0ff96138e
systemz: print immediates in range [-9, 9] without 0x prefix
2014-03-24 13:41:28 +08:00
Nguyen Anh Quynh
da1e833c8c
systemz: support accesss register operand
2014-03-23 11:12:07 +08:00
Nguyen Anh Quynh
b3d000a841
fix SystemZ on Op
2014-03-23 09:15:50 +08:00
Nguyen Anh Quynh
48a14ca4ce
add SystemZ arch
2014-03-23 08:35:45 +08:00
Nguyen Anh Quynh
88b2833760
sparc: cleanup
2014-03-22 13:41:04 +08:00
Nguyen Anh Quynh
017df604dc
arm64, mips, x86: print -9, not -0x9
2014-03-20 15:38:51 +08:00
Nguyen Anh Quynh
beda293c06
arm64: print label & offset in hex format for negative numbers
2014-03-20 15:30:54 +08:00
Nguyen Anh Quynh
fa814fe479
x86: flag short instruction with missing SIB byte as broken one. ported from upstream. bug reported by @longledinh
2014-03-20 14:14:27 +08:00
Nguyen Anh Quynh
f6c7cbc972
core: fix some warnings
2014-03-12 12:50:54 +08:00
Nguyen Anh Quynh
65c7a01d4f
sparc: fix warning on unused variable
2014-03-11 10:31:53 +08:00
Nguyen Anh Quynh
2ff665ad4a
arm: support asm syntax CS_OPT_SYNTAX_NOREGNAME to print out registers with numbers (ex: 'r11' rather than 'fp')
2014-03-11 00:18:50 +08:00
Nguyen Anh Quynh
641be49c2f
sparc: fix mnemnonic for some alias instructions
2014-03-10 17:57:04 +08:00
Nguyen Anh Quynh
78153f59bb
sparc: add SWAP instruction
2014-03-10 15:29:33 +08:00
Nguyen Anh Quynh
1055a2e22a
python: support Sparc
2014-03-10 14:37:08 +08:00
Nguyen Anh Quynh
05e27138ae
core: add Sparc arch
2014-03-10 11:58:57 +08:00
Nguyen Anh Quynh
cbaf913d68
arm: fix a bug in getting data from input buffer of Thumb: bail out if not enough data
2014-03-06 21:50:45 +08:00
Nguyen Anh Quynh
1514d5ca0c
ppc: cleaning up
2014-03-06 14:04:45 +08:00
Nguyen Anh Quynh
1c68ab9293
cleaning up unused code
2014-03-06 12:41:28 +08:00
Nguyen Anh Quynh
ce2ad202d2
x86: clean up X86ATTInstPrinter.c
2014-03-04 15:00:33 +08:00
Nguyen Anh Quynh
ca9a7ab30c
ppc: fix a segfault in Diet mode
2014-03-04 14:59:54 +08:00
Nguyen Anh Quynh
6b95e5ef74
arm64: fix a segfault bug in Diet engine
2014-03-04 14:23:00 +08:00
Nguyen Anh Quynh
bc22b5be83
x86: handle rep/repne mulpd case
2014-03-03 05:25:37 +08:00
Nguyen Anh Quynh
4ef1668834
arm64: remove dead code
2014-02-25 17:30:08 +08:00
Nguyen Anh Quynh
43befa06a3
arm: no longer rely on information from @groups to verify relative instructions
2014-02-25 16:26:56 +08:00
Nguyen Anh Quynh
079e0430b6
x86: bug fixes for some instructions, including AVX
2014-02-25 14:43:30 +08:00
Nguyen Anh Quynh
143759d9ab
x86: update core
2014-02-24 23:30:45 +08:00
Nguyen Anh Quynh
fc83a439e5
add diet compile option (CAPSTONE_DIET option in config.mk). This reduces binary size by around 40%
2014-02-22 23:26:27 +08:00
Nguyen Anh Quynh
1181a851b9
x86: fix a double-free bug for ATT syntax
2014-02-22 11:58:56 +08:00
Nguyen Anh Quynh
0b6daad5ad
x86: avoid duplicating slot 0 of Opcode tables with emptyTable
2014-02-22 09:31:52 +08:00
Nguyen Anh Quynh
f6060b8f70
x86: compress Opcode tables to make data size 3 times smaller. this is without performance sacrifice by using some extra index tables
2014-02-22 04:57:38 +08:00
Nguyen Anh Quynh
b24692cfcc
x86: add some debug code to find out size of some Opcode tables
2014-02-20 23:41:17 +08:00
Nguyen Anh Quynh
8b915ed765
ppc: update core
2014-02-19 17:01:44 +08:00
Nguyen Anh Quynh
bc0b3b92fd
mips: update core
2014-02-19 15:13:20 +08:00
Nguyen Anh Quynh
6b804dacb1
arm: update core
2014-02-19 12:52:50 +08:00
Nguyen Anh Quynh
27b9a96fd0
x86: make printAliasInstr() return string, not id
2014-02-19 10:13:47 +08:00
Nguyen Anh Quynh
74c41ebb1d
mips: simplify handling alias insn
2014-02-18 17:57:06 +08:00
Nguyen Anh Quynh
4f93d9c9dc
arm64: simplify handling alias instruction (printAliasInstr)
2014-02-18 17:00:18 +08:00
Nguyen Anh Quynh
85cddef303
x86: optimize handling special instructions with accumulate registers
2014-02-18 11:59:36 +08:00
Nguyen Anh Quynh
005c5148a6
x86: eliminate X86_get_insn_id2()
2014-02-18 11:11:46 +08:00
Nguyen Anh Quynh
585018f831
ppc & arm: remove functions *_get_insn_id2()
2014-02-18 00:13:34 +08:00
Nguyen Anh Quynh
a86a1279ff
Merge branch 'msvc0' into next1
2014-02-17 23:11:58 +08:00
kaka22
603f7ac953
x86: fix a warning on unused variable
2014-02-12 18:11:35 +08:00
Nguyen Anh Quynh
d7c00fe5ed
x86: REP should have *CX registers as implicit registers read/written
2014-02-08 18:06:07 +08:00
Nguyen Anh Quynh
13f40d26a2
x86: upgrade core
2014-02-07 22:06:33 +08:00
Nguyen Anh Quynh
9389947d0d
x86: fix a mem leaking issue in X86_insn_combine()
2014-01-25 13:58:58 +08:00
Nguyen Anh Quynh
a82a0890a6
more more fixes on C coding style
2014-01-23 23:42:40 +08:00
Nguyen Anh Quynh
aa078a1c4a
more fixes on C coding style
2014-01-23 22:29:04 +08:00
Nguyen Anh Quynh
2e79ba8996
fix C coding style
2014-01-23 22:22:45 +08:00
Nguyen Anh Quynh
eaeee31f64
Merge branch 'msvc' into test
2014-01-23 22:10:41 +08:00
Nguyen Anh Quynh
b57c90dd23
fix some issues introduced by MSVC port
2014-01-23 21:43:08 +08:00
Alex Ionescu
b8a57fe285
Additional MSVC fixes, including to fixed tables (temporary so Quynh can see what to do).
2014-01-22 18:12:01 -08:00
Alex Ionescu
46018db884
Initial set of changes to support building with MSVC 2013. Right now there's a bunch fo assumptions in the .vcxproj file and some things are not as clean as they should be, but it does build a full build and works (at least the x86 side). The point of this initial checkpoint is to make sure that nothing breaks on the GCC side, that everyone is ok with the changes to the source (or if better fixes/typing can be done).
2014-01-22 09:45:00 -08:00
Nguyen Anh Quynh
c34959b588
x86: proper calculation for the trailing instruction in total cache. issue reported by Pancake
2014-01-22 09:47:46 +08:00
Nguyen Anh Quynh
c36ce95d4a
x86: proper calculation for the trailing instruction in total cache. issue reported by Pancake
2014-01-22 09:46:42 +08:00
Nguyen Anh Quynh
06b3c05e20
cs_open() should return error on invalid mode
2014-01-21 15:27:19 +08:00
Nguyen Anh Quynh
53fc5c103a
cs_open() should return error on invalid mode
2014-01-21 15:26:02 +08:00
Nguyen Anh Quynh
9a291bda75
x86: do not use non-standard strlcat & strlcpy
2014-01-21 14:01:23 +08:00
Nguyen Anh Quynh
b9ff3aaf19
x86: do not use non-standard strlcat & strlcpy
2014-01-21 14:00:34 +08:00
Nguyen Anh Quynh
dc8c346cf0
Merge branch 'prefix' into next
2014-01-21 11:59:51 +08:00
Nguyen Anh Quynh
7772d859af
x86: fix known issue with prefix by combining with previous prefix instruction. this is not perfect, but good enough for now
2014-01-21 11:49:25 +08:00
Nguyen Anh Quynh
3732725342
rename mapping.c, mapping.h, module.c to have arch prefix. suggested by Alex Ionescu
2014-01-20 09:52:05 +08:00
Nguyen Anh Quynh
f328f30fd9
rename mapping.c, mapping.h, module.c to have arch prefix. suggested by Alex Ionescu
2014-01-20 09:47:21 +08:00
Nguyen Anh Quynh
d68a30f4c3
x86: remove 'opaque' in the output of some instructions
2014-01-19 22:40:58 +08:00
Nguyen Anh Quynh
9dfdae6421
x86: add new instructions: FSETPM, SALC, GETSEC & INT1. bug reported by Pancake
2014-01-19 22:40:31 +08:00
Nguyen Anh Quynh
38c1322bde
x86: remove 'opaque' in the output of some instructions
2014-01-19 17:23:08 +08:00
Nguyen Anh Quynh
c272e9d000
do not use constructor to enable archs, so code is more portable. suggested by Alex Ionescu
2014-01-19 12:03:22 +08:00
Nguyen Anh Quynh
edeeb04a1a
make vsnprintf() user-defined function pointer, which is passed in via the same CS_OPT_MEM option like malloc/calloc etc
2014-01-15 20:44:03 +08:00
Nguyen Anh Quynh
a9ffb440f8
replace strdup() with our cs_strdup(), which call cs_mem_malloc() internally
2014-01-15 18:27:01 +08:00
Nguyen Anh Quynh
57c50d4845
ppc: replace constant subtarget numbers with macros
2014-01-15 16:48:48 +08:00
Nguyen Anh Quynh
136e2df38c
x86: some arithmetic instructions should not update accumulate registers
2014-01-15 16:35:19 +08:00
Nguyen Anh Quynh
9cc56a3322
arm: update core
2014-01-15 16:01:55 +08:00
Nguyen Anh Quynh
cbb10ba0b6
arm64: update core
2014-01-15 12:38:38 +08:00
Nguyen Anh Quynh
75ef2426ea
mips: update core
2014-01-14 23:08:20 +08:00
Nguyen Anh Quynh
9c2d02908a
x86: few more SUB insn should not affect accumulate register
2014-01-14 07:30:31 +08:00
Nguyen Anh Quynh
3d56b823ed
extend @op_str of cs_insn_flat following the core change
2014-01-14 07:22:06 +08:00
Nguyen Anh Quynh
22800aac13
x86: some ADD & SUB insn should not affect accumulate registers. bug reported by Bleh
2014-01-14 07:21:17 +08:00
Nguyen Anh Quynh
e51e227409
ppc & x86: add third dummy MRI argument to printInstruction() to make it consistent with other archs
2014-01-12 20:27:54 +08:00
Nguyen Anh Quynh
56774a158c
mips: printInstruction() is static function. add dummy third argument MRI to be consistent with other archs
2014-01-12 18:13:53 +08:00
Nguyen Anh Quynh
dcbe0f8322
arm64: find alias insn after the main isnn name mapping.
2014-01-12 10:11:36 +08:00
Nguyen Anh Quynh
dc6b9574ff
arm64: more changes to make code closer to llvm
2014-01-12 00:52:51 +08:00
Nguyen Anh Quynh
126507741c
arm64: make the code closer to llvm code
2014-01-11 23:52:11 +08:00
Nguyen Anh Quynh
a8eb7a5ca5
rename memory function pointer types to have cs_ prefix. also rename internal function pointers my_* to have cs_mem_ prefix - suggested by Pancake
2014-01-11 12:55:31 +08:00
danghvu
701b850af9
Fix: bug that static link does not know constructor
2014-01-09 11:14:40 +07:00
Nguyen Anh Quynh
77944e0dab
arm64: add big-endian support
2014-01-09 09:13:48 +08:00
Nguyen Anh Quynh
a768c9eb2c
arm: support big-endian. issue reported by Pancake
2014-01-09 09:05:27 +08:00
Nguyen Anh Quynh
f1b05083a7
x86: cleanup unused stuff
2014-01-08 14:53:09 +08:00
Nguyen Anh Quynh
9fac512efc
no longer need to free insn_cache for each arch: simply do it from cs_close()
2014-01-07 10:56:04 +08:00
Nguyen Anh Quynh
1acfd0b883
move insn_cache into cs_struct to gurantee thread-safe
2014-01-06 10:56:59 +08:00
Nguyen Anh Quynh
c7404075ff
move internal memory management declarations from utils.h to cs_priv.h
2014-01-05 11:35:47 +08:00
Nguyen Anh Quynh
24bf0d9079
add new option CS_OPT_MEM for cs_option(): this enable user-defined dynamic memory management. idea proposed by Pancake
2014-01-05 11:19:04 +08:00
Nguyen Anh Quynh
2b14fcdf9b
ppc: update ppc.bh in post-printer
2014-01-05 10:37:50 +08:00
Nguyen Anh Quynh
f1d489b949
ppc: support details information
2014-01-05 00:00:05 +08:00
Nguyen Anh Quynh
5802e5e9a0
correct the last fix
2014-01-04 10:43:31 +08:00
Nguyen Anh Quynh
5ef633ce91
arm64 & arm: do not update details when detail option is off. bug reported by Pancake.
2014-01-04 10:41:17 +08:00
Nguyen Anh Quynh
ee143c8c6c
fix a crashed bug in cs_close(): call destroy function before freeing handle's memory
2014-01-03 21:51:59 +08:00
Nguyen Anh Quynh
b265406960
cache insns for fast lookup in mapping.c. based on the idea of Dang Hoang Vu
2014-01-03 17:08:58 +08:00
Nguyen Anh Quynh
57ab21b558
rename some old header guards from SB to CS
2014-01-02 12:44:20 +08:00
Nguyen Anh Quynh
5f1f90c559
fix for the last commit, and make the test code no longer specify ppc code as 64bit
2014-01-01 23:28:05 +08:00
Nguyen Anh Quynh
5742b1b814
ppc: support for PPC32 was already in
2014-01-01 23:24:07 +08:00
Nguyen Anh Quynh
cef6b27e95
remove -x from PPC files
2013-12-31 23:36:12 +08:00
Nguyen Anh Quynh
19b0de3c8d
moving static doing_mem variable into cs_struct to guarantee thread-safe when handling memory operands
2013-12-31 22:40:04 +08:00
Nguyen Anh Quynh
4d22779f1c
add the missing include/ppc.h
2013-12-31 21:01:01 +08:00
Nguyen Anh Quynh
04ac9c3725
arm,arm64,mips,x86: rename PPC_getFeatureBits() to getFeatureBits()
2013-12-31 18:15:12 +08:00
Nguyen Anh Quynh
ec79f401b1
ppc: rename PPC_getFeatureBits() to getFeatureBits()
2013-12-31 18:00:20 +08:00
Nguyen Anh Quynh
9c5b328cdc
ppc: rename ppc_cc to ppc_bc
2013-12-30 00:52:55 +08:00
Nguyen Anh Quynh
bacf4c8156
add the missing arch/PowerPC directory
2013-12-30 00:29:32 +08:00
Nguyen Anh Quynh
42c6b1acc7
initial support for PPC
2013-12-30 00:15:25 +08:00
Nguyen Anh Quynh
ec4ead2c02
function pointers in arch_init[] should be able to report errors
2013-12-28 14:34:21 +08:00
Nguyen Anh Quynh
4fe224b1ed
change API cs_disasm_dyn(): break cs_insn into 2 structures, and put all details into new structure cs_detail. this break API compatibility
2013-12-24 16:49:36 +08:00
Nguyen Anh Quynh
2b53b20272
x86: patch in acc registers for xchg. bug reported by felixwilhelm
2013-12-24 09:09:20 +08:00
Nguyen Anh Quynh
f954f871e8
initialize all_arch in constructors
2013-12-22 18:49:22 +08:00
Nguyen Anh Quynh
d345839bce
support cs_option() for arm64 module
2013-12-22 11:10:56 +08:00
Nguyen Anh Quynh
39a42eddfb
Change the way of supporting arch modularization
...
- Always use libapstone.so as library name, no matter which archs are compiled in.
- Add new API cs_support() to check if a particular arch is supported.
- Change cs_version(): return hexical version which encodes both major & minor version.
the return value can be comparable.
- Bump API version to 1.1
2013-12-22 10:40:58 +08:00
Nguyen Anh Quynh
13a7d95763
add missing arch/*/module.c
2013-12-21 12:19:44 +08:00
Nguyen Anh Quynh
f185180436
cleaner implementation for arch modularization
2013-12-21 12:16:47 +08:00
Nguyen Anh Quynh
abc02059e3
make all module code static
2013-12-21 10:06:59 +08:00
danghvu
7711858da6
Minor fix credit
2013-12-20 01:23:17 -06:00
danghvu
29e01a6895
arch/*/include.h -> arch/*/module.h
2013-12-20 00:20:57 -06:00
danghvu
a2e7ef1b73
Fix coding style
2013-12-19 23:12:30 -06:00
danghvu
0b6ea044ff
Move cs_option dispatch into arch specific
2013-12-19 23:07:26 -06:00
danghvu
34d49d935b
Support compilation of individual arch
2013-12-19 12:10:24 -06:00
Nguyen Anh Quynh
e832bd8996
arm: support alias registers SB, SL, FP & IP
2013-12-19 16:43:32 +08:00
Nguyen Anh Quynh
2578d3b9e6
mips: use alias registers
2013-12-19 12:26:05 +08:00
Nguyen Anh Quynh
4626224a33
mips: update doing_mem status, regardless of detail option, since that is also used to avoid printing zero offset in mem reference
2013-12-15 22:05:01 +08:00
Nguyen Anh Quynh
3d5930f39e
arm: fix some int types and string specifiers
2013-12-15 21:12:19 +08:00
Nguyen Anh Quynh
d14d3973f4
coding style for C code
2013-12-15 21:11:17 +08:00
Nguyen Anh Quynh
7013f4c53d
mips: print negative immediate when it is negative
2013-12-15 18:53:32 +08:00