Skip to content

Instantly share code, notes, and snippets.

@AreTillery
AreTillery / find_magic_costs.py
Last active May 30, 2021 20:25
Find the spell costs at each level of Magic in a Zelda 2 ROM.
inputfile = r"path\to\ROM"
# Because ROM hacks might change the actual spells, I left out the names from the list, but here they are, along with vanilla costs:
"""
Vanilla costs:
Shield [32, 24, 24, 16, 16, 16, 16, 16]
Jump [48, 40, 32, 32, 20, 16, 12, 8]
Life [70, 70, 60, 60, 50, 50, 50, 50]
Fairy [80, 80, 60, 60, 40, 40, 40, 40]
Fire [120, 80, 60, 30, 16, 16, 16, 16]
# Based on a simple python project from Al Sweigart's (twitter: @AlSweigart) Small Python Projects book, I thought I'd hack together a quick board generation and print routine.
# Allows for an arbitrary sized board. Only handles generation and printing, not the rest of the game.
import random
boardx = 7
boardy = 3
board = None
def drawboard(board):
@AreTillery
AreTillery / arbitraryShellcodeLinux.c
Last active April 4, 2021 21:33
Created for use by a friend who needed a quick way to test shellcode detection in an EDR tool. This program copies shellcode into an executable portion of memory then runs it.
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <sys/mman.h>
typedef void (*funcPtrType)(void);
int main(int argc, char** argv)