Ghidra: Be able to persist changes to the auto-analysis defaults

Created on 5 Aug 2020  路  2Comments  路  Source: NationalSecurityAgency/ghidra

I searched previous issues for a similar feature request but could not find any, so here it goes.
(I originally posted this to the Ghidra subreddit, but nobody new how to do that, but the upvotes show that there is interest :) https://ps.reddit.com/r/ghidra/comments/i1bk7v/change_the_autoanalysis_defaults/)

Is your feature request related to a problem? Please describe.
I am usually analyzing arm and aarch64 embedded Linux binaries and the "Non Returning Functions - Discovered" module identifies functions like memcpy as non-returning, making the analysis trash. (see #1981)

As there are many binaries and libraries I use the headless feature to import and auto-analyze the many files overnight so I can have a look at them in the morning.

However due the issue with the "Non Returning Functions - Discovered" module this does not work and I have to do all auto-analysis by hand.

Describe the solution you'd like
I would like to be able to change the modules active by default for auto-analysis and persist these changes by having a "save as default" in the "Analyze Options" window.

Describe alternatives you've considered
I load every binary manually into codebrowser and deselect the offending module by hand, and also select Decompiler Parameter ID manually and it costs a lot of time :(
(I now use a headless prescript as pointed out by dragonmacher as a workaround. Still this is a feature that is missing IMHO)

Most helpful comment

@dragonmacher I got the workaround working, thank you!
I still think this would be a missing feature that should be implemented (a "save as default" button in the windows).

All 2 comments

For now, you should be able to do this from a script. In this script, setup the analysis options as you like.

Run this script before you start analysis. If using the UI, then you must run the script from the script manager. If you wish to perform headless analysis, then this script needs to be a preScript (see the headless documentation for how to specify a preScript)

There are methods in the scripting interface to help change analysis options. The simplest example I could find is in the TurnOffStackAnalysis script.

@dragonmacher I got the workaround working, thank you!
I still think this would be a missing feature that should be implemented (a "save as default" button in the windows).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yifanlu picture yifanlu  路  24Comments

rszibele picture rszibele  路  35Comments

mumbel picture mumbel  路  29Comments

astrelsky picture astrelsky  路  16Comments

dalvarezperez picture dalvarezperez  路  19Comments