Nop world [Gaberboo]
#1
Over the many years of Wii and GameCube modding, there have a countless number of nop codes. These codes are often simple and basic, which saddens an advanced nop coder like me. For me, I find nops to be an impressive invention of coders, they advance the PC, and in beautiful elegance do nothing else.

In my journey of nop coding, I encountered an issue, when I tried maximizing the amount of nops in memory, I found myself limited by the measly 88 MiB of total main memory. My attempts to use IBATs to duplicate the memory were in vain, as their limited quantity and flexibility did not allow for making the entire address space nop. I had to resign to infinite nops being continually assisted by non-nop instructions.

This all changed when I discovered the page table, with this amazing new way of controlling memory, I could duplicate a 4 KiB region of memory almost an unlimited amount of times. Only filling one page with nops, I could fill all of virtual memory. With this sudden discovery I went hard at work to make a new code (that unfortunately could not be made of nops) to realize my dream of unlimited nops.

It would be a shame if I didn't share my code and resigned others to an imperfect nopping solution, so here it is.

NOTE: This code makes use of memory addresses 0x00000000 thru 0xFFFFFFFF. Make sure no other codes in your GCT/Cheat-Manager are using those addresses!

Region-free and any game

C0000000 00000027
7FE000A6 57E7045E
7CE00124 54ED0732
7DBB03A6 429F0005
7C4802A6 544200BE
38420014 7C5A03A6
4C000064 3C400080
604D003F 7C0004AC
7DB903A6 4C00012C
7C4D1378 3BE00000
3C20000F 6021FFFF
7C2903A6 93ED0000
97ED0004 4200FFFC
38200400 7C2903A6
3DA00100 3C206000
902D0000 942D0004
7C0068AC 7C006FAC
4200FFF4 3DA00100
3DC01000 57EAD2B2
7E225214 48000008
3A310008 81F10000
2C0F0000 4180FFF4
57FE56BE 67DE8000
91B10004 7C0006AC
93D10000 7C0004AC
3BFF1000 7C1F7040
4180FFC4 38000000
7C0001A4 7C0101A4
7C0201A4 7C0301A4
7C0401A4 7C0501A4
7C0601A4 7C0701A4
7C0801A4 7C0901A4
7C0A01A4 7C0B01A4
7C0C01A4 7C0D01A4
7C0E01A4 7C0F01A4
7C1083A6 7C1283A6
7C1483A6 7C1683A6
7C108BA6 7C128BA6
7C148BA6 7C168BA6
7CFB03A6 4C000064


Code:
    mfmsr r31
    rlwinm r7, r31, 0, 17, 15
    mtmsr r7
    rlwinm r13, r7, 0, 28, 25
    mtsrr1 r13
    bcl 20, 4*cr7+so, 0x4
LABEL:
    mflr r2
    rlwinm r2, r2, 0, 0x3FFFFFFF
    addi r2, r2, LABELTWO-LABEL
    mtsrr0 r2
    rfi
LABELTWO:
    lis r2, 0x80
    ori r13, r2, 0x3F
    sync
    mtsdr1 r13
    isync
    mr r13, r2
    li r31, 0
    lis sp, 0xF
    ori sp, sp, 0xFFFF
    mtctr sp
    stw r31, 0 (r13)
SUPERLOOP:
    stwu r31, 0x4 (r13)
    bdnz SUPERLOOP
    li sp, 0x400
    mtctr sp
    lis r13, 0x0100
    lis sp, 0x6000
    stw sp, 0 (r13)
NOPPAGE:
    stwu sp, 0x4 (r13)
    dcbf 0, r13
    icbi 0, r13
    bdnz NOPPAGE
    lis r13, 0x0100
    lis r14, 0x1000
REALLOOP:
    rlwinm r10, r31, 32-6, 10, 25
    add r17, r2, r10
    b ENTERSEARCH
SEARCH:
    addi r17, r17, 0x8
ENTERSEARCH:
    lwz r15, 0 (r17)
    cmpwi r15, 0
    blt SEARCH
    rlwinm r30, r31, 32-22, 26, 31
    oris r30, r30, 0x8000
    stw r13, 0x4 (r17)
    eieio
    stw r30, 0 (r17)
    sync

    addi r31, r31, 0x1000
    cmplw r31, r14
    blt REALLOOP

    li r0, 0
    mtsr 0, r0
    mtsr 1, r0
    mtsr 2, r0
    mtsr 3, r0
    mtsr 4, r0
    mtsr 5, r0
    mtsr 6, r0
    mtsr 7, r0
    mtsr 8, r0
    mtsr 9, r0
    mtsr 10, r0
    mtsr 11, r0
    mtsr 12, r0
    mtsr 13, r0
    mtsr 14, r0
    mtsr 15, r0
    mtibatu 0, r0
    mtibatu 1, r0
    mtibatu 2, r0
    mtibatu 3, r0
    mtspr 560, r0
    mtspr 562, r0
    mtspr 564, r0
    mtspr 566, r0
    mtsrr1 r7
    rfi
Reply


Messages In This Thread
Nop world [Gaberboo] - by Gaberboo - 12-16-2022, 11:58 PM
RE: Nop world [Gaberboo] - by Vega - 12-17-2022, 01:48 AM
RE: Nop world [Gaberboo] - by Gaberboo - 12-17-2022, 01:54 AM
RE: Nop world [Gaberboo] - by Vega - 12-17-2022, 02:19 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)