Skip to content

Commit

Permalink
Oracles check for md5sum
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacarte committed Aug 24, 2023
1 parent 6ee69e0 commit 51d5608
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
11 changes: 9 additions & 2 deletions experiments/jobs/dynamic_diversity/oracle_diff_trace_ins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ wasm=$2
/host_based/tracer/pintool/pin/pin -t /host_based/tracer/pintool/obj-intel64/tracer.so -i 1 -m 0 -c 1 -b 1 -o trace.ins.txt -- tracer $wasm

# check if the trace.ins.txt is the same as the trace_file, return 1 if they are the same
if cmp -s "trace.ins.txt" "$trace_file"; then
echo "Different trace"
# check the md5sum of the trace.ins.txt and trace_file
md5sum trace.ins.txt > trace.ins.txt.md5
md5sum $trace_file > $trace_file.md5
# remove the file name from the md5sum
sed -i 's/ trace.ins.txt//g' trace.ins.txt.md5
sed -i 's/ $trace_file//g' $trace_file.md5
# check if the md5sum is the same
if cmp -s "trace.ins.txt.md5" "$trace_file.md5"; then
echo "Same trace"
exit 1
else
exit 0
Expand Down
13 changes: 10 additions & 3 deletions experiments/jobs/dynamic_diversity/oracle_diff_trace_mem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ wasm=$2

echo "$trace_file $wasm" > trace.txt

/host_based/tracer/pintool/pin/pin -t /host_based/tracer/pintool/obj-intel64/tracer.so -i 0 -m 1 -M 0 -c 0 -b 0 -o orig.ins.txt -- tracer $wasm
/host_based/tracer/pintool/pin/pin -t /host_based/tracer/pintool/obj-intel64/tracer.so -i 0 -m 1 -M 0 -c 0 -b 0 -o trace.mem.txt -- tracer $wasm

md5sum trace.mem.txt > trace.mem.txt.md5
md5sum $trace_file > $trace_file.md5
# remove the file name from the md5sum
sed -i 's/ trace.mem.txt//g' trace.mem.txt.md5
sed -i 's/ $trace_file//g' $trace_file.md5

# check if the trace.ins.txt is the same as the trace_file, return 1 if they are the same
if cmp -s "trace.ins.txt" "$trace_file"; then
echo "Different trace"
if cmp -s "trace.mem.txt.md5" "$trace_file.md5"; then
echo "Same trace"
exit 1
else
exit 0
fi



0 comments on commit 51d5608

Please sign in to comment.