• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Completed GeckoLoader v7.1.0 - The Ultimate Gecko Code Loader

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
GeckoLoader v7.1.0

GeckoLoader is the dynamic gecko code allocator made by myself in C++, allowing much more space for gecko codes than previously possible by standard means. It also works in harmony with another codehandler in one ISO. This is possible because GeckoLoader dynamically relocates its own codehandler to an allocated point in the game's RAM, and uses a slightly different hook by default.

GeckoLoader is utilized by interfacing with the CLI. Simply pass a DOL, and a gecko codelist in the following format:
"geckoloader <dolfile> <codelist> <options>"

Annotation 2020-06-04 230122.png


Or you can use GeckoLoader's GUI, which is much more user friendly, but can't be automated by scripts:

VuHxAnU - Imgur.png

GeckoLoader is capable of patching most DOL files without any options given by the user, and it will even automatically choose some parameters that are optimal to the given data on its own.
But sometimes, you need to tell GeckoLoader what to do in order to patch the game the way you need it to. Great examples of when you may need to specify options are:

  1. Allocating more memory than there are codes, giving yourself global memory to work with in game.
  2. The default hook type isn't found in the executable or you have a better place to hook the codehandler.
  3. You want to optimize the code list, protect the game from user codes, etc.
You can change these things and more using the options GeckoLoader has to offer.
 
Last edited:

DRGN

Technowizard
Moderator
Joined
Aug 20, 2005
Messages
2,178
Location
Sacramento, CA
Nice!

Sounds like a cool methodology/feature that might be useful to add to MCM at some point. I can't remember if he documented it somewhere, but UnclePunch UnclePunch has a great method for injecting codes into the game as well, which also doesn't require finding much free space in the DOL. His implementation of the codehandler is also really great in that it doesn't run on every game frame, like it usually does with Dolphin or MCM. It also allows you to include a codelist in the root of the disc, rather than storing it externally or within the DOL.

So basically you're reducing the size of the heap, correct? What screen were you on when you had 0x40000 bytes reserved? Do you just do some trial and error to estimate the max amount that a game might need for the heap, and therefore the smallest size you can push it down to? The CSS is actually pretty intense in Melee, partly because the CSS file is so large, and partly because the game pre-loads several character dats for each character when one is chosen. The characters requiring the most space to select/pre-load are Zelda/Peach/Roy/Marth, so you could try that combination on the CSS and see if you still get that kind of space.
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
Yes, I am re-writing the pointer to the heap before the game officially recognizes it, therefore causing the game to think it has less space than what it actually has to use. As for the size stuff, the game appears to have a hard coded limit that it checks for during game boot and if it finds that there is less space than the needed amount, it crashes with debug information on the Arena's size, the time, and other things. I must note that this appears without any codes to make it, so this is something I find interesting for sure. I believe this limit is to keep the game from crashing later on due to memory limits, and such. Other games (like Super Mario Sunshine, or Mario Kart Wii for instance) don't seem to have this check, so the game will continue even if it doesn't have enough space to load levels and stuff later on, so they will just crash without warning. I will try that combination though and let you know the results.
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
GeckoLoader v1.0 is now out!

Yes, it is no longer called SME-CODE,
I felt it should be renamed to something less cumbersome
to go with the big update.


It also is I consider, a whole new tool at this point
having been written in C and also having the exe be remade
so drastically, hence it still being v1.0


Changes include a much smarter way of detecting what console the game is for,
Better cache handling, and the codehandler now gets invoked
on the GeckoLoader's exit, meaning you can patch code that normally gets run
on boot well before the codehandler would normally initialize,
and most importantly, a new codehandler altogether, which
has been optimized, and also properly handles the cache
unlike certain other codehandlers, including the one this used to use.
(The codehandler is missing 1 codetype, being the 40... base address type.
This will be added in the future)


Source binary files can be found here
Release can be found here
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
GeckoLoader v2.0.2 is now out!

