Ghidra

Ghidra · Actions GPT

Ghidraaas

## Ghidraaas is a simple web server that exposes Ghidra analysis through REST APIs. The project includes three Ghidra plugins to analyze a sample, get the list of functions and to decompile a function. Ghidraaas is also the backend of GhIDA, the IDA plugin that integrates the Ghidra decompiler in IDA Pro.

  • POST /ghidra/api/get_functions_list_detailedGet Functions List Detailed From File Url
  • POST /ghidra/api/get_functions_listGet Functions List From File Url
  • POST /ghidra/api/get_syscall_xrefsGet Syscall Xrefs From File Url
  • POST /ghidra/api/get_binexport_fileGet Binexport File From File Url
  • POST /ghidra/api/get_decompiled_functionGet Decompiled Function From File Url
  • POST /ghidra/api/get_elf_with_dwarf_fileGet Elf With Dwarf File From File Url
  • POST /ghidra/api/ida_plugin_checkin/Ida Plugin Checkin

    Submit the .bytes file to ghidraaas for future decompilation

  • POST /ghidra/api/ida_plugin_get_decompiled_function/Ida Plugin Get Decompiled Function

    Run the script to decompile a function starting from the xml project exported from IDA.

  • POST /ghidra/api/ida_plugin_checkout/Ida Plugin Checkout

    Remove file(s) associated with the sample requesting checkout

Schéma original API
{
  "openapi": "3.1.0",
  "info": {
    "title": "Ghidraaas",
    "description": "\n## Ghidraaas is a simple web server that exposes Ghidra analysis through REST APIs. \nThe project includes three Ghidra plugins to analyze a sample, get the list of functions and to decompile a function.\n\nGhidraaas is also the backend of GhIDA, the IDA plugin that integrates the Ghidra decompiler in IDA Pro.\n",
    "version": "0.0.1"
  },
  "servers": [
    {
      "url": "https://chatgpt.ghidra.ai.moda/",
      "description": "Server for ChatGPT"
    }
  ],
  "paths": {
    "/ghidra/api/get_functions_list_detailed": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Functions List Detailed From File Url",
        "operationId": "get_functions_list_detailed_from_file_url_ghidra_api_get_functions_list_detailed_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/get_functions_list": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Functions List From File Url",
        "operationId": "get_functions_list_from_file_url_ghidra_api_get_functions_list_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/get_syscall_xrefs": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Syscall Xrefs From File Url",
        "operationId": "get_syscall_xrefs_from_file_url_ghidra_api_get_syscall_xrefs_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/get_binexport_file": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Binexport File From File Url",
        "operationId": "get_binexport_file_from_file_url_ghidra_api_get_binexport_file_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/get_decompiled_function": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Decompiled Function From File Url",
        "operationId": "get_decompiled_function_from_file_url_ghidra_api_get_decompiled_function_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/decompile_sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/get_elf_with_dwarf_file": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Elf With Dwarf File From File Url",
        "operationId": "get_elf_with_dwarf_file_from_file_url_ghidra_api_get_elf_with_dwarf_file_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/ida_plugin_checkin/": {
      "post": {
        "tags": [
          "GhIDA specific endpoints"
        ],
        "summary": "Ida Plugin Checkin",
        "description": "Submit the .bytes file to ghidraaas for future decompilation",
        "operationId": "ida_plugin_checkin_ghidra_api_ida_plugin_checkin__post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "filename": {
                    "type": "string",
                    "title": "Filename"
                  },
                  "bytesfile": {
                    "type": "string",
                    "format": "binary",
                    "title": "Bytesfile"
                  }
                },
                "type": "object",
                "required": [
                  "filename",
                  "bytesfile"
                ],
                "title": "Body_ida_plugin_checkin_ghidra_api_ida_plugin_checkin__post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/ida_plugin_get_decompiled_function/": {
      "post": {
        "tags": [
          "GhIDA specific endpoints"
        ],
        "summary": "Ida Plugin Get Decompiled Function",
        "description": "Run the script to decompile a function starting\nfrom the xml project exported from IDA.",
        "operationId": "ida_plugin_get_decompiled_function_ghidra_api_ida_plugin_get_decompiled_function__post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "allOf": [
                  {
                    "$ref": {
                      "properties": {
                        "xmlfile": {
                          "type": "string",
                          "format": "binary",
                          "title": "Xmlfile",
                          "description": "XML project exported from IDA"
                        },
                        "data": {
                          "type": "string",
                          "format": "binary",
                          "title": "Data",
                          "description": "JSON metadata containing 'md5' hash, 'filename', and 'address' reference"
                        }
                      },
                      "type": "object",
                      "title": "Body_ida_plugin_get_decompiled_function_ghidra_api_ida_plugin_get_decompiled_function__post"
                    }
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/ida_plugin_checkout/": {
      "post": {
        "tags": [
          "GhIDA specific endpoints"
        ],
        "summary": "Ida Plugin Checkout",
        "description": "Remove file(s) associated with the sample requesting checkout",
        "operationId": "ida_plugin_checkout_ghidra_api_ida_plugin_checkout__post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Checkout"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Checkout": {
        "properties": {
          "filename": {
            "type": "string",
            "title": "Filename"
          }
        },
        "type": "object",
        "required": [
          "filename"
        ],
        "title": "Checkout"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "decompile_sample": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Publicly accessible URL of the binary sample.",
            "example": "https://github.com/aimoda/ghidra-sample-binaries/raw/main/a.out"
          },
          "offset": {
            "type": "string",
            "title": "Offset",
            "description": "Offset address of the target function",
            "example": "0x4005b0"
          }
        },
        "type": "object",
        "required": [
          "url",
          "offset"
        ],
        "title": "decompile_sample"
      },
      "sample": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Publicly accessible URL of the binary sample.",
            "example": "https://github.com/aimoda/ghidra-sample-binaries/raw/main/a.out"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "sample"
      }
    }
  },
  "tags": [
    {
      "name": "Ghidra generic endpoints"
    },
    {
      "name": "GhIDA specific endpoints"
    },
    {
      "name": "Ghidra Stateless URL Commands"
    }
  ]
}

