4

I overcame recent issues with a redefinition and finished my Plugin.

In short this plugin uses Hex-Rays Decompiler to decompile a given file, analyzes properties of the pseudocode and then appends the results to a .csv

Now I tried to use this in batch mode, but was stumped as the following happened:

Cmd input to call IDA:

idaw -A -c -Srecompile.idc input_file

The recompile.idc file:

#include <idc.idc>
static main() {
Wait();
Message("Hello world from IDC!\n");
RunPlugin("REcompile vs Hexrays",0); 
//Exit(0);
}

I obviously need to Wait() for Auto-Analysis. Exit() is commented since it's for use when this is all fixed.

Now i do get the following output on execution:

The initial autoanalysis has been finished.
Hello world from IDC!

LoadLibrary(C:\Program Files (x86)\IDA\plugins\REcompile vs Hexrays.plw) error: Das angegebene Modul wurde nicht gefunden.
C:\Program Files (x86)\IDA\plugins\REcompile vs Hexrays.plw: can't load file
Hex-Rays Decompiler plugin has been loaded (v1.6.0.111005)
Hex-rays version 1.6.0.111005 has been detected, REcompile vs Hexrays ready to use

As you can see the script is executed before the plugins are loaded. I assume this is the reason why I get the LoadLibrary Error.

If you have any other input or experience with plugin batch execution i'd be happy to hear from you.

Greetings, Viktor

1 Answer 1

4

Have you tried manually loading the Hex-Rays plugin before loading your plugin?

For example:

#include <idc.idc>
static main() {
    Wait();
    Message("Hello world from IDC!\n");
    RunPlugin("hexrays",0);
    RunPlugin("REcompile vs Hexrays",0); 
    //Exit(0);
}
2
  • Thank you so much, that solved it. I actually made a double mistake of using the wanted_name(), instead of the .plw-file name. Thanks again!
    – Viktor K
    Commented Jul 24, 2014 at 16:05
  • Glad it worked! Yeah, the documentation isn't very clear regarding the first argument for RunPlugin(). Commented Jul 24, 2014 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.