Skip to content

Instantly share code, notes, and snippets.

@sprout42
sprout42 / gist:16d3a2966a949b96368eaeeb9df620ce
Created May 21, 2016 04:10
Rust running as a Xen Mini-OS guest
xen-test@xen-test:/usr/src/xen/stubdom/rust$ sudo xl create -c ./rust-dom.cfg
Parsing config from ./rust-dom.cfg
Xen Minimal OS!
start_info: 0xfa000(VA)
nr_pages: 0x2000
shared_inf: 0x7fcd7000(MA)
pt_base: 0xfd000(VA)
nr_pt_frames: 0x5
mfn_list: 0xea000(VA)
mod_start: 0x0(VA)
@sprout42
sprout42 / gnuradio_install.sh
Last active December 16, 2023 15:20
Installing gnuradio w/ companion on MacOS
# This compiles and installs gnuradio including gnuradio-companion for MacOS.
# It uses homebrew (https://brew.sh/) for all non-python libraries and pyenv
# (https://github.com/pyenv/pyenv) for managing python. I'm sure some of this
# would be easier if I used homebrew for python as well but I've found pyenv
# and standard pip to be less buggy in general. However it does mean that for
# python packages that don't install with pip you need to download and compile
# the packages.
#
# Note that this script is not very robust yet, it's not made to run more than
# once (sorry). ~If~ When you find bugs please let me know and we'll update
#!/bin/bash -ex
# These instructions are mostly adapted from here:
# http://openwall.info/wiki/john/tutorials/Ubuntu-build-howto
#
# With some additional build steps from here:
# https://github.com/magnumripper/JohnTheRipper/wiki/Fallback-binary-chains
# Required stuff
sudo apt-get install build-essential libssl-dev
# example using the VM from https://practicalbinaryanalysis.com/
# Get some handy virt-manager and virtsh tools
$ sudo apt install virt-manager
# Make sure the libvirtd service is running
$ systemctl status libvirtd.service | head -13
● libvirtd.service - Virtualization daemon
Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-03-26 13:55:54 EDT; 27min ago
@sprout42
sprout42 / gist:b86ec97edd362ed64fef4cf5385f15d4
Last active June 28, 2020 13:21
WIP: Building a standalone Instagiffer install for MacOS
brew install tcl-tk
brew install pyenv
<setup .bash_profile for pyenv>
# Make sure not to use a virtualenv! py2app doesn't work
# we have to use a pyenv-alias instead to make a clean pythong env
git clone https://github.com/s1341/pyenv-alias.git $(pyenv root)/plugins/pyenv-alias
VERSION_ALIAS="2.7.16_instagiffer" \
LDFLAGS="-L$(brew --prefix zlib)/lib -L$(brew --prefix sqlite)/lib -L$(brew --prefix tcl-tk)/lib -ltcl8.6 -ltk8.6" \
@sprout42
sprout42 / build_unfork.sh
Created November 12, 2019 17:18
Compile unfork
#!/bin/bash -ex
# Downloads and builds the dependencies of https://github.com/whitequark/unfork.
# For some reason I keep getting an ENOMEM error from the kernel (Ubuntu 19.10:
# 5.3.0-19-generic) when unfork tries to mmap the vsyscall segment of a target
# process. For now this script works around that with a patch until I figure out why.
# Make sure a 32bit compiler is installed
sudo apt install -y gcc-multilib-i686-linux-gnu g++-multilib-i686-linux-gnu
if [ ! -d unfork ]; then
@sprout42
sprout42 / fsm_blink_test.py
Created December 24, 2019 06:31
playing with nMigen and the icebreaker
@sprout42
sprout42 / greatfet.lua
Last active February 27, 2020 17:48
GreatFET USB messages dissector
-- GreatFET USB protocol decoder
-- Run this to dump the classes and verbs in your greatfet firmare:
--
-- print('greatfet_classes = {')
-- gf_classes = sorted(gf.apis.core.get_available_classes())
-- for c in gf_classes:
-- print(' [%#06x] = {' % (c))
-- class_name = gf.apis.core.get_class_name(c)
-- print(' ["name"] = "%s", ' % (class_name))
@sprout42
sprout42 / limemini_instr.md
Last active July 14, 2022 01:37
Getting the LimeSDR Mini working on Linux

Description

I finally figured out how to get the LimeSDR Mini working, and I'm writing it down here so I don't forget how, but also so I can get upset later when I try this again and it doesn't work mysteriously.

This was done on a Dell laptop running Ubuntu 19.10, ymmv on other versions/distros.

As far as I can tell the magic string is using the uhd-soapy driver to interact with the LimeSDR: "driver=lime,soapy=0,nchan=1".

Initially I tried installing the SDR drivers and packages through the recommended PPA that MyriadRF lists on their wiki (https://wiki.myriadrf.org/Installing_Lime_Suite_on_Linux) but that didn't work. I removed the ppa, then I was able to install the necessary packages to get the uhd-soapy interface working properly. I have a few packages now showing up as installed,local and not yet sure if I want to uninstall those. I don't think they should be necessary but it's hard to tell.

Mysteries

@sprout42
sprout42 / qiling_install.md
Created May 6, 2020 19:09
WIP Installing qiling framework on MacOS 10.15

Install

Based on https://github.com/qilingframework/qiling/blob/master/docs/SETUP.md with customizations to make things install nicely in my environment.

Build and install keystone. I use pyenv to manage my python versions so use pyenv local to set keystone to build with python2.7

git clone https://github.com/keystone-engine/keystone
cd keystone
pyenv local 2.7.x
mkdir build
cd build