Skip to content
Merged
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
9f4c7fd
fixed inf no attribute "mf", because ida pro beta 3 (170724) rena…
Aug 1, 2017
024e984
fixed inf no attribute "mf", because ida pro beta 3 (170724) rena…
Aug 1, 2017
6efffeb
fixed inf no attribute "mf", because ida pro beta 3 (170724) rena…
Aug 1, 2017
1666ee7
fixed inf no attribute "mf", because ida pro beta 3 (170724) rena…
fjh658 Aug 1, 2017
a2efbec
fixed inf no attribute "mf", because ida pro7 beta 3 (170724) ren…
Aug 1, 2017
7ec9087
fixed inf no attribute "mf", because ida pro7 beta 3 (170724) ren…
Aug 1, 2017
cf967f4
fixed inf no attribute "mf", because ida pro7 beta 3 (170724) ren…
Aug 1, 2017
7f074a8
fixed inf no attribute "mf", because ida pro7 beta 3 (170724) ren…
fjh658 Aug 1, 2017
e2b3cf9
Merge branch 'master' of https://github.com/fjh658/keypatch
Aug 1, 2017
292c3bb
Merge branch 'master' of https://github.com/fjh658/keypatch
Aug 1, 2017
4893f18
Merge branch 'master' of https://github.com/fjh658/keypatch
Aug 1, 2017
2c95168
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Aug 1, 2017
5f4d382
Add ida pro version check, about be(big endian)
Aug 1, 2017
72f70f9
Add ida pro version check, about be(big endian)
Aug 1, 2017
0802608
Add ida pro version check, about be(big endian)
Aug 1, 2017
055f7df
Add ida pro version check, about be(big endian)
fjh658 Aug 1, 2017
53e0eba
Since ida pro7 beta 3 (170724) renamed inf.mf -> is_be()/set_be(), C…
Aug 2, 2017
bf837f7
Since ida pro7 beta 3 (170724) renamed inf.mf -> is_be()/set_be(), C…
Aug 2, 2017
e9085b8
Since ida pro7 beta 3 (170724) renamed inf.mf -> is_be()/set_be(), C…
Aug 2, 2017
81b7e08
Since ida pro7 beta 3 (170724) renamed inf.mf -> is_be()/set_be(), C…
fjh658 Aug 2, 2017
b4c04f2
Fixed inf has no attribute "mf" (#25)
fjh658 Aug 2, 2017
d4a14f0
Minor bug fixes and code cleanup (#26)
Musashii-kun Aug 29, 2017
94408f4
Merge remote-tracking branch 'upstream/master'
Sep 4, 2017
5c1c387
Merge remote-tracking branch 'upstream/master'
Sep 4, 2017
0887f36
Merge remote-tracking branch 'upstream/master'
Sep 4, 2017
4d68a39
Merge remote-tracking branch 'upstream/master'
Sep 4, 2017
741df42
Merge remote-tracking branch 'upstream/master'
Sep 4, 2017
406a1ea
Merge remote-tracking branch 'upstream/master'
fjh658 Sep 4, 2017
0733a65
Merge remote-tracking branch 'upstream/master'
Sep 4, 2017
ccc6a00
Merge remote-tracking branch 'upstream/master'
fjh658 Sep 4, 2017
7cb38a9
1. fixed ida pro 7 beta6 x86 crash. idainfo object has no attribute …
Sep 4, 2017
2eaf521
1. fixed ida pro 7 beta6 x86 crash. idainfo object has no attribute …
Sep 4, 2017
04019c0
1. fixed ida pro 7 beta6 x86 crash. idainfo object has no attribute …
Sep 4, 2017
66beeac
1. fixed ida pro 7 beta6 x86 crash. idainfo object has no attribute …
Sep 4, 2017
8cbd7bb
1. fixed ida pro 7 beta6 x86 crash. idainfo object has no attribute …
Sep 4, 2017
5c6f1d7
1. fixed ida pro 7 beta6 x86 crash. idainfo object has no attribute …
fjh658 Sep 4, 2017
ced9873
1. fixed ida pro 7 beta6 x86 crash. idainfo object has no attribute …
Sep 4, 2017
d3ac29b
1. fixed ida pro 7 beta6 x86 crash. idainfo object has no attribute …
fjh658 Sep 4, 2017
e2ec449
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
ca540cb
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
85e8e38
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
7742a46
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
e79cc2a
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
75c0dd1
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
d755b11
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
ae6bec3
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
e4d4d26
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
51fa122
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
1d85be2
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
54377cb
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
fd98b02
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
a68d5e4
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
6a37685
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
7f955eb
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
54635fa
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
f5a8b7c
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
424e612
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
52e384e
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
00340bb
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
928303e
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
d48c3c6
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
d29756a
Merge branch 'master' of https://github.com/fjh658/keypatch
Sep 6, 2017
bb5d3fc
Merge branch 'master' of https://github.com/fjh658/keypatch
Sep 6, 2017
2a291df
Merge branch 'master' of https://github.com/fjh658/keypatch
fjh658 Sep 6, 2017
8c2a899
Update the installation documentation for the macOS ida
fjh658 Oct 3, 2017
6e8d65a
Merge branch 'master' of https://github.com/keystone-engine/keypatch
fjh658 Oct 3, 2017
23ef0bc
Merge branch 'master' of https://github.com/keystone-engine/keypatch
fjh658 Oct 5, 2017
1930b52
Improve the accuracy of the documentation
fjh658 Oct 5, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 153 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ See [this quick tutorial](TUTORIAL.md) for how to use Keypatch, and [this slides
Keypatch is confirmed to work on IDA Pro version 6.4, 6.5, 6.6, 6.8, 6.9, 6.95, 7.0 but should work flawlessly on older versions.
If you find any issues, please [report](http://keystone-engine.org/contact).


--------------------

### 1. Why Keypatch?
Expand All @@ -34,7 +33,6 @@ Keypatch was developed to solve this problem. Thanks to the power of [Keystone](

Keypatch can be the missing piece in your toolset of reverse engineering.


--------------

### 2. Install
Expand Down Expand Up @@ -103,16 +101,15 @@ Email keystone.engine@gmail.com for any questions.

For future update of Keypatch, follow our Twitter [@keystone_engine](https://twitter.com/keystone_engine) for announcement.


----

### Appendix. Install Keystone for IDA Pro

We all know that before IDA 7.0, IDA Pro's Python is 32-bit itself, so it can only loads 32-bit libraries. For this reason, we have to build & install Keystone 32-bit. However, IDA 7.0 is now a native 64-bit application, which means we also need to install a correct version of Keystone. This section details the steps towards that goal.
We all know that before IDA 7.0, IDA Pro's Python is 32-bit itself, so it can only loads 32-bit libraries. For this reason, we have to build & install Keystone 32-bit. However, since IDA 7.0 supports both 32-bit & 64-bit, which means we also need to install a correct version of Keystone. This section details the steps towards that goal.

#### A1. Windows

##### For 32-bit users ( IDA < 7.0 )
##### For 32-bit users ( IDA <= 7.0 )

It is easiest to just download & install Python 2.7 module for Windows from [http://www.keystone-engine.org/download](http://www.keystone-engine.org/download). Be sure to get the 32-bit version, regardless of your Windows edition.

Expand All @@ -125,28 +122,173 @@ If you have installed a Python 2.7 (64-bit) from the install package of IDA, the
We have not yet tested to compile it from source, but you are welcomed to use a MSVC 64-bit and following the simillar steps in the previous paragraph. It should work, but if not, just send a pull request.

#### A2. MacOS
The macOS python is universal binary, so does not need to discuss the situation(x86, x64).

##### For 32-bit users ( IDA < 7.0 )
Compiling dynamic library(libkeystone.dylib) depends on cmake and compiler(llvm clang, gcc).

Quick start steps:

Install the core & Python module of Keystone with the following command:

```
- install brew

```shell
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```

- install cmake

```shell
brew install cmake
```

- install keystone-engine

```shell
sudo pip install keystone-engine
```

- Check Method ( Whether the installation is successful? ):

- You enter this in the console of ida

Normal result:

```python
Python>print keystone
<module 'keystone.keystone' from '/Applications/IDA Pro 7.0/ida64.app/Contents/MacOS/python/keystone/keystone.py'>

Python>print keystone.arm_const
<module 'keystone.arm_const' from '/Applications/IDA Pro 7.0/ida64.app/Contents/MacOS/python/keystone/arm_const.py'>
```
- enter this in the python standard console

Normal result:

```python
Python 2.7.13 (default, Jul 18 2017, 09:17:00)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import keystone
>>> print keystone
<module 'keystone' from '/usr/local/lib/python2.7/site-packages/keystone/__init__.pyc'>
>>> print keystone.arm_const
<module 'keystone.arm_const' from '/usr/local/lib/python2.7/site-packages/keystone/arm_const.pyc'>
>>>
```


If there are cmake and compiler, then install only the core & Python module of Keystone with the following command:

```shell
$ sudo pip install keystone-engine
```

FAQ:

1. "ImportError: No module named keystone

In case IDA still complains "ImportError: No module named keystone" when Keypatch is loading, then do the following step to copy Keystone Python binding to IDA directory. (replace `6.8` with your actual IDA version)

```
```shell
$ sudo cp -r /Library/Python/2.7/site-packages/keystone /Applications/IDA\ Pro\ 6.8/idaq.app/Contents/MacOS/python
```

##### For 64-bit users (IDA >= 7.0 )
In addition, executable file rename "idaq" to "ida" in ida pro 7, so it is "ida.app/ida64.app".

Still waiting for brave warriors.
```shell
cp -r /Library/Python/2.7/site-packages/keystone /Applications/IDA\ Pro\ 7.0/ida.app/Contents/MacOS/python
```

2. "ImportError: ERROR: fail to load the dynamic library"

![image](https://user-images.githubusercontent.com/5550316/30997551-3bde6be0-a48e-11e7-9813-3b196548f9a7.png)


- If the result "sudo pip install keystone-engine" of no error, but did not generate dynamic library, then try to manually do.

- Download keystone-engine, and extract this

```shell
https://pypi.python.org/packages/9a/fc/ed0d3f46921bfaa612d9e8ce8313f99f4149ecf6635659510220c994cb72/keystone-engine-0.9.1-3.tar.gz
```

- The site, Note please use latest version

```
https://pypi.python.org/pypi/keystone-engine
```

- Manual compile and install keystone-engine, see this log completely. Compiled libkeystone.dylib is universal binary.

```shell
cd keystone-engine-0.9.1-3
sudo python setup.py install
```

- cmake is only a build tool, and depends on your compiler

- Normal log:

```shell
> sudo python setup.py install

running install
running build
running build_py
creating build
creating build/lib
creating build/lib/keystone
copying keystone/__init__.py -> build/lib/keystone
...
copying keystone/x86_const.py -> build/lib/keystone
running build_clib
running custom_build_clib
building 'keystone' library
-- The C compiler identification is AppleClang 9.0.0.9000037
-- The CXX compiler identification is AppleClang 9.0.0.9000037

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works

-- Constructing LLVMBuild project information
-- Targeting AArch64
-- Targeting ARM
...
-- Targeting X86
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Configuring done
CMake Warning (dev):
Policy CMP0068 is not set: RPATH settings on macOS do not affect
install_name. Run "cmake --help-policy CMP0068" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.

For compatibility with older versions of CMake, the install_name fields for
the following targets are still affected by RPATH settings:

keystone

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: ~/Downloads/keystone-engine-0.9.1-3/src/build
Scanning dependencies of target keystone
[ 0%] Building CXX object llvm/keystone/CMakeFiles/keystone.dir/__/lib/MC/ConstantPools.cpp.o
...
[100%] Built target keystone
running install_lib
running install_data
copying src/build/llvm/lib/libkeystone.dylib -> /usr/local/lib/python2.7/site-packages/keystone
running install_egg_info
Removing /usr/local/lib/python2.7/site-packages/keystone_engine-0.9.1_3-py2.7.egg-info
Writing /usr/local/lib/python2.7/site-packages/keystone_engine-0.9.1_3-py2.7.egg-info
```


#### A3. Linux

##### For 32-bit users ( IDA < 7.0 )
##### For 32-bit users ( IDA <= 7.0 )

First of all, be sure that your machine already have Cmake installed. On Ubuntu, you can install Cmake with:

Expand Down