Skip to content

Instantly share code, notes, and snippets.

@jgensler8
jgensler8 / README.md
Last active September 24, 2022 22:06
solana compute budget testing
@camthesaxman
camthesaxman / doldisasm.py
Last active April 22, 2024 21:42
GameCube .dol disassembler
#!/usr/bin/env python
#
# GameCube .dol file disassembler
# Usage: doldisasm.py DOL_FILE > assembly_file.s
#
from capstone import *
from capstone.ppc import *
import sys
This file has been truncated, but you can view the full file.
.text section layout
00000000 000084 80006e00 00002fe0 4 __dt__Q44nw4r2ut6detail12LinkListImplFv libnw4r_ut.a ut_LinkList.o
00000084 000048 80006e84 00003064 4 Erase__Q44nw4r2ut6detail12LinkListImplFQ54nw4r2ut6detail12LinkListImpl8Iterator libnw4r_ut.a ut_LinkList.o
000000cc 00002c 80006ecc 000030ac 4 Insert__Q44nw4r2ut6detail12LinkListImplFQ54nw4r2ut6detail12LinkListImpl8IteratorPQ34nw4r2ut12LinkListNode libnw4r_ut.a ut_LinkList.o
000000f8 000030 80006ef8 000030d8 4 Erase__Q44nw4r2ut6detail12LinkListImplFPQ34nw4r2ut12LinkListNode libnw4r_ut.a ut_LinkList.o
00000128 000074 80006f28 00003108 4 IsValidBinaryFile__Q24nw4r2utFPCQ34nw4r2ut16BinaryFileHeaderUlUsUs libnw4r_ut.a ut_binaryFileFormat.o
0000019c 000078 80006f9c 0000317c 4 ReadNextCharUTF8__Q34nw4r2ut14CharStrmReaderFv libnw4r_ut.a ut_CharStrmReader.o
00000214 00001c 80007014 000031f4 4 ReadNextCharUTF16__Q34nw4r2ut14CharStrmReaderFv libnw4r_ut.a ut_CharStrmReader.o
@lcrilly
lcrilly / README.md
Last active April 29, 2024 15:58
NGINX OAuth 2.0 Token Introspection

OAuth 2.0 Token Introspection with NGINX and njs

This configuration enables NGINX to validate an authentication token against an authorization server by using OAuth 2.0 Token Introspection (RFC 7662). This solution uses the auth_request module and the NGINX JavaScript module to require authentication and perform the token introspection request.

By default, the client's authentication token is expected as a bearer token supplied in the Authorization header. If supplied elsewhere in the HTTP request, the $access_token variable must be configured to specify where to obtain the token.

Token introspection requests are authenticated. By default, the $oauth_client_id and $oauth_client_secret variables are used to perform HTTP Basic authentication with the Authorization Server. If only the $oauth_client_secret variable is specified then that value is used

@miguelmota
miguelmota / notes.md
Last active October 26, 2023 08:37
BIP32 vs BIP39 vs BIP44
  • BIP32 - is a method for generating a tree of private keys from a master private key.
  • BIP39 - is a method for encoding 128-256 bits of random data into 12-24 word phrases from a list of interchangeable 2018 words, and then turn those phrases into a 64-byte hash.
  • BIP44 - is a method for structuring a private key tree in a specific way that will facilitate usage/restoration/discovery of multiple accounts for multiple purposes.
@mariomadproductions
mariomadproductions / debug_games.md
Last active April 27, 2024 10:12 — forked from unreceptive/debug_games.md
List of video games shipped with debug symbols.

List of any video game shipped with debugging symbols.

Contributions are welcome.

Name Version Platform Notes
Brunswick Pro Bowling Unknown Nintendo 3DS Contains an ELF binary with full symbol information in its RomFS root
Fire Emblem: If/Fates All (double check) Nintendo 3DS All released versions of the game contain "name.StackTrace" and "addr.StackTrace" files in the "debug" folder in the RomFS, which provide full function names/signatures for the game's code.bin
Inazuma Eleven 3 Lightning Bolt / Team Ogre Attacks / Bomb Blast Unknown Nintendo 3DS CRO/CRS contains symbols
The Legend of Zelda: The Wind Waker n/a Nintendo GameCube
@SKempin
SKempin / Git Subtree basics.md
Last active May 16, 2024 20:38
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main
@pjdietz
pjdietz / rfc3339.js
Last active March 14, 2024 10:57
Format a local date as an RFC 3339 date with timezone
function rfc3339(d) {
function pad(n) {
return n < 10 ? "0" + n : n;
}
function timezoneOffset(offset) {
var sign;
if (offset === 0) {
return "Z";
@dvliman
dvliman / gist:11264471
Created April 24, 2014 18:24
4chan source code leak
<?
if(file_exists('/www/global/lockdown')) {
if($_COOKIE['4chan_auser'] && $_COOKIE['4chan_apass'] && ($_POST['mode']=='usrdel'||$_GET['mode']=='latest')) {
// ok
}
else {
die('Posting temporarily disabled. Come back later!<br/>&mdash;Team 4chan (uptime? what\'s that?)');
}
}
include_once "./yotsuba_config.php";