Ghidraaas

## Ghidraaas is a simple web server that exposes Ghidra analysis through REST APIs. The project includes three Ghidra plugins to analyze a sample, get the list of functions and to decompile a function. Ghidraaas is also the backend of GhIDA, the IDA plugin that integrates the Ghidra decompiler in IDA Pro.

  • POST /ghidra/api/get_functions_list_detailedGet Functions List Detailed From File Url
  • POST /ghidra/api/get_functions_listGet Functions List From File Url
  • POST /ghidra/api/get_syscall_xrefsGet Syscall Xrefs From File Url
  • POST /ghidra/api/get_binexport_fileGet Binexport File From File Url
  • POST /ghidra/api/get_decompiled_functionGet Decompiled Function From File Url
  • POST /ghidra/api/get_elf_with_dwarf_fileGet Elf With Dwarf File From File Url
  • POST /ghidra/api/ida_plugin_checkin/Ida Plugin Checkin

    Submit the .bytes file to ghidraaas for future decompilation

  • POST /ghidra/api/ida_plugin_get_decompiled_function/Ida Plugin Get Decompiled Function

    Run the script to decompile a function starting from the xml project exported from IDA.

  • POST /ghidra/api/ida_plugin_checkout/Ida Plugin Checkout

    Remove file(s) associated with the sample requesting checkout

