Skip to content

Commit bd2f8d5

Browse files
committed
Use Keystone Engine
1 parent 859e192 commit bd2f8d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1311
-169
lines changed

Keystone/AUTHORS.TXT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Nguyen Anh Quynh <aquynh -at- gmail.com>

Keystone/COPYING

Lines changed: 339 additions & 0 deletions
Large diffs are not rendered by default.

Keystone/CREDITS.TXT

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
This file credits all the contributors of Keystone Engine (keystone-engine.org).
2+
3+
4+
Beta testers (in no particular order)
5+
=====================================
6+
Mike Guidry
7+
Eloi Vanderbeken
8+
Tim "diff" Strazzere
9+
Matt Graeber
10+
Edgar Barbosa
11+
Loi Anh Tuan
12+
Sascha Schirra
13+
hugsy
14+
Alexander Tereshkin
15+
Sébastien Duquette
16+
Sergi Alvarez, aka pancake (author of radare)
17+
Richo Healey
18+
Remco Verhoef (honeytrap.io)
19+
Duncan Ogilvie
20+
Bruce Dang
21+
Dan Caselden
22+
Jaime Peñalba
23+
Daniel Collin
24+
Vitaly Osipov
25+
Dang Hoang Vu
26+
Paul Rascagneres
27+
postmodern
28+
Fotis Loukos
29+
Peter Geissler
30+
Ingmar Steen (CED)
31+
Matteo Favaro
32+
Julien Legras
33+
Anton Kochkov
34+
Francisco Alonso
35+
rdmz
36+
practicalswift
37+
Jurriaan Bremer
38+
39+
40+
Contributors (in no particular order)
41+
=====================================
42+
Ingmar Steen: NodeJS binding.
43+
Sascha Schirra: Ruby binding.
44+
Remco Verhoef: Go & Rust bindings.
45+
Adrian Herrera: Haskell binding.
46+
practicalswift: Various cool bugs found by fuzzing.
47+
Aziem Chawdhary: OCaml binding.

Keystone/ChangeLog

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
This file details the changelog of Keystone.
2+
3+
---------------------------------
4+
Version 0.9.1: July 27th, 2016
5+
6+
[ Core & tool ]
7+
8+
- Fix a segfault in kstool (on missing assembly input).
9+
- kstool now allows to specify instruction address.
10+
- Build Mac libraries in universal format by default.
11+
- Add "lib32" option to cross-compile to 32-bit *nix (on 64-bit system).
12+
- Add "lib_only" option to only build libraries (skip kstool).
13+
- New bindings: Haskell & OCaml.
14+
15+
[ X86 ]
16+
17+
- Fix instructions: LJMP, LCALL, CDQE, SHR, SHL, SAR, SAL, LOOP, LOOPE, LOOPNE
18+
- Better handling a lot of tricky input caught by assert() before.
19+
- Better support for Nasm syntax.
20+
21+
22+
[ Arm ]
23+
24+
- Fix BLX instruction.
25+
26+
[ Python binding ]
27+
28+
- Better Python3 support.
29+
- Expose @stat_count in KsError class when ks_asm() returns with error.
30+
See sample code in bindings/python/sample_asm_count.py
31+
32+
[ Go binding ]
33+
34+
- Fix Go binding for 32-bit
35+
36+
----------------------------------
37+
Version 0.9: May 31th, 2016
38+
39+
- Initial public release.
40+

