Skip to content

Instantly share code, notes, and snippets.

Avatar

Wladimir J. van der Laan laanwj

  • The Netherlands
View GitHub Profile
View aiur.md

Example getpeerinfo

{
    "id" : 3827,
    "addr" : "106.187.41.230:36085",
    "addrlocal" : ":8333",
    "services" : "0000000000000001",
    "lastsend" : 1409561285,
    "lastrecv" : 1409561233,
    "bytessent" : 1803,
@laanwj
laanwj / draft_paytohs.md
Last active Aug 29, 2015
Pay-to-HS BIP draft
View draft_paytohs.md
BIP: XX
Title: Pay-to-hidden-service
Author: Wladimir J. van der Laan, Gregory Maxwell
Status: Draft
Type: Standards Track
Created: 2014-12-18

Table of Contents

@laanwj
laanwj / secp256k1_fe_mul_inner.txt
Last active Aug 29, 2015
IR expressions generated from secp256k1_fe_*_inner ARM assembly
View secp256k1_fe_mul_inner.txt
loc_0000000000000000:
@32[(SP+0xFFFFFFFC)] = LR
@32[(SP+0xFFFFFFF8)] = R11
@32[(SP+0xFFFFFFF4)] = R10
@32[(SP+0xFFFFFFF0)] = R9
@32[(SP+0xFFFFFFEC)] = R8
@32[(SP+0xFFFFFFE8)] = R7
@32[(SP+0xFFFFFFE4)] = R6
@32[(SP+0xFFFFFFE0)] = R5
@32[(SP+0xFFFFFFDC)] = R4
@laanwj
laanwj / txblkutils.py
Created Apr 15, 2015
Bitcoin transaction and block surgery
View txblkutils.py
#!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
import os
import shutil
View patch-boost_test_impl_execution_monitor_ipp.patch
$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 / hexstr_benchmarks.cpp
Created Apr 21, 2012
Bitcoin HexStr benchmarks
View hexstr_benchmarks.cpp
// g++ -O2 hexstr_benchmarks.cpp -o hexstr_benchmarks
#include <stdio.h>
#include <vector>
#include <string>
#include <stdarg.h>
#include <time.h>
#include <string.h>
using namespace std;
#define loop for (;;)
@laanwj
laanwj / miniupnpc-1.9.20150730-1.9.20151008.diff
Created Oct 9, 2015
Difference between miniupnp 1.9.20150730 and 1.9.20151008
View miniupnpc-1.9.20150730-1.9.20151008.diff
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 / bignum_setcompact.cpp
Created Sep 21, 2012
Checks for all 32 bit integers whether SetCompactNew(x) == SetCompactOld(x)
View bignum_setcompact.cpp
// g++ bignum_setcompact.cpp -o ./bignum_setcompact -lcrypto -O3
// Checks for all 32 bit integers whether SetCompactNew(x) == SetCompactOld(x)
#include <limits>
#include <stdexcept>
#include <vector>
#include <openssl/bn.h>
#include <algorithm>
#include <assert.h>
#include <sys/types.h>
@laanwj
laanwj / bitstomp.py
Last active Oct 30, 2015
Overwrite 4/8-byte heap leak from old mingw binutils
View bitstomp.py
#!/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 Oct 30, 2015
sha256sum w/ unicode block elements
View usha256.py
#!/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):
You can’t perform that action at this time.