Skip to content

Instantly share code, notes, and snippets.

View vcsjones's full-sized avatar

Kevin Jones vcsjones

View GitHub Profile
@vcsjones
vcsjones / CustomRules.js
Last active January 5, 2018 17:35
Make Fiddler CHACHA20_POLY1305 aware.
//Add these two imports at the top of 'CustomRules.js'
import System;
import System.Reflection;
//Create or add this to the 'OnBoot' function:
static function OnBoot() : void {
var ciphersField = FiddlerApplication.Assembly.GetType("Fiddler.HTTPSClientHello").GetField("dictTLSCipherSuites", BindingFlags.NonPublic | BindingFlags.Static);
var ciphers = ciphersField.GetValue(null);
ciphers.set_Item(0xCCA8, "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256");
tell application "Microsoft Word"
activate
set currentZoom to percentage of zoom of view of active window
set newZoom to (round (currentZoom + 50) / 50) * 50
log newZoom
if newZoom <= 500 then
set percentage of zoom of view of active window to newZoom
end if
end tell
using System;
using System.Diagnostics;
using System.IO;
namespace Baconator
{
class Program
{
static void Main(string[] args)
{
@vcsjones
vcsjones / example.json
Last active December 22, 2015 18:58
Fiddler Extension Package Schema and Example
{
"files": [
{"src": "Contents/example.dll"}
],
"metadata": {
"id": "e.1xample",
"authors": [ "Kevin Jones" ],
"owners": [ "Kevin Jones" ],
"requireLicenseAcceptance": false,
"tags": [ "example" ],
f = do require 'thing'
<asp:Wizard runat="server" ID="GAWizard">
<WizardSteps>
<asp:WizardStep runat="server" ID="Step1">
Cut a hole in the box
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
List<string> aList = null;
foreach(var str in aList) {...}
//How I really wish this compiled:
var enumerator = aList == null ? null : aList.GetEnumerator();
try {
while (enumerator != null && enumerator.MoveNext()) {
var element = (ElementType)enumerator.Current;
open FSharp.Charting
open System
type ChartApplicationContext() as this =
inherit System.Windows.Forms.ApplicationContext()
do
let handler = new ConsoleCancelEventHandler(fun o e -> this.ExitThread())
Console.CancelKeyPress.AddHandler(handler)
@vcsjones
vcsjones / evil.cs
Created August 13, 2013 18:02
Overwrite's a MethodInfo's JITed assembly code so that a method aways returns false.
private static void ChangeToReturnFalse(MethodInfo methodInfo)
{
var intPtrConstructor = typeof(IntPtr).GetConstructor(new[] { typeof(void*) });
var method = new DynamicMethod("ChangeToReturnFalse", typeof(IntPtr), Type.EmptyTypes, typeof(ServiceLocationModule));
var generator = method.GetILGenerator();
generator.Emit(OpCodes.Ldftn, methodInfo);
generator.Emit(OpCodes.Newobj, intPtrConstructor);
generator.Emit(OpCodes.Ret);
var addressFunctor = (Func<IntPtr>)method.CreateDelegate(typeof(Func<IntPtr>));
var address = addressFunctor();
public static int DivRem(int a, int b, out int result)
{
result = a % b;
return a / b;
}