gsuberland / ghidra-cypress-fx2 Goto Github PK
View Code? Open in Web Editor NEWGhidra processor definition for Cypress FX2
License: Apache License 2.0
Ghidra processor definition for Cypress FX2
License: Apache License 2.0
Hi,
getting this error when running the script.
Thanks for sharing!
ApplyCypressFX2RegisterEnums.java> Running...
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_BREAKPT
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_CPUCS
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP1INCFG
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP1OUTCFG
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP2CFG
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP2FIFOCFG
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP2FIFOPFH
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP2ISOINPKTS
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP4CFG
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP4FIFOCFG
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP4FIFOPFH
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP4ISOINPKTS
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP6CFG
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP6FIFOCFG
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP6FIFOPFH
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP6ISOINPKTS
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP8CFG
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP8FIFOCFG
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP8FIFOPFH
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_EP8ISOINPKTS
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_FIFOPINPOLAR
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_FIFORESET
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_IFCONFIG
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_INPKTEND
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_OUTPKTEND
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_PINFLAGSAB
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_PINFLAGSCD
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_REVCTL
ApplyCypressFX2RegisterEnums.java> FX2_REG_BITS_UART230
ApplyCypressFX2RegisterEnums.java> FX2_REG_VAL_GPIFHOLDTIME
ApplyCypressFX2RegisterEnums.java> Enum count: 30
Error running script: ApplyCypressFX2RegisterEnums.java
java.lang.ClassCastException: class ghidra.program.database.data.EnumDB cannot be cast to class ghidra.program.model.data.EnumDataType (ghidra.program.database.data.EnumDB and ghidra.program.model.data.EnumDataType are in unnamed module of loader ghidra.GhidraClassLoader @22a71081)
at ApplyCypressFX2RegisterEnums.run(ApplyCypressFX2RegisterEnums.java:62)
at ghidra.app.script.GhidraScript.executeNormal(GhidraScript.java:395)
at ghidra.app.script.GhidraScript.doExecute(GhidraScript.java:250)
at ghidra.app.script.GhidraScript.execute(GhidraScript.java:228)
at ghidra.app.plugin.core.script.RunScriptTask.run(RunScriptTask.java:47)
at ghidra.util.task.Task.monitoredRun(Task.java:134)
at ghidra.util.task.TaskRunner.lambda$startTaskThread$0(TaskRunner.java:106)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.