Permalink
Browse files

Added easy install method

  • Loading branch information...
NeatMonster committed Mar 29, 2018
1 parent e4c0d4b commit 832b68f96b9f777a39a2e28affd5d09b3d5088ae
Showing with 69 additions and 3 deletions.
  1. +1 −2 .gitignore
  2. +5 −1 README.md
  3. +63 −0 easy_install.py
@@ -1,8 +1,7 @@
# Custom directories
.idea/
logs/
files/
venv/
logs/

# Byte-compiled / optimized / DLL files
__pycache__/
@@ -27,6 +27,10 @@ Install the IDAConnect client into the IDA plugins folder.
- On Windows, the folder is at `C:\Program Files\IDA 7.0\plugins`
- On macOS, the folder is at `/Applications/IDA\ Pro\ 7.0/idaq.app/Contents/MacOS/plugins`
- On Linux, the folder may be at `/opt/IDA/plugins/`
- Alternatively, you can use the "easy install" method by copying the following line into the console of an IDA Pro instance running with administrator privilege (to be able to write the program files directory):
```
import urllib2; exec urllib2.urlopen('https://raw.githubusercontent.com/IDAConnect/IDAConnect/master/easy_install.py').read()
```

**Warning:** The plugin is only compatible with IDA Pro 7.0 on Windows, macOS, and Linux.

@@ -43,7 +47,7 @@ First use the widget in the status bar to add the server of your choice in the *
- File --> Save to server
```

# Acknowledgements
# Thanks

This project is inspired by [Sol[IDA]rity](https://solidarity.re/). It started after contacting its authors and asking if it was ever going to be released to the public. [Lighthouse](https://github.com/gaasedelen/lighthouse) source code was also carefully studied to understand how to write better IDA plugins.

@@ -0,0 +1,63 @@
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import shutil
import zipfile
import urllib2

import idaapi

MASTER_LOCATION = 'https://github.com/IDAConnect/IDAConnect/archive/master.zip'
FILES_TO_MOVE = ['idaconnect_plugin.py', 'idaconnect/']

print('[*] Installing IDAConnect...')
pluginsDir = os.path.join(idaapi.idadir(None), 'plugins')
archivePath = os.path.join(pluginsDir, 'master.zip')
masterDir = os.path.join(pluginsDir, 'IDAConnect-master')

print('[*] Downloading master.zip archive...')
if os.path.exists(archivePath):
os.remove(archivePath)
with open(archivePath, 'wb') as f:
f.write(urllib2.urlopen(MASTER_LOCATION).read())

print('[*] Unzipping master.zip archive...')
if os.path.exists(masterDir):
shutil.rmtree(masterDir)
with zipfile.ZipFile(archivePath, 'r') as z:
for zf in z.namelist():
if zf.startswith('IDAConnect-master/'):
z.extract(zf, pluginsDir)

print('[*] Moving the IDAConnect files...')
for filename in FILES_TO_MOVE:
masterPath = os.path.join(masterDir, filename)
pluginPath = os.path.join(pluginsDir, filename)
if os.path.exists(pluginPath):
if os.path.isdir(pluginPath):
shutil.rmtree(pluginPath)
if os.path.isfile(pluginPath):
os.remove(pluginPath)
shutil.move(masterPath, pluginPath)

print('[*] Removing master.zip archive...')
if os.path.exists(archivePath):
os.remove(archivePath)
if os.path.exists(masterDir):
shutil.rmtree(masterDir)

print('[*] Loading IDAConnect into IDA Pro...')
pluginPath = os.path.join(pluginsDir, 'idaconnect_plugin.py')
idaapi.load_plugin(pluginPath)

print('[*] IDAConnect installed successfully!')

0 comments on commit 832b68f

Please sign in to comment.