Domain Name Changer [Vega]
#1
Domain Name Changer [Vega]

This code will allow you to edit in a custom domain name for your game for use to connect to a DWC-Emulator based Wii server. You will also need to use the No SSL code located HERE.

This code works on every Wii game, not just MKWii.

X Values = Domain Name (in ASCII Hex) Use any ASCII to Hex Online Converter

Any remaining unused X values must be set to zero.

You can put in any custom domain in the code that you want as long as it doesn't exceed the original domain's length (nintendowifi.net) of 16 characters.

Example Domain (example.com)
X values would be 6578616D 706C652E 636F6D00 00000000

Region-Free
C0000000 0000001A
3C004E80 60000020
900F0000 BFC1FFF8
7FC802A6 48000019
XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX
00000000 7D8802A6
3960FFFF 386CFFFF
8C030001 2C000000
396B0001 4082FFF4
3D408000 614A2FFF
3D202E6E 6129696E
3C00017F 6000CFFC
7C0903A6 840A0001
7C004800 40A20054
7D435378 38ACFFFF
7D7F5B78 8C050001
9C030001 37FFFFFF
4082FFF4 20AB0010
38A50001 7C0518AE
2C00002F 4182000C
98030001 4800001C
7CA51A14 38A5FFFF
8C050001 9C030001
2C000000 4082FFF4
4200FFA4 7FC803A6
BBC1FFF8 4E800020



Code creator: Vega



#START ASSEMBLY (C0)

#Register Notes
#r12 = Pointer to Domain Name
#r11 = Domain Byte Counter
#r10 = 0x80002FFF
#r9 = ASCII word for comparison
#CTR = 0x017FCFFC (main loop tracker/decrementer)

#Make it where C0 code only executes once
lis r0, 0x4E80
ori r0, r0, 0x0020
stw r0, 0 (r15)

#Backup r31, r30, & LR
stmw r30, -0x8 (sp)
mflr r30

#Set Domain Name
bl the_domain
.llong 0x6161616161616161 #Garbage domain used for compilation
.llong 0x2E636F6D00000000
.zero 4
the_domain:
mflr r12

#Calculate User's Domain Length in Bytes
li r11, -1
addi r3, r12, -1

domain_length:
lbzu r0, 0x1 (r3)
cmpwi r0, 0
addi r11, r11, 1
bne+ domain_length

#Set Beginning Address, ASCII, & Loop Tracker
lis r10, 0x8000
ori r10, r10, 0x2FFF #Start Load Address is 0x80003000
lis r9, 0x2E6E
ori r9, r9, 0x696E #ASCII for ".nin"
lis r0, 0x017F #0x817FFFFC - 0x80003000 = 0x17FCFFC
ori r0, r0, 0xCFFC
mtctr r0

#Main Loop
main_loop:
lwzu r0, 0x1 (r10)
cmpw r0, r9
bne+ decrement

#Domain String Found, edit in new Domain
mr r3, r10 #Make sure r10's current value doesn't get modified
addi r5, r12, -1 #Set Loop Load Address
mr r31, r11 #Domain length in bytes used for byte loop amount

edit_domain:
lbzu r0, 0x1 (r5)
stbu r0, 0x1 (r3)
subic. r31, r31, 1
bne+ edit_domain

#Check for Slash (sub directories) in URL; important FYI: r3 currently points to last byte of new domain!
subfic r5, r11, 16 #16 - r11 = r5; r5 is differnce of old vs new domain length
addi r5, r5, 1 #Add 1 to the difference
lbzx r0, r5, r3 #Load the character immediate after nintendowifi.net (will be slash or null)
cmpwi r0, 0x2F #Compare value to ASCII forward slash
beq- fix_subdirectories #If equal, we need to fix the URL

#No Slash (sub directories), simply append a null
zero_fill:
stb r0, 0x1 (r3) #r0 will be null since its not 0x2F
b decrement

#Fix Subdirectories part of URL (shift it over left); computer length of it first
fix_subdirectories:
add r5, r5, r3 #Will point to slash after nintendowifi.net
addi r5, r5, -1 #Loop first load address must be -1 in reference to Memmove r4's argument

url_shift_loop:
lbzu r0, 0x1 (r5)
stbu r0, 0x1 (r3)
cmpwi r0, 0 #Since cmpwi is after the stbu, it will auto append null at end
bne+ url_shift_loop

decrement:
bdnz+ main_loop

#Restore r31, r30, & LR
mtlr r30
lmw r30, -0x8 (sp)

#End C0
#blr #Uncomment if not using pyii to compile
Reply
#2
deleted
Reply
#3
(06-20-2019, 03:12 PM)Cameron_MKW Wrote: Nice!! This is awesome. One question, why would the domain need to be less than the original 16? Just wondering.

The new domain can be equal to 16 characters in length, just not anymore.

The original domain in any Wii game that used Nintendo WFC is nintendowifi.net (which is 16 ascii characters in length aka 32 bytes in decimal amount. Which is why there is 32 X's in the code). You cannot exceed this because there simply isn't enough space in memory for the extended URL to fit.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)