Skip to content

Instantly share code, notes, and snippets.

View alvinhochun's full-sized avatar
💭
ffs wtf is this status thing

alvinhochun alvinhochun

💭
ffs wtf is this status thing
View GitHub Profile
@alvinhochun
alvinhochun / cfguard-for-mingw-w64.md
Last active October 29, 2023 08:31
Control Flow Guard (CFG/CFGuard) for mingw-w64

Control Flow Guard (CFG/CFGuard) for mingw-w64

Control Flow Guard is a security mitigation that verifies the target address of indirect calls. It works by having the compiler insert a check at indirect call sites to verify the validity of the call target, and also the linker write the necessary data and flags into the PE/COFF image to enable the feature on Windows' end.

import stomp
import time
import sys
import logging
logger = logging.getLogger('stomp.py')
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
@alvinhochun
alvinhochun / build_krita_mingw.cmd
Last active August 16, 2016 13:11
Krita Windows TDM-gcc mingw-w64 build
rem
rem Tentative instructions on building Krita with mingw on Windows.
rem
rem NOTE:
rem I do *not* recommend running this script directly, since it may
rem fail on random steps and it won't stop the script.
rem It's just for reference.
rem
set CMAKE_BIN=D:\Programming\tools\cmake-3.4.3-win32-x86\bin\
@alvinhochun
alvinhochun / DeSmuME-NDS-WiFi-Wireshark.lua
Last active April 28, 2021 09:35
Script to process NDS WiFi communication in Wireshark (WIP)
--
-- DeSmuME and NDS Local WiFi Dissector script
--
-- * Last Modified: 2014-06-06
-- * Author: Alvin Wong (alvinhochun, alvinhochun-at-gmail-com)
--
-- This LUA script is designed to be used with Wireshark to inspect the detail
-- of the NDS WiFi local multiplayer protocol.
--
-- This script contains of three parts:
@alvinhochun
alvinhochun / kexec-hardboot.patch
Created December 13, 2013 14:53
Patch to implement kexec hardboot on Xperia M/M Dual kernel
From 2e818d81f21f6a627bc629e477052045426b0663 Mon Sep 17 00:00:00 2001
From: Alvin Wong <alvinhochun@gmail.com>
Date: Fri, 13 Dec 2013 22:19:52 +0800
Subject: [PATCH] Implement kexec-hardboot
This allows performing kexec with a full hardware reboot so that the "guest"
kernel does not have to worry about reinitializing hardware states.
I've ported the patch to this Xperia M stock kernel. The hardboot page is
located at 0x88000000, which is exactly 1MiB below the ram_console.
@alvinhochun
alvinhochun / do_kexec.sh
Created December 13, 2013 14:41
Simple (sample) shell script to perform kexec hardboot for Xperia M/M Dual.
#!/boot/busybox sh
set -x
echo "About to kexec new kernel..."
if [ -x "/cache/kexec" ] && [ -f "/cache/stock_kernel" ] && [ -f "/cache/ramdisk" ]; then
# Builds the new cmdline
# The portion starting from "androidboot.emmc=true" is added by