For some reason IDA executes FreeLibrary() to the plugin immediately after getting its PLUGIN structure's address, so later invocations of the plugin lead to calls to nowhere (that was supposed to be python3.dll). Simply patching the location of the FreeLibrary() call fixes the issue. The location is easy to find: go by cross-references to a place where the call to FreeLibrary is followed by a reference to the string "%s: incompatible plugin version..." and NOP it away.
ida.dll
+001c1d20 15 9b e6 e3 ff 48 8b 4d 88 48 85 c9 74 0e 90 90 |.....H.M.H..t...|
+001c1d30 90 90 90 90 48 c7 45 88 00 00 00 00 48 8b 4c 24 |....H.E.....H.L$|
ida64.dll
+001cb050 15 83 53 e3 ff 48 8b 4d 88 48 85 c9 74 0e 90 90 |..S..H.M.H..t...|
+001cb060 90 90 90 90 48 c7 45 88 00 00 00 00 48 8b 4c 24 |....H.E.....H.L$|
ida.dll
+001cb6f0 15 03 4d e3 ff 48 8b 4d 88 48 85 c9 74 0e 90 90 |..M..H.M.H..t...|
+001cb700 90 90 90 90 48 c7 45 88 00 00 00 00 48 8b 4c 24 |....H.E.....H.L$|
ida64.dll
+001d53f0 15 0b b0 e2 ff 48 8b 4d 88 48 85 c9 74 0e 90 90 |.....H.M.H..t...|
+001d5400 90 90 90 90 48 c7 45 88 00 00 00 00 48 8b 4c 24 |....H.E.....H.L$|
ida.dll
Patching not required.
-EAA2A 00 48 85 c9 74 0a ff 15 ea 0d
+EAA2A 00 48 85 c9 eb 0a ff 15 ea 0d
ida64.dll
-EEC80 ff 15 9a 5b 26 00 48 89 7d 00
+EEC80 90 90 90 90 90 90 90 90 90 90
First - you should disable idapython:
Rename
~/${IDA_WINE_PREFIX}/drive_c/Program Files/IDA 7.7/plugins/idapython3_64.dlltoidapython3_64.dll.disabledThe IDA should start after this rename, but without IdaPython support.
You can do bugfix patch without it using pure IDA features.
Here is how you can:
ida.dllorida64.dll) to another location or name (IDA may lock its files and prevent you from patching itself on-the-fly).ida.dllorida64.dll) with default settings, reject debug info download."incompatible plugin version"(with quotes).Xto go to xrefs to this string.OK.F5.Okbutton (or set it as you want, but make sure you setting sane rules - the defaults are fine).You will see something like this:
The
FreeLibrarycall andhLibModuleassignment are bogus, and should be patched out.FreeLibrary(hLibModule);line, then click onIDA View Atab and right-click anywhere in disassembly.Synchronize with -> Pseudocode A.You should see something like this:
The
jz short loc_1000EB63Ashould be patched tojmp short loc_1000EB63A10. Click on
jz short loc_1000EB63Aline and selectEdit->Patch program->Assemble...from window menu.11. You should now see a dialogue window with an
Instructionfield, andjz short loc_1000EB63Ain this field.12. Change it to
jmp short loc_1000EB63Aand pressOk, then pressCancel.13. Return to
Pseudocode Atab and make sure that bogus code block is now gone. Re-decompile it usingF5again if not.14. When DLL was fixed - save it using
Edit->Patch program->Apply patches to input file...from window menu. SelectCreate backupand pressOK.15. Close IDA saving the database - it may be a reference for yourself after a year or two when a new version will become available.
16. Save backup of original DLL and replace it with your fixed version.
17. Do this again for other DLL, both
ida.dllandida64.dllare buggy and should be patched.18. Congratulations, you have patched your IDA to fix this bug!
Now you should enable idapython - rename
~/${IDA_WINE_PREFIX}/drive_c/Program Files/IDA 7.7/plugins/idapython3_64.dll.disabledback toidapython3_64.dll- IDA should not crash.For Python - just install Python for Windows to the same Wine prefix.
You may also need to run
~/${IDA_WINE_PREFIX}/drive_c/Program Files/IDA 7.7/idapyswitch.exeand select your Python.Also, for Wine - go to
Options->Colors, select dark color theme and clickOK.This will fix black interface parts (which became an issue with 7.7SP1 on Wine).