Skip to content

Instantly share code, notes, and snippets.

View Swyter's full-sized avatar
💭
¯\_(ツ)_/¯

Swyter Swyter

💭
¯\_(ツ)_/¯
View GitHub Profile
@Swyter
Swyter / swy-como-firmar-pdf-cert-linux.md
Last active October 27, 2025 00:44
Cómo firmar electrónicamente un PDF con certificado digital en Linux y que aparezca como LTV (de largo plazo) en Acrobat Reader

Para que la firma digital de un PDF no solo sea válida, sino que tampoco deje de funcionar en unos cuatro años (cuando expire nuestro certificado) y que por lo tanto Acrobat Reader la marque como LTV (long-time validation) necesita adjuntar entre los datos de la firma dos requisitos extra que no están muy bien documentados:

  1. Usar un servidor de marca de tiempo (TSA en inglés) cualificado, de una empresa o servicio respetado, que esté en la lista de la Unión Europea. Es como una especie de notario virtual.
    • Con esto el servicio nos valida que realmente firmamos en ese día y hora, después de la emisión del certificado pero antes de que caduque. Nos da una prueba, una especie de certificado, de que eso (da igual lo que sea, no se mira el contenido) pasó ese día, a esa hora.
  • Sin adjuntar esta contrafirma podríamos rebobinar y cambiar la fecha del ordenador y utilizar certificados caducados o extraviados, por lo que sin la contrafirma de tiempo nuestra firma digital no es tan fiable y el tiempo podría s
@castano
castano / SparkTextureOutput.md
Last active February 24, 2025 09:48
Writing to block compressed textures across different graphics APIs

Writing to Compressed Textures

In general it's not possible to use a block-compressed texture as a render target or as a compute shader output. Instead you have to either: Alias the block compressed texture with an uncompressed texture where each texel corresponds to a block, or to output the compressed blocks to an uncompressed texture buffer, and then copy the compressed blocks from that intermediate memory location to the final compressed texture.

Each of the graphics APIs expose this functionality in a different way. This document explains the options available under the following APIs:

IERAE CTF 2024 - Intel CET Bypass Challenge

IERAE CTF had one of the coolest pwn challenges I've done in the while. It was written by hugeh0ge.

Here's the full source:

// gcc chal.c -fno-stack-protector -static -o chal
#include <stdio.h>
#include 
@davidgarland
davidgarland / lineageos_simple_kernel_build.md
Last active November 22, 2025 19:02
Building LineageOS Kernels without AOSP in 2024

Normally to cross compile a LineageOS kernel requires a massive amount of storage as it requires downloading the entirety of the android source, including building LineageOS itself, which you may not care to do if you just want to fiddle with kernel configuration or patching.

Here's a way around that! (In the form of a script with comments.)

Special thanks to this blog post in particular, which does a decent job of explaining what to do-- hopefully my comments offer some additional clarification.

@TolyanDimov
TolyanDimov / whatsapp-full-screen.user.js
Last active November 9, 2025 13:27
Enable full-screen mode for WhatsApp Web on larger screens
// ==UserScript==
// @name whatsapp-full-screen
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Enable full-screen mode for WhatsApp Web on larger screens
// @author tolyandimov
// @match https://web.whatsapp.com/
// @icon https://www.google.com/s2/favicons?sz=64&domain=whatsapp.com
// @grant none
// ==/UserScript==
import struct, time
## This experiment demonstrates that the claimed "hash" (that is not a hash) used
## by the L2 cache ECC debug feature used by Operation Triangulation is not secure,
## and can be trivially reverse engineered by anyone who owns one of the machines
## with the hardware (such as any M1 Mac), in seconds to days. Therefore, this proves
## that no "insider" access or leak is necessary to obtain this table, and that the
## attackers most likely did exactly the same thing.
## This is the "black box", i.e. the hardware: The table is not exposed to the caller.
class BlackBox:
@Swyter
Swyter / farmer-notes.txt
Last active September 2, 2023 03:38
Sphinx -- Heliopolis Farmer Brothers scripting notes
HT_Objective_Hel_Exterior_Farm_PlotTime: in-game timestamp in seconds when they originally started to dig
(gettimer - gPlotTime > 300 seconds) means done
HT_Objective_Hel_Exterior_Farm_FarmerState: 0 = waiting for player to kill all eyes,
1 = waiting in the hut to pick a plot,
2 = walking to farm plot,
3 = digging,
4 = walking back to hut,
5 = waiting for player to give reward
HT_Objective_Hel_Exterior_Farm_Plot: Active/current plot index, from 1 to 16 (this and the one below are set by each plot context action)
HT_Objective_Hel_Exterior_Farm_PlotList: bitfield of spent/dug plots, the set bit index comes from the Farm_Plot objective
@JiayinCao
JiayinCao / tiny_fiber.h
Last active November 18, 2025 21:16
Tiny Fiber ( A razor thin cross platform fiber library )
/*
MIT License
Copyright (c) 2023 Jiayin Cao
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is

v34 - Beyond Good and Evil - Symbolicated PS2 proto .elf
v36 - King Kong - (0xB398CC66 XOR key for headers) - Symbolicated .elf
v36 - Rayman Raving Rabbids - (0xB398CC66 XOR key for headers) - Symbolicated .elf
v36 - Rayman Raving Rabbids 2 - (0xB398CC66 XOR key for headers) - Multiple symbolicated .elf
v37 - Prince of Persia: The Sands of Time - PS2 proto symbol map file
v38 - Prince of Persia: Warrior Within -
v38 - Prince of Persia: The Two Thrones -
v42 - TMNT -
v42 - My Word Coach - Symbolicated .elf, unpacked data, uncompiled AI scripts
v42 - My Spanish Coach -

@DavidBuchanan314
DavidBuchanan314 / widevine_fixup.py
Last active July 15, 2025 03:43
Patch aarch64 widevine blobs from ChromeOS to work on non-ChromeOS linux, including platforms with 16K page size like Apple Silicon / Asahi Linux
"""
MIT License
Copyright (c) 2023 David Buchanan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is