Skip to content

Instantly share code, notes, and snippets.

View cetteup's full-sized avatar

cetteup

View GitHub Profile
@cetteup
cetteup / HttpClient.py
Last active September 5, 2024 19:13
BF2Hub stats Python ("decompiled" source code)
# uncompyle6 version 3.9.3.dev0
# Python bytecode version base 2.3 (62011)
# Decompiled from: Python 3.8.10 (default, Jul 29 2024, 17:02:10)
# [GCC 9.4.0]
# Embedded file name: /tmp/bf2c/bf2hub/HttpClient.py
# Compiled at: 2014-09-03 19:41:22
import socket, string
from urlparse import urlparse
class HttpClient:
@cetteup
cetteup / main.go
Last active September 4, 2024 20:53
GameSpy login flow
package main
import (
"fmt"
"net"
"os"
"time"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
@cetteup
cetteup / mutate.ts
Last active May 7, 2024 16:10
Mutating combination function (zero changes to array length)
function combine(strings: string[], length: number): string[] {
// Init results array of required length, filled with empty strings
const combinations = Array(strings.length**length).fill('')
for (let i = length; i > 0; i--) {
for (let j = 0; j < combinations.length; j++) {
combinations[j] += strings[Math.floor(j/(strings.length**(i-1)))%strings.length]
}
}
return combinations
@cetteup
cetteup / bf2mld_gui.py
Created April 16, 2024 16:36
BF2mld - Battlefield 2 mapload-delayer 0.8.2 ("decompiled" source code)
# 2024.04.16 16:32:56 UTC
# Embedded file name: bf2mld_gui.py
import wx
import wx.html
import sys
import time
from _winreg import *
import psutil
import threading
import ConfigParser
@cetteup
cetteup / fesl-add-login-persona.py
Created October 20, 2023 07:26
FESL add and login as persona
import logging
from urllib.parse import quote
from pybfbc2stats import Platform, FeslClient, SecureConnection, TheaterClient
from pybfbc2stats.constants import FeslTransmissionType
from pybfbc2stats.packet import FeslPacket
def main():
client = FeslClient('', '', Platform.pc, track_steps=False)
@cetteup
cetteup / bf2d-cc.service
Created March 2, 2023 18:45
Run a Battlefield 2 server as a systemd service
[Unit]
Description=Battlefield 2 dedicated server with BF2CC
After=network-online.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
@cetteup
cetteup / gsserver.service
Last active January 2, 2023 20:43
Run a GameSpy login emulator as a systemd service
[Unit]
Description=GameSpy login emulation server
After=network-online.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
@cetteup
cetteup / paraworldd.service
Created April 26, 2022 16:15
Paraworld dedicated server systemd service templates
[Unit]
Description=ParaWorld dedicated server "manager"
After=network-online.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
@cetteup
cetteup / paraworld-url-launcher.ps1
Created April 6, 2022 18:45
PowerShell script to register a URL handler for the paraworld:// protocol and act as the handler. Joining a Paraworld server is only one click away.
<#
PowerShell script to register a URL handler for the paraworld:// protocol and act as the handler. Joining a Paraworld server is only one click away.
Registers the URL handler if launched without any arguments.
Launches the game and joins the server if launched with valur -URI flag.
URL protocol format: paraworld://[server_ip]:[server_port]
#>
param(
@cetteup
cetteup / bf1942-url-launcher.ps1
Created March 20, 2022 14:04
PowerShell script to register a URL handler for the bf1942:// protocol and act as the handler. Joining a Battlefield 1942 server is only one click away.
<#
PowerShell script to register a URL handler for the bf1942:// protocol and act as the handler. Joining a Battlefield 1942 server is only one click away.
Registers the URL handler if launched without any arguments.
Launches the game and joins the server if launched with valur -URI flag.
URL protocol format: bf1942://[server_ip]:[server_port]
#>
param(