Skip to content

Instantly share code, notes, and snippets.

View jevinskie's full-sized avatar

Jevin Sweval jevinskie

View GitHub Profile
@mildsunrise
mildsunrise / create-object.py
Last active December 14, 2024 14:23
recursively creates git objects (trees, blobs) mirroring a directory in disk
import os, stat
from contextlib import contextmanager
from subprocess import run
@contextmanager
def fd_context(fd: int):
try:
yield fd
finally:
os.close(fd)
@carrot-c4k3
carrot-c4k3 / gspoc.txt
Last active October 4, 2025 18:03
Game Script native code execution PoC
// native code exec PoC via Game Script - @carrot_c4k3 (exploits.forsale)
//
// sample shellcode: mov rax, 0x1337; ret;
// drop your own shellcode inplace here
let shellcode = [0x48,0xC7,0xC0,0x37,0x13,0x00,0x00,0xC3]
// hex printing helper functions
let i2c_map = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']
let c2i_map = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, 'A': 0xA, 'B': 0xB, 'C': 0xC, 'D': 0xD, 'E': 0xE, 'F': 0xF}
# mini proof of concept of how to use Z3 to prove the correctness of bit
# manipulation formulas, using the Ternary.__add__ function from
# https://gist.github.com/dougallj/9211fd24c3759f7f340dede28929c659 as an
# example
# partly inspired by Philip Zucker's post about Z3 and ranges:
# https://www.philipzucker.com/more-stupid-z3py-tricks-simple-proofs/
import z3
@platomav
platomav / cabextract.py
Created June 1, 2024 22:48
Microsoft CAB Archive Extractor (Python-based)
#!/usr/bin/env python3
# coding=utf-8
"""
Microsoft CAB Archive Extractor (Python-based)
Usage: cabextract.py [-h] [-o OUTPUT_DIR] [paths ...]
Copyright (c) 2024 Plato Mavropoulos
"""
@apetenchea
apetenchea / manuals.py
Last active October 18, 2025 09:16
Download any manuals from https://www.manua.ls
# This script gathers all the pages of a manual and merges them into a PDF.
# You'll need to play a bit with inspect-element in order to figure out the format the correct url,
# but it should be easy to adapt it to any manual.
# This script is specifically for https://www.manua.ls/audi/q3-2018/manual.
# Their url format is https://www.manua.ls/viewer/{manual-id}/{page-number}/bg{page-number-hex}.png
# Example: https://www.manua.ls/viewer/668006/100/bg64.png
# Enjoy!
import requests
from tqdm import tqdm
from PIL import Image
@dlevi309
dlevi309 / objc_description.m
Created May 21, 2024 01:43
Dumps Objective-C class/instance info at runtime
//
// MIT License
//
// Copyright (c) 2024 Derek Selander
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@vtta
vtta / cwisstable.h
Last active July 19, 2024 21:59
A modified swisstable header for kernel use, orignal version: https://github.com/google/cwisstable. We need this because kernel's `rhashtable` does not support the "flat" mode in which small objects are stored directly in the table.
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@maikxchd
maikxchd / cbe_spu_fatan.c
Last active October 23, 2025 18:37
An implementation of a function to calculate arctangent approximations on the CELL SPU using the Estrin Method
#ifndef CBE_SPU_FATAN
#define CBE_SPU_FATAN
#include <stdint.h>
#include <spu_intrinsics.h>
#include <spu_mfcio.h>
// Helper functions to load constant values into quadwords
// These functions load pre-computed constant values into quadwords,
// which can be efficiently used in SIMD operations on the CELL SPE.
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/ioctl.h> // for _IOW, a macro required by FSEVENTS_CLONE
#include <sys/types.h> // for uint32_t and friends, on which fsevents.h relies
#include <unistd.h>
#include <string.h> // memset
//#include <sys/_types.h> // for uint32_t and friends, on which fsevents.h relies
#include <sys/stat.h> // for mkdir
@sebjvidal
sebjvidal / ViewController.swift
Created April 30, 2024 15:50
Apple Journal Calendar UI Demo
//
// ViewController.swift
// Journal-Calendar-Demo
//
// Created by Seb Vidal on 30/04/2024.
//
import UIKit
class ViewController: UIViewController {