Skip to content

Conversation

@fjh658
Copy link
Contributor

@fjh658 fjh658 commented Oct 3, 2017

Update the installation documentation for the macOS ida

jianhua.fengjh and others added 30 commits August 1, 2017 21:45
…mpatible with ida pro 6, 7(beta);

for everyone is happy
…mpatible with ida pro 6, 7(beta);

for everyone is happy
…mpatible with ida pro 6, 7(beta);

for everyone is happy
…mpatible with ida pro 6, 7(beta);

for everyone is happy
* fixed inf no attribute "mf",   because ida pro beta 3 (170724)   renamed inf.is_mf()/set_mf() -> is_be()/set_be()

* fixed inf no attribute "mf",   because ida pro7 beta 3 (170724)   renamed inf.is_mf()/set_mf() -> is_be()/set_be()

* Add ida pro version check, about be(big endian)

* Since ida pro7 beta 3 (170724) renamed inf.mf -> is_be()/set_be(),  Compatible with ida pro 6, 7(beta);
for everyone is happy
fjh658 and others added 18 commits September 6, 2017 13:24
@aquynh
Copy link
Member

aquynh commented Oct 5, 2017

cool, but this update docs for Mac is just for IDA7 (64bit), right?

@fjh658
Copy link
Contributor Author

fjh658 commented Oct 5, 2017

@aquynh
IDA 7 also has x86, x64. I have been testing on both versions.
In fact, macOS version does not need to discuss the situation(x86, x64).
I will explain in detail the reasons.

@aquynh
Copy link
Member

aquynh commented Oct 5, 2017

because Mac IDA is universal binary?

i merged #31, so there is a bit conflict now. could you please fix that when you update with more info?

@fjh658
Copy link
Contributor Author

fjh658 commented Oct 5, 2017

The macOS python is universal binary.

  1. First, if you install several python version on macOS, IDA will use only this
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
  1. Python is universal binary on macOS
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python: Mach-O universal binary with 2 architectures: [x86_64: Mach-O 64-bit executable x86_64] [i386: Mach-O executable i386]
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python (for architecture x86_64):	Mach-O 64-bit executable x86_64
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python (for architecture i386):	Mach-O executable i386
  • In fact, pkg too.
https://www.python.org/ftp/python/2.7.14/python-2.7.14-macosx10.6.pkg
  1. IDA loads the key process of python
    • IDA 7.0 x86(similar 6.8,6.9,6.95)
      • python.pmc or python.pmc64 and lib-dynload/ida_32/ are i386
            file python.pmc
            python.pmc: Mach-O dynamically linked shared library i386
        
            file /Applications/IDA_Pro_7.0_x86/idaq.app/Contents/MacOS/./python/lib/python2.7/lib-dynload/ida_32/_ida_allins.so
            /Applications/IDA_Pro_7.0_x86/idaq.app/Contents/MacOS/./python/lib/python2.7/lib-dynload/ida_32/_ida_allins.so: Mach-O dynamically linked shared library i386
        
            [  0] 0x00000000 ./idaq
           	[  1] 0x0042e000 /usr/lib/dyld
           	[  2] 0x9391b000 /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
           	[234] 0x09fc7000 /Applications/IDA_Pro_7.0_x86/idaq.app/Contents/MacOS/./plugins/python.pmc
           	[235] 0x0c800000 /System/Library/Frameworks/Python.framework/Versions/2.7/Python
           	[236] 0x059fa000 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so
        	[237] 0x05ce6000 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/time.so
        	[238] 0x0c9f9000 /Applications/IDA_Pro_7.0_x86/idaq.app/Contents/MacOS/./python/lib/python2.7/lib-dynload/ida_32/_ida_idaapi.so
        	[239] 0x05cee000 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so
        	[240] 0x05cf8000 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_bisect.so
        	[241] 0x0ca9c000 /Applications/IDA_Pro_7.0_x86/idaq.app/Contents/MacOS/./python/lib/python2.7/lib-dynload/ida_32/_ida_kernwin.so
        	[242] 0x0cb96000 /Applications/IDA_Pro_7.0_x86/idaq.app/Contents/MacOS/./python/lib/python2.7/lib-dynload/ida_32/_ida_pro.so
        	[243] 0x09ce2000 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ctypes.so
        	[245] 0x0ccad000 /Applications/IDA_Pro_7.0_x86/idaq.app/Contents/MacOS/./python/lib/python2.7/lib-dynload/ida_32/_ida_diskio.so
        	[251] 0x09cfa000 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so
        	[252] 0x0cdd3000 /Applications/IDA_Pro_7.0_x86/idaq.app/Contents/MacOS/./python/lib/python2.7/lib-dynload/ida_32/_ida_allins.so
        	...
        	[320] 0x00000001177cc000 /usr/local/lib/python2.7/site-packages/keystone/libkeystone.dylib
        
    • IDA 7.0 x64
      • python.dylib or python64.dylib and lib-dynload/ida_32/ are x64
         	file /Applications/IDA_Pro_7.0/ida.app/Contents/MacOS/./plugins/python.dylib
         	/Applications/IDA_Pro_7.0/ida.app/Contents/MacOS/./plugins/python.dylib: Mach-O 64-bit dynamically linked shared library x86_64
        
         	file /Applications/IDA_Pro_7.0/ida.app/Contents/MacOS/./python/lib/python2.7/lib-dynload/ida_32/_ida_allins.so
         	/Applications/IDA_Pro_7.0/ida.app/Contents/MacOS/./python/lib/python2.7/lib-dynload/ida_32/_ida_allins.so: Mach-O 64-bit dynamically linked shared library x86_64
        
         	[  0] 0x0000000000000000 ./ida
         	[  1] 0x0000000100446000 /usr/lib/dyld
         	[236] 0x000000010e263000 /Applications/IDA_Pro_7.0/ida.app/Contents/MacOS/./plugins/python.dylib
         	...
         	[323] 0x00000001177cc000 /usr/local/lib/python2.7/site-packages/keystone/libkeystone.dylib
        
  2. Compiled libkeystone.dylib is universal binary
file /usr/local/lib/python2.7/site-packages/keystone/libkeystone.dylib
/usr/local/lib/python2.7/site-packages/keystone/libkeystone.dylib: Mach-O universal binary with 2 architectures: [i386: Mach-O dynamically linked shared library i386] [x86_64]
/usr/local/lib/python2.7/site-packages/keystone/libkeystone.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
/usr/local/lib/python2.7/site-packages/keystone/libkeystone.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64

Merged macOS keypatch docs

# Conflicts:
#	README.md
@fjh658
Copy link
Contributor Author

fjh658 commented Oct 5, 2017

@aquynh I have resolved the conflict.

README.md Outdated
### 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 <= IDA 7.0 (eg: 6.8, 6.9, 6.95, 7.0_x86), 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you change "before" to "<=", which indicates also v7.0 (due to =) here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDA7.0 contains (32bit, 64bit). @aquynh

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but that is confused. how about keeping that "before" part, but change the later part "IDA 7.0 is now a native 64-bit application ..." to "since IDA 7.0 supports both 32-bit & 64-bit ..." ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aquynh modified

@fjh658
Copy link
Contributor Author

fjh658 commented Oct 5, 2017

@aquynh modified, please review.

@aquynh aquynh merged commit de711c5 into keystone-engine:master Oct 6, 2017
@aquynh
Copy link
Member

aquynh commented Oct 6, 2017

merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants