Commit Graph

710 Commits

Author SHA1 Message Date
Boris-Chengbiao Zhou ffe054aaa9 Various improvements to the Rust bindings (#401)
* Fix Rust bindings

* Various small improvements for the Rust bindings

* Remove unused dependencies

* Use the cmake crate to compile keystone

* Add Windows support to Rust bindings

* Cleanup doc a bit

* Fix symlink path

* Link to C++ standard library

* Build all keystone targets
2019-08-02 21:42:21 +08:00
Jinmo 13b13d99df add suite/ directory for suite/fuzz, fix python build (#414) 2019-08-02 21:41:00 +08:00
Catena cyber d49b6fa401 Sets a default radix (#382)
* Sets a default radix

* Default radix is 16
2019-02-08 10:26:25 +08:00
Trey Keown 622fe09217 Fix ADRP instruction encoding (#396)
* Fix ADRP instruction encoding

* Trigger checks on PR again, it failed for some reason unrelated to my code

* Add correct offset checks back in
2019-01-21 17:03:23 +08:00
mike-au-451 3ecb98cdfb Fix input from stdin. (#389) 2018-12-08 08:57:49 +07:00
Catena cyber 2c1a40b495 Limit recursion in AsmParser::parsePrimaryExpr (#379) 2018-09-24 20:19:16 +08:00
Catena cyber e649026ff3 Remove Sparc64 as it is unsupported (#376) 2018-09-17 20:52:59 +08:00
@tkmru 29f61ff562 fix sample in go binding (#372) 2018-09-17 20:52:16 +08:00
Tasuku SUENAGA a.k.a. gunyarakun f231d0d843 bindings: include keystone itself on Rust bindings (#324) 2018-09-16 21:48:20 +08:00
Catena cyber 9da56b67c1 Adds Philippe Antoine to CREDITS.TXT (#374)
For fuzzing
2018-09-13 12:23:04 +08:00
Catena cyber 0f19fa9acd Only frees instruction if allocated (#375)
* Only frees instruction if allocated

* Avoids memory leak in ks_close for EVM
2018-09-13 12:22:39 +08:00
Catena cyber 1ee0248c04 Fuzzing : integration with oss-fuzz (#371) 2018-09-11 21:51:03 +08:00
Ta Thanh Dinh 6a444fc633 fix gcc's memaccess warning (#373) 2018-09-11 21:48:54 +08:00
Grégoire Geis 0ab2b81261 Refactor to target .NET Standard 1.1 (#344)
* Refactor to target .NET Standard 1.1

* Added Nuget details to .csproj

* Reviewed Engine methods and docs; added own Exception type.

* Added migration guide for .NET bindings.
2018-08-02 10:49:31 +08:00
bsharet 3ea06c9ed3 Don't build universal binaries by default (#366)
* Don't build universal binaries by default

Starting Xcode 10 beta, there's no support for i386.
This commit changes the default build on iOS to regular libraries
instead of universal binaries.
Build of universal binaries is still supported with macos-universal.

* Add macos-no-universal option (compatibility)

Keep the default to be macos-no-universal, but add it as an option as
well for backward compatibility.
2018-07-26 00:29:31 +08:00
Nguyen Anh Quynh e4d73ee083 add Java binding to README 2018-07-18 14:07:52 +08:00
Jämes Ménétrey 097dca275a Introduction of the Java bindings (#364)
* Add the structure for the Java Bindings

Set up the structure hosting the Java bindings using JNA,
and provides a binding for the function ks_version.

* Ignore the compiled extension of macOS libraries.

* Add infrastructure to open and close Keystone handles.

Keystone enumerations have been added, as well as the required
wrappers for JNA to convert the enumerations to and from the
native library.

Create exceptions for handling issues related to Keystone.

Implement a cleaner that automatically collect any opened
Keystone handles when a Keystone instance is garbage collected.

* The close method of Keystone is now thread-safe.

* Rename the exception KeystoneOpenFailedException into OpenFailedKeystoneException.

* Add the assemble function into the wrapper of Keystone.

* Enhance the exceptions thrown by Keystone using ks_strerror.

The exception classes have been refactored to shorten hardcoded
error messages into the wrapper and instead, rely on the error
messages generated by the native library, thanks to the function
ks_strerror.

* Add the ability to check with a given architecture is supported.

Enhance the wrapper to map the function function ks_arch_supported
in order to determine whether a given architecture is supported.

* Add the features the change the assembly syntax and resolve symbols.

Enhance the wrapper in order to support the changes of options.

* Document the class KeystoneEncoded.

* Add additional unit tests for a better coverage.

* Reorder the native functions import and document the native functions prototype.

* Optimize the code.

* Add the target folder to the gitignore.

* Add missing Javadoc annotations for the exceptions.

* Add a gitkeep for the folder hosting the Keystone library for macOS.

* Update the Maven configuration for version and dependencies.

Use the version convention defined in the README, add a couple
of testing dependencies and plugins to package the bindings in
a fat JAR and enable Maven to use jUnit 5.

* Use JNA Direct Mapping for better performances on native function calls.

* Add the README.

* Add myself to the credits :)

* Use the syntax highlighting of Java in the README.

* Fix a typo.

* Optimize imports.

* Add predefined folders hosting the library Keystone on Windows.

* Add the Java bindings to the README of the bindings summary.
2018-07-18 14:05:01 +08:00
Michael Mohr 067d2bdfa3 Update Debian packaging to Ubuntu 18.04 (#352) 2018-05-10 15:07:25 +08:00
gmorenz 2829223952 Fix use after free in Rust bindings (#334) 2018-04-01 20:56:00 +08:00
Christian Sharpsten 3e67c1d488 Auto-detect install libdir to enable multi-arch debian builds (#345)
When compiling on linux, use GNUInstallDirs to automatically determine
the appropriate libdir path for multi-arch builds instead of hardcoding
lib/ or lib64/. GNUInstallDirs should follow the FHS appropriately for
non-debian platforms that place libs in lib64/. This also removes the
need to specify `lib64` on the command line when building for a
non-debian system that follows the linux FHS.

When compiling with cmake directly on debian and specifying
`-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_LIBRARY_ARCHITECTURE=<arch>`, the
libdir should be set to /usr/lib/<arch>/.
2018-04-01 10:38:32 +08:00
Christian Sharpsten 4733bab91b Fix x86 instruction prefix ordering (#340)
A REX prefix byte must immediately precede the opcode byte or the
opcode escape byte. Emit segment override and address size prefix
bytes before a REX prefix byte.
2018-04-01 00:48:51 +08:00
Christian Sharpsten 91d0ea2c2c Use hidden symbol visibility by default (#347) 2018-04-01 00:45:01 +08:00
Christian Sharpsten ae8d127e34 Fix spelling errors in libkeystone (#346) 2018-04-01 00:39:46 +08:00
Nguyen Anh Quynh 80d46cee40 add Ethereum VM architecture 2018-03-31 00:08:28 +08:00
Ta Thanh Dinh 88d1557e5a Add another Rust binding (#343) 2018-03-15 09:11:27 +08:00
Michael Mohr e1173698d7 Minor updates / fixes (#342) 2018-03-13 23:09:52 +08:00
Michael Mohr 6eefe77b4e Add Debian packaging (#341) 2018-03-12 19:57:39 +07:00
Nguyen Anh Quynh 83655e4d9f include stdbool.h in keystone.h for older compiler 2018-02-20 17:40:48 +08:00
Nguyen Anh Quynh d7ba8e378e ks_close() reports error on invalid handle 2018-01-24 16:25:28 +08:00
Nguyen Anh Quynh 52accc6b48 add Masm binding to README 2018-01-23 11:39:31 +08:00
fearless 2c659e9d13 Include bindings for masm x86 and other x64 assemblers (#320)
* Include bindings for masm x86 and other x64 assemblers

* Added examples RadASM projects for x86 and x64 assembler
Removed stub lib files
Added readme.md

* removed stub lib files

* Fixed passing address parameter of ks_asm as qword size.
Added unzipped source folders for examples
Removed extra lines in text files

* Removed additional extra lines at end of text files

* Renamed readme.md to README.md, removed additional binaries.

* Rename readme.md to README.md

* Removed additional non-required files. Have to leave .dlg files as they are required for the main dialog examples and examples wont compile without them.

* Updated bindings to add masm binding by mrfealress
2018-01-23 11:37:49 +08:00
Peter Matula 1815d79beb rename namespace "llvm" to "llvm_ks" (#333)
This prevents symbol collisions when the Keystone library is linked with the LLVM libraries.

Renaming was done by the following repository-wide substitutions:
* `namespace llvm` -> `namespace llvm_ks`
* `llvm::` -> `llvm_ks::`
2018-01-23 11:29:52 +08:00
Nguyen Anh Quynh 1a640afc55 sparc: V9 in KS_MODE_SPARC_MASK 2017-12-21 16:48:24 +08:00
unknownv2 a6f802e864 Fix "Compare Keystone & LLVM" link (#332)
The path /beyond_qemu.html should most likely be /beyond_llvm.html.
2017-12-21 13:04:30 +08:00
Brian Kearns 5a874f6fd4 Test+fix ARM Thumb2 ADR calculations (#329) 2017-11-30 00:42:13 +08:00
Brian Kearns e7212da5a6 Test/fix ARM Thumb B.W addresses (#326)
* add ARM Thumb branch address testcases

* fix ARM Thumb B.W addresses (issue #298)
2017-11-30 00:20:52 +08:00
Segev Finer 1123976377 Add asm(..., as_bytes=True) to Python bindings (#327)
When enabled, the assembled code will be returned as bytes (str on
Python 2) instead of a list of integers, this is more memory efficient,
faster (It's created using ctypes.string_at instead of a loop in
Python), and more convenient since that's the type that most code that
works with bytes in Python expects (That includes capstone).

Defaults to `False` for backwards compatibility, since changing the
return type is a breaking change.
2017-11-29 22:29:04 +08:00
Segev Finer 2aeffc216e Add *.egg-info to .gitignore (#328)
This is a meta data folder generated by Python's setuptools.
2017-11-29 22:27:04 +08:00
Stephen 0dc6a0cdba add monitoring of brew builds (#325)
* add monitoring of brew builds

* Update .travis.yml
2017-11-05 21:09:27 +08:00
Tasuku SUENAGA a.k.a. gunyarakun db87c0bcc2 bindings: make the sample code in README.md for Rust compilable (#322) 2017-10-26 20:24:45 +08:00
hongxu 5bcff118bb fix python bindings shared library directory issue (#301)
using `data_files` dict prefixed with
`SITE_PACKAGES = os.path.join(get_python_lib(), "keystone")` is not
portable, see #235 and #297 for details. Regular setup configuration does
not work, e.g., specifying `package_data` etc, since that only affects
`sdist`.

The fix is a hack: customize `install_lib` to explicitly copy the file
into keystone install dir.
2017-10-24 09:41:53 +08:00
Stephen d19579217c clean travis and add linux (#315) 2017-10-07 23:57:24 +08:00
David Zimmer 95b7212a85 +vb6 bindings (#303)
* +vb6 bindings

* vb6 bindings credits update
2017-07-13 14:10:45 -10:00
fidgetingbits c474c6c4b2 Fix issue #293 (#300) 2017-06-01 21:42:52 +08:00
Nguyen Anh Quynh e101997a6f add nmake-dll-x86.bat 2017-05-09 23:03:50 +08:00
Nguyen Anh Quynh f2f796d059 msvc: build static CRT by default 2017-05-09 00:32:20 -07:00
xiaohuajiao 35accb128f fixed Mips 'jal imm' segmentation fault (#294) 2017-04-17 14:59:39 +08:00
noword 51ea7aff4e ARM64, fix issue for PC-relative offset (#291)
b.cond/cbz/cbnz/tbz/tbnz/adrp
2017-04-08 14:17:03 +08:00
Marco 2e6f7c3984 Updated contributors; Fixed some issues with the guide of C# binding (#289) 2017-03-22 00:47:25 +08:00
Nguyen Anh Quynh 0aea340b78 add C# to README 2017-03-20 21:32:48 +08:00