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
public class Target | |
{ | |
private void Test1() | |
{ | |
} | |
private string Test2() | |
{ | |
return ""; |
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
// ==UserScript== | |
// @name Mastodon Local Post Link | |
// @namespace http://tampermonkey.net/ | |
// @version 0.6 | |
// @description This script identifies links to posts on other Mastodon instances and adds an additional link to open it on the local instance. | |
// @author Graham Sutherland | |
// @match https://chaos.social/* | |
// @icon https://chaos.social/favicon.ico | |
// @grant none | |
// ==/UserScript== |
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
// Clusters functions by their function ID and applies tags to functions in clusters with a size larger than 1. | |
//@category FunctionID | |
//@author Graham Sutherland | |
import java.io.IOException; | |
import java.util.*; | |
import ghidra.app.script.GhidraScript; | |
import ghidra.feature.fid.hash.FidHashQuad; | |
import ghidra.feature.fid.plugin.HashLookupListMode; |
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
/* | |
works in LinqPad 5 (.NET Framework) | |
requires System.Speech.dll to be loaded | |
*/ | |
string script = @" | |
This is a test of automatic forced alignment transcription. | |
When I read these words, the program will automatically follow along and output SRT subtitle entries. | |
The code also handles situations where two lines in the script are the same. | |
For example, I can repeat the first line of this 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
// ==UserScript== | |
// @name Mastodon Unlisted Replies | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Sets the privacy of replies to unlisted by default on Mastodon. | |
// @author Graham Sutherland (@[email protected]) | |
// @match https://chaos.social/* https://mastodon.social/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=chaos.social | |
// @grant none | |
// @run-at document-idle |
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
// dump ProductPolicy data structure from Windows | |
// ref: https://www.geoffchappell.com/studies/windows/km/ntoskrnl/api/ex/slmem/productpolicy.htm | |
using (var pok = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Control\ProductOptions", false)) | |
{ | |
byte[] policy = (byte[])pok.GetValue(@"ProductPolicy"); | |
using (var ms = new MemoryStream(policy)) | |
using (var br = new BinaryReader(ms)) | |
{ | |
Console.WriteLine("total license data size (including header): {0}", br.ReadUInt32()); |
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
// quick bit of code to move displays to specific locations in C# | |
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] | |
public struct DEVMODE | |
{ | |
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] | |
public string dmDeviceName; | |
public short dmSpecVersion; | |
public short dmDriverVersion; |
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
// ==UserScript== | |
// @name Load HQ Video on Twitter | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Forces Twitter to always load the highest bitrate video available. | |
// @author Graham Sutherland | |
// @match https://twitter.com/* | |
// @icon https://www.google.com/s2/favicons?domain=twitter.com | |
// @grant none | |
// ==/UserScript== |
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
// see: https://bugs.chromium.org/p/chromium/issues/detail?id=1201106 | |
// see: https://twitter.com/gsuberland/status/1445547814965055488 | |
#include <Windows.h> | |
#include <stdio.h> | |
#include <TlHelp32.h> | |
#include <memory> | |
#include <cassert> | |
#include <vector> |
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
// dump LE EXE headers for mixed 16/32-bit VXDs | |
// ref: https://faydoc.tripod.com/formats/exe-LE.htm | |
// ref: https://github.com/open-watcom/open-watcom-v2/blob/master/bld/watcom/h/exeflat.h | |
// ref: http://www.textfiles.com/programming/FORMATS/lxexe.txt (this is for LX, not LE, but layout is roughly the same) | |
enum Endianness : byte | |
{ | |
LittleEndian = 0, | |
BigEndian = 1 |
NewerOlder