Skip to content

Instantly share code, notes, and snippets.

View LiquidFenrir's full-sized avatar

Théo B. LiquidFenrir

  • France
  • 02:33 (UTC +02:00)
View GitHub Profile
@LiquidFenrir
LiquidFenrir / ctrulib_fonttool.py
Created June 13, 2019 02:08
This file is a python script (that requires Pillow/PIL) to decode a ctrulib font file to an image, or encode a png to a ctrulib font file
"""
This file is a python script (that requires Pillow/PIL) to decode a ctrulib font file to an image, or encode a png to a ctrulib font file
ctrulib: https://github.com/smealum/ctrulib
Copyright (C) 2019 LiquidFenrir
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@LiquidFenrir
LiquidFenrir / line_by_line.py
Created October 14, 2018 00:41
execute a python script line by line from another python script, using threads and bdb
import sys
import bdb
import threading
class ActualRunner(bdb.Bdb):
def __init__(self):
bdb.Bdb.__init__(self)
self.line_no = -1
self.program_done = False
@LiquidFenrir
LiquidFenrir / main.c
Created July 14, 2018 19:37
string_append
#include <stdio.h>
#include <stdlib.h>
// You need to pass a pointer since the pointer itself is being modified
void append_string(const char *** array, const char * string)
{
if(*array == NULL) // If the array is empty, allocate it with size 2 for the current string and an ending null marker
{
*array = malloc(sizeof(const char *)*2);
if(*array == NULL) // if *array is NULL, then malloc failed because it couldn't find enough memory
# https://www.reddit.com/r/dailyprogrammer/comments/8rcjx0/20180615_challenge_363_hard_anagram_slices/
words_length = 4
def get_letter_count(word):
letters = {chr(letter): 0 for letter in range(ord('a'), ord('z')+1)}
for letter in word:
letters[letter] += 1
out = []
for letter in range(ord('a'), ord('z')+1):
# https://www.reddit.com/r/dailyprogrammer/comments/8n8tog/20180530_challenge_362_intermediate_route/
from os import system
from time import sleep
visualization = True
def print_grid(grid, x=-1, y=-1):
if x != -1 and y != -1:
system("cls")
print("\x1b[1;1H", end="")

Keybase proof

I hereby claim:

  • I am liquidfenrir on github.
  • I am liquidfenrir (https://keybase.io/liquidfenrir) on keybase.
  • I have a public key ASC72JR4gQQZkOphbnqnBMRxJcvF1dMaknb0mu8QsXrk-Qo

To claim this, I am signing this object:

@LiquidFenrir
LiquidFenrir / boot_native.gm9
Last active December 19, 2017 23:53
GM9 script to boot native_firm from sysnand ctrnand
# GodMode9 "Boot NATIVE_FIRM"
# Launches NATIVE_FIRM from sysnand ctrnand, WARNING: do NOT update
# last changed: 20171220
# author: LiquidFenrir
find 1:/title/00040138/00000002/content/????????.app NATIVEAPP
imgmount $[NATIVEAPP]
set CPPATH 0:/luma/payloads/native.firm
cp -h -w G:/exefs/.firm $[CPPATH]
imgumount
@LiquidFenrir
LiquidFenrir / gist:d110f3e7755ffbe82672eda49ae21af2
Last active February 21, 2023 22:06
gdb 101 for 3ds, credits to Stary
1. enable debugger in rosalina menu
go to process list
select a process
2. launch arm-none-eabi-gdb <path to elf>
command "target remote ip:port"
3. command "continue" or "c" to resume execution
4.
@LiquidFenrir
LiquidFenrir / common.h
Last active June 4, 2017 15:55
simple filebrowser for 3ds
#pragma once
#include <3ds.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdbool.h>
// according to wikipedia, the max FAT32 path length is 255 UTF-16 characters, so 0xFF * 2 (because the 16 in UTF-16 means 16 bits = 2 bytes) (shifting left of 1 is the same as multiplying by 2)