keystone-engine / keypatch

Multi-architecture assembler for IDA Pro. Powered by Keystone Engine.
http://www.keystone-engine.org/keypatch
GNU General Public License v2.0
1.49k stars 355 forks source link

Update README.md for Linux x64 #8

Closed pedrib closed 8 years ago

pedrib commented 8 years ago

As discussed in issue #4

aquynh commented 8 years ago

merged, thanks!

aquynh commented 8 years ago

in the later part of this PR, we copy shared library of Keystone, like this:

$ sudo mkdir -p /opt/IDAPro6.4/python/lib/python2.7/dist-packages/keystone/
$ sudo cp build/llvm/lib/libkeystone.so.* /opt/IDAPro6.4/python/lib/python2.7/dist-packages/keystone/

but i think this can be more simple by just copying to /opt/IDAPro6.4/python/keystone/, like:

$ sudo cp build/llvm/lib/libkeystone.so.* /opt/IDAPro6.4/python/keystone/

can you confirm this works?

pedrib commented 8 years ago

@aquynh you're right, it works like that!

pedrib commented 8 years ago

Sent updated PR #18

aquynh commented 8 years ago

another question: do we really want this line? why distutils is needed here?

 $ sudo cp -r /usr/lib/python2.7/distutils /opt/IDAPro6.8/python/
pedrib commented 8 years ago

I don't know, but without that it won't work... I guess IDA's python doesn't have that package and it's needed?

This is the output: Loading processor module /home/user/stuff/ida/6.95/procs/pc.ilx for metapc...OK keypatch.py: No module named distutils.sysconfig Traceback (most recent call last): File "/home/user/stuff/ida/6.95/python/ida_idaapi.py", line 509, in IDAPython_ExecScript execfile(script, g) File "/home/user/stuff/ida/6.95/plugins/keypatch.py", line 23, in from keystone import * File "/home/user/stuff/ida/6.95/python/keystone/init.py", line 4, in from .keystone import Ks, ks_version, ks_arch_supported, version_bind, debug, KsError, version File "/home/user/stuff/ida/6.95/python/keystone/keystone.py", line 15, in import distutils.sysconfig, sys ImportError: No module named distutils.sysconfig

Loading type libraries... Autoanalysis subsystem has been initialized. loadImportTable: storage::loadExternSegData() failed RpcThreadWorker::RpcThreadWorker(QT::QObject) Database for file 'server.exe' has been loaded. Compiling file '/home/user/stuff/ida/6.95/idc/ida.idc'... Executing function 'main'... keypatch.py: cannot import name arm_const Traceback (most recent call last): File "/home/user/stuff/ida/6.95/python/ida_idaapi.py", line 509, in IDAPython_ExecScript execfile(script, g) File "/home/user/stuff/ida/6.95/plugins/keypatch.py", line 23, in from keystone import File "/home/user/stuff/ida/6.95/python/keystone/init.py", line 2, in from . import arm_const, arm64_const, mips_const, sparc_const, hexagon_const, systemz_const, ppc_const, x86_const ImportError: cannot import name arm_const

aquynh commented 8 years ago

could you please do me a favour: if you comment out this line in your keystone.py at https://github.com/keystone-engine/keystone/blob/master/bindings/python/keystone/keystone.py#L15, then remove your /opt/IDAPro6.8/python/distutils/, does Keypatch still load & work for you?

pedrib commented 8 years ago

@aquynh it works! I've removed the directory, commented the line and all seems to work fine.

aquynh commented 8 years ago

Thanks for your confirmation. I will make some changes in the next version of Keystone, so distutils is no longer required for Keypatch.

aquynh commented 8 years ago

next version of Keystone will have this https://github.com/keystone-engine/keystone/commit/f7f71f6318812aac64b8c6210537b179c0218232, so you dont need to copy distutils just for Keypatch.

pedrib commented 8 years ago

Thanks, I've changed that on my end while the new version doesn't come out.