gsuberland / ghidra-cypress-fx2

Ghidra processor definition for Cypress FX2
Apache License 2.0
5 stars 1 forks source link

more info needed #1

Closed ladmanj closed 2 years ago

ladmanj commented 2 years ago

Hello @gsuberland

Unfortunately, the description isn't detailed enough.

I found that adding a section to 8051.ldefs file is also needed, I tried my best but still don't know if that's right.

  <language processor="Cypress FX2"
            endian="big"
            size="16"
            variant="default"
            version="2.0"
            slafile="8051.sla"
            processorspec="cypress_fx2.pspec"
            id="8051:BE:16:fx2">
    <description>8051 Cypress FX2</description>
    <compiler name="Cypress FX2" spec="8051.cspec" id="default"/>
  </language>

You wrote that the java script has to be run, but I don't know where. Should I compile the .java file and then run it in the console, or load it inside ghidra somehow?

Thank you for your answers J.

gsuberland commented 2 years ago

Yeah, sorry, I must've missed the ldefs step. My language definition in 8051.ldefs is as follows:

  <language processor="8051"
            endian="big"
            size="16"
            variant="fx2"
            version="2.0"
            slafile="8051.sla"
            processorspec="cypress_fx2.pspec"
            manualindexfile="../manuals/8051.idx"
            id="8051:BE:16:fx2">
    <description>Cypress FX2</description>
    <compiler name="default" spec="8051.cspec" id="default"/>
    <external_name tool="IDA-PRO" name="8051"/>
  </language>

Ghidra has a scripting engine. In the Code Browser go to Window -> Script Manager. You can copy the Java file into Ghidra\Processors\8051\ghidra_scripts\ or any other of your script paths. Alternatively you can click the New Script button, select Java, then and paste in the contents manually.

gsuberland commented 2 years ago

I've now clarified the install procedure in the readme.