I figured it'd be more appropriate to ask this question here:
https://github.com/NationalSecurityAgency/ghidra/issues/2530#issuecomment-785007613
Given this linear address space a particular MCU:
It's not easily definable as-is on the memory manager, see:
memory = currentProgram.getMemory()
fb = memory.getAllFileBytes()
blk = memory.getBlock(toAddr(0x0))
memory.removeBlock(blk, monitor)
memory.createUninitializedBlock("internal_ram",toAddr(0x3ff8000),0x2fff,False)
memory.createUninitializedBlock("peripherals", toAddr(0x3ffefff),0xfff, False)
memory.createInitializedBlock("rom", toAddr(0x0), fb[0], 0, 0x1000000, False)
disassemble(toAddr(0x0))
Yields:
Traceback (most recent call last):
File "python", line 1, in <module>
at ghidra.program.database.mem.MemoryMapDB.checkBlock(MemoryMapDB.java:1043)
at ghidra.program.database.mem.MemoryMapDB.removeBlock(MemoryMapDB.java:1850)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Blocks do not belong to this program
ghidra.program.database.mem.MemoryBlockDB@6f03ae13
ghidra.program.database.mem.MemoryBlockDB@38d5ac1c
ghidra.program.database.mem.MemoryBlockDB@6ad8b9ac
What would be the correct sequence of arguments/flags/(instruction ordering?) to have a correct representation of a loaded V850 16MB firmware (size 0x1000000) on Ghidra? What am I doing wrong?
ghidra
tag was meant for specific Ghidra questions as I was directed here a while ago in stackoverflow.com/questions/65314484/…