mirror of
https://github.com/cemu-project/GhidraRPXLoader.git
synced 2024-11-22 01:09:17 +01:00
Only get the ElfSectionHeader in the RelocationHandler if it's not a special section header index to avoid a ArrayIndexOutOfBoundsException
This commit is contained in:
parent
0005907547
commit
fb3ec7fe28
@ -44,6 +44,8 @@ public class Cafe_ElfRelocationHandler extends ElfRelocationHandler {
|
|||||||
* reference because it will be too far away for the actual relocation to
|
* reference because it will be too far away for the actual relocation to
|
||||||
* be valid itself.
|
* be valid itself.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (sym.getSectionHeaderIndex() > 0) {
|
||||||
ElfSectionHeader symbolSection = elf.getSections()[sym.getSectionHeaderIndex()];
|
ElfSectionHeader symbolSection = elf.getSections()[sym.getSectionHeaderIndex()];
|
||||||
if (symbolSection.getType() == Cafe_ElfExtension.SHT_RPL_IMPORTS.value) {
|
if (symbolSection.getType() == Cafe_ElfExtension.SHT_RPL_IMPORTS.value) {
|
||||||
String symbolSectionName = symbolSection.getNameAsString();
|
String symbolSectionName = symbolSection.getNameAsString();
|
||||||
@ -79,6 +81,7 @@ public class Cafe_ElfRelocationHandler extends ElfRelocationHandler {
|
|||||||
Msg.warn(this, "Failed to find location for " + sym.getNameAsString());
|
Msg.warn(this, "Failed to find location for " + sym.getNameAsString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Cafe_ElfRelocationConstants.R_PPC_ADDR32:
|
case Cafe_ElfRelocationConstants.R_PPC_ADDR32:
|
||||||
|
Loading…
Reference in New Issue
Block a user