Skip to content

Instantly share code, notes, and snippets.

View SpaghettDev's full-sized avatar
🌌
eclipsing all over the place

SpaghettDev SpaghettDev

🌌
eclipsing all over the place
View GitHub Profile
@SpaghettDev
SpaghettDev / mach_o.py
Created August 17, 2024 19:15
Get Mach-O binary target platform IDAPython
import idaapi
import struct
MINIMUM_OS_VERSION_LOAD_COMMAND = 0x32
# https://en.wikipedia.org/wiki/Mach-O#Minimum_OS_version
PLATFORM_TYPES = {
0x00000001: "macOS",
0x00000002: "iOS",
0x00000003: "tvOS",
0x00000004: "watchOS",
@SpaghettDev
SpaghettDev / cpp-func-args-parser.py
Last active August 31, 2024 21:04
C++ function arguments parser in python (no regex real). From BromaIDA.
CPP_TYPE_SPECIFIERS = ("unsigned", "signed")
CPP_TYPE_QUALIFIERS = ("const", "volatile")
def parse_str_args(args_str: str) -> list[tuple[str]]:
"""Mini parser that converts a string of arguments
into a list of tuples in the form of ("type", "name").
Supports templates, named and unnamed arguments,
as well as stuff like long long, const short int...
@SpaghettDev
SpaghettDev / layer.hpp
Last active December 17, 2023 15:12
An FLalertLayer than actually registers touch events within nested CCMenus (Geometry Dash)
#include <cocos2d.h>
#include <gd.h>
class Layer : public gd::FLAlertLayer
{
public:
CCMenu* m_pMenu{};
void onEnter() override
{
@SpaghettDev
SpaghettDev / range.js
Created August 29, 2023 14:21
Python-like range function in Javascript.
/**
* Python-like range function
*
* @param start {Number} Start value, inclusive, if end isn't provided, start is end
* @param end {Number|null} End value, exclusive, defaults to null
* @param step {Number} Step value, default to 1
* @returns {Array} [start, start+step, start+step*2, ..., end - 1]
*/
const range = (start, end=null, step=1) => {
@SpaghettDev
SpaghettDev / radio_stations.cpp
Created November 4, 2022 12:10
All GTA 5 radio stations (including hidden ones).
// Taken from https://gist.github.com/Sainan/e290bef8b482005a01f3444d3341ac5f
// and https://web.archive.org/web/20211024160434/https://pastebin.com/Kj9t38KF.
std::vector<std::string> radio_stations{
"RADIO_11_TALK_02", // Blaine County Radio
"RADIO_12_REGGAE", // The Blue Ark
"RADIO_13_JAZZ", // Worldwide FM
"RADIO_14_DANCE_02", // FlyLo FM
"RADIO_15_MOTOWN", // The Lowdown 9.11
"RADIO_20_THELAB", // The Lab