Skip to content

Instantly share code, notes, and snippets.

/*
NOTE this doesn't really check if a specifier is entirely valid in order to highlight
for example if you have %lls we highlight it
we simply check each subspecifier in order to see if it seems valid and move on and don't have logic to see if
the subspecifiers are comptaible or not
we don't highlight if any of the subspecifier checks fail so if you do %.qd we don't highlight it
Also I commented out some checks that I wasn't sure if they were invalid in c++ but valid in C or ones that I just never use
Instructions
In 4coder_draw.cpp there a function draw_cpp_token_colors() that decides what color to draw tokens and draws them.
# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
@valinet
valinet / README.md
Last active June 10, 2026 22:53
Get dark command windows all the time in Windows

Case study: Get dark command windows all the time in Windows

TL;DR

  1. Make a copy conhost.exe from System32.
  2. Open it with a hex editor (I use HxD).
  3. In HxD, go to Search - Find - Hex-values.
  4. Search for 881d9e530a004885c07477ff15b32e08009084c0.
  5. In Windows 10 version 2004, replace ff15b32e0800 with 909090909090. If using Windows 10 version 20H2, replace ff15b32e08009084 with 9090909090909090.
  6. Save file and copy it back to System32 (take ownership of original conhost.exe in order to replace it).
  7. Profit!
This file has been truncated, but you can view the full file.
//
// +-------------------------------------------------------------------------+
// | This file was generated by The Interactive Disassembler (IDA) |
// | Copyright (c) 2019 Hex-Rays, <support@hex-rays.com> |
// +-------------------------------------------------------------------------+
//
//
// This file should be used in the following way:
// - reload executable into IDA with using switch -c
// - use File, Load IDC file and load this file.
@WillSams
WillSams / m68k_dev_setup.sh
Last active October 25, 2025 04:00
Setup for Motorola 68000 (Sega, Neo Geo) Cross Compiler on Windows-based System
#!/bin/bash
echo "==================================================================="
echo
echo " My m68000 Development Setup "
echo " You may be prompted by UAC for credentials to complete the install "
echo
echo " Pre-req: Latest 64-bit MSYS2 from http://www.msys2.org/ "
echo
echo " Howto: Use 'wget' to download the raw version of this script "
@mmozeiko
mmozeiko / ods.c
Created April 16, 2019 19:20
Example how to capture OutputDebugString on Windows
#include <windows.h>
#include <intrin.h>
#define Assert(x) do { if (!(x)) __debugbreak(); } while (0)
static struct
{
DWORD process_id;
char data[4096 - sizeof(DWORD)];
}* ods_buffer;
@d7samurai
d7samurai / .readme.md
Last active June 10, 2026 13:13
Minimal D3D11

Minimal D3D11

Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++ / OOP or (other) obscuring cruft. View on YouTube

hollowcube

Other gists in this series:

@flamewing
flamewing / m68k_opt.md
Last active December 11, 2025 21:42
Some peephole optimizations for M68000
@flamewing
flamewing / dma-macros.asm
Last active February 28, 2025 03:51
Some improved DMA macros, and a couple new DMA macros, for the Mega Drive
dmaSource function addr,((addr>>1)&$7FFFFF)
dmaLength function length,((length>>1)&$7FFF)
dmaCommLength function length,(($9400|((length&$FF00)>>8))<<16)|($9300|(length&$FF))
dmaCommSrcLow function source,(($9600|((source&$FF00)>>8))<<16)|($9500|(source&$FF))
dmaCommSrcHigh function source,$9700|(((source&$FF0000)>>16)&$7F)
; Tells the VDP to copy a region of 68k memory to VRAM or CRAM or VSRAM.
dma68kToVDP macro src,dest,length,type,bswap
if MOMPASS>1
if ((src)&1)<>0