Skip to content

Instantly share code, notes, and snippets.

@mwrouse
mwrouse / Base64Decode.pas
Last active July 16, 2021 11:42
Inno Setup (Pascal Script) Base64 Decode
// Left shift operator for Base64Decode (Inno Setup does not support << )
function BitwiseLeftShift (input: LongInt; shiftFactor: Integer): LongInt;
var
exp: LongInt; // Total to multiply by
i: Integer;
//Result: LongInt;
begin
Result := 0;
exp := 1;
@apprenticenaomi
apprenticenaomi / ion.py
Created July 13, 2017 07:24
Python DeDRM KFX v0.1
# BinaryIon.pas + DrmIon.pas + IonSymbols.pas
import collections
import enum
import hashlib
import hmac
import os
import os.path
import struct
@zezba9000
zezba9000 / HTTPServer.cs
Last active March 13, 2023 11:52
HTTP C# server
// Modified from: https://gist.github.com/aksakalli/9191056
using System;
using System.Collections.Generic;
using System.Net;
using System.IO;
using System.Threading;
namespace MyNamespace
{
@jimmywarting
jimmywarting / readme.md
Last active June 29, 2025 03:40
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@jhoenicke
jhoenicke / break-short.c
Created April 6, 2017 09:31
Program to brute force private keys from public keys using the baby-step giant-step algorithm.
/**********************************************************************
* Copyright (c) 2017, Jochen Hoenicke *
* *
* Compile with: *
* gcc -O2 -I secp256k1/src/ -I secp256k1/ break_short.c -lgmp *
**********************************************************************/
#include "libsecp256k1-config.h"
#include <stdio.h>
@baratgabor
baratgabor / GetThreadStack0.cs
Last active November 8, 2022 19:04
32 bit ThreadStack0 implementation in C#
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
/// <summary>
/// Only for 32 bit processes. The methods of this static class can find the special symbol ThreadStack0,
/// and follow pointer chains to return the end result in the specified type T.
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@avih
avih / context.lua
Created February 2, 2017 14:07
flexible mpv context menu using Tcl/Tk, for Windows too!
--[[ *************************************************************
* Context menu for mpv using Tcl/Tk. Mostly proof of concept.
* Avi Halachmi (:avih) https://github.com/avih
*
* Features:
* - Simple construction: ["<some text>", "<mpv-command>"] is a complete menu item.
* - Possibly dynamic menu items and commands, disabled items, separators.
* - Possibly keeping the menu open after clicking an item (via re-launch).
* - Hacky pseudo sub menus. Really, this is an ugly hack.
* - Reasonably well behaved/integrated considering it's an external application.
@ameerkat
ameerkat / MD5.cs
Created October 29, 2016 08:35
MD5 Implementation in C# based on Wikipedia psuedocode
using System;
using System.Linq;
namespace MD5
{
/// <summary>
/// RFC for MD5 https://tools.ietf.org/html/rfc1321
/// Based on the pseudo code from Wikipedia: https://en.wikipedia.org/wiki/MD5
/// </summary>
public class MD5
@patrickgill
patrickgill / m3u8download.sh
Last active June 1, 2025 11:06
download m3u8 ts segments, then decode, join, and remux them! (HTTP Live Streaming TS files)
# download
aria2c -x 5 -i file.m3u8
# decode (example)
openssl aes-128-cbc -d -K 15D0F46608409DA364E3F5D92BDE9F61 -iv 00000000000000000000000000000000 -nosalt -in G00000000.ts -out G00000000.d.ts
# join all ts files
cat *.ts > out.ts
# convert ts output file