mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-20 05:23:43 +00:00
Merge pull request #2469 from refi64/persistent-qemu-a64
Fix persistent qemu_mode test base address on aarch64
This commit is contained in:
@ -120,11 +120,16 @@ test -e ../afl-qemu-trace && {
|
|||||||
if file test-instr | grep -q "32-bit"; then
|
if file test-instr | grep -q "32-bit"; then
|
||||||
# for 32-bit reduce 8 nibbles to the lower 7 nibbles
|
# for 32-bit reduce 8 nibbles to the lower 7 nibbles
|
||||||
ADDR_LOWER_PART=`nm test-instr | grep "T main" | awk '{print $1}' | sed 's/^.//'`
|
ADDR_LOWER_PART=`nm test-instr | grep "T main" | awk '{print $1}' | sed 's/^.//'`
|
||||||
else
|
|
||||||
# for 64-bit reduce 16 nibbles to the lower 9 nibbles
|
|
||||||
ADDR_LOWER_PART=`nm test-instr | grep "T main" | awk '{print $1}' | sed 's/^.......//'`
|
|
||||||
fi
|
|
||||||
export AFL_QEMU_PERSISTENT_ADDR=`expr 0x4${ADDR_LOWER_PART}`
|
export AFL_QEMU_PERSISTENT_ADDR=`expr 0x4${ADDR_LOWER_PART}`
|
||||||
|
elif [ "$SYS" = "aarch64" ]; then
|
||||||
|
# for aarch64 reduce 16 nibbles to the lower 8 nibbles
|
||||||
|
ADDR_LOWER_PART=`nm test-instr | grep "T main" | awk '{print $1}' | sed 's/^........//'`
|
||||||
|
export AFL_QEMU_PERSISTENT_ADDR=`expr 0x55${ADDR_LOWER_PART}`
|
||||||
|
else
|
||||||
|
# for x64 reduce 16 nibbles to the lower 9 nibbles
|
||||||
|
ADDR_LOWER_PART=`nm test-instr | grep "T main" | awk '{print $1}' | sed 's/^.......//'`
|
||||||
|
export AFL_QEMU_PERSISTENT_ADDR=`expr 0x4${ADDR_LOWER_PART}`
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
test -n "$IS_STATIC" && {
|
test -n "$IS_STATIC" && {
|
||||||
export AFL_QEMU_PERSISTENT_ADDR=0x`nm test-instr | grep "T main" | awk '{print $1}'`
|
export AFL_QEMU_PERSISTENT_ADDR=0x`nm test-instr | grep "T main" | awk '{print $1}'`
|
||||||
@ -170,11 +175,16 @@ test -e ../afl-qemu-trace && {
|
|||||||
if file test-instr-exit-at-end | grep -q "32-bit"; then
|
if file test-instr-exit-at-end | grep -q "32-bit"; then
|
||||||
# for 32-bit reduce 8 nibbles to the lower 7 nibbles
|
# for 32-bit reduce 8 nibbles to the lower 7 nibbles
|
||||||
ADDR_LOWER_PART=`nm test-instr-exit-at-end | grep "T main" | awk '{print $1}' | sed 's/^.//'`
|
ADDR_LOWER_PART=`nm test-instr-exit-at-end | grep "T main" | awk '{print $1}' | sed 's/^.//'`
|
||||||
else
|
|
||||||
# for 64-bit reduce 16 nibbles to the lower 9 nibbles
|
|
||||||
ADDR_LOWER_PART=`nm test-instr-exit-at-end | grep "T main" | awk '{print $1}' | sed 's/^.......//'`
|
|
||||||
fi
|
|
||||||
export AFL_QEMU_PERSISTENT_ADDR=`expr 0x4${ADDR_LOWER_PART}`
|
export AFL_QEMU_PERSISTENT_ADDR=`expr 0x4${ADDR_LOWER_PART}`
|
||||||
|
elif [ "$SYS" = "aarch64" ]; then
|
||||||
|
# for aarch64 reduce 16 nibbles to the lower 8 nibbles
|
||||||
|
ADDR_LOWER_PART=`nm test-instr-exit-at-end | grep "T main" | awk '{print $1}' | sed 's/^........//'`
|
||||||
|
export AFL_QEMU_PERSISTENT_ADDR=`expr 0x55${ADDR_LOWER_PART}`
|
||||||
|
else
|
||||||
|
# for x64 reduce 16 nibbles to the lower 9 nibbles
|
||||||
|
ADDR_LOWER_PART=`nm test-instr-exit-at-end | grep "T main" | awk '{print $1}' | sed 's/^.......//'`
|
||||||
|
export AFL_QEMU_PERSISTENT_ADDR=`expr 0x4${ADDR_LOWER_PART}`
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
test -n "$IS_STATIC" && {
|
test -n "$IS_STATIC" && {
|
||||||
export AFL_QEMU_PERSISTENT_ADDR=0x`nm test-instr-exit-at-end | grep "T main" | awk '{print $1}'`
|
export AFL_QEMU_PERSISTENT_ADDR=0x`nm test-instr-exit-at-end | grep "T main" | awk '{print $1}'`
|
||||||
|
Reference in New Issue
Block a user