Keystone/EXCEPTIONS-CLIENT

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
FOSS License Exception
2+
3+
What is the FOSS License Exception?
4+
5+
This is based on the Oracle's Free and Open Source Software ("FOSS")
6+
License Exception.
7+
8+
The Free and Open Source Software ("FOSS") License Exception allows
9+
developers of FOSS applications to include Keystone Libraries with their
10+
FOSS applications. This exception permits distribution of Keystone libraries
11+
with a developer's FOSS applications licensed under the terms of another
12+
FOSS license listed below, even though such other FOSS license may be
13+
incompatible with the GPL.
14+
15+
The following terms and conditions describe the circumstances under which
16+
Oracle's FOSS License Exception applies.
17+
18+
FOSS License Exception Terms and Conditions
19+
20+
1. Definitions. "Derivative Work" means a derivative work, as defined
21+
under applicable copyright law, formed entirely from the Program and
22+
one or more FOSS Applications.
23+
24+
"FOSS Application" means a free and open source software application
25+
distributed subject to a license listed in the section below titled
26+
"FOSS License List."
27+
28+
"FOSS Notice" means a notice put in a copy of Keystone Libraries
29+
stating that such copy of Keystone Libraries may be distributed under
30+
FOSS License Exception.
31+
32+
"Independent Work" means portions of the Derivative Work that are not
33+
derived from the Program and can reasonably be considered independent
34+
and separate works.
35+
36+
"Program" means a copy of Keystone Libraries that contains
37+
a FOSS Notice.
38+
39+
2. A FOSS application developer ("you" or "your") may distribute a
40+
Derivative Work provided that you and the Derivative Work meet all of
41+
the following conditions:
42+
43+
a. You obey the GPL in all respects for the Program and all portions
44+
(including modifications) of the Program included in the
45+
Derivative Work (provided that this condition does not apply to
46+
Independent Works);
47+
b. The Derivative Work does not include any work licensed under the
48+
GPL other than the Program;
49+
c. You distribute Independent Works subject to a license listed in
50+
the section below titled "FOSS License List";
51+
d. You distribute Independent Works in object code or executable
52+
form with the complete corresponding machine-readable source code
53+
on the same medium and under the same FOSS license applying to
54+
the object code or executable forms;
55+
e. All works that are aggregated with the Program or the Derivative
56+
Work on a medium or volume of storage are not derivative works of
57+
the Program, Derivative Work or FOSS Application, and must
58+
reasonably be considered independent and separate works.
59+
60+
3. Keystone's authors reserves all rights not expressly granted in these
61+
terms and conditions. If all of the above conditions are not met, then
62+
this FOSS License Exception does not apply to you/your Derivative Work.
63+
64+
FOSS License List
65+
66+
+------------------------------------------------------------------------+
67+
|License Name |Version(s)/Copyright Date|
68+
|----------------------------------------------+-------------------------|
69+
|Academic Free License |2.0 |
70+
|----------------------------------------------+-------------------------|
71+
|Apache Software License |1.0/1.1/2.0 |
72+
|----------------------------------------------+-------------------------|
73+
|Apple Public Source License |2.0 |
74+
|----------------------------------------------+-------------------------|
75+
|Artistic license |From Perl 5.8.0 |
76+
|----------------------------------------------+-------------------------|
77+
|BSD license |"July 22 1999" |
78+
|----------------------------------------------+-------------------------|
79+
|Common Development and Distribution License |1.0 |
80+
|(CDDL) | |
81+
|----------------------------------------------+-------------------------|
82+
|Common Public License |1.0 |
83+
|----------------------------------------------+-------------------------|
84+
|Eclipse Public License |1.0 |
85+
|----------------------------------------------+-------------------------|
86+
|European Union Public License (EUPL)¹ |1.1 |
87+
|----------------------------------------------+-------------------------|
88+
|GNU Affero General Public License (AGPL) |3.0 |
89+
|----------------------------------------------+-------------------------|
90+
|GNU Library or "Lesser" General Public License|2.0/2.1/3.0 |
91+
|(LGPL) | |
92+
|----------------------------------------------+-------------------------|
93+
|GNU General Public License (GPL) |3.0 |
94+
|----------------------------------------------+-------------------------|
95+
|IBM Public License |1.0 |
96+
|----------------------------------------------+-------------------------|
97+
|Jabber Open Source License |1.0 |
98+
|----------------------------------------------+-------------------------|
99+
|MIT License (As listed in file |- |
100+
|MIT-License.txt) | |
101+
|----------------------------------------------+-------------------------|
102+
|Mozilla Public License (MPL) |1.0/1.1 |
103+
|----------------------------------------------+-------------------------|
104+
|Open Software License |2.0 |
105+
|----------------------------------------------+-------------------------|
106+
|OpenSSL license (with original SSLeay license)|"2003" ("1998") |
107+
|----------------------------------------------+-------------------------|
108+
|PHP License |3.0/3.01 |
109+
|----------------------------------------------+-------------------------|
110+
|Python license (CNRI Python License) |- |
111+
|----------------------------------------------+-------------------------|
112+
|Python Software Foundation License |2.1.1 |
113+
|----------------------------------------------+-------------------------|
114+
|Sleepycat License |"1999" |
115+
|----------------------------------------------+-------------------------|
116+
|University of Illinois/NCSA Open Source |- |
117+
|License | |
118+
|----------------------------------------------+-------------------------|
119+
|W3C License |"2001" |
120+
|----------------------------------------------+-------------------------|
121+
|X11 License |"2001" |
122+
|----------------------------------------------+-------------------------|
123+
|Zlib/libpng License |- |
124+
|----------------------------------------------+-------------------------|
125+
|Zope Public License |2.0 |
126+
+------------------------------------------------------------------------+
127+
128+
¹) When an Independent Work is licensed under a "Compatible License"
129+
pursuant to the EUPL, the Compatible License rather than the EUPL is the
130+
applicable license for purposes of these FOSS License Exception Terms and
131+
Conditions.
132+

Keystone/LICENSE-COM.TXT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The commercial license of Keystone allows you to use Keystone libraries & tools
2+
in commercial products.
3+
4+
- The Keystone commercial license is perpetual and royalty-free.
5+
- You have the right to distribute the binary and modifications of Keystone.
6+
- No source code redistribution is allowed in any way.
7+
8+
Contact [email protected] for further information.

