Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andrea Gussoni
artifacts-asiaccs20
Commits
c0765a3e
Commit
c0765a3e
authored
Dec 10, 2020
by
Andrea Gussoni
Browse files
Add main IDA driver for decompiled normalization
parent
ebe715d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripting/ida-extraction-scripts/clang-parser/ida-normalizer-wrapper.sh
0 → 100755
View file @
c0765a3e
#!/bin/bash
if
[
$#
-eq
0
]
;
then
echo
"No arguments supplied"
exit
1
fi
filename
=
$1
iteration
=
0
max_iteration
=
15
# Invoke a script which performs ad-hoc normalization for this decompiled output.
./ida-normalizer-pre.sh
$filename
# First invocation of the compiler
clang-7
-ferror-limit
=
0
-S
-emit-llvm
-w
$filename
&> clang.log
# While we have errors output from the compiler, continue our fixed-point purge.
while
[
-s
clang.log
]
;
do
# Invoke the script that, on the basis of the compiler output generated at the previous iteration, purges the decompiled file.
./ida-normalizer.sh
$filename
clang.log
# Invoke the compiler.
clang-7
-ferror-limit
=
0
-S
-emit-llvm
-w
$filename
&> clang.log
iteration
=
$((
iteration
+
1
))
# Exit if we did not reach stability in an high number of runs (cheap way to detect instability).
if
[
"
$iteration
"
-gt
"
$max_iteration
"
]
;
then
echo
"Stability not reached"
break
fi
done
# Finally, create the output adding an adequate suffix.
cp
$filename
$filename
.normalized.c
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment