-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented fixups for types 3 (16:16 pointer) and 8 (32bit self-ref)
- Loading branch information
1 parent
3b8b395
commit 22064a4
Showing
6 changed files
with
312 additions
and
85 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
src/main/java/yetmorecode/ghidra/format/lx/ObjectMapEntry.java
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
src/main/java/yetmorecode/ghidra/format/lx/ObjectTableEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package yetmorecode.ghidra.format.lx; | ||
|
||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
|
||
import ghidra.app.util.bin.format.FactoryBundledWithBinaryReader; | ||
|
||
public class ObjectTableEntry extends yetmorecode.file.format.lx.ObjectTableEntry { | ||
|
||
public ObjectTableEntry(FactoryBundledWithBinaryReader reader, int index) throws IOException { | ||
long oldIndex = reader.getPointerIndex(); | ||
reader.setPointerIndex(index); | ||
size = reader.readNextInt(); | ||
base = reader.readNextInt(); | ||
flags = reader.readNextInt(); | ||
pageTableIndex = reader.readNextInt(); | ||
pageCount = reader.readNextInt(); | ||
reader.setPointerIndex(oldIndex); | ||
} | ||
|
||
public String getPermissionFlagsLabel() { | ||
return String.format( | ||
"%s%s%s", | ||
(flags & FLAG_READABLE) > 0 ? "r" : "-", | ||
(flags & FLAG_WRITEABLE) > 0 ? "w" : "-", | ||
(flags & FLAG_EXECUTABLE) > 0 ? "x" : "-" | ||
); | ||
} | ||
|
||
public String getExtraFlagsLabel() { | ||
ArrayList<String> f = new ArrayList<>(); | ||
f.add(getPermissionFlagsLabel()); | ||
if ((flags & FLAG_PRELOAD_PAGES) > 0) { | ||
f.add("preload pages"); | ||
} | ||
if ((flags & FLAG_1616_ALIAS) > 0) { | ||
f.add("16:16 alias"); | ||
} | ||
if ((flags & FLAG_BIG_DEFAULT_BIT) > 0) { | ||
f.add("big default"); | ||
} | ||
return String.format("%04x (%s)", flags, String.join(", ", f)); | ||
} | ||
} |
Oops, something went wrong.