Perfect License Unlocker + VR/BR Modifier [Vega]
#1
Perfect License Unlocker + VR/BR Modifier [Vega]

This code will do one or both of the following...
1. Unlock Everything for all 4 licenses FOR ALL YOUR DATA SAVES (with whatever Star Rank you want)
2. Set VR+BR for all 4 licenses FOR ALL YOUR DATA SAVES
3. You also have ability to choose whether or not to apply 100% Wii Wheel Stat (for those who want Golden Wii Wheel); FOR ALL YOUR DATA SAVES

Instructions for filling in U,W,X,Y,Z values:

Set your 'user option' (the U value)
0 = Unlock Everything + choose Star Rank, Set VR & BR
1 = Unlock Everything + choose Star Rank, no VR & BR changes
2 = Set VR & BR, do NOT unlock

If you chose to do option 0 or 1, please also set what Star Rank you want (the X value). Regardless of what rank you select, you will have the gold icons/trophies for all the licenses.
0 = 3 Stars
1 = 2 Star
2 = 1 Star
3 = A Rank (0 stars)
4 = B
5 = C
6 = D
7 = E
8 = F

Please also set whether or not you want 100% Wii Wheel Stat (the W value)
0 = No, leave it alone
1 = Remove 100% Wii Wheel Stat
2 = Yes, set 100% Wii Wheel Stat

If a license slot doesn't have a license made, the code will make a new blank license for that slot (with no Mii applied). That way all 4 License Slots for all your Data Saves will have everything unlocked.

If your user option (U value) is 2, just set the X value to anything random, doesn't matter as the code will NOT do any unlocking.

The YYYY value in the code is the VR rating and the ZZZZ value is the BR rating. If your user option (W value) is 1, then set the YYYY/ZZZZ values to anything random, it doesn't matter as the code will NOT apply the VR/BR changes.

Example YYYY/ZZZZ value:
270F = 9999 VR/BR

Instructions on using the code:
All you have to do is boot MKWii. After a few seconds (your TV screen may show some visual glitches, this is normal), you will automatically be returned to the Wii Main Menu. And... that's it!!! You're done. You only need this run this code once. Congratz.

NOTE: If using this on Dolphin, the automatic return to the Wii Menu will likely fail (emulation freezes/glitches) but the code will still take effect.

NTSC-U
C20095F4 00000042
3BE0000U 3BC00X00
3FA0YYYY 63BDZZZZ
3B80000W 3F600002
637B8000 3F408150
3F208016 3B003430
3B180001 2C18343A
41820020 2C183467
41820020 2C18353A
41820020 28183561
418101B4 48000018
3B003461 48000010
3B003530 48000008
3B003561 4800002D
2F746974 6C652F30
30303130 3030342F
35323464 34335858
2F646174 612F726B
7379732E 64617400
7C6802A6 B3030016
7C771B78 38800001
632CADBC 7D8803A6
4E800021 2C03FF96
41A2FF78 2C030000
41800144 7C761B78
7F44D378 7F65DB78
632CB15C 7D8803A6
4E800021 7C03D800
40820124 7EC3B378
632CB2E4 7D8803A6
4E800021 387A0008
3C800000 60848CC0
38A00004 3CC0524B
60C65044 90C30000
2C1C0000 4182001C
38000000 2C1C0001
4182000C 3C000001
6000869F 900300C0
2C1F0001 41820010
93A300B0 2C1F0002
41820040 3800FFFF
90030030 3C00031F
6000FFFC 90030034
38E301AF 38000020
7C0903A6 84070060
540000BE 60000080
54000626 7C00F378
90070000 4200FFE8
34A5FFFF 7C632214
4082FF84 7F43D378
389BFFFC 3D80801D
618C1C00 7D8803A6
4E800021 2C030000
4182005C 3C9A0002
90647FFC 7EE3BB78
38800002 632CADBC
7D8803A6 4E800021
2C030000 41800038
7C761B78 7F44D378
7F65DB78 632CB220
7D8803A6 4E800021
7C03D800 40820018
7EC3B378 632CB2E4
7D8803A6 4E800021
4BFFFE30 3D80801A
618C87B8 7D8803A6
4E800020 00000000

