Skip to content

Instantly share code, notes, and snippets.

$OpenBSD: patch-boost_test_impl_execution_monitor_ipp,v 1.2 2010/09/19 20:47:29 jasper Exp $
--- boost/test/impl/execution_monitor.ipp.orig Sat Nov 28 10:19:18 2009
+++ boost/test/impl/execution_monitor.ipp Sun Sep 19 22:33:20 2010
@@ -341,14 +341,18 @@ system_signal_exception::report() const
report_error( execution_exception::system_error,
"signal: the expiration of a timer set by timer_settimer()" );
break;
+#ifdef SI_ASYNCIO
case SI_ASYNCIO:
report_error( execution_exception::system_error,
@laanwj
laanwj / configure_measure.sh
Last active November 30, 2021 09:47
Measure during compile process
./configure --disable-ccache --with-gui=qt5 --with-incompatible-bdb CC="$PWD/../devtools/mtime.sh gcc" CXX="$PWD/../devtools/mtime.sh g++" CPP="$PWD/../devtools/mtime.sh cpp"
@laanwj
laanwj / miniupnpc-1.9.20150730-1.9.20151008.diff
Created October 9, 2015 11:39
Difference between miniupnp 1.9.20150730 and 1.9.20151008
diff -duN miniupnpc-1.9.20150730/apiversions.txt miniupnpc-1.9.20151008/apiversions.txt
--- miniupnpc-1.9.20150730/apiversions.txt 2015-07-30 00:05:55.000000000 +0200
+++ miniupnpc-1.9.20151008/apiversions.txt 2015-10-08 18:16:03.000000000 +0200
@@ -1,7 +1,15 @@
-$Id: apiversions.txt,v 1.7 2015/07/23 20:40:08 nanard Exp $
+$Id: apiversions.txt,v 1.8 2015/10/08 16:15:47 nanard Exp $
Differences in API between miniUPnPc versions
+API version 15
@laanwj
laanwj / bitstomp.py
Last active October 30, 2015 15:02
Overwrite 4/8-byte heap leak from old mingw binutils
#!/usr/bin/python2
# W.J. 2015 (License: MIT)
'''
Overwrite 4/8-byte heap leak from old mingw binutils.
Input: test.exe test.map
Create linker map with -Wl,-Map=mtest.map
'''
from __future__ import print_function,division
@laanwj
laanwj / usha256.py
Created October 30, 2015 17:35
sha256sum w/ unicode block elements
#!/usr/bin/python3
# W.J. 2015 (License: MIT)
import hashlib,sys,os
BLOCKCHARS = '\u0020\u2598\u259d\u2580\u2596\u258c\u259e\u259b\u2597\u259a\u2590\u259c\u2584\u2599\u259f\u2588'
def uhex(x):
return ''.join(BLOCKCHARS[b>>4] + BLOCKCHARS[b&0xf] for b in x)
for filename in sys.argv[1:]:
if not os.path.isfile(filename):
@laanwj
laanwj / run.gdbscript
Last active March 24, 2022 14:39
Start bitcoind in a screen in a debugger
set disable-randomization off
set $_exitcode = -999
set height 0
handle SIGTERM nostop print pass
handle SIGPIPE nostop
define hook-stop
if $_exitcode != -999
quit
else
shell echo | mail -s "NOTICE: app has stopped on unhandled signal" root
@laanwj
laanwj / build_afl.sh
Created April 21, 2016 10:34
Build univalue for afl-fuzz
#!/bin/bash
AFLPATH=/store/orion/upstream/testing/afl
CC=${AFLPATH}/afl-gcc CXX=${AFLPATH}/afl-g++ ./configure --disable-shared
export AFL_HARDEN=1
make
@laanwj
laanwj / rpc_batch_test.py
Last active September 17, 2021 10:37
RPC batching example
#!/usr/bin/env python3
'''
Example showing the use of RPC batching in Bitcoin Core.
'''
# W.J. van der Laan
# SPDX-License-Identifier: MIT
import sys,os
# just grab the library from the closest bitcoin instance
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'bitcoin', 'test', 'functional'))
from test_framework.authproxy import AuthServiceProxy, JSONRPCException
@laanwj
laanwj / siptests.py
Last active June 8, 2016 13:11
Bitcoin SipHash 2_4 tests
#!/usr/bin/python3
# Uses https://github.com/majek/pysiphash
import siphash, struct, binascii
_twoQ = struct.Struct('<QQ')
def check_hash(data, value, sip=None):
if sip is None:
sip = siphash.SipHash_2_4(_twoQ.pack(0x0706050403020100, 0x0F0E0D0C0B0A0908))
v = sip.update(data).hash()
if v != value:
print('Mismatch for %s: %016x versus %016x' % (
@laanwj
laanwj / 18_smt2.py
Created August 10, 2016 18:33
microcorruption ctf: 'invert' hash for Hollywood level using z3 constriant solver
#!/usr/bin/python
from __future__ import division, print_function, unicode_literals
from z3 import *
import binascii, struct
def byteswp(a):
'''
Build expression to swap bytes in 16-bit word.
'''
return RotateLeft(a,8) # can also be RotateRight, or even Concat(Extract(), Extract())