- Install
gdb
- Install GDB PEDA
- Install
nasm
- Create a makefile:
%: %.asm nasm -f elf64 $< && ld -s -o $@ [email protected] all: $(patsubst %.asm,%,$(wildcard *.asm))
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
description = "Bevy flake"; | |
inputs = | |
{ | |
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # or whatever vers | |
}; | |
outputs = { self, nixpkgs, ... }@inputs: | |
let | |
system = "aarch64-darwin"; # your version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# depends on having `wmctrl`, `xdotool`, and `zenity` installed. | |
import argparse | |
import re | |
import subprocess | |
import os | |
import traceback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# `pip install raylib` to get pyray | |
import pyray as rl | |
from dataclasses import dataclass | |
import random | |
from typing import Optional | |
SIZE = 32 | |
def copy_rect(rect): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
tailscale = { | |
source = "tailscale/tailscale" | |
version = "0.13.7" | |
} | |
} | |
} | |
provider "tailscale" { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Script to solve SRA in picoCTF 2023 | |
The challenge provides a broken version of RSA that gives the user the cipher text | |
and d (e^-1) for the private key. n is not given. Below is the original script | |
with some annotations I added. | |
from Crypto.Util.number import getPrime, inverse, bytes_to_long | |
from string import ascii_letters, digits | |
from random import choice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python implementation of the wordwrap algorithm from | |
# http://blogs.perl.org/users/damian_conway/2019/08/greed-is-good-balance-is-better-beauty-is-best.html | |
import math | |
import re | |
def cost(lines, width): | |
# NOTE: not skipping the last line in the uniformity cost since | |
# if there's no way of splitting in greedy_wrap, the last line ends up | |
# with everything on it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import wraps | |
from collections import defaultdict | |
from dataclasses import dataclass, field | |
from typing import Dict, List | |
import ast | |
import inspect | |
class StateFinder(ast.NodeVisitor): | |
def __init__(self, state_name): | |
self.state_name = state_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: tailscale | |
# Required-Start: $local_fs $all $network | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: Tailscale daemon | |
# Description: Runs the tailscale daemon. | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RawFrame(gdb.Command): | |
"""Dump the raw memory for the stack while visualizing a stack frame""" | |
def __init__ (self): | |
super().__init__('raw-frame', gdb.COMMAND_USER) | |
def invoke(self, arg, from_tty): | |
sp = gdb.selected_frame().read_register('rsp').cast(gdb.lookup_type('unsigned char').pointer()) | |
bp = gdb.selected_frame().read_register('rbp').cast(gdb.lookup_type('unsigned char').pointer()) | |
def hex_word(addr, length=8): |
NewerOlder