PAL
C2009634 00000042
3BE0000U 3BC00X00
3FA0YYYY 63BDZZZZ
3B80000W 3F600002
637B8000 3F408150
3F208016 3B003430
3B180001 2C18343A
41820020 2C183467
41820020 2C18353A
41820020 28183561
418101B4 48000018
3B003461 48000010
3B003530 48000008
3B003561 4800002D
2F746974 6C652F30
30303130 3030342F
35323464 34335858
2F646174 612F726B
7379732E 64617400
7C6802A6 B3030016
7C771B78 38800001
632CAE5C 7D8803A6
4E800021 2C03FF96
41A2FF78 2C030000
41800144 7C761B78
7F44D378 7F65DB78
632CB1FC 7D8803A6
4E800021 7C03D800
40820124 7EC3B378
632CB384 7D8803A6
4E800021 387A0008
3C800000 60848CC0
38A00004 3CC0524B
60C65044 90C30000
2C1C0000 4182001C
38000000 2C1C0001
4182000C 3C000001
6000869F 900300C0
2C1F0001 41820010
93A300B0 2C1F0002
41820040 3800FFFF
90030030 3C00031F
6000FFFC 90030034
38E301AF 38000020
7C0903A6 84070060
540000BE 60000080
54000626 7C00F378
90070000 4200FFE8
34A5FFFF 7C632214
4082FF84 7F43D378
389BFFFC 3D80801D
618C1CA0 7D8803A6
4E800021 2C030000
4182005C 3C9A0002
90647FFC 7EE3BB78
38800002 632CAE5C
7D8803A6 4E800021
2C030000 41800038
7C761B78 7F44D378
7F65DB78 632CB2C0
7D8803A6 4E800021
7C03D800 40820018
7EC3B378 632CB384
7D8803A6 4E800021
4BFFFE30 3D80801A
618C8858 7D8803A6
4E800020 00000000

NTSC-J
C2009590 00000042
3BE0000U 3BC00X00
3FA0YYYY 63BDZZZZ
3B80000W 3F600002
637B8000 3F408150
3F208016 3B003430
3B180001 2C18343A
41820020 2C183467
41820020 2C18353A
41820020 28183561
418101B4 48000018
3B003461 48000010
3B003530 48000008
3B003561 4800002D
2F746974 6C652F30
30303130 3030342F
35323464 34335858
2F646174 612F726B
7379732E 64617400
7C6802A6 B3030016
7C771B78 38800001
632CAD7C 7D8803A6
4E800021 2C03FF96
41A2FF78 2C030000
41800144 7C761B78
7F44D378 7F65DB78
632CB11C 7D8803A6
4E800021 7C03D800
40820124 7EC3B378
632CB2A4 7D8803A6
4E800021 387A0008
3C800000 60848CC0
38A00004 3CC0524B
60C65044 90C30000
2C1C0000 4182001C
38000000 2C1C0001
4182000C 3C000001
6000869F 900300C0
2C1F0001 41820010
93A300B0 2C1F0002
41820040 3800FFFF
90030030 3C00031F
6000FFFC 90030034
38E301AF 38000020
7C0903A6 84070060
540000BE 60000080
54000626 7C00F378
90070000 4200FFE8
34A5FFFF 7C632214
4082FF84 7F43D378
389BFFFC 3D80801D
618C1BC0 7D8803A6
4E800021 2C030000
4182005C 3C9A0002
90647FFC 7EE3BB78
38800002 632CAD7C
7D8803A6 4E800021
2C030000 41800038
7C761B78 7F44D378
7F65DB78 632CB1E0
7D8803A6 4E800021
7C03D800 40820018
7EC3B378 632CB2A4
7D8803A6 4E800021
4BFFFE30 3D80801A
618C8778 7D8803A6
4E800020 00000000

NTSC-K
C200973C 00000042
3BE0000U 3BC00X00
3FA0YYYY 63BDZZZZ
3B80000W 3F600002
637B8000 3F408150
3F208016 3B003430
3B180001 2C18343A
41820020 2C183467
41820020 2C18353A
41820020 28183561
418101B4 48000018
3B003461 48000010
3B003530 48000008
3B003561 4800002D
2F746974 6C652F30
30303130 3030342F
35323464 34335858
2F646174 612F726B
7379732E 64617400
7C6802A6 B3030016
7C771B78 38800001
632CAEF8 7D8803A6
4E800021 2C03FF96
41A2FF78 2C030000
41800144 7C761B78
7F44D378 7F65DB78
632CB298 7D8803A6
4E800021 7C03D800
40820124 7EC3B378
632CB420 7D8803A6
4E800021 387A0008
3C800000 60848CC0
38A00004 3CC0524B
60C65044 90C30000
2C1C0000 4182001C
38000000 2C1C0001
4182000C 3C000001
6000869F 900300C0
2C1F0001 41820010
93A300B0 2C1F0002
41820040 3800FFFF
90030030 3C00031F
6000FFFC 90030034
38E301AF 38000020
7C0903A6 84070060
540000BE 60000080
54000626 7C00F378
90070000 4200FFE8
34A5FFFF 7C632214
4082FF84 7F43D378
389BFFFC 3D80801D
618C1FFC 7D8803A6
4E800021 2C030000
4182005C 3C9A0002
90647FFC 7EE3BB78
38800002 632CAEF8
7D8803A6 4E800021
2C030000 41800038
7C761B78 7F44D378
7F65DB78 632CB35C
7D8803A6 4E800021
7C03D800 40820018
7EC3B378 632CB420
7D8803A6 4E800021
4BFFFE30 3D80801A
618C8BB4 7D8803A6
4E800020 00000000



