Skip to content

Instantly share code, notes, and snippets.

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

Swyter Swyter

💭
¯\_(ツ)_/¯
View GitHub Profile

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 -

@Swyter
Swyter / gist:a17f5f8a4d5e0d489dea9d4a937f46c8
Last active December 15, 2022 16:16
sphinx-amd-radeon-win-driver-crash-opengl-regression-testing.txt
https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-11-1 GOOD
https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-10-3 BAD
https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-10-2 BAD
https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-10-1 BAD
https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-9-1 BAD
https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-7-1 BAD
https://www.amd.com/en/support/kb/release-notes/rn-rad-win-22-6-1 GOOD
@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 / fix-for-qemu-kvm-over-4gb-bug.md
Created November 26, 2022 22:51
Fix for qemu-system-x86_64: kvm_set_user_memory_region: KVM_SET_USER_MEMORY_REGION failed, slot=6, start=0xc004800000000000, size=0x200000000

If you get this crash after booting macOS in KVM with AMD GPU passthrough you'll need to disable Above 4GB decoding on your BIOS/UEFI Setup.

qemu-system-x86_64: kvm_set_user_memory_region: KVM_SET_USER_MEMORY_REGION failed, slot=6, start=0xc004800000000000, size=0x200000000: Invalid argument kvm_set_phys_mem: error registering slot: Invalid argument
./boot-passthrough.sh: línea 90:  3507 Aborted                (`core' generado) qemu-system-x86_64 "${args[@]}"

That fixed it.

@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.

r3718 doesn't
r3658 doesn't
r3648 doesn't
r3630 doesn't
r3629 doesn't -- added remaining/missing glsl files, it loads without crashing but font is broken, appears sideways and the uniforms dont color vertices
r3623 doesn't
r3613 crash -- glsl shader issues: https://github.com/tldmod/tldmod/commits/master?before=14db8746657b2a94eb2b8b45a69fa5bc5a848f08+105&branch=master&qualified_name=refs%2Fheads%2Fmaster -- see the changes on Mar 29, 2022
r3613
r3600 works
r3464 works
@Swyter
Swyter / PKGBUILD
Last active September 25, 2022 16:37
Bisect bugs in the Linux kernel -- Arch Linux
# Maintainer: Jonathan Wright <jon@than.io>
# Contributor: Boohbah <boohbah at gmail.com>
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
pkgbase=linux-git
pkgver=5.18.r12154.g5d4af9c1f04a
pkgrel=1
pkgdesc='Linux (Git)'
url="https://www.kernel.org"
arch=(x86_64)
@Swyter
Swyter / module_skins.py
Last active August 31, 2022 00:24
Mount&Blade 1.011 + Warband: Face key / face code format research
face_key_1 = fd301148b
face_key_2 = 2d2655bcdc51c6c9
0x0000000fd301148b2d2655bcdc51c6c900000000000656aa0000000000000000
face_key_1 = 2ff0012ce
face_key_2 = 36db6db6db6db6db
@Swyter
Swyter / gist:09b7090590efe4cab3ff66cafd526f15
Last active August 26, 2022 12:58
NGS Phantom gamepad / PC TWIN SHOCK / Dragonrise / Generic Chinese chipset -- USB force feedback protocol
// IRP information: 0x00, Direction: FDO -> PDO
// URB bus id: 3
// Device address: 1
// Endpoint: 0x01, Direction: OUT
// URB transfer type: URB_INTERRUPT (0x01)
// Packet Data Length: 7
7-byte interrupt messages:
Leftover Capture Data: 51000000b60000
# swy: install pyusb (pacman -S python-pyusb) and run python3 as sudo
import usb.core, usb.control, usb.util, binascii
dev = usb.core.find(idVendor=0x0079, idProduct=0x0006)
print('[* dumping]', dev)
print('DESC_TYPE_DEVICE 0', binascii.hexlify(usb.control.get_descriptor(dev, 0x400, usb.util.DESC_TYPE_DEVICE, 0))) # b'120100010000000879000600070101020001'
print('DESC_TYPE_CONFIG 0', binascii.hexlify(usb.control.get_descriptor(dev, 0x400, usb.util.DESC_TYPE_CONFIG, 0))) # b'0902290001010080fa0904000002030000000921100121012265000705810308000a0705010308000a'
print('DESC_TYPE_STRING 0', binascii.hexlify(usb.control.get_descriptor(dev, 0x400, usb.util.DESC_TYPE_STRING, 0))) # b'04030904'
print('DESC_TYPE_STRING 1', binascii.hexlify(usb.control.get_descriptor(dev, 0x400, usb.util.DESC_TYPE_STRING, 1))) # b'240344007200610067006f006e005200690073006500200049006e0063002e0020002000'
print('DESC_TYPE_STRING 2', binascii.hexlify(usb.control.get_descriptor(dev, 0x400, usb.util.DESC_TYPE_STRING, 2))) # b'3403470065006e006