Skip to content

Instantly share code, notes, and snippets.

View thesamesam's full-sized avatar

Sam James thesamesam

View GitHub Profile
@smx-smx
smx-smx / XZ Backdoor Analysis
Last active April 21, 2024 16:12
[WIP] XZ Backdoor Analysis and symbol mapping
XZ Backdoor symbol deobfuscation. Updated as i make progress
@rubyroobs
rubyroobs / git_repo_binary_investigation_idea.zsh
Last active April 8, 2024 11:11
a starting point for investigating anomalous contributions in git repositories
# ruby's git repo investigation zsh one-liner-ish thingy
# (a starting point for investigating anomalous contributions in git repositories)
echo "$(find . -type f ! -size 0 ! -path './.git*' -exec grep -IL . "{}" \;)" | \
sed -e "s/^\.\///g" | \
while read line; \
do \
echo ">>>>>>>>$line"; \
echo "$(git log --follow --find-renames=40% --pretty=format:"%ad%x0A%h%x0A%an%x20<%ae>%x0A%s" -- "$line" | head -n 4)"; \
commitdates="$(git log --follow --find-renames=40% --pretty=format:"%ae" -- "$line" | head -n 1 | xargs -I {} git log --author={} --pretty=format:"%ad")"; \
@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@Earnestly
Earnestly / posix-issue8.md
Last active April 22, 2024 09:13
A Selected List of Additions and Changes Coming With POSIX Issue 8

A Selected List of Additions and Changes Coming With POSIX Issue 8

Last major change: 10th March 2023

New Commands

Additions

@rkeiii
rkeiii / gist:0fe05fdcee6f520c208280acbf2b49ea
Created September 10, 2022 23:20
Hack fix script for volumes suffering ZFS encryption bug
#!/usr/bin/env bash
#
# This script attempts to recover a ZFS filesystem afflicted by the bug described in
# the following GitHub issues:
#
# * https://github.com/openzfs/zfs/issues/13859
# * https://github.com/openzfs/zfs/issues/13521
# * https://github.com/openzfs/zfs/issues/13709
#
@gyakovlev
gyakovlev / porting-with-crossdev.md
Last active March 7, 2022 22:03
porting-with-crossdev.md
@MawKKe
MawKKe / cryptsetup-with-luks2-and-integrity-demo.sh
Last active April 16, 2024 22:44
dm-crypt + dm-integrity + dm-raid = awesome!
#!/usr/bin/env bash
#
# Author: Markus (MawKKe) ekkwam@gmail.com
# Date: 2018-03-19
#
#
# What?
#
# Linux dm-crypt + dm-integrity + dm-raid (RAID1)
#
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active April 24, 2024 03:49
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th