Skip to content

Instantly share code, notes, and snippets.

View TrebledJ's full-sized avatar
🎯
Focusing

Johnathan TrebledJ

🎯
Focusing
View GitHub Profile
@TrebledJ
TrebledJ / api-wordlist.txt
Last active December 5, 2023 17:10 — forked from yassineaboukir/List of API endpoints & objects
A list of 3203 common API endpoints and objects designed for fuzzing.
0
00
01
02
03
1
1.0
10
100
1000
@TrebledJ
TrebledJ / rev.cpp
Last active November 16, 2023 10:10
HKCERT CTF 2023 – Decompetition: Vitamin C++ reversed source code and solve scripts. Writeup: https://trebledj.me/posts/hkcert-2023-decompetition-vitamin-cpp.
//
// 100% Similarity Reversed Source Code for [HKCERT CTF 2023 – Decompetition: Vitamin C++].
// by @TrebledJ
//
#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
@TrebledJ
TrebledJ / solve.py
Created September 20, 2023 13:03
Solve scripts for HITCON 2023 The Blade. Writeup: https://trebledj.github.io/posts/hitcon-2023-the-blade
# HITCON 2023 – The Blade
# Solve Script by TrebledJ
# WriteUp: https://trebledj.github.io/posts/hitcon-2023-the-blade
import string
###############
### Part 1. ###
###############
@TrebledJ
TrebledJ / solve.py
Last active September 4, 2023 06:44
Solve scripts for DUCTF 2023 Wrong Signal. Writeup: https://trebledj.github.io/posts/ductf-2023-wrong-signal/
# DownUnderCTF 2023 – Wrong Signal
# Solve Script by TrebledJ
# WriteUp: https://trebledj.github.io/posts/ductf-2023-wrong-signal/
import z3
# Func to extract crumbs from bytes.
crumbs = lambda bs: [(b >> (2 * i)) & 0b11 for b in bs for i in range(4)]
@TrebledJ
TrebledJ / main.c
Last active May 24, 2023 14:52
STM32F405 example for 440Hz sine wave generation.
// main.c
#include "stm32f4xx_hal.h"
#include <math.h>
#include <stdint.h>
DAC_HandleTypeDef hdac;
DMA_HandleTypeDef hdma_dac1;
DMA_HandleTypeDef hdma_dac2;
@TrebledJ
TrebledJ / wavetable_synthesis.py
Last active April 7, 2023 18:31
Demonstration of wavetable synthesis using numpy and matplotlib. See it in action: https://trebledj.github.io/posts/digital-audio-synthesis-for-dummies-part-2/#wavetable-synthesis
# Wavetable Synthesis Demo
# by @TrebledJ
from matplotlib.patches import ConnectionPatch
import matplotlib.ticker as mticker
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import numpy as np
@TrebledJ
TrebledJ / additive_synthesis.py
Last active April 7, 2023 18:32
Demonstration of additive synthesis using numpy and matplotlib. See it in action: https://trebledj.github.io/posts/digital-audio-synthesis-for-dummies-part-2/#additive-synthesis
# Additive Synthesis Demo
# by @TrebledJ
import matplotlib.pyplot as plt
import numpy as np
t = np.linspace(0, 1, 44100)
t = t[:800]
@TrebledJ
TrebledJ / d22.rs
Created December 2, 2022 19:41
Advent of Code 2021 Day 22 Rust solution. Writeup: https://trebledj.github.io/posts/aoc-2021-day-22/
use regex::Regex;
use std::collections::{HashSet, LinkedList};
use std::fs;
type Set = HashSet<(cube_t, cube_t, cube_t)>;
#[allow(non_camel_case_types)]
type cube_t = i64;
type Cuboid = ((cube_t, cube_t), (cube_t, cube_t), (cube_t, cube_t));
struct Command(bool, Cuboid);
@TrebledJ
TrebledJ / charm.c
Last active December 5, 2022 16:09
Solve scripts for HKCERT 2022 C++harming Website. charm.h and .c are taken from https://github.com/jedisct1/charm. Writeup: https://trebledj.github.io/posts/hkcert-2022-cpp-harming-website/
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#ifdef __SSSE3__
#include <x86intrin.h>
#endif
#if defined(__ARM_NEON) || defined(__aarch64__)
#include <arm_neon.h>
#endif
#ifdef __linux__
@TrebledJ
TrebledJ / ezpz-rev-solve.py
Created September 28, 2022 07:46
Solve script for the DUCTF 2022 ezpz-rev reverse engineering challenge. Writeup: https://trebledj.github.io/posts/ductf-2022-ezpz-rev/
import z3
# Initialisation procedure.
encoded = '5a4b3c2d5a4b4c1d2a1e3a3b4c1d2a1e1f2a3b3c1g1d3e5f1b2c2g1d1f2e4f6g1d7f3h3g1d4f6h3g1d2f1i4j1h2k2l1m1d3i2j5k2l2m2i3j4k3l2m2i3j4k3l2m1i5j2k2n2l2m1i4j5n4l'
chars = ''
for i in range(len(encoded) // 2):
skip, char = encoded[2*i:2*i+2]
chars += int(skip) * char
assert len(chars) == 0xc4