mirror of
https://github.com/Maschell/GhidraRPXLoader.git
synced 2024-11-16 05:09:17 +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>
|
<opinions>
|
||||||
<constraint loader="Wii U Executable (RPX/RPL)" compilerSpecID="default">
|
<constraint loader="Wii U / CafeOS Binary (RPX/RPL)" compilerSpecID="default">
|
||||||
<constraint primary="0" processor="PowerPC" endian="big" size="32" />
|
<constraint primary="wiiu" processor="PowerPC" endian="big" size="32" variant="Gekko/Broadway" />
|
||||||
|
<constraint primary="wiiu" processor="PowerPC" endian="big" size="32" variant="default" />
|
||||||
</constraint>
|
</constraint>
|
||||||
</opinions>
|
</opinions>
|
||||||
|
@ -28,8 +28,26 @@ public class CafeLoader extends ElfLoader {
|
|||||||
List<LoadSpec> loadSpecs = new ArrayList<>();
|
List<LoadSpec> loadSpecs = new ArrayList<>();
|
||||||
|
|
||||||
if (Arrays.equals(provider.readBytes(0, header.length), header)) {
|
if (Arrays.equals(provider.readBytes(0, header.length), header)) {
|
||||||
loadSpecs.add(new LoadSpec(this, 0, new LanguageCompilerSpecPair("PowerPC:BE:32:Gekko_Broadway", "default"), true));
|
List<QueryResult> results = QueryOpinionService.query(getName(), "wiiu", null);
|
||||||
return loadSpecs;
|
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;
|
return loadSpecs;
|
||||||
|
Loading…
Reference in New Issue
Block a user