Changes include refactored C code for Geckoloader, meaning
the code is slightly more efficient now, and the source more readable!

main.exe has been renamed to GeckoLoader.exe,
and is
now a command line tool!
Options include the verbosity of the info printed,
the allocation size (if 0 or excluded, the size is auto),
and what codes get included when a txt file is parsed.
(txt file must follow the Ocarina Manager format)


Because yes, gecko txt files can now be used!

Source files can be found here
Release build can be found here
 
Last edited:

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
GeckoLoader v4.1 is now out!

Changes include:
1. Dol file is now properly aligned, fixing random crashes

2. Codehandler is moved to the allocation as well when using the Arena
3. The main kernel is rewritten in C++, compiled under -Os
4. Multiple options added to the compiler

5. Another pointer is now taken into consideration during heap allocation


Source files can be found here
Release build can be found here
 

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
Hey, I tried the latest version from your github (5.1.1), but while it says the installation was successful, I can't seem to use it?
It says that GeckoLoader is not recognized as an internal or external command. Am I missing some pre-requisite or something?
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
It sounds like it wasn't added to your PATH variable, can you inform me of your setup, such as OS and admin privileges? If you know how, you can also manually check your PATH variable to see if GeckoLoader is added. (There are lots of tutorials on the web)
 

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
I just checked it, it's added, and also checked out the path in roaming, everything seems to present. (Basically a copy of what the github download provided minus the installer.exe)
Is that how it's supposed to be? Because it's still giving the same response as I posted before when trying to use it in cmd.

EDIT: Oh yeah, I'm on windows 10 and installed+ran as Admin.
 
Last edited:

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
That's how it's supposed to be... :ohwell:
I wonder, did you have the specified cmd window open before or after you installed GeckoLoader? Also, is python 3 (preferably 3.8) installed on your PC (and added to path)
 

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
Tried with a new cmd window after installing + rebooting my computer and then again since it didn't work.
And no, I don't have any version of python on this computer. I'm on their website rn, and it says x64 is for AMD, is this still the download I'd want if I'm on an intel CPU?
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
The documentation states that AMD x64 binaries will also work on Intel CPUs, so yes.

Make sure while you are installing python that you click the checkbox that adds python to PATH

The reason you have to have python installed now is because I have stopped compiling GeckoLoader into an exe, as it bloats the filesize by about 1000x, heavily stunts performance, and also was x64 Windows only, not to mention it was hard to maintain anyway as python scripts aren't designed to be packaged as an exe :p
 

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
I see, well, now it seems to "work", but it keeps saying "No module named 'chardet'" when I'm trying to use it. Is there something else that I'm lacking?
 
Last edited:

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
Ah yes, I forgot this last thing

In cmd, enter the commands:
pip install chardet
pip install colorama

This will install chardet and colorama, thus GeckoLoader should become very happy

I plan to integrate the code I need from chardet directly into GeckoLoader so that no module imports are needed (colorama is optional, and is what colors the text), but for now just enter the above commands
 
Last edited:

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
Uh, you sure there isn't anything else? Or am I doing something wrong here:
1598084217701.png

(happens regardless of command)
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
I'm sorry lol, I keep forgetting that requests is not part of the standard library oof, just do: pip install requests

I honestly am going to improve on this setup next time around lol
 

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
Well, that took care of that, but now I'm faced with this:
1598084887611.png

Is there anything else possibly?

EDIT: Also no need to apologize, I'm just really happy you're putting in work here lol, it's very much appreciated.
 
Last edited:

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
Basically, just do a pip install command for anymore that pop up, so for this do pip install bs4

Also thank you for the understanding
 

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
That seemed to be the last of it, now I just gotta figure out how to make a codelist. There was an option for .txt, could I just use something similar to what I'd use in Dolphin?

Because trying to create a .gct with GeckoCodes.org online app, and it's not recognizing some of the codes (I'm guessing I can't have multiple codes under 1 name?)
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
You can do 2 things for txt files, create a text file using Ocarina Manager, or you can create one using the dolphin format.

