Skip to content

Instantly share code, notes, and snippets.

View HGStyle's full-sized avatar

HGStyle HGStyle

View GitHub Profile
@HGStyle
HGStyle / replay.rs
Created April 22, 2024 15:02
Geometry Dash OmegaBot3/OBot V3 File Format Specification - From https://discord.gg/4vrxF335wh (their official Discord server)
use std::{fs::File, path::Path};
use dlhn::{Deserializer, Serializer};
use serde::{Deserialize, Serialize};
use thiserror::Error;
#[derive(Debug, Error)]
pub enum ReplayError {
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
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