Skip to content

Commit

Permalink
chore: reword unlink with delink
Browse files Browse the repository at this point in the history
The reverse of assembling is disassembling, the reverse of compiling is
decompiling, so the reverse of linking should then be called delinking.
  • Loading branch information
boricj committed Sep 12, 2023
1 parent eae23a6 commit 56ae94a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"console": "internalConsole",
"mainClass": "ghidra.GhidraLauncher",
"name": "Ghidra Debug",
"projectName": "ghidra-unlinker-extension",
"projectName": "ghidra-delinker-extension",
"request": "launch",
"shortenCommandLine": "argfile",
"type": "java",
Expand Down
2 changes: 1 addition & 1 deletion Module.manifest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MODULE NAME: Unlinker
MODULE NAME: Delinker
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The Ghidra extension archive will be created inside the `dist/` directory.

## Installation

* Download the extension from the [releases page](https://github.com/boricj/ghidra-unlinker-extension/releases) or build it locally ;
* Download the extension from the [releases page](https://github.com/boricj/ghidra-delinker-extension/releases) or build it locally ;
* Install the extension in your Ghidra instance with `File > Install Extensions…` ;
* Enable the `RelocationTableSynthesizedPlugin` plugin with `File > Configure` inside a CodeBrowser window.

Expand Down Expand Up @@ -50,4 +50,4 @@ When a linker is invoked to generate an executable from a bunch of object files,
* Apply the relocations based on the final addresses of the symbols onto the section bytes.

Normally the relocation table is discarded after this process, as well as the symbol table if debugging symbols aren't kept, leaving only the un-relocatable section bytes.
However, through careful analysis this data can be recreated, which allows us to then effectively _unlink_ the program back into object files.
However, through careful analysis this data can be recreated, which allows us to then effectively _delink_ the program back into object files.
2 changes: 1 addition & 1 deletion extension.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=@extname@
description=Unlink programs back into relocatable object files.
description=Delink programs back into relocatable object files.
author=Jean-Baptiste Boric
createdOn=
version=@extversion@
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import ghidra.util.task.TaskMonitor;
import utility.application.ApplicationLayout;

public abstract class UnlinkerIntegrationTest extends AbstractProgramBasedTest {
public abstract class DelinkerIntegrationTest extends AbstractProgramBasedTest {
private static DBHandle dbHandle = null;
private static Program program = null;

Expand All @@ -60,7 +60,7 @@ public IntegrationTestApplicationLayout(File userSettingsDir)
@Override
protected Map<String, GModule> findGhidraModules() throws IOException {
Map<String, GModule> modules = new HashMap<>(super.findGhidraModules());
modules.put("Unlinker",
modules.put("Delinker",
new GModule(applicationRootDirs, new ResourceFile(System.getProperty("user.dir"))));
return Collections.unmodifiableMap(modules);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import org.junit.Test;

import ghidra.UnlinkerIntegrationTest;
import ghidra.DelinkerIntegrationTest;
import ghidra.app.analyzers.RelocationTableSynthesizerAnalyzer;
import ghidra.app.util.importer.MessageLog;
import ghidra.program.model.address.AddressSetView;
Expand All @@ -35,7 +35,7 @@
import ghidra.program.model.relocobj.RelocationTable;
import ghidra.util.task.TaskMonitor;

public class MipselAsciiTableFreestandingIntegrationTest extends UnlinkerIntegrationTest {
public class MipselAsciiTableFreestandingIntegrationTest extends DelinkerIntegrationTest {
private static final List<String> MEMORY_BLOCK_NAMES = List.of(
".sbss",
".sdata",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.junit.Test;

import ghidra.UnlinkerIntegrationTest;
import ghidra.DelinkerIntegrationTest;
import ghidra.app.analyzers.RelocationTableSynthesizerAnalyzer;
import ghidra.app.util.DomainObjectService;
import ghidra.app.util.Option;
Expand All @@ -30,7 +30,7 @@
import ghidra.program.model.listing.Program;
import ghidra.util.task.TaskMonitor;

public class MipselAsciiTableFreestandingIntegrationTest extends UnlinkerIntegrationTest {
public class MipselAsciiTableFreestandingIntegrationTest extends DelinkerIntegrationTest {
private static final String ACTUAL_RAW_FILENAMES_FORMAT =
"src/test/resources/ascii-table/reference/freestanding/mipsel/ascii-table%s.bin";

Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/ascii-table/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ascii-table test case

This is a simple test case for the unlinker, adapted from this [case study](https://boricj.direct.quickconnect.to/reverse-engineering/2023/05/15/part-2.html), suitable as a basic end-to-end integration test.
This is a simple test case for the delinker, adapted from this [case study](https://boricj.direct.quickconnect.to/reverse-engineering/2023/05/15/part-2.html), suitable as a basic end-to-end integration test.

Any relocation synthesizer implementation should be able to at least successfully unlink its corresponding freestanding artifact, in order to demonstrate a minimum level of functionality, as well as having its test harness integrated for basic anti-regression testing.
Any relocation synthesizer implementation should be able to at least successfully delink its corresponding freestanding artifact, in order to demonstrate a minimum level of functionality, as well as having its test harness integrated for basic anti-regression testing.

## Prerequisites

Expand Down

0 comments on commit 56ae94a

Please sign in to comment.