Skip to content

Instantly share code, notes, and snippets.

Adam Greig adamgreig

View GitHub Profile
@adamgreig
adamgreig / bin2elf.sh
Created Oct 9, 2018 — forked from tangrs/bin2elf.sh
Convert a memory dump/raw binary image into an ELF file
View bin2elf.sh
#!/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
View binja-fwimg.py
import traceback
from binaryninja import (BinaryView, Architecture, SegmentFlag, log_error,
get_address_input, log_info, SectionSemantics)
offset = 0x08000000
entry_addr = 0x080001c0
class FwImgView(BinaryView):
@adamgreig
adamgreig / axi3.py
Created Dec 14, 2017
AXI3 read-only slave in migen for Cyclone V SoC
View axi3.py
from migen import Module, Signal, FSM, If, NextState, NextValue
class AXI3SlaveReader(Module):
"""
AXI3 read-only slave.
Input signals are from the AXI3 master AR and R ports.
`regfile` is an Array which is indexed to respond to reads.
View psudmm.py
import sys
import time
import socket
import datetime
import numpy as np
import matplotlib.pyplot as plt
if len(sys.argv) != 4:
print("Usage: psudmm.py <Channel> <Max Voltage> <Voltage Step>")
sys.exit(1)
View fir.v
`timescale 10ns / 1ns
module FIR
(
input reset,
input clock,
input [11:0] u,
output [11:0] y
);
View screenshot_dmm.py
import io
import sys
import time
import socket
import struct
from PIL import Image
if len(sys.argv) != 2:
print("Usage: screenshot_dmm.py <filename>")
@adamgreig
adamgreig / Makefile
Last active Aug 29, 2015
BladeRF 10MHz Clock Output
View Makefile
all:
gcc -g -c main.c -Wall -Werror -Wpedantic
gcc -g main.o -lpthread -lm -lbladeRF -Wall -Werror -Wpedantic -o bladerf-10mhz
@adamgreig
adamgreig / hrfpsk31.c
Created Apr 16, 2015
PSK31 Modulator in C for HackRF
View hrfpsk31.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include "libhackrf/hackrf.h"
#include "psk31_varicode.h"
/*
@adamgreig
adamgreig / 00-README.md
Last active Apr 19, 2019
Run embedded Rust code on your STM32F4
View 00-README.md

Embedded Rust on STM32F4

My notes from implementing Job Vranish's excellent guide.

Follow along with the guide above, getting rustc from rustup or similar:

rustc 1.0.0-nightly (dcaeb6aa2 2015-01-18 11:28:53 +0000)
binary: rustc
commit-hash: dcaeb6aa23ecba2dc2af870668a9239136d20fa3
commit-date: 2015-01-18 11:28:53 +0000
You can’t perform that action at this time.