Code creator: Vega
Code credits: RiiDefi (Helped w/ NetCalc function), Megazig (all other functions)



#START ASSEMBLY

#Address Ports
#800095F4 = NTSC-U
#80009634 = PAL
#80009590 = NTSC-J
#8000973C = NTSC-K

#Compilation Region Setting
.set region, '' #Fill in E, P, J, or K within the quotes for your region when Compiling! Lowercase letters can also be used.

#Macros and Statements
.macro call_link address
lis r12, \address@h
ori r12, r12, \address@l
mtlr r12
blrl
.endm

.macro call_isfs address
ori r12, r25, \address@l
mtlr r12
blrl
.endm

.macro call_nolink address
lis r12, \address@h
ori r12, r12, \address@l
mtlr r12
blr
.endm

.if (region == 'E' || region == 'e') #RMCE
.set ISFS_Open, 0xADBC
.set ISFS_Read, 0xB15C
.set ISFS_Write, 0xB220
.set ISFS_Close, 0xB2E4
.set Wii_Menu, 0x801A87B8
.set Egg_Alloc, 0x80229490
.set NET_Calc, 0x801D1C00
.elseif (region == 'P' || region == 'p') #RMCP
.set ISFS_Open, 0xAE5C
.set ISFS_Read, 0xB1FC
.set ISFS_Write, 0xB2C0
.set ISFS_Close, 0xB384
.set Wii_Menu, 0x801A8858
.set Egg_Alloc, 0x80229814
.set NET_Calc, 0x801D1CA0
.elseif (region == 'J' || region == 'j') #RMCJ
.set ISFS_Open, 0xAD7C
.set ISFS_Read, 0xB11C
.set ISFS_Write, 0xB1E0
.set ISFS_Close, 0xB2A4
.set Wii_Menu, 0x801A8778
.set Egg_Alloc, 0x80229734
.set NET_Calc, 0x801D1BC0
.elseif (region == 'K' || region == 'k') #RMCK
.set ISFS_Open, 0xAEF8
.set ISFS_Read, 0xB298
.set ISFS_Write, 0xB35C
.set ISFS_Close, 0xB420
.set Wii_Menu, 0x801A8BB4
.set Egg_Alloc, 0x80229B88
.set NET_Calc, 0x801D1FFC
.else # Invalid Region
.err
.endif

#Register Notes:
#r31 = User Option
#r30 = Star Rank
#r29 = VR+BR
#r28 = Wii Wheel % Option
#r27 = Data Save Size (0x28000)
#r26 = Pointer to read/write Data Save (0x81500000)
#r25 = ISFS Macro Upper 16 bits
#r24 = Data Save ASCII Edit
#r23 = File Address Pointer
#r22 = fd

#No need to backup anything. Code end in blr. Set User parameters
li r31, 0x0 #User Option, zero used just for compilation
li r30, 0x200 #User star rank option, one used just for compilation
lis r29, 0x270F #VR, random value for compilation
ori r29, r29, 0x270F #BR, random value for compilation
li r28, 0x2 #User wii wheel stat option, one used just for compilation

#Set Size & Heap for Data Save (set it at 0x81500000); has to be 32-byte aligned btw for ISFS Write & Read
lis r27, 0x0002
ori r27, r27, 0x8000
lis r26, 0x8150

#Set ISFS Macro Register, Setup/Check ASCII Mega Loop
lis r25, 0x8016

