Skip to content

Instantly share code, notes, and snippets.

@rqou
rqou / convert_font_sheet.py
Created Nov 26, 2020
TWEWY font datamining and extraction
View convert_font_sheet.py
#!/usr/bin/env python3
import sys
from PIL import Image
infn = sys.argv[1]
outfn = sys.argv[2]
with open(infn, 'rb') as f:
indata = f.read()
View game and watch flash dump via gdb
set mem inaccessible-by-default off
# GPIO clocks
set *(int*)0x58024540 = 0x7FF
# OCTOSPI clocks
set *(int*)0x58024534 = 0x00204000
# Port A
set *(int*)0x58020020 = 0x00000090
View ftdi-sk9822-blinky.py
#!/usr/bin/env python3
from math import ceil
import pyftdi.gpio
dev = pyftdi.gpio.GpioAsyncController()
dev.open_from_url('ftdi:///1', 0b11)
print(dev)
dev.set_frequency(1000000)
@rqou
rqou / pcbnew
Created Jul 8, 2020
KiCad fairyfloss theme
View pcbnew
canvas_type=2
Color4DPCBLayer_F.Cu=rgb(255, 133, 127)
Color4DPCBLayer_In1.Cu=rgb(255, 243, 82)
Color4DPCBLayer_In2.Cu=rgb(197, 163, 255)
Color4DPCBLayer_In3.Cu=rgb(194, 0, 0)
Color4DPCBLayer_In4.Cu=rgb(0, 132, 132)
Color4DPCBLayer_In5.Cu=rgb(0, 132, 0)
Color4DPCBLayer_In6.Cu=rgb(0, 0, 132)
Color4DPCBLayer_In7.Cu=rgb(132, 132, 132)
Color4DPCBLayer_In8.Cu=rgb(132, 0, 132)
View cuterunner-vga.v
module top(r0, r1, g0, g1, b0, b1, hsync, vsync,
clk_,
but0, but1, but2, but3,
led4);
(* LOC = "FB1_2" *)
output r0;
(* LOC = "FB1_6" *)
output r1;
(* LOC = "FB1_3" *)
View usbip_barebones_demo.py
#!/usr/bin/env python3
from collections import namedtuple
import socket
import struct
usbip_user_op_common = namedtuple('usbip_user_op_common', 'version code status')
usbip_usb_device = namedtuple('usbip_usb_device', 'path busid busnum devnum speed idVendor idProduct bcdDevice bDeviceClass bDeviceSubClass bDeviceProtocol bConfigurationValue bNumConfigurations bNumInterfaces')
usbip_header_basic = namedtuple('usbip_header_basic', 'command seqnum devid direction ep')
View hack_fix_idb.py
# import idaapi
# print(idaapi)
# import binascii
# # print(binascii.hexlify(idaapi.netnode('$ original user', 0, False).supval(0)))
# dumped_netnode = 'ca75b28848ea06bcae409699fa2510a03bbaf43bd167eecb17d52918187133a793ebf8d3270230c7164d7a79b53c2c3edd611ede975690784cf2c254abe8b587140d19a3f46b2be109bde1da1b7ed4d7c9f7b58135f2c296db4e86ad29b6f0b999b5599d40c3bae8b29d2cc06ecef63cba0e1b9a9505c1efe9019a7020127e100000000000000000000000000000000000000000000000000000000000000000'
import binascii
View defcon-26-human-orig.hex
:020000041D00DD
:1000000014161A392E26392A443E4E314636191115
:100010001846121C1B1E2B1A35384D3E3A20370E3F
:100020000E43111D18203A0D354841344B18180A5B
:10003000140D20252508381C421F4131474C4E180D
:100040000F150D46271831373E0B413A4E214E43CE
:1000500013361D2C2713253430174A0B4E2B424CD8
:100060001A263D3B212D30252F10294A40224F4191
:100070000C32221627092A4A3247320C48384E22BF
:10008000160F152D2E41374D40274E224E3D180597
@rqou
rqou / asmbits2.asm
Created Apr 18, 2018
Calling Linux syscalls from WINE with bonus "Heaven's Gate"
View asmbits2.asm
global call_64_from_64
global call_32_from_64
global call_32_from_32
section .text
call_64_from_64:
push rsi
push rdi
mov rax, 1
@rqou
rqou / asmbits.asm
Created Apr 18, 2018
Code segment trickery / "Heaven's Gate" on Linux
View asmbits.asm
global call_64_from_64
global call_32_from_64
global call_32_from_32
section .text
call_64_from_64:
mov rsi, rdi
mov rax, 1
mov rdi, 1