eta patch loader:
li %r4, 0x200
oris %r4, %r4, 0x8000
sldi %r4, %r4, 32
oris %r4, %r4, 1
ld %r5, 0x258(%r4) # ^ stores nand offset in memory
addi %r5, %r5, 0x200 # offset we're storing the patches now
patchLoop:
ld %r4, 0(%r5) # load offset to patch
ld %r3, 4(%r5) # load number of instructions to patch
addi %r5, %r5, 8 # add 8 to patch pointer
cmplwi cr6, %r4, 0xFFFF # if offset == 0xFFFFxxxx
beq cr6, endPatch # patchset over :)
patchCopyLoop:
ld %r4, 0(%r5) # load the patch to apply
stw %r4, 0(%r4) # patch it
addi %r4, %r4, 4 # add 4 to khv pointer
addi %r5, %r5, 4 # add 4 to patch pointer
addi %r3, %r3, -1 # decrease counter
cmplwi cr6, %r3, 0 # if counter == 0
beq cr6, patchLoop # load next patch
endPatch:
rfid # original thing we patched
Alpha patch loader:
li %r2, 0x200
oris %r2, %r2, 0x8000
sldi %r2, %r2, 32
oris %r2, %r2, 1
addis %r11, %r2, 0
addi %r29, %r11, 0
ld %r11, 0x258(%r29) # ^ stores nand offset in r29
addi %r11, %r11, 0x200 # r11 is set to where we're storing the patches now in nand
patchLoop:
ld %r2, 0(%r11) # load offset to patch
ld %r3, 4(%r11) # load number of instructions to patch
addi %r11, %r11, 8 # add 8 to patch pointer
cmplwi cr6, %r2, 0xFFFF # if offset == 0xFFFFxxxx
beq cr6, endPatch # patch over :)
patchCopyLoop:
ld %r4, 0(%r11) # load the patch to apply
stw %r4, 0(%r2) # patch it
addi %r2, %r2, 4 # add 4 to khv pointer
addi %r11, %r11, 4 # add 4 to patch pointer
addi %r3, %r3, -1 # decrease counter
cmplwi cr6, %r3, 0 # if counter == 0
beq cr6, patchLoop # load next patch
endPatch:
rfid # original thing we patched
ya que estamos en que lenguaje de programacion esta?, aunque a mi me parece una lista de los cambios que hay que hacer mediante un editor hexadecimal a la nand, si es asi normal que vallan tan lentos, leer programas en hexadecimal no es precisamente facil
, corrijanme si me equivoco