Skip to content

Instantly share code, notes, and snippets.

View corytodd's full-sized avatar

Cory Todd corytodd

View GitHub Profile
@corytodd
corytodd / run_reconnection_test.cs
Created August 30, 2018 16:13
PTIRelianceLib Reconnection Test Loop
// Call out from some place else...
private static void RunReconnectionTest()
{
while (true)
{
using (var printer = new ReliancePrinter())
{
var start = DateTime.Now;
@corytodd
corytodd / fixed_minispy.inf
Created November 24, 2019 17:42
The latest Windows 10 build, 1903-1909, rejects the minifilter INI samples shown in the DDK Github. This modified version allows the driver to at least load and function. I don't know if it is 100% correct though.
;;;
;;; Minispy
;;;
;;;
;;; Copyright (c) 2001, Microsoft Corporation
;;;
[Version]
Signature = "$Windows NT$"
Class = "ActivityMonitor" ;This is determined by the work this filter driver does
@corytodd
corytodd / bitbucket_team_repos.py
Created August 9, 2015 17:56
Python Bitbucket helper
from rauth import OAuth1Service
import BaseHTTPServer
import threading,time
import webbrowser
import urlparse
class Config(object):
def __init__(self):
# Create a new consumer at https://bitbucket.org/account/user/{username}/api
self.consumer_key = <YOUR_KEY>
using System;
using System.IO.Ports;
class PortDataReceived
{
public static void Main()
{
SerialPort portA = new SerialPort("COM7");
@corytodd
corytodd / dism.sh
Created November 2, 2023 19:41
GDB disassmbly helper
#!/bin/bash -eu
TOOLCHAIN=${TOOLCHAIN-arm-none-eabi-}
OBJDUMP=${TOOLCHAIN}objdump
GDB=${TOOLCHAIN}gdb
function usage()
{
cat <<EOF
Usage: dism.sh -f|function -b|--binary --no-source
@corytodd
corytodd / csharp_gdi_print.cs
Created June 13, 2018 02:59
GDI Printing Example for C#
#region Win32 GDI
private void btnTextDrawCenter_Click(object sender, RoutedEventArgs e)
{
var doc = new PrintDocument()
{
PrintController = new StandardPrintController(),
};
doc.OriginAtMargins = false;
doc.PrinterSettings.PrinterName = CurrentPrinter;
doc.PrintPage += (s, args) =>