Skip to content

Instantly share code, notes, and snippets.

@ariscop
ariscop / element.py
Created March 19, 2015 03:35
Simple passthrough element for gstreamer 1.0 in python
#!/usr/bin/env python3
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst
loop = GObject.MainLoop()
GObject.threads_init()
Gst.init()
@ariscop
ariscop / memcpy.asm
Created March 2, 2023 13:09
rgbasm macro to unrolled loops
; unroll_loop_c N "loop body"
; unrolls to 2**N operations per loop using c as a the loop counter
; does not affect a, b, hl, de
; falls through on completion
MACRO unroll_loop_c
ASSERT FATAL, \1 > 0, "Must have depth > 0"
DEF BODY equs \2
for N, \1
: srl c
jr nc, :+
@ariscop
ariscop / decompress.asm
Created March 1, 2023 03:59
LZ3 decompressor for pokemon crystal, faster but larger and i plan on rewriting parts
MACRO ld_a_dei
ld a, [de]
inc de
ENDM
MACRO ld_hli_dei
ld a, [de]
ld [hli], a
inc de
ENDM
@ariscop
ariscop / ifr.txt
Created April 17, 2021 02:43
Dell G5 SE IFR Dump
UEFI Protocol Detected
--------------------------------------------------------------------------------
String Packages
--------------------------------------------------------------------------------
Offset: Language:
--------------------------------------------------------------------------------
0x1395AC en-US (0x0)
0x13A3C2 fr-FR (0x1)
@ariscop
ariscop / topsee_dev.py
Created March 2, 2015 01:11
Python script that 'emulates' topsee devices
#!/usr/bin/env python3
from socket import socket
import xml.etree.ElementTree as ET
magic = b'\x58\x91\x58\x51'
auth_response = """<?xml version="1.0" encoding="GB2312" ?>
<XML_TOPSEE>
<MESSAGE_HEADER
@ariscop
ariscop / blueprint-storage.py
Created April 4, 2021 07:27
Partially reads blueprint-storage.dat, the file appear to be completely auto generated and its a chore to reverse engineer
#!/usr/bin/env python3
from pprint import pprint
from construct import *
class VersionStringAdapter(Adapter):
def _decode(self, obj, context, path):
return ".".join(map(str, obj))
Version = VersionStringAdapter(Int16ul[4])
@ariscop
ariscop / train_pathing_cost.gdb
Created March 4, 2021 03:13
awful gdb script to measure pathfinder cost by train in factorio
file factorio
set $train_id = (int)0
set $start = (unsigned long long)0
set $end = (unsigned long long)0
# for 1.1.26, linux build
break _ZN5Train11requestPathEPK4Rail13RailDirectionPK20InChainSignalSection
commands
@ariscop
ariscop / build.log
Created February 9, 2019 03:59
Building reactos with gcc 7.3
[91/9712] Performing configure step for 'host-tools'
-- The C compiler identification is GNU 8.2.1
-- The CXX compiler identification is GNU 8.2.1
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
@ariscop
ariscop / with_macro.c
Created September 27, 2018 02:25
with macro in c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define with(_init, _fini) for(int _count = ((_init), 1); _count--; (_fini))
#define with_file(var, name, access) with(var = fopen(name, access), (var ? fclose(var) : 0 ))
void
test_macro(char *file)
From f114131ec986a3ff7f7668df1a31fb60daf980a6 Mon Sep 17 00:00:00 2001
From: Andrew Cook <ariscop@gmail.com>
Date: Sun, 11 Mar 2018 13:18:36 +1100
Subject: [PATCH] Reactos changes
---
Source/CMakeLists.txt | 12 ++
Source/CMakeVersionCompute.cmake | 1 +
Source/cmGeneratorTarget.h | 5 +-
Source/cmGlobalNinjaGenerator.cxx | 24 ++-