oshogbo / ghidra-lx-loader Goto Github PK
View Code? Open in Web Editor NEWA Ghidra loader module for the Linear eXecutable Module Format
Home Page: https://oshogbo.vexillium.org/blog/70/
A Ghidra loader module for the Linear eXecutable Module Format
Home Page: https://oshogbo.vexillium.org/blog/70/
I was attempting to look at a file which I believe is LX, however it is responding with the error below. Do you think you could offer some assistance as to how I can move forward in getting this file open?
Unknwon file format: PE
java.lang.UnknownError: Unknwon file format: PE
at lx.LXHeader.<init>(LXHeader.java:130)
at lx.LX.<init>(LX.java:116)
at lx.LXLoader.load(LXLoader.java:66)
at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:347)
at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:83)
at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:112)
at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:400)
at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:349)
at ghidra.util.task.TaskLauncher$1.run(TaskLauncher.java:90)
at ghidra.util.task.Task.monitoredRun(Task.java:124)
at ghidra.util.task.TaskRunner.lambda$startTaskThread$1(TaskRunner.java:94)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:831)
Hi,
I wanted to use this plugin (latest ver. 9.1.2) but Ghidra 9.2 refuses it to install (it's showed in the extension list for install but checkbox cannot be selected). Other plugin e.g. gas that came with Ghidra installs OK. Doest it perform some version checking? Could you update the plugin or can I bypass version check some way?
ghidra-lx-loader/src/main/java/lx/LX.java
Line 180 in 6d1d468
This is a 16-bit selector fixup. It's for replacing 16 bit segment selectors with the actual selectors as used at runtime. The executable won't be able to know which selector will be given to for example the data segment (DS). The fixup will set the right selector (DS) after the executable was actually loaded into memory.
Below is an example with the dosbox debugger + dos32a on the left (note the replaced selector for DS after fixups performed by dos32a), and the executable without those fixups applied on the right.
ghidra-lx-loader/src/main/java/lx/LX.java
Line 187 in 6d1d468
I've been working on my own LE loader for an old DOS game and been using your code as an inspiration where needed. Thanks for that.
I think what the spec in the referenced code means is as follows:
Let's say you have a 32 bit fixup that is half on page X and part on page X+1 (16 bits each). The EXE will contain two fixup records for this fixup, one for each page.
The fixup for page X will have SRCOFF pagesize-2, meaning you will only fix 16 bits on page X and discard the other 16 bits that would be on page X+1 (depending on endianess).
The fixup for page X+1 will have SRCOFF -2, meaning you will have to discard the first 16 bits that are on page X, and only for the remaining 16 bits for PAGE X+2.
Depending on how the 32 bits are split, you can have SRCOFFs of -1, -2 or -3 on the second page.
Hi,
Trying to decompile a Windows 9x VXD (LE format) I got this exception:
Unsupported fixup source: 12
java.lang.UnknownError: Unsupported fixup source: 12
at lx.LXFixupRecordTable.<init>(LXFixupRecordTable.java:70)
at lx.LX.loadFixupRecordTable(LX.java:104)
at lx.LX.<init>(LX.java:126)
at lx.LXLoader.load(LXLoader.java:142)
at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:347)
at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:83)
at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:112)
at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:400)
at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:351)
at ghidra.util.task.TaskBuilder$TaskBuilderTask.run(TaskBuilder.java:306)
at ghidra.util.task.Task.monitoredRun(Task.java:124)
at ghidra.util.task.TaskRunner.lambda$startTaskThread$0(TaskRunner.java:106)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
---------------------------------------------------
Build Date: 2021-Sep-09 1133 CEST
Ghidra Version: 10.0.3
Java Home: /usr/lib/jvm/java-11-openjdk
JVM Version: Oracle Corporation 11.0.12
OS: Linux 5.14.6-arch1-1 amd64
Workstation: localhost.localdomain
The loader cannot be installed in Ghidra 9.1.2
Any plans to support Ghidra 11?
Loading the 3dfx carmageddon executable fails with:
Unsupported fixup source: 3
java.lang.UnknownError: Unsupported fixup source: 3
at lx.LXFixupRecordTable.<init>(LXFixupRecordTable.java:70)
at lx.LX.loadFixupRecordTable(LX.java:104)
at lx.LX.<init>(LX.java:126)
at lx.LXLoader.load(LXLoader.java:142)
at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:724)
at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:98)
at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:126)
at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:368)
at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:351)
at ghidra.util.task.TaskBuilder$TaskBuilderTask.run(TaskBuilder.java:306)
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)
---------------------------------------------------
Build Date: 2022-Nov-01 1334 EDT
Ghidra Version: 10.2
Java Home: /usr/lib/jvm/java-17-openjdk-17.0.5.0.8-2.fc36.x86_64
JVM Version: Red Hat, Inc. 17.0.5
OS: Linux 6.0.5-200.fc36.x86_64 amd64
Workstation: fedora
The executable CARMAV.EXE
can be downloaded here.
Unsupported fixup source: 0
java.lang.UnknownError: Unsupported fixup source: 0
at lx.LXFixupRecordTable.(LXFixupRecordTable.java:85)
at lx.LX.loadFixupRecordTable(LX.java:104)
at lx.LX.(LX.java:126)
at lx.LXLoader.load(LXLoader.java:142)
at ghidra.app.util.opinion.AbstractLibrarySupportLoader.doLoad(AbstractLibrarySupportLoader.java:811)
at ghidra.app.util.opinion.AbstractLibrarySupportLoader.loadProgram(AbstractLibrarySupportLoader.java:100)
at ghidra.app.util.opinion.AbstractProgramLoader.load(AbstractProgramLoader.java:131)
at ghidra.plugin.importer.ImporterUtilities.importSingleFile(ImporterUtilities.java:388)
at ghidra.plugin.importer.ImporterDialog.lambda$okCallback$7(ImporterDialog.java:347)
at ghidra.util.task.TaskBuilder$TaskBuilderTask.run(TaskBuilder.java:306)
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:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Build Date: 2023-Aug-29 1442 EDT
Ghidra Version: 10.3.3
Java Home: /usr/lib/jvm/java-21-openjdk
JVM Version: N/A 21
OS: Linux 6.6.3-1-MANJARO amd64
VREDIR.386 from windows 3.11
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.