Skip to content

Commit

Permalink
arcfw: fix mfpvr instruction patching
Browse files Browse the repository at this point in the history
this isn't my cursed big endian hackfest, the correct endianness is little
  • Loading branch information
Wack0 committed Jul 16, 2024
1 parent 39db15b commit 07c7343
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arcgrackle/source/arcload.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ static void InstructionPerformPatch(
// NT 4 osloader checks pvr, if it's not in hardcoded list then panic
// so patch this check :)
if (PvrVersion > 9 && PvrVersion != 20) {
PPC_INSTRUCTION_BIG Insn;
PPC_INSTRUCTION Insn;
Insn.Long = instruction;
if (Insn.Primary_Op == X31_OP && Insn.XFXform_XO == MFSPR_OP && Insn.XFXform_spr == 1000) {
// Make NT believe this is an Arthur derivative
// addis rx, 0, 8
PPC_INSTRUCTION_BIG Patch;
PPC_INSTRUCTION Patch;
Patch.Long = 0;
Patch.Primary_Op = ADDIS_OP;
Patch.Dform_RT = Insn.XFXform_RT;
Expand Down

0 comments on commit 07c7343

Please sign in to comment.