Skip to content

Instantly share code, notes, and snippets.

@superllama
superllama / hexToBase64.xslt
Last active April 20, 2022 17:34
Some XSLT templates that can convert Hex to Base64, for some reason.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="ascii" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="Hex">
<xsl:call-template name="bin2b64">
<xsl:with-param name="x">
<xsl:call-template name="hex2bin">
<xsl:with-param name="x" select="text()"/>
</xsl:call-template>
</xsl:with-param>
@superllama
superllama / Minds-CSV.ps1
Last active August 5, 2021 14:14
A work-in-progress PowerShell script that helps me generate CSV files for tracking Minds.com Off-Chain transactions in CoinTracker, because I'm crazy
param([Parameter(Mandatory=$true)][string]$csv)
$out = new-object Object[](0)
Write-Host 'Go to minds in firefox, filter Network tab by ''ledger'' and visit the transactions page, scroll until all are loaded.'
$i = 1;
while ($true) {
Write-Host "Right-click item #$i and choose Copy->Copy Response, then press any key to process it. Press Enter instead when finished."
$key = $host.UI.RawUI.ReadKey()
if ($key.Character -eq "`0" -or $key.Character -eq "`t") {continue;}
if ($key.VirtualKeyCode -eq 13) {break;}
$x = (get-clipboard)
@superllama
superllama / asm.vbs
Created February 25, 2020 00:28
An x86 assembler... in VBScript, for some reason. Includes two unfinished EXE projects.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Hit Ctrl+F and find the second instance of "here"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
exetxt = ""
loc = 0
eax="eax":ecx="ecx":edx="edx":ebx="ebx":esp="esp":ebp="ebp":esi="esi":edi="edi"
cs="cs":ds="ds"
al="al":cl="cl":dl="dl":bl="bl"
ah="ah":ch="ch":dh="dh":bh="bh"
ax="ax":cx="cx":dx="dx":bx="bx":sp="sp":bp="bp":si="si":di="di"
@superllama
superllama / scrollbar_fix.cpp
Last active February 25, 2020 00:36
a throwaway C++ program that uses WinAPI calls to fix a very specific scrollbar issue caused by ActiveX controls on a specific intranet website on a specific version of Windows 10
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
//detect if the scrollbar is one of the ones affected by the bug
bool IsBrokenScrollbar(HWND hw) {
char clsname[256];
GetClassName(hw, clsname, 256);
if (strcmp(clsname, "ScrollBar")) return false;
GetClassName(GetParent(hw), clsname, 256);
if (strcmp(clsname, "DataTable5")) return false;
return true;
@superllama
superllama / chip8.ps1
Last active February 25, 2020 00:31
A Chip-8 Emulator written in PowerShell
param(
[string]$rom,
[int]$cpulimit = 0,
[switch]$nowrap = $false,
[switch]$noclear = $false
)
if ($rom -eq "") {
"PowerShell Chip-8 Emulator 1.0`n"+
" by SuperLlama (superllama527@hotmail.com)`n"+
"-"*48+"`n"+
@superllama
superllama / png.c
Last active February 25, 2020 00:35
A PNG Decoder I wrote years ago that has an unfindable bug with some images and also relies on strange header files, but otherwise works
#include "guts.h"
#include "png.h"
#include "mem.h"
static unsigned int flip(unsigned int x)
{
x = ((x & 0x0000ffff) << 16) | ((x & 0xffff0000) >> 16);
x = ((x & 0x00ff00ff) << 8) | ((x & 0xff00ff00) >> 8);
x = ((x & 0x0f0f0f0f) << 4) | ((x & 0xf0f0f0f0) >> 4);
x = ((x & 0x33333333) << 2) | ((x & 0xcccccccc) >> 2);
x = ((x & 0x55555555) << 1) | ((x & 0xaaaaaaaa) >> 1);
@superllama
superllama / Joystickthing.cpp
Last active February 25, 2020 00:38
a test to mess with the windows gamepad API to show a friend a bare minimum example for collecting joystick data
#pragma comment(lib, "hid.lib")
#include <stdio.h>
#include <Windows.h>
#include <hidsdi.h>
LRESULT CALLBACK dummy_wndproc(HWND wnd, UINT msg, WPARAM wp, LPARAM lp) {
if (msg == WM_INPUT) {
UINT bufferSize;
//get the rawinput data
GetRawInputData((HRAWINPUT)lp, RID_INPUT, 0, &bufferSize, sizeof(RAWINPUTHEADER));
PRAWINPUT rawinput = (PRAWINPUT)malloc(bufferSize);