Skip to content

Instantly share code, notes, and snippets.

Wladimir J. van der Laan laanwj

  • The Netherlands
Block or report user

Report or block laanwj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:dcc0f30d52fdeeed57689e1edf6cc7f5
laanwj /
Last active Jun 27, 2019
Alphanumeric instructions on RISC-V

Alphanumeric shellcode on RISC-V

Although common on x86, it was initially believed that it was not possible to make alphanumeric shellcode for ARM. Later it turned out it was.

Similar to that, I wondered if it was possible to make alphanumeric shell-code for RISC-V.

(Basic shellcode in RISC-V Linux provides a good introduction to shellcode for RISC-V, including how to avoid NUL bytes.)

First, I enumerated all the possible instructions that could be formed from these characters with a little Rust program and generated some statistics.

laanwj / options-including-debug.diff
Last active Oct 3, 2018
Difference between Bitcoin Core 0.16 and 0.17.0 options
View options-including-debug.diff
aurora:~/projects/bitcoin$ bitcoin-0.16/build/src/bitcoind --help --help-debug|grep "^ -" | sort > /tmp/options-0.16.txt
aurora:~/projects/bitcoin$ bitcoin-0.17/build/src/bitcoind --help --help-debug|grep "^ -" | sort > /tmp/options-0.17.txt
aurora:~/projects/bitcoin$ diff -du /tmp/options-0.16.txt /tmp/options-0.17.txt
--- /tmp/options-0.16.txt 2018-10-03 14:35:57.661688575 +0200
+++ /tmp/options-0.17.txt 2018-10-03 14:36:03.789664725 +0200
@@ -2,8 +2,10 @@
+ -addrmantest
laanwj / 99-aithra-serial.rules
Last active Oct 9, 2019
udev rules example for lots of serial devices (put in /etc/udev/rules.d)
View 99-aithra-serial.rules
# serial devices
# get attributes using: udevadm info -a -n /dev/ttyUSBn
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{product}=="Flyswatter2", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="serial/flyswatter-jtag"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{product}=="Flyswatter2", ENV{ID_USB_INTERFACE_NUM}=="01", SYMLINK+="serial/flyswatter-tty"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{product}=="Dual RS232-HS", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="serial/unleashed-jtag"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", ATTRS{product}=="Dual RS232-HS", ENV{ID_USB_INTERFACE_NUM}=="01", SYMLINK+="serial/unleashed-tty"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{product}=="Quad RS232-HS", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="serial/zodiac-jtag0"
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", ATTRS{product}=="Quad RS232-HS", ENV{ID_USB_IN
laanwj /
Last active Jun 28, 2019
gitian buildling on debian 9.5

Some changes are needed to build on debian because of the switch of the guest OS to bionic.

lxc that comes with debian is not high enough version to support bionic (the minimum is 2.1.1), so need to build from scratch.

debootstrap that comes with debian will give the following error:

    $ bin/make-base-vm --lxc --suite bionic --arch amd64                                                                                              
    E: No such script: /usr/share/debootstrap/scripts/bionic
laanwj /
Last active Sep 16, 2018
tools to write (block) data to png files and vice versa
#!/usr/bin/env python3
# Distributed under the MIT software license
import binascii, struct, sys, io, argparse
from PIL import Image
IMG_WIDTH = 512 # could be made adaptive...
MIN_HEIGHT = 4 # minimum height of image; twitter won't let us upload anything smaller
def div_roundup(x,y):
View sendalert.cpp
#include "main.h"
#include "net.h"
#include "alert.h"
#include "init.h"
static const int64_t DAYS = 24 * 60 * 60;
void ThreadSendAlert()
laanwj / c++14.patch
Created May 31, 2018
Patch for buiding Bitcoin Core with C++14
View c++14.patch
diff --git a/ b/
index 1ffef1527bdb556dff79338f4052d1b49ae6bc42..5f324894bd861fe92ec7fad24b6687876b0e1919 100644
--- a/
+++ b/
@@ -60,8 +60,8 @@ case $host in
-dnl Require C++11 compiler (no GNU extensions)
-AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory], [nodefault])
You can’t perform that action at this time.