From c79bbdb0448501987c0c16c2877c780143156d1e Mon Sep 17 00:00:00 2001 From: Orfeas <38209077+0xfea5@users.noreply.github.com> Date: Sun, 21 Apr 2024 16:27:55 +0300 Subject: Changes in trainer interface, bug fixes & helper scripts --- scripts/scan.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 scripts/scan.sh (limited to 'scripts/scan.sh') diff --git a/scripts/scan.sh b/scripts/scan.sh new file mode 100644 index 0000000..c700011 --- /dev/null +++ b/scripts/scan.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +if [ "$#" -ne 1 ] +then + printf "Usage: %s \n" "$0" + exit 1 +fi + +echo ' + /$$ + | $$ + /$$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$| $$$$$$$ + /$$_____/ /$$_____/ |____ $$| $$__ $$ /$$_____/| $$__ $$ +| $$$$$$ | $$ /$$$$$$$| $$ \ $$ | $$$$$$ | $$ \ $$ + \____ $$| $$ /$$__ $$| $$ | $$ \____ $$| $$ | $$ + /$$$$$$$/| $$$$$$$| $$$$$$$| $$ | $$ /$$ /$$$$$$$/| $$ | $$ +|_______/ \_______/ \_______/|__/ |__/|__/|_______/ |__/ |__/ +' + +pid="$1" +scanfile=${SCANFILE:-/tmp/scanfile} +rm -f ${scanfile} + +while true +do + read -p "Scan pattern (hex): " pattern + newscan=$(mktemp) + ./hack.out ${pid} scan ${pattern} > ${newscan} 2> /dev/null + if [ ! -f ${scanfile} ] + then + mv ${newscan} ${scanfile} + else + temp=$(mktemp) + cat ${newscan} ${scanfile} | sort | uniq -d > ${temp} + mv ${temp} ${scanfile} + rm ${newscan} + fi +done -- cgit v1.2.3