diff options
| author | Nguyễn Gia Phong <cnx@loang.net> | 2025-10-17 07:41:10 +0900 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2025-10-17 07:41:10 +0900 |
| commit | 3a2e8fd0b06ebb738d9d4677659249e05b09e7cb (patch) | |
| tree | 46e7ab24161958d60fb980dd1e28096c0fb28dd6 /fix.m4 | |
| parent | 663ea12374e958fa83ac7e1b439dd6ab22bb59ed (diff) | |
| download | taosc-3a2e8fd0b06ebb738d9d4677659249e05b09e7cb.tar.gz | |
Give up fancy things 0.0.3.dev1
Diffstat (limited to 'fix.m4')
| -rw-r--r-- | fix.m4 | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/fix.m4 b/fix.m4 index 4ae99b9..fc7c2ce 100644 --- a/fix.m4 +++ b/fix.m4 @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Affero General Public License # along with taosc. If not, see <https://www.gnu.org/licenses/>. -set -eux -o pipefail save_exit_code() { set +e timeout -k 1 $1 ${@:2} 1>/dev/null 2>&1 @@ -36,6 +35,8 @@ then echo Usage: taosc-fix WORKDIR TIMEOUT EXECUTABLE PROOFS_OF_CONCEPT [OPTION]... exit 1 fi + +set -eux -o pipefail wd="$(realpath $1)" test -d "$wd" timeout=$2 @@ -103,7 +104,8 @@ e9tool -100 -M addr=$patch_loc -P 'if dest(state)@patch goto'\ -o "$bin.patched" "$binary" # TODO: FUZZOLIC's options -fuzzolic -kmprst 90000 -i "$poc" -o "$wd/fuzzolic" -- "$binary" $option @@ +fuzzolic -kmprst 90000 -i "$poc" -o "$wd/fuzzolic" -- "$binary" $options @@ || + true # FIXME: failing with the same status as the target program rm -fr "$wd/input" mkdir -p "$wd/input/benign" cp -r "$poc" "$wd/input/malicious" @@ -127,13 +129,16 @@ do output_dir="$wd/values/$(basename "$input_dir")" mkdir -p "$output_dir" # TODO: use parallel - for input in "$input_dir"/* - do - output="$output_dir/$(basename "$input")" - save_exit_code $timeout\ - env TAOSC_STACK_SIZE=$stack_size TAOSC_OUTPUT=$output\ - "$bin.collect" $options "$input" - done + if test "$(ls -A "$input_dir")" + then + for input in "$input_dir"/* + do + output="$output_dir/$(basename "$input")" + save_exit_code $timeout\ + env TAOSC_STACK_SIZE=$stack_size TAOSC_OUTPUT=$output\ + "$bin.collect" $options "$input" + done + fi done # TODO: split if the patch location is reached multiple times with an input taosc-synth $stack_size "$wd"/values/{benign,malicious} > "$wd/predicates" |
