mirror of
https://github.com/Maschell/GhidraRPXLoader.git
synced 2024-11-14 12:25:12 +01:00
Prefer Gekko processor but fallback to normal PowerPC if not present.
This commit is contained in:
parent
dc715cfb81
commit
3eda80f7c5
@ -1,5 +1,6 @@
|
||||
<opinions>
|
||||
<constraint loader="Wii U Executable (RPX/RPL)" compilerSpecID="default">
|
||||
<constraint primary="0" processor="PowerPC" endian="big" size="32" />
|
||||
</constraint>
|
||||
<constraint loader="Wii U / CafeOS Binary (RPX/RPL)" compilerSpecID="default">
|
||||
<constraint primary="wiiu" processor="PowerPC" endian="big" size="32" variant="Gekko/Broadway" />
|
||||
<constraint primary="wiiu" processor="PowerPC" endian="big" size="32" variant="default" />
|
||||
</constraint>
|
||||
</opinions>
|
||||
|
@ -28,8 +28,26 @@ public class CafeLoader extends ElfLoader {
|
||||
List<LoadSpec> loadSpecs = new ArrayList<>();
|
||||
|
||||
if (Arrays.equals(provider.readBytes(0, header.length), header)) {
|
||||
loadSpecs.add(new LoadSpec(this, 0, new LanguageCompilerSpecPair("PowerPC:BE:32:Gekko_Broadway", "default"), true));
|
||||
return loadSpecs;
|
||||
List<QueryResult> results = QueryOpinionService.query(getName(), "wiiu", null);
|
||||
boolean hasGekkoProcessor = false;
|
||||
|
||||
for (QueryResult result : results) {
|
||||
if (result.pair.languageID.getIdAsString().contains("Gekko")) {
|
||||
hasGekkoProcessor = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (QueryResult result : results) {
|
||||
if (result.pair.languageID.getIdAsString().contains("Gekko")) {
|
||||
loadSpecs.add(new LoadSpec(this, 0, new QueryResult(result.pair, true)));
|
||||
} else {
|
||||
loadSpecs.add(new LoadSpec(this, 0, new QueryResult(result.pair, hasGekkoProcessor ? false : result.preferred)));
|
||||
}
|
||||
}
|
||||
|
||||
if (loadSpecs.isEmpty()) {
|
||||
loadSpecs.add(new LoadSpec(this, 0, new LanguageCompilerSpecPair("PowerPC:BE:32:default", "default"), true));
|
||||
}
|
||||
}
|
||||
|
||||
return loadSpecs;
|
||||
|
Loading…
Reference in New Issue
Block a user