Skip to content

Commit 3ff3cdb

Browse files
committed
Adding src
1 parent 05949f0 commit 3ff3cdb

File tree

29 files changed

+1153
-0
lines changed

29 files changed

+1153
-0
lines changed

GhidraESP8266_2/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bin
2+
.ant*.xml
3+
.settings
4+
.classpath
5+
.project

GhidraESP8266_2/Module.manifest

Whitespace-only changes.

GhidraESP8266_2/build.gradle

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Builds a Ghidra Extension for a given Ghidra installation.
2+
//
3+
// An absolute path to the Ghidra installation directory must be supplied either by setting the
4+
// GHIDRA_INSTALL_DIR environment variable or Gradle project property:
5+
//
6+
// > export GHIDRA_INSTALL_DIR=<Absolute path to Ghidra>
7+
// > gradle
8+
//
9+
// or
10+
//
11+
// > gradle -PGHIDRA_INSTALL_DIR=<Absolute path to Ghidra>
12+
//
13+
// Gradle should be invoked from the directory of the project to build. Please see the
14+
// application.gradle.version property in <GHIDRA_INSTALL_DIR>/Ghidra/application.properties
15+
// for the correction version of Gradle to use for the Ghidra installation you specify.
16+
17+
//----------------------START "DO NOT MODIFY" SECTION------------------------------
18+
def ghidraInstallDir
19+
20+
if (System.env.GHIDRA_INSTALL_DIR) {
21+
ghidraInstallDir = System.env.GHIDRA_INSTALL_DIR
22+
}
23+
else if (project.hasProperty("GHIDRA_INSTALL_DIR")) {
24+
ghidraInstallDir = project.getProperty("GHIDRA_INSTALL_DIR")
25+
}
26+
27+
if (ghidraInstallDir) {
28+
apply from: new File(ghidraInstallDir).getCanonicalPath() + "/support/buildExtension.gradle"
29+
}
30+
else {
31+
throw new GradleException("GHIDRA_INSTALL_DIR is not defined!")
32+
}
33+
//----------------------END "DO NOT MODIFY" SECTION-------------------------------

GhidraESP8266_2/data/README.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
The "data" directory is intended to hold data files that will be used by this module and will
2+
not end up in the .jar file, but will be present in the zip or tar file. Typically, data
3+
files are placed here rather than in the resources directory if the user may need to edit them.
4+
5+
An optional data/languages directory can exist for the purpose of containing various Sleigh language
6+
specification files and importer opinion files.
7+
8+
The data/build.xml is used for building the contents of the data/languages directory.
9+
10+
The skel language definition has been commented-out within the skel.ldefs file so that the
11+
skeleton language does not show-up within Ghidra.
12+
13+
See the Sleigh language documentation (docs/languages/sleigh.htm or sleigh.pdf) for details
14+
on Sleigh language specification syntax.
15+

