Skip to content

Instantly share code, notes, and snippets.

View zhuowei's full-sized avatar

zhuowei

View GitHub Profile

AGX coherency, caching, and TLBs

These are just some notes on my current understanding of the subtleties of the AGX memory model and the TLB/caching issues I'm seeing.

Hypervisor shenanigans

TLBI instructions do not broadcast to the GPU from EL1 with stage 2 translation enabled. That's it. That's what the bug was.

GPU side

@BestPig
BestPig / analogue-pocket-game-patches.md
Last active April 20, 2024 20:01
Patches to convert GameBoy ROM to `.pocket` (Analogue Pocket ROM)

Patches

Those patches are to convert GameBoy ROM to .pocket ROM. This allows you to play games from the SD Card on your Analogue Pocket.
Feature like RTC and Link cable seems to be unsupported by the Analogue Pocket in GB Studio mode.

Legend of Zelda, The - Link's Awakening DX

GitHub: https://github.com/BestPig/LADX-Disassembly-Pocket

Zelda no Densetsu - Yume o Miru Shima DX

@woachk
woachk / AAPL.md
Last active May 17, 2021 03:44
Apple in 2018: what's new

Apple devices in 2018

Notes

Both iPhone and Watch ship with a Secure Enclave processor. Both are also H11-class SoCs. As such, there are broad similarities between the different blocks. Embedded cores present on-die use firmware written with RTKit, which is Apple's own broadly-used RTOS on cores codenamed Chinook. The codename for the eSIM platform on both the iPhone and Watch is Vinyl. The NFC (+Apple Pay?) controller is named Stockholm, and the Apple Watch Series 4 + iPhone Xs and Xr ship with version 5.

@inoahdev
inoahdev / gist:49604741443b43ee6e7e75736d4ce67f
Created April 30, 2018 00:28
Allow No-USB windows installation
choose(DAWindowController)[0]->installWindowsDirect = true
@roblabla
roblabla / HABILITIES.md
Last active March 14, 2024 03:24
We believe in your habilities.

Muh Switch Keys

So you want to decrypt switch content ? Well, the good news is that all the tools required to do that are written up! The great news is, since this is crypto we're talking about, you'll have to find the keys. Yourself. Like it's easter.

So here you can find a template of the $HOME/.switch/prod.keys file that hactool uses to decrypt content. It contains all the SHA256 and location of the keys and seeds, so you can find them yourselves.

Note that all the seeds (the keys that end with _source) are used along with the master_key_## to derive an actual key. If you have somehow obtained the key without the seed, you can rename xxx_source to xxx_## (where ## is the master key number) and put your key there.

How the heck do I obtain dem keys ?

@goloveychuk
goloveychuk / code.ll
Last active August 31, 2018 02:32
swift to wasm
; ModuleID = 'code.ll'
source_filename = "code.ll"
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32"
%swift.type = type { i64 }
%swift.type_metadata_record = type { i32, i32 }
%T4code5StrctV = type <{ %TSi, %TSi }>
%TSi = type <{ i64 }>
@saagarjha
saagarjha / WBSAutoFillQuirks.plist
Last active April 17, 2019 18:02
List of password generation quirks that MobileSafari uses when generating passwords
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DomainsWithAssociatedCredentials</key>
<array>
<array>
<string>comcast.net</string>
<string>xfinity.com</string>
</array>
PRD-63116-001/nPRD-63116-003/nPRD-63116-005/nPRD-63116-007/nPRD-63116-009/nPRD-63116-010/nPRD-63116-013/nPRD-63116-017/nPRD-63116-020/nPRD-63116-021/nPRD-63116-027/nPRD-63116-033/nPRD-63117-003/nPRD-63117-011/nPRD-63117-015/nPRD-63117-019/nPRD-63117-023/nPRD-63117-025/nPRD-63117-027/nPRD-63117-028/nPRD-63117-029/nPRD-63117-041/nPRD-63117-703/nPRD-63117-704/nPRD-63118-001/nPRD-63734-001/nPRD-63734-002/nPRD-63763-001/nPRD-63764-001/n
@P1kachu
P1kachu / calling_printf_osx.c
Created November 24, 2016 20:30
Calling printf in OSX - The overkill way
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <mach-o/dyld.h>
#include <mach-o/nlist.h>
#include <mach-o/dyld_images.h>
#include <mach/mach_vm.h>
/* Dyld is the OSX Dynamic Linker
* /usr/include//mach-o/loader.h

Making a PDF + Bootable ISO Hybrid Polyglot

If you've not seen my résumé, that is what this post is about, and you should probably look at it first to get an idea of what's happening.

A Tale of Two Files

PDF and ISO9660 are two very different file formats. PDF is actually a surprisingly human-readable (but, sadly, not very human-writable) plain-text format, technically descended from PostScript. PDF is not very forgiving on changes, as it stores tables of offsets to various elements, so it is very difficult to insert or remove content manually without going through a robust PDF manipulation library.

ISO9660 is a disk filesystem, meant to be written once and read many times on many different kinds of hardware. As it is sector-based, it expects data structures to be at particular absolute offsets.