#41 = 3431 = RMCA
#42 = 3432 = RMCB
#43 = 3433 = RMCC
#44 = 3434 = RMCD
#45 = 3435 = RMCE
#46 = 3436 = RMCF
#47 = 3437 = RMCG
#48 = 3438 = RMCH
#49 = 3439 = RMCI
# first step
#4a = 3461 = RMCJ
#4b = 3462 = RMCK
#4c = 3463 = RMCL
#4d = 3464 = RMCM
#4e = 3465 = RMCN
#4f = 3466 = RMCO
# second step
#50 = 3530 = RMCP
#51 = 3531 = RMCQ
#52 = 3532 = RMCR
#53 = 3533 = RMCS
#54 = 3534 = RMCT
#55 = 3535 = RMCU
#56 = 3536 = RMCV
#57 = 3537 = RMCW
#58 = 3538 = RMCX
#59 = 3539 = RMCY
# third step
#5a = 3561 = RMCZ

li r24, 0x3430 #This is 1 before "41" in ASCII for Data Save ID

mega_loop:
addi r24, r24, 1

cmpwi r24, 0x343A
beq- first_step

cmpwi r24, 0x3467
beq- second_step

cmpwi r24, 0x353A
beq- third_step

cmplwi r24, 0x3561
bgt- launch_menu #Data Save checklist completed, we're completely done

b start_isfs_open

first_step:
li r24, 0x3461
b start_isfs_open

second_step:
li r24, 0x3530
b start_isfs_open

third_step:
li r24, 0x3561

#ISFS_Open
#r3 = File Path
#r4 = 1 for Read Permissions
start_isfs_open:
bl open_datasave
.string "/title/00010004/524d43XX/data/rksys.dat"
open_datasave:
mflr r3
sth r24, 0x16 (r3) #Update the file path with new ascii, no need for data cache flush. IOS_Open (within ISFS_Open) does it for us before file information is sent to the IPC Interface
mr r23, r3 #Backup file path address pointer
li r4, 0x1
call_isfs ISFS_Open
cmpwi r3, -106
beq- mega_loop #FFFFFF96 = File not found, try next Ascii
cmpwi r3, 0 #If negative value (not -106), then error occured.
blt- launch_menu
mr r22, r3 #Backup fd

#ISFS_Read
#r3 = fd
#r4 = Address Pointer to dump Data to
#r5 = Amount of Bytes to read/dump
mr r4, r26
mr r5, r27 #Backed up size arg from Egg Alloc moved to r5
call_isfs ISFS_Read
cmpw r3, r27
bne- launch_menu

#ISFS_Close
#r3 = fd
mr r3, r22
call_isfs ISFS_Close

#Pre-Loop Config
#r3 = RKPD
#r3 + 0x30 = Unlock doubleword bits (set to 0xFFFFFFFF031FFFFC)
#r3 + 0xB0 = VR+BR word
#r3 + 0xC0 = WIi WHeel % word
#r3 + 0x20F = Cup word
addi r3, r26, 0x0008 #This is the exact spot for RKPD of License 1
lis r4, 0
ori r4, r4, 0x8CC0 #Each License is separated by a gap of 0x8CC0 bytes, can't load this amount via Li. Load it via Lis then Ori.
li r5, 4 #For 4 Licenses
lis r6, 0x524B
ori r6, r6, 0x5044 #RKPD Magic ASCII

#License Loop
license_loop:

#No point checking for an existing license since all new licenses will be made, just force make it all. Exiting licenses will not be corrupted by this, it's just rewriting over the same word value that was already present.
stw r6, 0 (r3)

#Check Wii Wheel Option
#0 = Do not modify %
#1 = Reset it to 0 (remove wii wheel icon)
#2 = Set to 100% (gold wii wheel icon)
cmpwi r28, 0
beq- check_user_option
li r0, 0
cmpwi r28, 1
beq- update_wheel
lis r0, 0x0001
ori r0, r0, 0x869F #Apply Wii Wheel 100% Stat
update_wheel:
stw r0, 0xC0 (r3)

#Check User Option
#0 = Unlock everything, set VR+BR
#1 = Unlock everything, do NOT set VR+BR
#2 = Do NOT unlock, set VR+BR
check_user_option:
cmpwi r31, 1
beq- do_unlocks
stw r29, 0xB0 (r3) #Write VR+BR
cmpwi r31, 2
beq- decrement_license_loop

#Unlock everything
do_unlocks:
li r0, -1
stw r0, 0x30 (r3)
lis r0, 0x031F
ori r0, r0, 0xFFFC
stw r0, 0x34 (r3)