GhidraESP8266_2/data/build.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
+ Compile sleigh languages within this module.
5+
+ Sleigh compiler options are read from the sleighArgs.txt file.
6+
+ Eclipse: right-click on this file and choose menu item "Run As->Ant Build"
7+
-->
8+
9+
<project name="privateBuildDeveloper" default="sleighCompile">
10+
11+
<property name="sleigh.compile.class" value="ghidra.pcodeCPort.slgh_compile.SleighCompile"/>
12+
13+
<!--Import optional ant properties. GhidraDev Eclipse plugin produces this so this file can find the Ghidra installation-->
14+
<import file="../.antProperties.xml" optional="false" />
15+
16+
<target name="sleighCompile">
17+
18+
<!-- If language module is detached from installation, get Ghidra installation directory path from imported properties -->
19+
<property name="framework.path" value="${ghidra.install.dir}/Ghidra/Framework"/>
20+
21+
<path id="sleigh.class.path">
22+
<fileset dir="${framework.path}/SoftwareModeling/lib">
23+
<include name="*.jar"/>
24+
</fileset>
25+
<fileset dir="${framework.path}/Generic/lib">
26+
<include name="*.jar"/>
27+
</fileset>
28+
<fileset dir="${framework.path}/Utility/lib">
29+
<include name="*.jar"/>
30+
</fileset>
31+
</path>
32+
33+
<available classname="${sleigh.compile.class}" classpathref="sleigh.class.path" property="sleigh.compile.exists"/>
34+
35+
<fail unless="sleigh.compile.exists" />
36+
37+
<java classname="${sleigh.compile.class}"
38+
classpathref="sleigh.class.path"
39+
fork="true"
40+
failonerror="true">
41+
<jvmarg value="-Xmx2048M"/>
42+
<arg value="-i"/>
43+
<arg value="sleighArgs.txt"/>
44+
<arg value="-a"/>
45+
<arg value="./languages"/>
46+
</java>
47+
48+
</target>
49+
50+
</project>
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!-- See Relax specification: Ghidra/Framework/SoftwareModeling/data/languages/compiler_spec.rxg -->
4+
5+
<compiler_spec>
6+
<data_organization>
7+
<pointer_size value="2" />
8+
</data_organization>
9+
<global>
10+
<range space="ram"/>
11+
<range space="io"/>
12+
</global>
13+
<stackpointer register="SP" space="ram"/>
14+
<segmentop space="ram" userop="segment" baseinsize="2" innerinsize="2" farpointer="yes">
15+
<baseop code="INT_ZEXT"/>
16+
<baseop code="INT_LEFT" value="12"/>
17+
<innerop code="INT_ZEXT"/>
18+
<constresolve>
19+
<register name="rBBR"/>
20+
</constresolve>
21+
</segmentop>
22+
<default_proto>
23+
<prototype name="__asmA" extrapop="2" stackshift="2" strategy="register">
24+
<input>
25+
<pentry minsize="1" maxsize="1">
26+
<register name="A"/>
27+
</pentry>
28+
<pentry minsize="1" maxsize="2">
29+
<register name="BC"/>
30+
</pentry>
31+
<pentry minsize="1" maxsize="2">
32+
<register name="HL"/>
33+
</pentry>
34+
<pentry minsize="1" maxsize="2">
35+
<register name="DE"/>
36+
</pentry>
37+
<pentry minsize="1" maxsize="2">
38+
<register name="IY"/>
39+
</pentry>
40+
<pentry minsize="1" maxsize="2">
41+
<register name="IX"/>
42+
</pentry>
43+
<pentry minsize="1" maxsize="500" align="2">
44+
<addr offset="2" space="stack"/>
45+
</pentry>
46+
</input>
47+
<output>
48+
<pentry minsize="1" maxsize="1">
49+
<register name="A"/>
50+
</pentry>
51+
</output>
52+
<unaffected>
53+
<register name="SP"/>
54+
<register name="BC_"/>
55+
<register name="HL_"/>
56+
<register name="DE_"/>
57+
<register name="AF_"/>
58+
<register name="rBBR"/>
59+
</unaffected>
60+
</prototype>
61+
</default_proto>
62+
<prototype name="__asmAF" extrapop="2" stackshift="2" strategy="register">
63+
<input>
64+
<pentry minsize="1" maxsize="1">
65+
<register name="A"/>
66+
</pentry>
67+
<pentry minsize="1" maxsize="2">
68+
<register name="BC"/>
69+
</pentry>
70+
<pentry minsize="1" maxsize="2">
71+
<register name="HL"/>
72+
</pentry>
73+
<pentry minsize="1" maxsize="2">
74+
<register name="DE"/>
75+
</pentry>
76+
<pentry minsize="1" maxsize="2">
77+
<register name="IY"/>
78+
</pentry>
79+
<pentry minsize="1" maxsize="2">
80+
<register name="IX"/>
81+
</pentry>
82+
<pentry minsize="1" maxsize="500" align="2">
83+
<addr offset="2" space="stack"/>
84+
</pentry>
85+
</input>
86+
<output>
87+
<pentry minsize="1" maxsize="2">
88+
<register name="AF"/>
89+
</pentry>
90+
</output>
91+
<unaffected>
92+
<register name="SP"/>
93+
<register name="rBBR"/>
94+
<register name="BC_"/>
95+
<register name="HL_"/>
96+
<register name="DE_"/>
97+
<register name="AF_"/>
98+
</unaffected>
99+
</prototype>
100+
<prototype name="__stdcall" extrapop="2" stackshift="2">
101+
<input>
102+
<pentry minsize="1" maxsize="1">
103+
<register name="A"/>
104+
</pentry>
105+
<pentry minsize="1" maxsize="2">
106+
<register name="BC"/>
107+
</pentry>
108+
<pentry minsize="1" maxsize="2">
109+
<register name="HL"/>
110+
</pentry>
111+
<pentry minsize="1" maxsize="500" align="2">
112+
<addr offset="2" space="stack"/>
113+
</pentry>
114+
</input>
115+
<output>
116+
<pentry minsize="1" maxsize="1">
117+
<register name="AF"/>
118+
</pentry>
119+
</output>
120+
<unaffected>
121+
<register name="SP"/>
122+
<register name="rBBR"/>
123+
<register name="BC_"/>
124+
<register name="HL_"/>
125+
<register name="DE_"/>
126+
<register name="AF_"/>
127+
</unaffected>
128+
</prototype>
129+
</compiler_spec>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!-- See Relax specification: Ghidra/Framework/SoftwareModeling/data/languages/language_definitions.rxg -->
4+
5+
<language_definitions>
6+
<!--
7+
<language processor="ESP8266"
8+
endian="little"
9+
size="32"
10+
variant="default"
11+
version="1.0"
12+
slafile="xtensa.sla"
13+
processorspec="xtensa.pspec"
14+
id="Xtensa:LE:32:default">
15+
<description>Skeleton Language Module</description>
16+
<compiler name="default" spec="xtensa.cspec" id="default"/>
17+
</language>
18+
-->
19+
</language_definitions>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<opinions>
2+
<!-- The primary and secondary constraint values must be specified as a decimal string -->
3+
<constraint loader="ESP8266" compilerSpecID="default">
4+
<constraint primary="0" processor="Xtensa" size="32" variant="default" />
5+
</constraint>
6+
</opinions>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!-- See Relax specification: Ghidra/Framework/SoftwareModeling/data/languages/processor_spec.rxg -->
4+
5+
<processor_spec>
6+
<programcounter register="PC"/>
7+
<register_data>
8+
<register name="AF_" group="Alt"/>
9+
<register name="BC_" group="Alt"/>
10+
<register name="DE_" group="Alt"/>
11+
<register name="HL_" group="Alt"/>
12+
</register_data>
13+
<default_symbols>
14+
<symbol name="RST0" address="ram:0000" entry="true"/>
15+
<symbol name="RST1" address="ram:0008" entry="false"/>
16+
<symbol name="RST2" address="ram:0010" entry="false"/>
17+
<symbol name="RST3" address="ram:0018" entry="false"/>
18+
<symbol name="RST4" address="ram:0020" entry="false"/>
19+
<symbol name="RST5" address="ram:0028" entry="false"/>
20+
<symbol name="RST6" address="ram:0030" entry="false"/>
21+
<symbol name="RST7" address="ram:0038" entry="false"/>
22+
</default_symbols>
23+
</processor_spec>

0 commit comments

Comments
 (0)