Skip to content

Instantly share code, notes, and snippets.

@citrusui
citrusui / comments.txt
Created November 24, 2016 13:02 — forked from turbo/comments.txt
Some comments from some version of the NT <5 kernel. Unaltered.
../w32/ntgdi/fondrv/tt/ttfd/fdfc.c:// apple logo which is not allowed in msft fonts.
../dlc/llcmem.c:// damn! Miscalculated pool usage
../w32/ntgdi/printers/msplot/plotter/enable.c:// fill in the graphics capabilities flags--can't do a damn thing
../w32/ntgdi/gre/fontmap.cxx:// Device font, but the match better be a damn good one!
../w32/ntuser/client/mdiwin.c:// NO -- no bit overloading, damn it. FritzS
../w32/ntuser/client/btnctl.c:// CTLCOLOR_BTN actually set up the damned button colors.
../boot/lib/fatboot.c:// As a safety net we'll flush any dirty fats that we might have cached before...
../ndis/elnk3/receive.c:// to make sure that the fifo is not fucked up...
../ndis/elnk3/receive.c:// It's fucked up. Reset the receiver.
../tdi/tcpip/tcp/tcpsend.c:// STUPID FUCKING COMPILER generates incorrect code for this.
@citrusui
citrusui / dot_clean.sh
Created May 20, 2017 23:23 — forked from NapoleonWils0n/dot_clean.sh
macosx: dotclean remove dot underscore and ds_store files
#!/bin/sh
# =================================================
# = remove dot underscore file and ds_store files =
# =================================================
# syntax
dot_clean /path/to/folder
@citrusui
citrusui / xnu-4570.1.46-arm64-steps.txt
Created October 9, 2017 23:03 — forked from Proteas/xnu-4570.1.46-arm64-steps.txt
steps to build arm64 version of xnu-4570.1.46
Following are my steps to build the ARM64 version of xnu-4570.1.46, hope this is helpfull for saving time.
1. Use Xcode 9.0
2. Preparation is same as macOS, and there is a guide: https://0xcc.re/building-xnu-kernel-macosx-sierrra-10-12-x/
3. There is an ARM64 version libfirehose: https://github.com/Proteas/install_firehose_lib
4. Copy and edit the ARM64 config(CFLAGS, LDFLAGS) from darwin-on-arm/xnu to your target project
5. Example CFLAGS: -Darm64 -DARM64 -D__arm64__ -D__ARM64__ -DLP64 -DCONFIG_EMBEDDED -mkernel -DARM64_BOARD_CONFIG_T8011=1
6. Fix compiling stage errors by directly importing the missing headers or editing the code
7. Fix linking stage errors by implementing place holder funcitons for: chudxnu_cpu_alloc, etc
8. If missing symbol __divti3 in linking stage, get the runtime from llvm.
#!/usr/bin/env python3
'''convert payload to zip'''
import struct
import sys
import zipfile
import datetime
import io
import lzma
def get_chunk(payload, chunknum):
@citrusui
citrusui / SMBDIS.ASM
Created October 16, 2017 18:58 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@citrusui
citrusui / imageHandler.js
Created January 27, 2018 16:12
Handling Images in JavaScript
function imageHandler(action, image, callback) {
switch (action) {
case 'fallback':
if (image.hasAttribute('data-fallback')) {
image.style.backgroundColor = image.getAttribute('data-fallback');
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function Note(e) {
this.coord = e
}
function Interval(e) {
this.coord = e
}
function add_addsubtract_func(e) {
return e.add = function(e) {
/*
Traverse through all the Text Nodes in a page and force them to display hidden characters
Sources:
Hacker news: https://news.ycombinator.com/item?id=16749422
user: tim333's js fiddle https://jsfiddle.net/tim333/np874wae/13/
medium post: https://medium.com/@umpox/be-careful-what-you-copy-invisibly-inserting-usernames-into-text-with-zero-width-characters-18b4e6f17b66
TODO:
@citrusui
citrusui / Mojave-dynamic-wallpaper-notes.md
Created June 7, 2018 01:25 — forked from ole/Mojave-dynamic-wallpaper-notes.md
Reverse-engineering the dynamic wallpaper file format in macOS Mojave.

The dynamic wallpaper in MacOS Mojave is a single 114 MB .heic file that seems to contain 16 embedded images.

It also contains the following binary plist data in its metadata under the key "Solar". It's an array of 16 items, each with four keys: