LE-CODE Debugging
#1
So I managed to find LE-CODE's start address when it hooks in during the game load, being at address 0x808DD478 (NTSC-U)
Let's let this be the start of newfound knowledge of LE-CODE let alone MKW!

Anything discovered about LE-CODE/MKW through this please comment below and I will edit it into this post Smile



-- LE-CODE Start Address (NTSC-U) = 0x808DD478

-- Code List length is no longer an issue for LE-CODE based distributions. Simply extend the le-code.bin file with your code list and change the file size header to match. Then patch a main.dol with a special boot code and LE-CODE. There is room for 73000+ lines of code within the buffer as LE-CODE currently stands.
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#2
73k lines?! Haven't seen GCTs that size since something like Legacy XP!
Reply
#3
Hi everyone, 

someone just told me about this thread and I wanted to leave a note about that before people start using that for actual custom distributions and run into trouble.

While the information that JoshuaMK found out is absolutely correct (0x808DD478 is the start address of the NTSC-U LE-CODE), there is a caveat when you use this additional space. The memory block that the LE-CODE is loaded into, starting at 0x808DD478, is not only used by the LE-CODE, but various locations of that space are also used for the Wiimmfi update (the run-time code that gets downloaded and executed every time you connect to Wiimmfi), which we are using to update the game and keep it secure and add more Wiimmfi features. 

That means, while you can safely use this method for offline testing, and while it appears to work reliably, any change Wiimm and me do to the update code on Wiimmfi can potentially make the game start using the space it believes is unused (even if you do change the file header!), which would either corrupt your custom code as soon as you go online, or would break the Wiimmfi update code, resulting in you being unable to connect to Wiimmfi. 

While this does work properly with the current version of Wiimmfi and the LE-CODE, we can give absolutely no guarantee that distributions patched with this hack will continue to be able to connect to Wiimmfi in the future, and thus I'd like to discourage distribution creators from using this hack if you want to have your distribution work reliably on Wiimmfi in the future, because it WILL break at some point when the game tries to use memory space that should be free to use.
Reply
#4
(12-29-2019, 04:09 PM)Leseratte10 Wrote: Hi everyone, 

someone just told me about this thread and I wanted to leave a note about that before people start using that for actual custom distributions and run into trouble.

While the information that JoshuaMK found out is absolutely correct (0x808DD478 is the start address of the NTSC-U LE-CODE), there is a caveat when you use this additional space. The memory block that the LE-CODE is loaded into, starting at 0x808DD478, is not only used by the LE-CODE, but various locations of that space are also used for the Wiimmfi update (the run-time code that gets downloaded and executed every time you connect to Wiimmfi), which we are using to update the game and keep it secure and add more Wiimmfi features. 

That means, while you can safely use this method for offline testing, and while it appears to work reliably, any change Wiimm and me do to the update code on Wiimmfi can potentially make the game start using the space it believes is unused (even if you do change the file header!), which would either corrupt your custom code as soon as you go online, or would break the Wiimmfi update code, resulting in you being unable to connect to Wiimmfi. 

While this does work properly with the current version of Wiimmfi and the LE-CODE, we can give absolutely no guarantee that distributions patched with this hack will continue to be able to connect to Wiimmfi in the future, and thus I'd like to discourage distribution creators from using this hack if you want to have your distribution work reliably on Wiimmfi in the future, because it WILL break at some point when the game tries to use memory space that should be free to use.

Well, how much space does wiimmfi use out of this free space? And where exactly within the buffer? Because I would gladly mod this hack to simply relocate the memory
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#5
At the moment, Wiimmfi uses memory at the end of that free space, and LE-CODE uses memory at the start. Thus, adding code right after the LE-CODE is probably fine within the near future. However, depending on the amount of code you add, and the amount of code we add to Wiimmfi in the future. you might run into trouble.

I'm not saying you absolutely must not use this patch, but that memory block was intended to be used by LE-CODE and Wiimmfi only, and we can't consider any custom codes that people add there when we update the LE-CODE or the Wiimmfi updater. Just saying that just because there are 73k lines of code space today, doesn't mean that there will be 73k lines of code space tomorrow or next week. We are expanding the wiimmfi updater with more code fairly regularly for improvements, new statistics, or other things, and if a distribution places its own code in that space Wiimmfi uses will cause trouble.

If you do want to have a custom buffer to use for cheat codes, I would recommend taking a chunk off the heap prior to the start of the game. Wiimms tools ( https://szs.wiimm.de/info/add-section.html ) together with the parameter "--gct-move" can do that automatically. That way you are using space on the heap, and not space that can potentially be used by Wiimmfi in the future.
Reply
#6
i have a question about LE-CODE...

is it possible to disable the new login method,
so that we can play a LE-CODE based distribution on the dwc_network_server_emulator?

sorry for my english i am from germany
Reply
#7
(07-30-2020, 08:39 PM)einfach_nur_ich Wrote: i have a question about LE-CODE...

is it possible to disable the new login method,
so that we can play a LE-CODE based distribution on the dwc_network_server_emulator?

sorry for my english i am from germany

Open the binary in a hex editor, search for "48 00 00 6d 80 01 00 0c", replace with "60 00 00 00 80 01 00 0c".
That should disable all the Wiimmfi patches and you can use a normal patch for the dwc_network_server_emulator.

However, I have never tested this method. I don't know if it works properly, I don't know if that server supports everything the LE-CODE needs, and we can't give support for a setup like that, so if something doesn't work, you are on your own unless you can reproduce the issue on Wiimmfi.
Reply
#8
(08-01-2020, 08:10 PM)Leseratte10 Wrote:
(07-30-2020, 08:39 PM)einfach_nur_ich Wrote: i have a question about LE-CODE...

is it possible to disable the new login method,
so that we can play a LE-CODE based distribution on the dwc_network_server_emulator?

sorry for my english i am from germany

Open the binary in a hex editor, search for "48 00 00 6d 80 01 00 0c", replace with "60 00 00 00 80 01 00 0c".
That should disable all the Wiimmfi patches and you can use a normal patch for the dwc_network_server_emulator.

However, I have never tested this method. I don't know if it works properly, I don't know if that server supports everything the LE-CODE needs, and we can't give support for a setup like that, so if something doesn't work, you are on your own unless you can reproduce the issue on Wiimmfi.
Thank you very much!

Login works!  Smile

I will do more tests on the weekend...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)