Keystone/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Keystone Engine
2+
==============
3+
4+
[![Build Status](https://travis-ci.org/keystone-engine/keystone.svg?branch=master)](https://travis-ci.org/keystone-engine/keystone)
5+
[![Build Status](https://semaphoreci.com/api/v1/aquynh/keystone/branches/master/badge.svg)](https://semaphoreci.com/aquynh/keystone)
6+
[![Build status](https://ci.appveyor.com/api/projects/status/c27slvyrijiejvqs?svg=true)](https://ci.appveyor.com/project/aquynh/keystone)
7+
8+
Keystone is a lightweight multi-platform, multi-architecture assembler framework.
9+
It offers some unparalleled features:
10+
11+
- Multi-architecture, with support for Arm, Arm64 (AArch64/Armv8), Hexagon, Mips, PowerPC, Sparc, SystemZ & X86 (include 16/32/64bit).
12+
- Clean/simple/lightweight/intuitive architecture-neutral API.
13+
- Implemented in C/C++ languages, with bindings for Python, NodeJS, Ruby, Go, Rust, Haskell & OCaml available.
14+
- Native support for Windows & \*nix (with Mac OSX, Linux, *BSD & Solaris confirmed).
15+
- Thread-safe by design.
16+
- Open source - with a dual license.
17+
18+
Keystone is based on LLVM, but it goes much further with [a lot more to offer](/docs/beyond_llvm.md).
19+
20+
Further information is available at http://www.keystone-engine.org
21+
22+
23+
License
24+
-------
25+
26+
Keystone is available under a dual license:
27+
28+
- Version 2 of the GNU General Public License (GPLv2). (I.e. Without the "any later version" clause.).
29+
License information can be found in the [COPYING file](COPYING) and the [EXCEPTIONS-CLIENT file](EXCEPTIONS-CLIENT).
30+
31+
This combination allows almost all of open source projects to use Keystone without conflicts.
32+
33+
- For commercial usage in production environments, contact the authors of Keystone to buy a royalty-free license.
34+
35+
See [LICENSE-COM.TXT](LICENSE-COM.TXT) for more information.
36+
37+
38+
Compilation & Docs
39+
------------------
40+
41+
See [COMPILE.md](docs/COMPILE.md) file for how to compile and install Keystone.
42+
43+
More documentation is available in [docs/README.md](docs/README.md).
44+
45+
46+
Contact
47+
-------
48+
49+
[Contact us](http://www.keystone-engine.org/contact/) via mailing list, email or twitter for any questions.
50+
51+
52+
Contribute
53+
----------
54+
55+
Keystone is impossible without generous support from [our sponsors](/SPONSORS.TXT). We cannot thank them enough!
56+
57+
[CREDITS.TXT](CREDITS.TXT) records other important contributors of our project.
58+
59+
If you want to contribute, please pick up something from our [Github issues](https://github.com/keystone-engine/keystone/issues).
60+
61+
We also maintain a list of more challenged problems in a [TODO list](https://github.com/keystone-engine/keystone/wiki/TODO).
62+
63+

Keystone/RELEASE_NOTES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Version 0.9.1 works quite well for all architectures, but is known to not be able
2+
to deal with some malformed craft input. In such a case, Keystone usually exits
3+
with some error messages. Report if you experience this issue, so we can fix
4+
that in the next release.
5+
6+
See details of open bugs at https://github.com/keystone-engine/keystone/issues

Keystone/SPONSORS.TXT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This file lists all the sponsors of Keystone Engine.
2+
Thanks a lot for your great support!
3+
----------------------------------------------------
4+
5+
Mike Guidry
6+
Synacktiv Digital Security (www.synacktiv.com)
7+
Tim "diff" Strazzere
8+
Veris Group (www.verisgroup.com)

Keystone/include/keystone/arm.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* Keystone Assembler Engine */
2+
/* By Nguyen Anh Quynh, 2016 */
3+
4+
#ifndef KEYSTONE_ARM_H
5+
#define KEYSTONE_ARM_H
6+
7+
#ifdef __cplusplus
8+
extern "C" {
9+
#endif
10+
11+
#include "keystone.h"
12+
13+
typedef enum ks_err_asm_arm {
14+
KS_ERR_ASM_ARM_INVALIDOPERAND = KS_ERR_ASM_ARCH,
15+
KS_ERR_ASM_ARM_MISSINGFEATURE,
16+
KS_ERR_ASM_ARM_MNEMONICFAIL,
17+
} ks_err_asm_arm;
18+
19+
#ifdef __cplusplus
20+
}
21+
#endif
22+
23+
#endif

0 commit comments

Comments
 (0)