Skip to content

Instantly share code, notes, and snippets.


Nick Desaulniers nickdesaulniers

View GitHub Profile
View gist:ebbc625a359d1d3e292e1fd2007ecb52
pushd /image/usr/src/linux-5.13.12
make ARCH=x86_64 mrproper
make ARCH=x86_64 INSTALL_HDR_PATH=/image/usr headers_install
mkdir -p /image/var/tmp/build/compiler-rt-12.0.1
pushd /image/var/tmp/build/compiler-rt-12.0.1
cmake -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_COMPILER_TARGET=x86_64-unknown-linux-musl \
View defconfig
PixelSergey /
Last active March 13, 2023 02:57
Dump games with godmode9

Dumping games with Godmode9

Dumping games is the act of taking a game from your system or gamecart and copying it into a readable format onto your SD card. Dumping is perfectly legal if you keep the dumps to yourself, however sharing these dumps is piracy and is illegal.

This guide will tell you how to dump games from various formats and for various purposes. Dumping 3DS cartriges as .cia files is good if you want to install them to your system. Dumping them as .3ds files is good for emulators. Installed titles cannot be dumped as .3ds files. NDS cartiges can only be dumped as .nds files and cannot be installed (however, you can play them with emulators or flashcarts).

Dumping the RomFS of a game is primarily for romhacking purposess.

shafik /
Last active March 23, 2023 06:58
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

rygorous / gist:e0f055bfb74e3d5f0af20690759de5a7
Created May 8, 2016 06:54
A bit of background on compilers exploiting signed overflow
View gist:e0f055bfb74e3d5f0af20690759de5a7
Why do compilers even bother with exploiting undefinedness signed overflow? And what are those
mysterious cases where it helps?
A lot of people (myself included) are against transforms that aggressively exploit undefined behavior, but
I think it's useful to know what compiler writers are accomplishing by this.
TL;DR: C doesn't work very well if int!=register width, but (for backwards compat) int is 32-bit on all
major 64-bit targets, and this causes quite hairy problems for code generation and optimization in some
fairly common cases. The signed overflow UB exploitation is an attempt to work around this.
paragonie-scott /
Last active February 24, 2023 06:02
An Open Letter to Developers Everywhere (About Cryptography)
sergnechaev / sdl2_opengl.cpp
Last active September 26, 2022 02:34 — forked from exavolt/sdl2_opengl.c
Very basic SDL2 OpenGL application (C++1y)
View sdl2_opengl.cpp
#include <iostream>
#include <cmath>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
constexpr int SCREEN_WIDTH = 800;
constexpr int SCREEN_HEIGHT = 600;
anonymous / joshVR.xml
Created August 24, 2015 11:39
joshVR snapshot
View joshVR.xml
<!-- VR X-Wing by David Bryant ( -->
<!-- X-Wing = all parts grouped together -->
<group scaleX="1.0" scaleY="1.0" scaleZ="1.0"
rotateX="0.0" rotateY="0.0" rotateZ="0.0"
translateX="0.0" translateY="0.0" translateZ="0.0">
<!-- Fuselage -->
<!-- Main body -->
anonymous / joshVR.xml
Created August 23, 2015 14:35
joshVR snapshot
View joshVR.xml
<!-- VR Airplane by David Bryant ( -->
<!-- Airplane = all parts grouped together -->
<group rotateX="0.23" rotateY="0.00" rotateZ="0.0" translateX="0.0" translateY="0.0" translateZ="0.0">
<!-- Fuselage -->
<sphere translateY="1.0" scaleX="5.0" scaleZ="0.7" scaleY="0.7"/>