New answers tagged

1

You noted that Decompiler Parameter ID fixes the discrepancy, but I suspect that the relevant action code is the one behind the context menu action Commit Params/Return. The Ghidra Advanced Class slides state: Decompiler Parameter ID The Decompiler Parameter ID Analyzer (Analysis → One Shot → Decompiler Parameter ID) uses the decompiler and an ...


3

So, I found out the reason. By default when the ghidra asks for options when we load the binary, Decompiler Parameter ID option is disabled. Once you enable it, you will have the function parameters correctly. It will take longer time to make the analysis once this option is enabled.


3

You can use FunctionManager to get all the functions in the current program and then, from it iterate and get signatures of each. fm = currentProgram.getFunctionManager() functions = fm.getFunctions(True) for f in functions: print(f.getSignature().getPrototypeString()) The output: Signatures.py> Running... char * strcpy(char * __dest, char * __src) ...


-1

In order to run make you first run ./configure $ ./configure configure-plugins: Loading ./plugins.cfg .. configure-plugins: Generating libr/config.h .. configure-plugins: Generating libr/config.mk ..


0

In cutter you have an option under right mouse button click to set a label for a particular value. Or you can use Shift+N to activate that. From r2 you can get the same behavior by issuing a f name = addr command. | f name 12 @ 33 set flag 'name' with length 12 at offset 33 | f name = 33 alias for 'f name @ 33' or 'f name 1 33' ...


1

It just doesn't print anything on the the screen but set's internal value. You can be verifie that by looking at the source code here. What it does tell you to do is to run ?? which is actually printing that value as can be seen in the help | ?? show value of operation Additionally based on the result you can run the ...


2

You'll want to use ~/.radare2rc to make configs / cmds automatically run everytime radare2 is launched. You'll have to set a flag inside of that so it loads up the visual configuration you have everytime it's ran. Example .radare2rc Here is a fine example I found on GitHub. You use the flag eco theme_name to set a default theme on launch.


2

@0xec's answer is great. This script will help you get blocks function wise. from ghidra.program.model.block import BasicBlockModel blockiterator = BasicBlockModel(currentProgram).getCodeBlocks(monitor) # dictionary contains function wise basic block information functions = {} def add_block(function, block): if function not in functions: ...


1

0xec has answered you but if you are interested in functions you can iterate as below #TODO Lists Functions in a given program #@author blabb #@category _NEW_ funcs = currentProgram.getFunctionManager().getFunctions(True) f1 = funcs.next() print("Function Name",f1.getName()) print("Function Body" , f1.getBody()) print("Function Entry" , f1.getEntryPoint()...


3

You can obtain the list of all defined basic blocks using BasicBlockModel Example from ghidra.program.model.block import BasicBlockModel from ghidra.util.task import TaskMonitor bbm = BasicBlockModel(currentProgram) blocks = bbm.getCodeBlocks(TaskMonitor.DUMMY) block = blocks.next() while block: print "Label: {}".format(block.name) print "Min ...


0

If you have and e io.cache set to true, then breakpoints don't work


Top 50 recent answers are included