Loading multiple/all entries of a ".a" file? (Lumina signature generation)

For generating Lumina signatures of a Mono runtime library which is often statically compiled into Xamarin/MAUI apps I extracted an .a file which contains all relevant functions.

The main problem is that when I open that .a file in IDA 9.1 it forces me to select one of ~200 compiled objects. So I would have to open that .a file more than 200 times each time selecting a different contained compiled object. This makes Lumina signature generation a pretty nasty job.

Is there some way to load all compiled object files of an .a file into one IDA database or alternatively automate the Lumina signature generation?

Currently you have these options to push Lumina metadata automatically:

  • Create a script similar to this:
class MyUiHook(idaapi.UI_Hooks):
    def __init__(self):
        idaapi.UI_Hooks.__init__(self)

    def ready_to_run(self):
        idaapi.process_ui_action("LuminaPushAllMds", 0)
        idaapi.qexit(0)

idaapi.auto_wait()
uihook = MyUiHook()
uihook.hook()
  • launch IDA in batch mode with: idat -A -Spush2lum.py input_file

Alternatively, the decompiler can push functions to Lumina:
idat -A -Ohexrays:-lumina:output.c:ALL input_file_or_idb
see Batch operation | Hex-Rays Docs for more info.

To process each object, you can either extract them beforehand using ar (lib on Windows), or use the the nested -T switch, e.g.
ida -TAR:/path/to/file.o library.a

More info: Command line switches | Hex-Rays Docs and Igor’s tip of the week #07: IDA command-line options cheatsheet

Yet another option: link the archive into an executable or DLL while forcing inclusion of all objects, then open it in IDA. With MS’ linker , it would looks similar to:
link.exe /DLL /OUT:mylib.dll /NOENTRY /FORCE /OPT:NOICF /OPT:NOREF /WHOLEARHIVE mylib.lib
The same is likely achievable with ld or lld, but I don’t have the specifics.