Schéma original API
{
  "openapi": "3.1.0",
  "info": {
    "title": "Ghidraaas",
    "description": "\n## Ghidraaas is a simple web server that exposes Ghidra analysis through REST APIs. \nThe project includes three Ghidra plugins to analyze a sample, get the list of functions and to decompile a function.\n\nGhidraaas is also the backend of GhIDA, the IDA plugin that integrates the Ghidra decompiler in IDA Pro.\n",
    "version": "0.0.1"
  },
  "servers": [
    {
      "url": "https://chatgpt.ghidra.ai.moda/",
      "description": "Server for ChatGPT"
    }
  ],
  "paths": {
    "/ghidra/api/get_functions_list_detailed": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Functions List Detailed From File Url",
        "operationId": "get_functions_list_detailed_from_file_url_ghidra_api_get_functions_list_detailed_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/get_functions_list": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Functions List From File Url",
        "operationId": "get_functions_list_from_file_url_ghidra_api_get_functions_list_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/get_syscall_xrefs": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Syscall Xrefs From File Url",
        "operationId": "get_syscall_xrefs_from_file_url_ghidra_api_get_syscall_xrefs_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/get_binexport_file": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Binexport File From File Url",
        "operationId": "get_binexport_file_from_file_url_ghidra_api_get_binexport_file_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/get_decompiled_function": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Decompiled Function From File Url",
        "operationId": "get_decompiled_function_from_file_url_ghidra_api_get_decompiled_function_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/decompile_sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/get_elf_with_dwarf_file": {
      "post": {
        "tags": [
          "Ghidra Stateless URL Commands"
        ],
        "summary": "Get Elf With Dwarf File From File Url",
        "operationId": "get_elf_with_dwarf_file_from_file_url_ghidra_api_get_elf_with_dwarf_file_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sample"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/ida_plugin_checkin/": {
      "post": {
        "tags": [
          "GhIDA specific endpoints"
        ],
        "summary": "Ida Plugin Checkin",
        "description": "Submit the .bytes file to ghidraaas for future decompilation",
        "operationId": "ida_plugin_checkin_ghidra_api_ida_plugin_checkin__post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "filename": {
                    "type": "string",
                    "title": "Filename"
                  },
                  "bytesfile": {
                    "type": "string",
                    "format": "binary",
                    "title": "Bytesfile"
                  }
                },
                "type": "object",
                "required": [
                  "filename",
                  "bytesfile"
                ],
                "title": "Body_ida_plugin_checkin_ghidra_api_ida_plugin_checkin__post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/ida_plugin_get_decompiled_function/": {
      "post": {
        "tags": [
          "GhIDA specific endpoints"
        ],
        "summary": "Ida Plugin Get Decompiled Function",
        "description": "Run the script to decompile a function starting\nfrom the xml project exported from IDA.",
        "operationId": "ida_plugin_get_decompiled_function_ghidra_api_ida_plugin_get_decompiled_function__post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "allOf": [
                  {
                    "$ref": {
                      "properties": {
                        "xmlfile": {
                          "type": "string",
                          "format": "binary",
                          "title": "Xmlfile",
                          "description": "XML project exported from IDA"
                        },
                        "data": {
                          "type": "string",
                          "format": "binary",
                          "title": "Data",
                          "description": "JSON metadata containing 'md5' hash, 'filename', and 'address' reference"
                        }
                      },
                      "type": "object",
                      "title": "Body_ida_plugin_get_decompiled_function_ghidra_api_ida_plugin_get_decompiled_function__post"
                    }
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ghidra/api/ida_plugin_checkout/": {
      "post": {
        "tags": [
          "GhIDA specific endpoints"
        ],
        "summary": "Ida Plugin Checkout",
        "description": "Remove file(s) associated with the sample requesting checkout",
        "operationId": "ida_plugin_checkout_ghidra_api_ida_plugin_checkout__post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Checkout"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Checkout": {
        "properties": {
          "filename": {
            "type": "string",
            "title": "Filename"
          }
        },
        "type": "object",
        "required": [
          "filename"
        ],
        "title": "Checkout"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "decompile_sample": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Publicly accessible URL of the binary sample.",
            "example": "https://github.com/aimoda/ghidra-sample-binaries/raw/main/a.out"
          },
          "offset": {
            "type": "string",
            "title": "Offset",
            "description": "Offset address of the target function",
            "example": "0x4005b0"
          }
        },
        "type": "object",
        "required": [
          "url",
          "offset"
        ],
        "title": "decompile_sample"
      },
      "sample": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Publicly accessible URL of the binary sample.",
            "example": "https://github.com/aimoda/ghidra-sample-binaries/raw/main/a.out"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "sample"
      }
    }
  },
  "tags": [
    {
      "name": "Ghidra generic endpoints"
    },
    {
      "name": "GhIDA specific endpoints"
    },
    {
      "name": "Ghidra Stateless URL Commands"
    }
  ]
}