Skip to content

Instantly share code, notes, and snippets.

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

Swyter Swyter

💭
¯\_(ツ)_/¯
View GitHub Profile
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 May 6, 2024 21:19
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 April 24, 2024 06:24
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
@Swyter
Swyter / fixes.sh
Last active December 6, 2022 07:26
mab-warband-macos-binary-patches.txt
sh <<EOF && sh -c "# swy: zsh in catalina+ doesn't support inline comments: https://apple.stackexchange.com/a/405317"
# swy: needed for sed to stop complaining about the wholy unsupported hexadecimal literals
export LANG=C
export LC_ALL=C
# swy: go into the game's binary folder
cd ~/'Library/Application Support/Steam/steamapps/common/MountBlade Warband/Mount and Blade.app/Contents/MacOS'
# swy: turn their ../../.. hack into the harmless .//.//./ without changing the length of the string
sed -i '' 's|\.\./\.\./\.\.|\.//\.//\./|g' ./'Mount and Blade'
@Swyter
Swyter / listado-sds.md
Last active May 8, 2024 22:45
Listado de descargas de versiones antiguas de ContaSol, FactuSol, TPVSol y NominaSol de la compañia Software DELSOL
@shinyquagsire23
shinyquagsire23 / gist:824d4e6b08379f3b537fa703d2b1874a
Created October 26, 2022 01:46
Pixel Watch - Dump boot_a/boot_b from fastboot using sha1sum and ramdump memes
# Dump partitions from the Pixel Watch's fastboot using `oem sha1sum`
# and `oem ramdump` memes.
#
# Currently the first 8 bytes aren't bruteforced, but they ~can be.
# Doesn't really matter though because the first 8 bytes is the "ANDROID!" magic
# for boot partitions.
import os
import sys
import subprocess
import hashlib
@Swyter
Swyter / linux-vfio-kvm-passthrough-with-amd-card.md
Last active November 22, 2022 05:42
Linux VFIO KVM Passthrough with AMD Radeon card -- Solution for dmesg error «No more image in the PCI ROM» -- VFIO single graphics card bootup

If you have a black screen when trying to boot your guest OS via qemu/kvm with passthrough for your AMD Radeon card (in my case RX 480/590 or POLARIS10) and nothing is working, and you are able to ssh into the host while the virtualization is running or afterwards and get something like this via dmesg:

...
vfio_ecap_init: hiding ecap 0x19@0x270
...
vfio-pci 0000:03:00.0: No more image in the PCI ROM
...

Then the solution is to boot Linux through pure EFI; the problem is enabling CSM and then either booting the host system through a legacy BIOS bootloader or EFI. TL;DR: Disable CSM, ensure you've a proper EFI boot chain first. Then it will work straight away.

@Swyter
Swyter / pc-port-best-practices.md
Last active July 8, 2022 03:28
PC game port best practices
  • Always use scancodes for keyboard game input to make WASD work even under DVORAK or AZERTY layouts; you care about the key position, not the meaning.

    • Use keycodes to retrieve the actual key meaning/value when you need actual text input.
  • Support paths bigger than 256 characters (MAX_PATH), this should no longer be a limitation. Launch your game from a folder or symlink with hundreds of characters; this can be combined with the next point.

  • Try your game with a special username/user account that has international characters and spaces, like Ñame áôeÓ®他の詩っステム 元バ to ensure you are handling Unicode paths correctly. This is especially tricky on Windows, where you will have to wrap fopen() with the UTF-16 version because the normal version does not understand UTF-8.

    • Very often players with non-English names won't be able to save under AppData or their home directory otherwise.
  • On Windows you should store your savegames under the special %USERPROFILE%\Saved Games folder, use a dynamica