diff --git a/doc/portscan.r2 b/doc/portscan.r2 new file mode 100755 index 0000000000..79b9287af1 --- /dev/null +++ b/doc/portscan.r2 @@ -0,0 +1,14 @@ +#!/usr/bin/r2 -qni portscan.r2 - +# r2 portscanner +# author: pancake +# date: 2013-11-30 + +f minport=1 +f maxport=1024 +k host=localhost + +(connect host port,=+tcp://$0:`?vi $1`/ 2>/dev/null,?! ?e OPEN `?vi $1`) +(scan host min max,.(connect $0 $$) @@=`?s $1 $2`,?e Report:,=~[2],=-*) +.(scan `k host` minport maxport) + +# Oneliner version: diff --git a/libr/anal/anal.c b/libr/anal/anal.c index cd4234c465..f7bec93a00 100644 --- a/libr/anal/anal.c +++ b/libr/anal/anal.c @@ -252,7 +252,9 @@ R_API RAnalOp *r_anal_op_hexstr(RAnal *anal, ut64 addr, const char *str) { int len; ut8 *buf; RAnalOp *op = R_NEW0 (RAnalOp); + if (!op) return NULL; buf = malloc (strlen (str)+1); + if (!buf) return NULL; len = r_hex_str2bin (str, buf); r_anal_op (anal, op, addr, buf, len); return op; diff --git a/sys/find-regression.sh b/sys/find-regression.sh new file mode 100755 index 0000000000..66a7291243 --- /dev/null +++ b/sys/find-regression.sh @@ -0,0 +1,41 @@ +#!/bin/sh +NAME=cmd_macros +LAST=`curl -s http://ci.rada.re/job/radare2-regressions/ | \ + perl -ne 's,>,\n,g;print' | \ + perl -ne 'if (/Last build/) { + $str = $_; + $str=~/\(\#(\d+)\)/; + $str = $1; + print $str; + }' +` + +R2R=/tmp/.r2r.txt +R2C=/tmp/.r2c.txt +PREV="" +PR2REV="" +while : ; do + [ ${LAST} -lt 0 ] && break + echo "+ Testing build $LAST..." + curl -s http://ci.rada.re/job/radare2-regressions/${LAST}/consoleText > $R2R + R2B=`grep 'Started by upstream project' $R2R | awk '{print $8 }'` + curl -s http://ci.rada.re/job/radare2/${R2B}/consoleText > $R2C + R2REV=`grep 'Checking out Revision' $R2C | awk '{print $4}'` + echo " - radare2 $R2B = $R2REV" + REV=`grep 'Checking out Revision' $R2R | awk '{print $4}'` + echo " - regression $LAST $REV" + grep ${NAME} $R2R | grep -q XX + if [ $? != 0 ]; then + echo "Passing test found." + echo " + LAST=$LAST..$PLAST" + echo " + RRREV=$REV..$PREV" + echo " + R2REV=$R2REV..$PR2REV" + fi + PREV=$REV + PR2REV=$R2REV + PLAST=$LAST + LAST=$(($LAST-1)) +done + +rm -f $R2R $R2C +