This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this code fragment shows how to print a stack trace (to stderr) | |
// on Linux using the functions provided by the GNU libc | |
#include <execinfo.h> | |
#define MAX_STACK_LEVELS 50 | |
// helper-function to print the current stack trace | |
void print_stacktrace() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
import os, json, random, time, re | |
# adult games are part of the hub "Theme - Mature", | |
# but I can't get the data over the API, so I manually scraped it from the website. | |
# use this expression in the browser dev console on the mature hub: | |
# Array.from(document.querySelectorAll("table td.py-2 a")).map(x => x.href.split("/")[4] + ", # " + x.parentElement.outerText.split("\n")[0]).join("\n") | |
# scrape date: 2024-03-06 | |
_mature_games = set([ | |
420, # Mario is a Drug Addict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# takes a csv export of the google sheet as input and tries to download pastebins | |
# | |
# usage: | |
# download_pastebins.py <prefix> <name column> <url column> <csv file> | |
# | |
# example: | |
# download_pastebins.py mt18 1 5 "MT18 Draw List - Played Games.csv" | |
import sys, os, re, urllib.request, csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this file is an example of how to intercept a C++ method by using the | |
// LD_PRELOAD environment variable of the GNU dynamic linker. | |
// | |
// it works like this: | |
// | |
// 1) define a method that will have the same symbol as the intercepted | |
// method when compiled. For example, the method Foo::getValue() | |
// defined here has the mangled symbol "_ZNK3Foo8getValueEv". | |
// tools like nm, objdump or readelf can display the symbols of | |
// binaries. note that depending on compiler and linker options, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// prebuilt for VC14/VS2015 here: | |
// https://dl.dropboxusercontent.com/u/267889/changeres.exe | |
#include <iostream> | |
#include <sstream> | |
#include <Windows.h> | |
int main(int argc, char **argv) | |
{ | |
bool reset = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: used cdb commands: | |
:: !sym noisy -> prints verbose output when searching PDBs | |
:: .symopt+0x40 -> accept mismatching PDBs | |
:: .lines -e -> enable source file and line information | |
:: .kframes 100 -> set max number of display stack frames to 0x100 | |
:: lmv -> list all loaded modules with version information | |
:: | -> show process status | |
:: !peb -> show process environment block (command line arguments, environment variables) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A little script to extract old japanese zip files | |
# with the correct text encoding for filenames. | |
# Most applications assume a US text codepage for | |
# old zip formats, which is not always correct. | |
import os | |
import shutil | |
import sys | |
import zipfile | |
from datetime import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# colored stream handler for python logging framework (use the ColorStreamHandler class). | |
# | |
# based on: | |
# http://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output/1336640#1336640 | |
# how to use: | |
# i used a dict-based logging configuration, not sure what else would work. | |
# | |
# import logging, logging.config, colorstreamhandler | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<title>SRL Races</title> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous"> | |
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> | |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes, ctypes.wintypes | |
advapi32 = ctypes.windll.advapi32 | |
# LSTATUS RegOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult) | |
RegOpenKeyExA = advapi32.RegOpenKeyExA | |
RegOpenKeyExA.argtypes = (ctypes.wintypes.HKEY, ctypes.wintypes.LPCSTR, ctypes.wintypes.DWORD, ctypes.wintypes.DWORD, ctypes.wintypes.PHKEY) | |
# LSTATUS RegCloseKey(HKEY hKey) | |
RegCloseKey = advapi32.RegCloseKey |
NewerOlder