Skip to content

Instantly share code, notes, and snippets.

View pelrun's full-sized avatar

James Churchill pelrun

  • Melbourne, Australia
View GitHub Profile
@henryfung3a27
henryfung3a27 / mem_init_block.py
Created November 18, 2019 03:50
A Ghidra script to initialise a block of uninitialised memory and set bytes to the block
# Initialise a block of memory by splitting the block of memory of interest, set
# them to initialised and set bytes to them
#@author Henry Fung
#@category CustomScript
#TODO Add User Code Here
def mySplit(start, end, value=""):
mem = currentProgram.getMemory()
aStart = currentAddress.getAddress(start)
aEnd = currentAddress.getAddress(hex(int(end, base=16) + 1)[2:])
@lwerdna
lwerdna / rel2elf.py
Created August 22, 2019 21:17
convert SDCC .rel files to 32-bit ELF relocatable
#!/usr/bin/env python
#
# convert SDCC .rel files to 32-bit ELF relocatable
#
# resulting file structure:
#
# ------------------------
# ELF header
# ------------------------
# .text section
@mgeeky
mgeeky / udp-superfunkychat-dissector.lua
Last active April 8, 2022 05:54
My first Wireshark LUA dissector (UDP): dissecting James Forshaw's SuperFunkyChat (https://github.com/tyranid/ExampleChatApplication) network protocol.
--
-- SuperFunkyChat (https://github.com/tyranid/ExampleChatApplication) by James Forshaw - Wireshark UDP dissector
--
-- On Fedora one has to install wireshark-devel first:
-- $ sudo dnf install wireshark-devel -y
--
-- Then it can be used as following:
-- $ wireshark -X lua_script:udp-superfunkychat-dissector.lua -r capture.pcap -Y "udp.port == 12345"
--
-- Wrriten by: Mariusz B. / mgeeky, '18
@Tenzer
Tenzer / 000-README.md
Last active July 16, 2024 10:19
LastPass Pwned Passwords checker

LastPass Pwned Passwords checker

This is a script for checking if any of the passwords you have stored in LastPass have been exposed through previous data breaches.

To use the script you need to have Python 3 installed and you need a CSV export of your LastPass vault. The export can be generated from the LastPass CLI with:

lpass export > lastpass.csv

or can be extracted with the browser plugin by going to the LastPass icon → More Options → Advanced → Export → LastPass CSV File (note that I did have problems getting this to work).

@gbaman
gbaman / HowToOTG.md
Last active November 3, 2024 17:19
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@royshil
royshil / SimpleAdHocTracker.cpp
Created March 15, 2015 18:21
Ad-Hoc AR tracker from a planar scene without need for markers
/*
* SimpleAdHocTracker.cpp
*
* Created on: Mar 15, 2015
* Author: roy_shilkrot
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Roy Shilkrot
*
@pixelhandler
pixelhandler / pre-push.sh
Last active July 2, 2024 11:27
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@tangrs
tangrs / bin2elf.sh
Last active October 31, 2024 04:51
Convert a memory dump/raw binary image into an ELF file
#!/bin/sh
# Convert a raw binary image into an ELF file suitable for loading into a disassembler
cat > raw$$.ld <<EOF
SECTIONS
{
EOF
echo " . = $3;" >> raw$$.ld