Skip to content

Instantly share code, notes, and snippets.

View aboood40091's full-sized avatar

AboodXD aboood40091

View GitHub Profile
@aboood40091
aboood40091 / ptclTool.py
Created July 13, 2024 17:44
NSMBU PTCL exporter and importer
import enum
from itertools import chain
import math
import os
import struct
import subprocess
import sys
from typing import Union
from typing import Tuple
@aboood40091
aboood40091 / cwfilt.py
Last active August 26, 2021 15:51 — forked from bwrsandman/cwfilt.py
CodeWarrior C++ Symbol Demangler
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Changes in this fork by aboood40091:
# - Added support for arrays and functions as parameters.
# - Added support for static local variables.
# - Properly show the return type of function if applicable.
# - Added different modes. (File reading, passing symbol as argument, console)
# - Added overriding known function names.
# - Fixed several bugs.
@aboood40091
aboood40091 / aglResShaderArchive.cpp
Created May 5, 2021 00:48
Decompilation / Rewrite of agl::ResBinaryShaderArchive (and relevant structures) for SHARCFB parsing
#include "aglResShaderArchive.h"
#include <cstring>
namespace agl {
const char* ResBinaryShaderArchiveData::getExtension()
{
return ".sharcfb";
}
root_heaps:
- heap_name: RootHeap
heap_type: ExpHeap
heap_address: 0x1061F068
heap_size: 0x3C000000
heap_direction: Forward
heap_children:
- heap_name: sead::ThreadMgr
heap_type: ExpHeap
heap_address: 0x1061F12C
@aboood40091
aboood40091 / setup.py
Created August 25, 2019 18:08
Build all pyx files in the same directory as this script.
from distutils.core import setup
from Cython.Build import cythonize
from os import listdir
for file in listdir('.'):
if file[-4:] == '.pyx':
setup(ext_modules = cythonize(file))
import json
import os
import struct
import shutil
from PIL import Image
folder = input('Enter folder path:')
outFolder = os.path.join(folder, "out")
if not os.path.isdir(outFolder):
@aboood40091
aboood40091 / sharc_read.py
Created July 8, 2019 09:01
Shader Archive (SHAA/.sharc) reader
import struct
import os
header = None
supported_versions = [0xA, 0xB]
class Header:
def __init__(self, endianness='<'):
@aboood40091
aboood40091 / bone.py
Last active February 15, 2021 09:53
Basic class for bones in native python
from math import asin, atan2, copysign, cos, fabs, pi, sin
def _matMultiply(mat1, mat2):
matW1 = len(mat1[0])
matH1 = len(mat1)
matW2 = len(mat2[0])
matH2 = len(mat2)
assert matW1 == matH2
@aboood40091
aboood40091 / bfres_tex_replacer.py
Created July 9, 2018 12:07
A tool for replacing BNTX files inside a BFRES
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# BFRES textures replacer
# Copyright © 2018 AboodXD
import struct
import time
from tkinter import Tk, filedialog
@aboood40091
aboood40091 / obj_sorter.py
Created July 4, 2018 08:12
A tool to sort NSMBU/NSLU .json objects manually
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Object Sorter
# Copyright © 2018 AboodXD
import json, os, re, sys
from PyQt5.QtCore import QSize
from PyQt5.QtGui import QIcon, QPalette, QPixmap