Skip to content

Instantly share code, notes, and snippets.

@sasdf
sasdf / ma530_patch.py
Created May 22, 2025 15:03
Linux bluetooth driver patch for MA530
#!/usr/bin/env python3
import lzma
import re
import struct
# Find your current driver in /lib/modules/$(uname -r)/kernel/drivers/bluetooth/btusb.ko.xz
with lzma.open('./btusb.ko.xz.org', 'rb') as f:
data = bytearray(f.read())
@sasdf
sasdf / solve.cpp
Last active November 29, 2021 06:18
DragonCTF 2021 CRC Recursive Challenge
// g++ -O3 solve.cpp -fopenmp && ./a.out
//
// Credits:
// Algorithm: @utaha1228
// Optimization: @sasdf
#include "table.h" // Generated by python3 solve.py
#include <omp.h>
#include <cstdint>
#include <cstdio>
@sasdf
sasdf / p.py
Created November 22, 2021 02:34
dlog solution
import gmpy2
import requests
import random
import time
import sys
import numpy as np
import re
from tqdm import tqdm, trange
from telnetlib import Telnet
@sasdf
sasdf / prep.hs
Created May 18, 2018 13:21
FLOLAC '18 preparation answer
{- 1 -}
myFst :: (a, b) -> a
myFst x = fst x
{- 2 -}
myOdd :: Int -> Bool
myOdd x = mod x 2 == 1
{- 3 -}
-- (a) Ord is for types that have an ordering.