Skip to content

Instantly share code, notes, and snippets.

from ghidra.program.model.address import Address
from ghidra.program.model.mem import MemoryAccessException
from ghidra.program.flatapi import FlatProgramAPI
from ghidra.util.task import TaskMonitor
import math
import json
from os.path import isfile, join, dirname
import struct as st
import string
@SamL98
SamL98 / fob_trigger_and_read.cpp
Created September 14, 2020 23:22
HCS361 Trigger+Read
#define SAMPLE_OFFSET 188
#define NSAMPLES 68
#define TRACES_TO_CAPTURE 200
#define FOB_PIN 5
#define BUTTON_PIN 8
#define TRIGGER_PIN 9
unsigned int timeDiffs[NSAMPLES]; // the diffs (us) between all the codeword pulses received
unsigned char bits[NSAMPLES - 1]; // timeDiffs converted into bits according to the VPWM modulation in the datasheet
@SamL98
SamL98 / skiphook.m
Created June 6, 2019 00:01
Hooks and accompanying code for Skiptracing
// MARK: SkipManager
#define NUM_SKIP_BYTES 10
#define BYTES_PER_LINE 34
#define SKIP_FILE_PATH "/Users/samlerner/Documents/Spotify/skipped.csv"
// SkipManager class to handle writing skips to files
class SkipManager {
public:
@SamL98
SamL98 / sputil.py
Last active August 18, 2022 19:15
Core of SPUtil Module
# Partial library I wrote a while ago that is a wrapper for spotipy.
# I'm not particularly proud of the code so I only posted what's needed to understand
# my get_recents.py gist
import os
import spotipy.util as util
base_url = 'https://api.spotify.com/v1/'
auth_header = None
@SamL98
SamL98 / get_recents.py
Last active March 9, 2024 01:54
Python Script for Getting Spotify Listening History
# To run as a local cron job, edit your crontab like so:
#
# SPOTIPY_USER_ID=<redacted>
# SPOTIPY_CLIENT_ID=<redacted>
# SPOTIPY_CLIENT_SECRET=<redacted>
# script_path=<redacted>
# SPPATH=$script_path
# python_path=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
#
# PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin