7

I am working on adding a processor to Ghidra (I have no idea what I'm doing, just working my way through based off the documentation).

I've seen SleighDevTools mentioned in the 9.1 release as being "support of processor module development", which sounds like it would be helpful to me. However, I can't find any documentation on what it does or how to use it. All, I've found is the source code for it in the Ghidra repo (no readme), and a single mention of it on reddit.

Is there documentation on SleighDevTools? If so, where is it? If not, are there any good resources for processor development besides the official Ghidra docs?

Thank you!

Heiko
  • 73
  • 3
  • 2
    I believe there is no documentation for this yet, but I was reading a blog post/README/forum comment from somebody a day or two ago who had added a few processors or microcontrollers who gave some explanation of what they went through. I'll add a link if I find at again. – hippietrail May 20 '20 at 11:26
  • @hippietrail Look forward to seeing the link if you find it again and add it here, thanks – auspicious99 May 21 '20 at 04:51
  • @auspicious99: I'm certain this is not the one I was reading, but it seems to be another of the same kind! https://guedou.github.io/talks/2019_BeeRump/slides.pdf – hippietrail May 21 '20 at 05:48
  • 1
    Thanks @hippietrail . I had previously found that one (linked it in my answer too), and was hoping you might have seen another one. – auspicious99 May 21 '20 at 06:18
  • Oh sorry I didn't notice that. Only found it while trying to find the one I'd had earlier... – hippietrail May 21 '20 at 08:28
  • 1
    No problem, thanks for looking. Look forward to future discussions with you regarding Ghidra and reverse engineering on this site! – auspicious99 May 21 '20 at 13:09
  • 1
    BTW. The reddit post that I was referring to was this. It sounds like it could be the one that @hippietrail was looking at. – Heiko May 21 '20 at 13:13
  • @Heiko: Yes that's the one! – hippietrail May 21 '20 at 13:52
  • Awesome, thanks, will be bookmarking that too! – auspicious99 May 21 '20 at 16:37

1 Answers1

8

In the SleighDevTools folder, there is a pcodetest folder, with a README.txt (which is unfortunately very brief).

The documentation on SLEIGH can be found in <ghidra install dir>/docs/languages/index.html, which explains what goes in the .slaspec file for your new processor.

Some documentation on what goes in the other files like .cspec, .ldefs, .., can be found in <ghidra install dir>/Ghidra/Framework/SoftwareModeling/data/languages.

There is also an Eclipse plugin, GhidraSleighEditor, that is currently (Ghidra 9.1.2) separate from the GhidraDev eclipse plugin and must be manually installed. It can be found at <ghidra install dir>/Extensions/Eclipse/GhidraSleighEditor/, and has some documentation in the GhidraSleighEditor_README.html in that folder.

As for your question on good documentation besides the Ghidra docs:

  1. Here is the original paper on SLED, which later in modified form became SLEIGH.

  2. These slides go through an example of adding a processor to Ghidra

  3. There's also this high level guide to adding a processor.

  4. (thanks to mumbel for pointing this out) This reddit post provides valuable details on adding a processor.

  5. (thanks to Heiko) This blog contains tutorials on how to put together SLEIGH, pcode, and related concepts.

auspicious99
  • 474
  • 3
  • 16
  • Thanks! That gives me quite a few more things to work off of. – Heiko May 21 '20 at 13:24
  • feel free to ask questions in that thread, I can maybe expand on anything that's lacking (oops posted in wrong comment chain) – mumbel May 21 '20 at 18:29
  • hi @mumbel thanks for the offer. might be best to ask any questions in separate question posts, though, rather than in threads, so it is easier for the community to find the questions and answers in the future. – auspicious99 May 22 '20 at 05:04
  • sorry, my edit should have been more clear. meant my reddit thread linked above in the question's comments – mumbel May 22 '20 at 15:31
  • 1
    Oh! I see, you were the author of that reddit article? – auspicious99 May 22 '20 at 15:47
  • 2
    Yup, Wrote that (tricore, risc-v, and 80960 modules and a few various fixes across the ghidra code base) this acct is same mumbel as https://www.reddit.com/user/mumbel and https://github.com/mumbel – mumbel May 22 '20 at 23:02
  • 2
    I just found a good general sleigh tutorial at https://spinsel.dev/ – Heiko Aug 17 '20 at 16:56