Commit Graph

3782 Commits

Author SHA1 Message Date
amirgon 29893c63e3 Recognize MSYS compiler as MINGW compiler (#1290) 2018-11-21 00:46:12 +08:00
Dimitri Bohlender f01c267f88 Typo in register's name (#1282)
Fixed Minor typo, i.e. the friendly string representation of X86_REG_ST0 was "st(0"
2018-11-02 07:43:54 +08:00
Nguyen Anh Quynh 641a0dd95b x86: fix instruction suffix of MOV to segment register for ATT syntax. issue #1240 2018-10-26 14:08:18 +08:00
Nguyen Anh Quynh 88d0442e9f x86: fix operand access of FSTP (#1255) 2018-10-25 23:22:48 +08:00
Derrick McKee c3bc43e354 Generate capstone.pc to the location it is installed from (#1265)
* forcing capstone.pc to be generated in the same place it is installed from

* x86: fix operand access of SETE & SETNE (#1262)

* forcing capstone.pc to be generated in the same place it is installed from
2018-10-23 19:42:36 -03:00
ael 0a39b785d3 fix include path in pkg-config template (#1276) 2018-10-23 19:42:01 -03:00
Nguyen Anh Quynh 9408c0de4f Merge branch 'master' of github.com:aquynh/capstone 2018-10-10 14:14:48 +08:00
Nguyen Anh Quynh 260fbdc313 x86: fix operand access of SETE & SETNE (#1262) 2018-10-10 14:07:07 +08:00
blacktop 0999ad1b5e Remove i386 from Makefile (#1260) 2018-10-03 15:21:54 +08:00
Nguyen Anh Quynh a6b87b7bc3 x86: fix operand access of fistp & fstp, in #1255 2018-10-02 12:22:13 +02:00
Nguyen Anh Quynh fc8ba23378 x86: fix operand access of CMP in #1253 2018-10-02 12:18:29 +02:00
Hugo fbeffa489c Add python_requires and update Trove classifiers (#1251) 2018-10-02 17:45:45 +08:00
Bruce Mitchener aed8bffd61 Fix typo: combined. (#1254) 2018-10-02 17:44:39 +08:00
Nguyen Anh Quynh 2b4aec9c76 bindings: make bindings/const_generator.py compatible with recent reformat of C headers 2018-10-01 20:29:39 +08:00
Bruce Mitchener 441d37fbd6 Adjust comments in arch headers for doxygen style. (#1250) 2018-10-01 20:11:21 +08:00
Nguyen Anh Quynh a732cb0ca1 bindings: update PPC constants 2018-09-17 21:01:01 +08:00
Bruce Mitchener 1d40b9ee0a Use doxygen style comments. (#1249)
This converts various documentation comments to use Doxygen-style
syntax so that other tools can pick up and process these comments.
2018-09-17 20:59:47 +08:00
Bruce Mitchener e8b234d237 Fix typos. (#1248) 2018-09-17 20:54:00 +08:00
Tim Brooks e2c1cd46c0 Correct use of strncpy function (#1247)
The last argument should be the max size of the destination, not the
source buffer. A null byte is added to the end of the destination buffer
since strncpy only adds one if it does not truncate the source.
This fixes the -Wstringop-overflow warning on GCC.
2018-09-15 13:47:52 +08:00
beatcracker d70e2b286a Update PowerShell bindings (#1239)
* Remove trailing whitespace

* ~2x speedup by removing array appending

More info: https://powershell.org/2013/09/16/powershell-performance-the-operator-and-when-to-avoid-it/

* Import inline C# conditionally

Avoids errors when importing module using "-Force"

* Throw exception on missing DLL

+ use idiomatic PowerShell

* Throw exception on errors

+ use idiomatic PowerShell

* Throw exception on errors

+ use idiomatic PowerShell

* Use idiomatic PowerShell

* Fix DLL path escaping

* Add native PowerShell formatting

Instruction address will display as "0xdeadbeef" in console output, but the actual value will be stored as appropriate integer type.

This allows to use "Address" property directly in code that relies on Get-Capstone disasselbly w/o type conversion.

The original module author was using hex-strings, because when you add things in PowerShell like this:  $Integer + '0xFF' , PowerShell will cast everything to the type of the first operand. And it's smart enough to cast hex-string to integer.

Example: https://github.com/FuzzySecurity/PowerShell-Suite/blob/master/Trace-Execution.ps1#L195

But this is unreliable and moreover, PowerShell has peculiar quirks when casting hex-strings: https://github.com/PowerShell/PowerShell/issues/3313

* Move Capstone init to separate function

* Add Get-CaptoneVersion function

Which resturns "version" object. Also add back erroneously deleted "return" to Get-CapstoneDisassembly -Version and convert it to advanced function.

* Fix help text

* Replace double quotes with single quotes where appropriate

* No need to assign $null to switch params

* Make return usage more obvious

* No need for double quotes in version banner

* Add space after comma

* ~3x speedup by removing New-Object usage. Requires PS 3.0

* Cosmetic fixes

* Remove PS 2.0 compatibility code

* Fix PSScriptAnalyzer warnings

* Don't load module if inline C# doesn't compile

* Return actual instruction bytes

* Fix version function

* Use lowercase for accelerators

* Remove "Mandatory = $False" since it's default

* Add spaces around "=" and ";"

* Use lowercase for built-in variables

* Tabs -> Spaces

* Update help

* Use standard manifest

* UTF-8, no BOM

* Remove remaining New-Object invocations

* Bump module version (semver anyone?)

* Restore PSv2 compatibility

Use [pscustomobject]/New-Object based on reported PS version.

* Tabs -> Spaces

* Update authors
2018-09-11 12:50:55 +08:00
Riccardo Schirone c3bc95b4a1 arch/X86: fix strncpy usage (#1243)
The `n` parameter should be the size of the destination buffer, not the
source one.
2018-09-04 08:51:02 +07:00
xambroz 5c168e515d introduce PYTHON2 and PYTHON3 variables in the makefiles (#1236)
This change makes it possible to be explicit during the build time
on what python version/binary use to compile.
2018-08-29 12:26:53 +08:00
Catena cyber 970df19f6e Avoids memory leak with fuzz driver (#1233) 2018-08-27 07:57:27 +07:00
Riccardo Schirone bfa649ff1a WIP: arch/TMS320C64x: fix underflow (#1220)
* arch/TMS320C64x: fix underflow

(patch coming from radare2)

* arch/TMS320C64x: fix spaces between if/for/while and parenthesis

* arch/TMS320C64x: switch back to ==
2018-07-30 15:17:43 +08:00
Nguyen Anh Quynh dc7aafb87c evm: fix EVMMappingInsn.inc 2018-07-29 02:38:10 +08:00
Nguyen Anh Quynh 8074420213 Merge branch 'master' of github.com:aquynh/capstone 2018-07-28 00:24:46 +08:00
Nguyen Anh Quynh 44bcb2fa38 MacOS: do not build in Universal format by default 2018-07-28 00:24:14 +08:00
Nguyen Anh Quynh 4f05e83334 README 2018-07-24 13:44:39 +08:00
Riccardo Schirone 6cfbd06b61 arch/M68k: do not return reg_name if beyond limits (#1219)
* arch/M68k: do not return reg_name if beyond limits

(patch coming from radare2)

* arch: checks index when returning reg names
2018-07-24 16:25:47 +08:00
Nguyen Anh Quynh 782ea67e17 sparc: fix issue #1221 on double printing imm operand 2018-07-24 14:53:00 +08:00
Riccardo Schirone e8a818d9a7 cstool: fix memleak to prevent ASAN from complaining (#1222) 2018-07-24 10:19:07 +08:00
Nguyen Anh Quynh 2fc852dcbd fix warnings on const char * discards qualifiers 2018-07-24 01:41:59 +08:00
Nguyen Anh Quynh 443f82ee74 Merge branch 'v4' 2018-07-23 21:20:46 +08:00
Francesco Tamagni dd6e558a33 Fix testAndBranch sign extend to 64 bit (#1213) 2018-07-20 14:50:41 +08:00
Nguyen Anh Quynh afffa5d741 merge next to master 2018-07-20 12:36:50 +08:00
Nguyen Anh Quynh db19431d4b ChangeLog 2018-07-19 00:17:10 +08:00
Nguyen Anh Quynh bbe9ce9b7c mips: compilable for MSVC 2013 2018-07-18 23:47:07 +08:00
Nguyen Anh Quynh 7123dbc486 mips: compilable for MSVC 2013 2018-07-18 23:46:36 +08:00
Nguyen Anh Quynh eeff103965 ChangeLog 2018-07-18 13:48:32 +08:00
Nguyen Anh Quynh 49950e4672 python: raise CsError(CS_ERR_SKIPDATA) when accessing irrelevant data in skipdata mode. this fixes issue #679 2018-07-18 13:43:32 +08:00
Nguyen Anh Quynh d553dbf3eb python: raise CsError(CS_ERR_SKIPDATA) when accessing irrelevant data in skipdata mode. this fixes issue #679 2018-07-18 13:37:45 +08:00
Nguyen Anh Quynh 9ea5fbd210 ChangeLog for v3.0.5 2018-07-17 15:59:51 +08:00
Nguyen Anh Quynh 4741517c34 change PKG_TAG for v3.0.5 2018-07-17 15:30:42 +08:00
keenk d03cab449d Update TestX86.java (#1208)
* Fix java bindings for encoding

Fix java bindings broken with addition of encoding struct in #1194

* Add files via upload


Update TestX86.java for printing encoding struct and register access

* Add files via upload

Added conditions to only print encoding class info when needed.
Formatting.

* Add files via upload

Another space
2018-07-13 15:52:19 +07:00
clslgrnc 9b9844d276 Init cs_detail (#1205)
* Update init of cs_detail for AArch64

as @aquynh requested in #1125

* Update init of cs_detail for ARM

as @aquynh requested in #1125

* Update init of cs_detail for EVM

as @aquynh requested in #1125

* Update init of cs_detail for M680X

as @aquynh requested in #1125

* Update init of cs_detail for M68K

as @aquynh requested in #1125

* Update init of cs_detail for Mips

as @aquynh requested in #1125

* Update init of cs_detail for PowerPC

as @aquynh requested in #1125

* Update init of cs_detail for Sparc

as @aquynh requested in #1125

* Update init of cs_detail for SystemZ

as @aquynh requested in #1125

* Update init of cs_detail for TMS320C64x

as @aquynh requested in #1125

* Update init of cs_detail for XCore

as @aquynh requested in #1125

* Comment on init of cs_detail

* wrap long lines
2018-07-12 11:01:34 +07:00
Nguyen Anh Quynh 728e6999eb x86: fix imm operand of RETF. see #1204 2018-07-11 23:20:00 +08:00
Martin b5b2a11474 readDisplacement fix (#1200) 2018-07-11 23:19:45 +08:00
Martin cc7b088236 readDisplacement fix (#1200) 2018-07-11 22:18:38 +07:00
Nguyen Anh Quynh ae703aaea0 x86: fix imm operand of RETF. see #1204 2018-07-11 23:12:18 +08:00
keenk e90af81ac8 Fix java bindings for encoding (#1202)
Fix java bindings broken with addition of encoding struct in #1194
2018-07-09 08:26:33 +07:00