Skip to content

Importing and sharing types with IDA

Alan Tse edited this page Oct 25, 2023 · 1 revision

Using a .pdb

The simplest way to import CommonLibSF types into IDA is to build CommonLibSF and import the .pdb into IDA.

Importing headers

CommonLibSF headers can be imported into IDA to populate the local types. To do this, set up IDA in the following way. Note that this feature depends on Clang support. You only need to run the CMake configuration, not a full build. In the IDA disassembler view, go to Options->Compiler. You should set the following options to fully parse the C++ headers:

  • Set Source parser to clang.
  • Set Includes to C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\<version>\include;<path-to-CommonLibSF>\build\build-debug-clang-cl-ninja-vcpkg\vcpkg_installed\x64-windows-static-md\include;<path-to-CommonLibSF>\include. This is three include directories separated by a semicolon. The first is the full path your MSVC C++ standard library headers (the exact path varies depending on the specific Visual Studio version, and whether you have installed Community or Professional edition). The second path is to the includes prepared by vcpkg for your CommonLibSF project directory, and will depend on the path where you cloned CommonLibSF. The third path is the path to the CommonLibSF include files, which also uses the same base directory to which you cloned CommonLibSF.
  • Set Arguments to -x c++ -std=c++20 -fms-compatibility -D_CRT_USE_BUILTIN_OFFSETOF.

Now go to File->Load File->Parse C header file.... Select the include\RE\Starfield.h file from inside your CommonLibSF directory. IDA will parse the files and all the types will be added to your local types.

Lumina

Lumina allows sharing of definitions between IDA

IDA < 8.1 ida.cfg

// Lumina related parameters
LUMINA_HOST = "18.144.142.42";
LUMINA_PORT = 1234
LUMINA_TLS = NO
//LUMINA_MIN_FUNC_SIZE = 32