ghidra/GhidraDocs/GhidraClass/BSim/BSimTutorial_Creating_Database_From_GUI.md
2023-12-05 16:50:13 +00:00

1.3 KiB

Creating and Populating a BSim Database from the Ghidra GUI

This section explains how to create and populate an H2-backed BSim database from the Ghidra GUI.

Creating the Database

To create a BSim database, first create a directory on your file system to contain the database.

Next, perform the following steps from the Ghidra Code Browser:

  1. Run the Ghidra script CreateH2BSimDatabaseScript.java.
  2. In the resulting dialog:
    1. Enter "example" in the Database Name field.
    2. Select the new directory in the Database Directory field.
    3. Don't change any of the other fields.
  3. Click OK.

Populating the Database

We now populate the database with an executable which is contained in the Ghidra distribution.

  1. Import and analyze the executable <ghidra_install_dir>/GPL/DemanglerGnu/os/linux_x86_64/demangler_gnu_v2_41 using the default analysis options.
  2. Run the Ghidra script AddProgramToH2BSimDatabaseScript.java on this program.
    • The script will ask you to select an H2 database file. Use example.mv.db in the database directory.
  3. In general you can run this script on other programs to add their signatures to this database, but that's not necessary for the exercises in the next section.

Next Section: Basic BSim Queries