I use IDA Pro in a virtual machine and I use a little trick to update plugins without messing with the guest machine:
- I mount a directory inside the virtual machine as read-only from the host. I call this
Z:\readonly - In the guest, I set the environment variable
%PYTHONPATH%to include hisZ:\readonlydirectory. - In the plugin directory (found by
ida_diskio.get_ida_subdirs("plugins")[0]) I put a placeholder file that has the following content:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' Put this file in the IDA/plugins folder and the plugin file somewhere that IDA can reach it. '''
import os
exec(f"from {os.path.basename(__file__).replace('_ida.py','')} import *")
- From the host, I place the real file in the readonly directory with the same name except I removed the “_ida” part
- This way, I can update the files that are in the readonly directory from the host machine and still revert the guest machine.
Hope this trick helps someone else! Happy reversing!