0

I'm experimenting with Ghidra and decompiling code intended for the MSP430 FR4133 Launchpad. I'm not sure if it's supported but Ghidra appeared to support MSP430 devices.

For a simple test, I'm using the example code at this link for the MSP EXP430FR4133 Launchpad.

This link contains a simple source program in this directory MSP-EXP430FR4133_Software_Examples_windows\Firmware\Source\OutOfBox_MSP430FR4133. It's a simple program with a stop watch and temperature sensor.

I decided to load the binary that's also there in the Binary folder.

enter image description here

Then I selected TI MSP430 16-bit and let Ghidra do the analysis. The problem is that the decompiler doesn't provide any functions. I'm wondering if I've selected the wrong architecture or option?

enter image description here

UPDATE 1 I'm posting two extra images which show two functions but there's nothing of any significance.

enter image description here enter image description here

sdbol
  • 413
  • 4
  • 17
  • Show the decompiled code at the position pointed to by the reset vector. – CL. Dec 30 '20 at 21:20
  • I'm not sure how to find the reset vector. You'll see in my latest two screenshots there is a scroll bar on the right hand side of the listing box. Clicking on the two functions shows the decompiled code. These are saying "Could not recover jumptable". I suspect this would occur if I've selected the wrong architecture. – sdbol Dec 30 '20 at 22:49
  • The reset vector is at address FFFE. – CL. Dec 31 '20 at 06:56
  • There's no address at FFFE. The listing goes from 0000 to 49db. I'm wondering if I've used the right settings for importing with the format as raw binary? – sdbol Dec 31 '20 at 21:35

1 Answers1

0

You are not decompiling a raw binary, but a text file.

If you look at the Readme, it indicates that this is a pre-built TI-TXT image.

Basically, it contains small chunks of data encoded in hexadecimal, prefixed with the load address. See the format definition here.

Ghidra supports similar formats (Intel HEX or Motorola S-Records), but not TI-TXT. I didn't find a tool to convert it to a supported format, but this could probably be done with a small script.

Tim
  • 1
  • 1
  • Can you clarify in my MSP430 example above which type of file is supported? – sdbol Feb 11 '21 at 05:54
  • I'm not sure, I don't know the IDE. But apparently, TI maintains a [GCC](https://www.ti.com/tool/MSP430-GCC-OPENSOURCE) version for MSP430 so you might be able to compile the examples in ELF format ? – Tim Feb 13 '21 at 19:25