You can also use Ocarina Manager to convert your codelist into a gct if you desire.

There is one last option which is to pass a folder as the codelist, and have the given folder be filled with your txt and gct codes
 

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
Alright, I got it working, thanks a lot!

However, while I eventually got .gcts working. .txts in Dolphins format do not.
If I add [Gecko] at the top, like Dolphin does it, it doesn't wanna build at all. But if I remove it, it does, however none of the codes work in-game.
Is this a bug?
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
Yes, I probably have overlooked something, if it's possible, send me your codelist so I can debug
 

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
There's really a lot, so put a few instead (tested so it still yields the same issue though).

Further more, what's really strange, is that I can't get .gct working at all anymore either.
I did it the exact same way I did it before, but less codes even, and tried Ocarina Manager + GeckoCodes.org, and it still gives me this issue.
Game doesn't crash, I can confirm that the .dol is the new one and that it's larger, but codes just don't load. It's the vanilla game.
 

Attachments

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
That's very interesting, I will need to see the dol file, for now tho, its not a good idea to use the online converter as it has parsing issues for gets, use Ocarina manager instead

And to be clear this is for melee?
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
Well, I can't test that game myself, so for a proper conclusion we need to make sure what you have set up is proper
 

DRGN

Technowizard
Moderator
Joined
Aug 20, 2005
Messages
2,178
Location
Sacramento, CA
The documentation states that AMD x64 binaries will also work on Intel CPUs, so yes.

Make sure while you are installing python that you click the checkbox that adds python to PATH

The reason you have to have python installed now is because I have stopped compiling GeckoLoader into an exe, as it bloats the filesize by about 1000x, heavily stunts performance, and also was x64 Windows only, not to mention it was hard to maintain anyway as python scripts aren't designed to be packaged as an exe :p
What were you using to compile it before? I use cx_freeze.

You should generally avoid doing imports like "from _ import *", and be explicit with your imports, for example: "from binascii import hexlify, unhexlify". Using the ampersand (import everything) method can make it ambiguous for where objects or other components are coming from, and can even lead to namespace collisions. It can also be inefficient for compiling it, since the program doing so may think all of those extra parts are needed and should be included. You could see if changing your import methods reduces your compiled filesize.
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
I've been making those exact fixes, as I've been cleaning up and rewriting most everything. We will see, also I was using pyinstaller iirc
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
GeckoLoader v6.0.0 is out!

This release brings awesome new features such as:​
  1. The ability to hook the codehandler to almost any instruction​
  2. The ability to choose between the VI, GX, and PAD hooks when auto searching a hook​
  3. Optional codelist encryption* (sometimes you want to deter snoopers)​
  4. The ability to block user codes* (So people cant mod your mod easily)​
*ARENA patching only

There have also been a lot of optimizations and refactoring of code. There's even an installer to add the program to the Windows PATH variable and copy it to the user's roaming data. (New as of v5.1.0)

This is likely going to be the last version of GeckoLoader. If there are anymore it will be emergency hotfixes​
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
GeckoLoader v7.0.0 is out!

This release was brought as an emergency fix for optimizing and legacy patching, but it also contains a few new upgrades:
  1. GUI with Dark Theme and Session open/save functionality​
  2. Fancy installer​
  3. Linux x64 support​
The GUI was a direct response to enough people requesting it. I really hope this is the last version I have to make lol​
 

JoshuaMK

Smash Apprentice
Joined
May 19, 2019
Messages
75
GeckoLoader v7.1.0 is out!

I really hope this is the final release.. a bug was brought to my attention so I had to fix it ofc :p

I did make some other changes while I was at it, which can be seen below:
  • Removed LEGACY patching; it was buggy, a limitation, and loaders never enjoyed it. Oh well :p
  • Refactored code (For the reverse engineers and programmers ofc!)​
Now that this is out of the way... pleeease let this be the final version lol​
 
Top Bottom