A mod (also known as an extension, hack, or plugin) is a piece of software that modifies another piece of software. Usually in games, this is done through the use of a mod loader; something that, well, loads mods. Some games, like Friday Night Funkin and Skyrim have built-in support for loading mods, as well as built-in interfaces for working with mods, which make modding very easy and simple. Geometry Dash, unfortunately, does not have any built-in mod support. However, using very clever methods such as DLL injection and hooking, we can create an external mod loader. This does come with some disadvantages like the lack of a stable API (meaning it’s not guaranteed to work between versions), but it also comes with some huge advantages, such as fully unrestricted access (which might also be seen as a huge disadvantage, depending on who and when you ask). A mod can do basically anything, within the limits of computer hardware. But how exactly does a mod work? The actual executable file for Geometry Dash that you have installed on your computer is what is known as an executable binary program. If you open the game’s executable with a text editor, you will see a bunch of random-looking characters. This is, in fact, the game’s code; however it is not its source code. This is binary code, the raw low-level instructions your CPU executes. If we had the game’s source code, we could create a fork of it and add built-in mod loader support. However, as Geometry Dash is closed-source, we have to deal with modifying the binary code.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/geode-sdk/docs/llms.txt
Use this file to discover all available pages before exploring further.
Modifying binary code is a bit difficult, however, as it is not meant to be for humans; binary code is strictly for computers, and as such it is unreadable and unmodifiable for a human. Binary code is also platform-specific: a mod written purely in binary would only work on one platform, and could not be ported over to others without fully rewriting the entire mod from the ground up.
As a historical curiosity, it should be noted that mods used to be written fully in binary. Or, more accurately, they were written in assembly, which is a (somewhat) human-readable form of binary. However, to make it very clear, no sane person does this anymore. Working with binary code directly is nowadays only done in rare cases, which will be explained in Chapter 1.2.
But what’s the alternative? We can make modding much easier by knowing two facts:
- Binary code is produced through compilation.
- Geometry Dash is written in C++.
There is one platform that doesn’t have dynamic library support: iOS (unless jailbroken). Modding on iOS without jailbreaking requires basically baking all the mods you want into a premodified game, like iCreate has done, but a general mod loader like Geode will likely never see iOS support unless some major changes to the OS happen first.
If you are interested in learning more about binary injection, the Wikipedia article on DLL injection is a pretty good place to start.
LoadLibrary function. This can also be done an arbitary number of times within our initial library, so we can for example automatically find all the .DLL files in some directory and load them. This is how old 2.1 mod loaders such as Mega Hack v7 used to work: they would search for all of the .dll files in a predefined folder like extensions and call LoadLibrary on them.
At this point, we’ve gotten our library up and running, and are ready to start writing some code. However, now we enter a new problem: how do we actually do things?
Chapter 1.2: Hooking & Patching