Skip to content

Commit 5a42d40

Browse files
author
Your Name
committed
Upgrade for 10.3
1 parent 364a043 commit 5a42d40

File tree

12 files changed

+333
-295
lines changed

12 files changed

+333
-295
lines changed

.github/workflows/build_on_tag_push.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Ghidra Extension Publish
22

33
env:
4-
ghidra-url: https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_10.2.1_build/ghidra_10.2.1_PUBLIC_20221110.zip
5-
ghidra-zip-filename: ghidra_10.2.1_PUBLIC_20221110.zip
6-
ghidra-directory: ghidra_10.2.1_PUBLIC
4+
ghidra-url: https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_10.3_build/ghidra_10.3_PUBLIC_20230510.zip
5+
ghidra-zip-filename: ghidra_10.3_PUBLIC_20230510.zip
6+
ghidra-directory: ghidra_10.3_PUBLIC
77

88
on:
99
push:
@@ -16,6 +16,11 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v2
19+
- uses: actions/setup-java@v3
20+
with:
21+
distribution: 'temurin'
22+
java-version: '17'
23+
cache: 'gradle'
1924

2025
- name: Get the version
2126
id: get_version
@@ -33,14 +38,11 @@ jobs:
3338
- name: Build
3439
shell: bash
3540
run: |
36-
sudo apt-get update
37-
sudo apt-get install -y openjdk-17-jdk-headless
38-
sudo update-java-alternatives -s java-1.17.0-openjdk-amd64
3941
unzip -qq ${{ steps.download-ghidra.outputs.file-path }} -d /opt
4042
rm -v ${{ env.ghidra-zip-filename }}
4143
cd lightkeeper
4244
java --version
43-
gradle -Dorg.gradle.java.home=/usr/lib/jvm/java-1.17.0-openjdk-amd64 -PGHIDRA_INSTALL_DIR=/opt/${{ env.ghidra-directory }}
45+
gradle -PGHIDRA_INSTALL_DIR=/opt/${{ env.ghidra-directory }}
4446
mv -v dist/*.zip ${{ github.workspace }}/lightkeeper-${{ steps.get_version.outputs.VERSION }}.zip
4547
4648
- name: Create Release

lightkeeper/.classpath

Lines changed: 283 additions & 248 deletions
Large diffs are not rendered by default.

lightkeeper/.project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>LightKeeper</name>
3+
<name>lightkeeper</name>
44
<comment></comment>
55
<projects>
66
</projects>
@@ -18,7 +18,7 @@
1818
<link>
1919
<name>Ghidra</name>
2020
<type>2</type>
21-
<location>/opt/ghidra_10.2.1_PUBLIC</location>
21+
<location>/opt/ghidra_10.3_PUBLIC</location>
2222
</link>
2323
</linkedResources>
2424
</projectDescription>

lightkeeper/src/main/java/lightkeeper/controller/Controller.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void colour(TaskMonitor monitor) throws CancelledException {
7272
try {
7373
colorService.clearAllBackgroundColors();
7474
for (AddressRange range : instructionModel.getModelData()) {
75-
monitor.checkCanceled();
75+
monitor.checkCancelled();
7676
var min = range.getMinAddress();
7777
var max = range.getMaxAddress();
7878
colorService.setBackgroundColor(min, max, Color.GREEN);
@@ -120,7 +120,7 @@ public void addException(Exception exc) {
120120
}
121121

122122
public void importCoverage(TaskMonitor monitor, List<File> files) throws CancelledException {
123-
monitor.checkCanceled();
123+
monitor.checkCancelled();
124124
try {
125125
for (File file : files) {
126126
monitor.setMessage(String.format("Importing: %s", file.getAbsolutePath()));
@@ -145,7 +145,7 @@ public void importCoverage(TaskMonitor monitor, List<File> files) throws Cancell
145145
}
146146

147147
public void clearCoverage(TaskMonitor monitor) throws CancelledException {
148-
monitor.checkCanceled();
148+
monitor.checkCancelled();
149149
monitor.setMessage("Clearing");
150150
addMessage("Clearing");
151151
monitor.setProgress(0);
@@ -156,7 +156,7 @@ public void clearCoverage(TaskMonitor monitor) throws CancelledException {
156156

157157
public void refreshCoverage(TaskMonitor monitor) throws CancelledException {
158158
try {
159-
monitor.checkCanceled();
159+
monitor.checkCancelled();
160160
monitor.setMessage("Refreshing");
161161
addMessage("Refreshing");
162162
monitor.setProgress(0);

lightkeeper/src/main/java/lightkeeper/controller/DisassemblyController.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.awt.Color;
44
import java.math.BigInteger;
55

6+
import docking.widgets.fieldpanel.LayoutModel;
67
import docking.widgets.fieldpanel.listener.IndexMapper;
78
import docking.widgets.fieldpanel.listener.LayoutModelListener;
89
import ghidra.app.decompiler.ClangLine;
@@ -37,7 +38,7 @@ public void modelChanged(TaskMonitor monitor) throws CancelledException {
3738
DecompilerActionContext context = (DecompilerActionContext) dprov.getActionContext(null);
3839
if (context != null) {
3940
DecompilerPanel dpanel = context.getDecompilerPanel();
40-
var controller = dpanel.getLayoutModel();
41+
LayoutModel controller = dpanel.getFieldPanel().getLayoutModel();
4142
controller.addLayoutModelListener(new LayoutModelListener() {
4243

4344
@Override
@@ -65,13 +66,13 @@ public void updateCoverage(TaskMonitor monitor, DecompilerPanel dpanel) throws C
6566

6667
for (ClangLine line : dpanel.getLines()) {
6768
for (ClangToken token : line.getAllTokens()) {
68-
monitor.checkCanceled();
69+
monitor.checkCancelled();
6970
var address = DecompilerUtils.getClosestAddress(program, token);
7071
if (address == null) {
7172
continue;
7273
}
7374
for (AddressRange range : model.getModelData()) {
74-
monitor.checkCanceled();
75+
monitor.checkCancelled();
7576
if (!range.contains(address)) {
7677
continue;
7778
}

lightkeeper/src/main/java/lightkeeper/io/BinaryLineReader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
public class BinaryLineReader extends BinaryReader {
88

9-
protected CountedByteProvider provider;
9+
protected CountedByteProvider countedProvider;
1010

1111
public BinaryLineReader(CountedByteProvider provider) {
1212
super(provider, true);
13-
this.provider = provider;
13+
this.countedProvider = provider;
1414
}
1515

1616
public String readLine() throws IOException {
@@ -22,7 +22,7 @@ public String readLine() throws IOException {
2222
}
2323

2424
if (!isPrintable(c)) {
25-
throw new IOException(String.format("Invalid character at position: %d", provider.getPosition()));
25+
throw new IOException(String.format("Invalid character at position: %d", countedProvider.getPosition()));
2626
}
2727

2828
buffer.append(c);

lightkeeper/src/main/java/lightkeeper/io/block/BlockReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ public void addException(Exception exc) {
4040
}
4141

4242
public BlockEntry read() throws CancelledException, IOException {
43-
monitor.checkCanceled();
43+
monitor.checkCancelled();
4444
var start = reader.readNextUnsignedInt();
4545
var size = reader.readNextUnsignedShort();
4646
var module = reader.readNextUnsignedShort();
4747

4848
var block = new BlockEntry(start, size, module);
4949
addMessage(String.format("Read Block: %s", block));
50-
monitor.checkCanceled();
50+
monitor.checkCancelled();
5151
return block;
5252
}
5353
}

lightkeeper/src/main/java/lightkeeper/io/file/DynamoRioFile.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,18 @@ public void addException(Exception exc) {
7474
}
7575

7676
private void readHeader(TaskMonitor monitor) throws CancelledException, IOException {
77-
monitor.checkCanceled();
77+
monitor.checkCancelled();
7878
monitor.setMessage("Reading header");
7979
var headerLine = reader.readLine();
8080
addMessage(headerLine);
8181
if (!headerLine.equals(HEADER)) {
8282
throw new IOException(String.format("Invalid header: '%s' expected '%s'", headerLine, HEADER));
8383
}
84-
monitor.checkCanceled();
84+
monitor.checkCancelled();
8585
}
8686

8787
private void readFlavour(TaskMonitor monitor) throws CancelledException, IOException {
88-
monitor.checkCanceled();
88+
monitor.checkCancelled();
8989
monitor.setMessage("Reading flavour");
9090
var flavourLine = reader.readLine();
9191
addMessage(flavourLine);
@@ -95,11 +95,11 @@ private void readFlavour(TaskMonitor monitor) throws CancelledException, IOExcep
9595
}
9696
flavour = flavourMatcher.group("flavour");
9797
addMessage(String.format("Detected flavour: %s", flavour));
98-
monitor.checkCanceled();
98+
monitor.checkCancelled();
9999
}
100100

101101
private void readTable(TaskMonitor monitor) throws CancelledException, IOException {
102-
monitor.checkCanceled();
102+
monitor.checkCancelled();
103103
monitor.setMessage("Reading table");
104104
var tableLine = reader.readLine();
105105
addMessage(tableLine);
@@ -120,22 +120,22 @@ private void readTable(TaskMonitor monitor) throws CancelledException, IOExcepti
120120
var count = tableMatcher.group("count");
121121
tableCount = Integer.parseInt(count);
122122
addMessage(String.format("Detected table count: %d", tableCount));
123-
monitor.checkCanceled();
123+
monitor.checkCancelled();
124124
}
125125

126126
private void readModules(TaskMonitor monitor) throws CancelledException, IOException {
127127
var moduleReader = new ModuleReader(monitor, reader, tableVersion);
128128
moduleReader.addListener(this);
129129
for (var i = 0; i < tableCount; i++) {
130-
monitor.checkCanceled();
130+
monitor.checkCancelled();
131131
monitor.setMessage(String.format("Reading module: %d", i));
132132
var module = moduleReader.read();
133133
modules.add(module);
134134
}
135135
}
136136

137137
private void readBbHeader(TaskMonitor monitor) throws CancelledException, IOException {
138-
monitor.checkCanceled();
138+
monitor.checkCancelled();
139139
monitor.setMessage("Reading BB header");
140140
var bbHeaderLine = reader.readLine();
141141
addMessage(bbHeaderLine);
@@ -147,7 +147,7 @@ private void readBbHeader(TaskMonitor monitor) throws CancelledException, IOExce
147147
var blockString = bbHeaderMatcher.group("blocks");
148148
blockCount = Integer.parseInt(blockString);
149149
addMessage(String.format("Detected: %d blocks", blockCount));
150-
monitor.checkCanceled();
150+
monitor.checkCancelled();
151151
}
152152

153153
private void readBlocks(TaskMonitor monitor) throws CancelledException, IOException {
@@ -157,7 +157,7 @@ private void readBlocks(TaskMonitor monitor) throws CancelledException, IOExcept
157157
var moduleLimits = getModuleLimits();
158158

159159
for (var i = 0; i < blockCount; i++) {
160-
monitor.checkCanceled();
160+
monitor.checkCancelled();
161161
monitor.setMessage(String.format("Reading block: %d", i));
162162
var block = blockReader.read();
163163
long moduleLimit = moduleLimits.get(block.getModule());
@@ -167,7 +167,7 @@ private void readBlocks(TaskMonitor monitor) throws CancelledException, IOExcept
167167
blocks.add(block);
168168
}
169169

170-
monitor.checkCanceled();
170+
monitor.checkCancelled();
171171

172172
if (provider.getLength() != provider.getPosition()) {
173173
throw new IOException(String.format("File has: %d unexpected trailing bytes at position: %d",

lightkeeper/src/main/java/lightkeeper/io/module/ModuleReader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ protected void addMessage(String message) {
9797
}
9898

9999
private void readColumnHeader() throws CancelledException, IOException {
100-
monitor.checkCanceled();
100+
monitor.checkCancelled();
101101
monitor.setMessage("Reading Column Header");
102102
columnHeader = reader.readLine();
103103
addMessage(columnHeader);
104104
}
105105

106106
public ModuleEntry read() throws CancelledException, IOException {
107-
monitor.checkCanceled();
107+
monitor.checkCancelled();
108108
var moduleLine = reader.readLine();
109109
addMessage(moduleLine);
110110

@@ -150,7 +150,7 @@ public ModuleEntry read() throws CancelledException, IOException {
150150

151151
var module = new ModuleEntry(id, containingId, start, end, entry, checksum, timeStamp, pathString);
152152
addMessage(String.format("Read Module: %s", module));
153-
monitor.checkCanceled();
153+
monitor.checkCancelled();
154154
return module;
155155
}
156156

lightkeeper/src/main/java/lightkeeper/model/coverage/CoverageModel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ public void update(TaskMonitor monitor) throws CancelledException, IOException {
120120

121121
Set<Integer> ids = this.getSelectedModuleIds(selectedModules);
122122

123-
var baseAddress = api.getCurrentProgram().getAddressMap().getImageBase();
123+
var baseAddress = api.getCurrentProgram().getImageBase();
124124
for (BlockEntry block : file.getBlocks()) {
125-
monitor.checkCanceled();
125+
monitor.checkCancelled();
126126
if (!ids.contains(block.getModule())) {
127127
continue;
128128
}

0 commit comments

Comments
 (0)