Skip to content

Instantly share code, notes, and snippets.

@HGStyle
Last active March 2, 2024 17:53
Show Gist options
  • Save HGStyle/69f7fbce6eb9d2f096605b44acd128e4 to your computer and use it in GitHub Desktop.
Save HGStyle/69f7fbce6eb9d2f096605b44acd128e4 to your computer and use it in GitHub Desktop.
import re # Required by the function
import os # Required by the interface
def find_gdps_endpoint(data: bytes): # Input data should be the bytes of the whole binary file !
# DO NOT REMOVE THE FOLLOWING COMMENT
# THIS FUNCTION IS COPYRIGHTED UNDER MIT LICENSE BY HGSTYLE 2023-end of the time
# READ THE LICENSE AT: https://hgstyle.mit-license.org/
# Get the URLs using a regex that I copy-pasted from Stack Overflow
result = re.findall(r"\w+://\w+\.\w+\.\w+/?[\w\.\?=#]*".encode(), data)
# Set the domains to exclude
domains_to_exclude = [
b"robtopgames.com", # RobTop's website (used below the user icon on the main screen)
b"youtube.com", # YouTube (used to credit main levels tracks artists)
b"facebook.com", # Facebook (same as YouTube)
b"newgrounds.com", # Newgrounds (same as Youtube)
b"haxx.se", # Haxx group (they are the creators of cURL, the library used to send HTTP requests, unknown use in-game)
b"openssl.org", # OpenSSL (the OpenSSL project used to send (inexistant) secure HTTPS requests, unknown use in-game)
b"twitter.com", # Twitter (same as YouTube - wait actually it's now called X)
b"twitch.tv", # Twitch (same as YouTube)
b"apple.com", # Apple (used in the iOS version of Geometry Dash for some reason, unknown use in-game)
b"steampowered.com", # Steam (used too in the Steam version of Geometry Dash, unknown use in-game)
b"w3.org", # W3 group (they are the group that defines the web standarts, unknown use in-game)
b"cocos2d-x.org", # Cocos2d X (used in the settings help screen to credit the creators of the game engine used by Geometry Dash)
b"discord.gg", # Discord short links (I predict that there will be Discord links in GD 2.2)
b"discord.com", # Discord app (see Discord short links)
b"discordapp.com", # Discord app (see Discord short links)
b"discord.app", # Discord app (see Discord short links)
b"cocos.com", # Cocos (just in case the URL is updated in 2.2)
b"fmod.com", # FMOD (just in case GD 2.2 credits FMOD)
b"github.com", # GitHub (just in case GD 2.2 credits people or projects and gave their GitHub like in GDBrowser)
b"curl.se", # cURL (just in case the cURL link is updated in 2.2)
b"x.com", # X (just in case the link gets updated in 2.2 - old name Twitter)
b"geometrydash.com", # Exclued for now since it's completely useless right now, we'll see in 2.21 if it is usefull this time...
] # EDIT: the game got updated to 2.2 (rn its 2.201) but i have dont want to look now to see if these domains are present
# Filter the links using the domain exclusion list
for domain in domains_to_exclude:
result = [url for url in result if domain not in url]
# Filter the links to remove the useless links to the files folder and the links to the "databas" folder
# with a typing error (this last one is unused)
urls = [url for url in result if not((b"/files" in url) or (b"/databas/" in url + b'/'))]
if not urls: # No match
return None
# Return the last URL of the list (since the last one is generaly more accruate than the first one), decode it and handle decoding errors by
# replacing undecodable characters by unicode 0xFFFD (official replacement character), then split to the first 0xFFFD character and keep only
# the first part of it, and finally removes the http:// and https:// schemes if one is present
return urls[-1].decode(errors="replace").split("\uFFFD")[0].replace('http://', '').replace('https://', '')
if __name__ == "__main__":
print("TOOL CREATED BY HGSTYLE AND COPYRIGHTED UNDER MIT LICENSE 2023-end of time")
print("INFO ABOUT GD BINARY")
print("On Android, its the libcocos2dcpp.so")
print("On Windows, its the file ending by .exe (by default GeometryDash.exe)")
print("On MacOS and iOS, its the GeometryJump file")
print("On MacOS, make sure to NOT put the path of the .app file !")
print("It should be the path of the file called GeometryJump that you can find inside using tools like 7-zip.")
print("NOTE: It may work weirdly on GDPSes hosted on by FruitSpace")
while True:
path = input("Path to GD binary: ")
if os.path.exists(path):
print("Endpoint is", find_gdps_endpoint(open(path, 'rb').read()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment