mirror of
https://github.com/Maschell/GhidraRPXLoader.git
synced 2024-11-26 01:44:18 +01:00
Ghidra 11.0+ Fix
- Make sure "d" exists before we try to use it - Check for length of 1 to actually catch empty strings
This commit is contained in:
parent
19c77f28f8
commit
c4370fd256
@ -311,11 +311,10 @@ public class Cafe_ElfExtension extends ElfExtension {
|
|||||||
Address tagAddress = fileInfoAddr.add(tagOffset);
|
Address tagAddress = fileInfoAddr.add(tagOffset);
|
||||||
while (true) {
|
while (true) {
|
||||||
Data d = elfLoadHelper.createData(tagAddress, TerminatedStringDataType.dataType);
|
Data d = elfLoadHelper.createData(tagAddress, TerminatedStringDataType.dataType);
|
||||||
int length = d.getLength();
|
if (d == null || d.getLength() <= 1) { // empty string has a length of 1 (just a null terminator)
|
||||||
if (length == 0) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tagAddress = tagAddress.add(length);
|
tagAddress = tagAddress.add(d.getLength());
|
||||||
}
|
}
|
||||||
} catch (AddressOutOfBoundsException e) {
|
} catch (AddressOutOfBoundsException e) {
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user