From 128413690e4ffbf107c66965d51db96201ad7db0 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Sat, 1 Jan 2022 00:38:54 +0100 Subject: nyx references --- nyx_mode/LIBNYX_VERSION | 1 + nyx_mode/PACKER_VERSION | 1 + nyx_mode/QEMU_NXY_VERSION | 1 + nyx_mode/build_nyx_support.sh | 8 ++-- nyx_mode/packer | 2 +- nyx_mode/update_ref.sh | 99 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 107 insertions(+), 5 deletions(-) create mode 100644 nyx_mode/LIBNYX_VERSION create mode 100644 nyx_mode/PACKER_VERSION create mode 100644 nyx_mode/QEMU_NXY_VERSION create mode 100755 nyx_mode/update_ref.sh diff --git a/nyx_mode/LIBNYX_VERSION b/nyx_mode/LIBNYX_VERSION new file mode 100644 index 00000000..1ac5611b --- /dev/null +++ b/nyx_mode/LIBNYX_VERSION @@ -0,0 +1 @@ +ecbcb2d diff --git a/nyx_mode/PACKER_VERSION b/nyx_mode/PACKER_VERSION new file mode 100644 index 00000000..2596e40f --- /dev/null +++ b/nyx_mode/PACKER_VERSION @@ -0,0 +1 @@ +f91742c diff --git a/nyx_mode/QEMU_NXY_VERSION b/nyx_mode/QEMU_NXY_VERSION new file mode 100644 index 00000000..d2f0328b --- /dev/null +++ b/nyx_mode/QEMU_NXY_VERSION @@ -0,0 +1 @@ +acc90e462b diff --git a/nyx_mode/build_nyx_support.sh b/nyx_mode/build_nyx_support.sh index b73423d2..8626342d 100755 --- a/nyx_mode/build_nyx_support.sh +++ b/nyx_mode/build_nyx_support.sh @@ -39,27 +39,27 @@ test -d libnyx || { echo "[-] Not checked out, please install git or check your echo "[*] checking packer init.cpio.gz ..." if [ ! -f "packer/linux_initramfs/init.cpio.gz" ]; then cd packer/linux_initramfs/ - sh pack.sh + sh pack.sh || exit 1 cd ../../ fi echo "[*] Checking libnyx ..." if [ ! -f "libnyx/libnyx/target/release/liblibnyx.a" ]; then cd libnyx/libnyx - cargo build --release + cargo build --release || exit 1 cd ../../ fi echo "[*] Checking QEMU-Nyx ..." if [ ! -f "QEMU-Nyx/x86_64-softmmu/qemu-system-x86_64" ]; then cd QEMU-Nyx/ - ./compile_qemu_nyx.sh + ./compile_qemu_nyx.sh || exit 1 cd .. fi echo "[*] Checking libnyx.so ..." if [ -f "libnyx/libnyx/target/release/liblibnyx.so" ]; then - cp -v libnyx/libnyx/target/release/liblibnyx.so ../libnyx.so + cp -v libnyx/libnyx/target/release/liblibnyx.so ../libnyx.so || exit 1 else echo "[ ] libnyx.so not found..." exit 1 diff --git a/nyx_mode/packer b/nyx_mode/packer index 87837335..f91742ce 160000 --- a/nyx_mode/packer +++ b/nyx_mode/packer @@ -1 +1 @@ -Subproject commit 87837335d6a9834516aacf4121cbe0e2b9692125 +Subproject commit f91742ce6c51eee133b5675edd68f39202785db1 diff --git a/nyx_mode/update_ref.sh b/nyx_mode/update_ref.sh new file mode 100755 index 00000000..3e94a42b --- /dev/null +++ b/nyx_mode/update_ref.sh @@ -0,0 +1,99 @@ +#/bin/sh + +################################################## +# AFL++ internal tool to update nyx references. +# Usage: ./update_ref.sh +# It will take HEAD of all the repos! +################################################## + +if [ "$NEW_VERSION" = "-h" ]; then + echo "Internal script to update bound qemuafl version." + echo + echo "Usage: ./update_ref.sh" + echo "t will take HEAD of all the repos!" + echo "-h to show this help screen." + exit 1 +fi + +git submodule init && git submodule update || exit 1 + +UC_VERSION_FILE='./LIBNYX_VERSION' +NEW_VERSION="" + +cd ./libnyx || exit 1 +git fetch origin main 1>/dev/null || exit 1 +git stash 1>/dev/null 2>/dev/null +git stash drop 1>/dev/null 2>/dev/null +git checkout main +git pull origin main 1>/dev/null || exit 1 + +NEW_VERSION=$(git rev-parse --short HEAD) + +if [ -z "$NEW_VERSION" ]; then + echo "Error getting version." + exit 1 +fi + +git checkout "$NEW_VERSION" || exit 1 + +cd .. + +rm "$UC_VERSION_FILE" +echo "$NEW_VERSION" > "$UC_VERSION_FILE" + +echo "Done. New XXX version is $NEW_VERSION." + + +UC_VERSION_FILE='./PACKER_VERSION' +NEW_VERSION="" + +cd ./packer || exit 1 +git fetch origin main 1>/dev/null || exit 1 +git stash 1>/dev/null 2>/dev/null +git stash drop 1>/dev/null 2>/dev/null +git checkout main +git pull origin main 1>/dev/null || exit 1 + +NEW_VERSION=$(git rev-parse --short HEAD) + +if [ -z "$NEW_VERSION" ]; then + echo "Error getting version." + exit 1 +fi + +git checkout "$NEW_VERSION" || exit 1 + +cd .. + +rm "$UC_VERSION_FILE" +echo "$NEW_VERSION" > "$UC_VERSION_FILE" + +echo "Done. New XXX version is $NEW_VERSION." + + +UC_VERSION_FILE='./QEMU_NXY_VERSION' +NEW_VERSION="" + +cd ./QEMU-Nyx || exit 1 +git fetch origin qemu-nyx-4.2.0 1>/dev/null || exit 1 +git stash 1>/dev/null 2>/dev/null +git stash drop 1>/dev/null 2>/dev/null +git checkout qemu-nyx-4.2.0 +git pull origin qemu-nyx-4.2.0 1>/dev/null || exit 1 + +NEW_VERSION=$(git rev-parse --short HEAD) + +if [ -z "$NEW_VERSION" ]; then + echo "Error getting version." + exit 1 +fi + +git checkout "$NEW_VERSION" || exit 1 + +cd .. + +rm "$UC_VERSION_FILE" +echo "$NEW_VERSION" > "$UC_VERSION_FILE" + +echo "Done. New XXX version is $NEW_VERSION." + -- cgit 1.4.1