1

How to configure "Memory Map" for RAM image use Ghidra Script API? For example, here is Memory layout created by python script:

.text start: 0x80004000
.text end: 0x8079e4d0
.text length: 0x79a4d0
.data start: 0x8079e4d4
.data end: 0x8093e220
.data length: 0x19fd4c
.bss_start: 0x80aad090
.bss_end: 0x80d19760
stack start: 0x80b15660
stack end: 0x80b19660

I want a) split RAM in two blocks: .text (code) and .data (data), and b) add 2 new blocks: .bss and stack. (both as overlay) I set the start address to 0x80004000, and imported binary. It seems, Ghidra computes the addresses a little different (add 1 to length?) than python script I used to create the memory layout and this confuses things.

I think, for .bss and stack it could be

memory.createUninitializedBlock(".bss",toAddr(0x80aad090),0x26c6d0,True)
memory.createUninitializedBlock("stack",toAddr(0x80b15660),0x4000,True)

Not sure how to split ram block and what should be the full script.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.