#Apply Star Rank; setup Cup Loop
#Cup word contents
#Bits 0 & 1 = Trophy Cup color. 0x0 = Gold, 0x1 = Silver, 0x2 = Bronaze, 0x3 = No Cup
#Bits 2 thru 18 = Unknown
#Bits 19 thru 23 = Star Rank. 0x0 = 3 stars, 0x1 = 2, 0x2 = 1, 0x3 = A, 0x4 = B, 0x5 = C, 0x6 = D, 0x7 = E, 0x8 = F
#Bit 24 = Completion flag
#Bits 25 thru 31 = Unknown
addi r7, r3, 0x1AF #0x20F - 0x60
li r0, 32 #Loop 32 times for 32 cups per license
mtctr r0

#Cup Loop
#Load word with update address
#Set Gold Color Trophy
#Set Completion Flag high
#Remove previous Star Rank
#Set new Star Rank
#Repeat
cup_loop:
lwzu r0, 0x60 (r7)
rlwinm r0, r0, 0, 0x3FFFFFFF
ori r0, r0, 0x0080
rlwinm r0, r0, 0, 0xFFFFF0FF
or r0, r0, r30
stw r0, 0 (r7)
bdnz+ cup_loop

#Decrement License Loop
decrement_license_loop:
subic. r5, r5, 1
add r3, r3, r4 #Increment by 0x8CC0 to move onto next license
bne+ license_loop

#NETCalcCRC32
#r3 = File Contents Address Pointer
#r4 = Amount of Bytes to use for Calculation
#r3's return value = new Checksum
mr r3, r26 #Move backed up Heap Address Pointer to r3
addi r4, r27, -4 #Subtract 0x4 from data save size alloc to get byte size amount, 0x27FFC
call_link NET_Calc
cmpwi r3, 0
beq- launch_menu

#Write new Checksum
addis r4, r26, 0x0002 #Add 0x00020000 to Pointer
stw r3, 0x7FFC (r4) #Store CRC32 Word to spot (which is final word location of entire contents)

#ISFS_Open
#r3 = File Path
#r4 = 2 for Write Permissions
mr r3, r23 #Move backed up file path address pointer to r3
li r4, 2
call_isfs ISFS_Open
cmpwi r3, 0
blt- launch_menu
mr r22, r3 #Backup fd

#ISFS_Write
#r3 = fd
#r4 = Address Pointer where String Data that will used for writes is located
#r5 = Amount of Bytes to Write to File
mr r4, r26 #r3 already set by ISFS_Open return value. Move backed up Heap Address Pointer to r4
mr r5, r27 #Move backed up Byte Write Size to r5
call_isfs ISFS_Write
cmpw r3, r27 #r3 should return r5's aka r27's value. If not, then error occured.
bne- launch_menu

#ISFS_Close
#r3 = fd
mr r3, r22
call_isfs ISFS_Close
b mega_loop #Start Loop all over again

#Return to Wii Menu. No need to free the Heap.
launch_menu:
call_nolink Wii_Menu

#END ASSEMBLY
Reply
#2
Y'all better use this it's a one of a kind Tongue

Great job!
Reply
#3
(04-18-2019, 08:45 PM)Dorian Wrote: Y'all better use this it's a one of a kind Tongue

Great job!

Thanks Dorian.  Tongue
Reply
#4
BIG BUMP!!!

Finally stopped being lazy and added Star Rank option. All other unlocking codes have now been moved to incomplete/outdated sub forum.
Reply
#5
Yet another bump. Added ability to choose whether or not you want 100% Wii Wheel Stat (for Golden Wii Wheel icon online)
Reply
#6
Is it possible to choose the license used for this code?
Reply
#7
Yes it's possible, but it's not something I want to do as I don't see a good enough reason to. Plus the code already has too many options as it is.
Reply
#8
What is the best method to upload this code to wii? It’s been a while and seems I’ve lost all progress on license. Never uploaded codes so any direction will be greatly appreciated.
Reply
#9
(11-15-2020, 03:22 AM)mvera2553 Wrote: What is the best method to upload this code to wii? It’s been a while and seems I’ve lost all progress on license. Never uploaded codes so any direction will be greatly appreciated.
In my opinion, the best way to get this code on wii is thru a method called riivolution. Make a GCT file and run it threw riivolution, I am pretty sure the MKWii.com also has some tutorials on this subject as well.
~MarioKartWii.com #1~
Reply
#10
Why bother with codes at all? Just use my HBC app. Tongue

https://mkwii.com/showthread.php?tid=1491
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)