mirror of
https://github.com/Maschell/GhidraRPXLoader.git
synced 2024-11-23 00:29:15 +01:00
Force .rodata section to be read only.
This commit is contained in:
parent
8155a56707
commit
088a2ca0ed
@ -104,6 +104,18 @@ public class Cafe_ElfExtension extends ElfExtension {
|
||||
return address;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isSectionWritable(ElfSectionHeader section) {
|
||||
// For some reason .rpl files have .rodata marked with W flag,
|
||||
// forcing it to read only will help improve decompiler output.
|
||||
String name = section.getNameAsString();
|
||||
if (name != null && name.contentEquals(".rodata")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (section.getFlags() & ElfSectionHeaderConstants.SHF_WRITE) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processElf(ElfLoadHelper elfLoadHelper, TaskMonitor monitor)
|
||||
throws CancelledException {
|
||||
|
Loading…
Reference in New Issue
Block a user