Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
artifacts-asiaccs20
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andrea Gussoni
artifacts-asiaccs20
Commits
c0765a3e
Commit
c0765a3e
authored
4 years ago
by
Andrea Gussoni
Browse files
Options
Downloads
Patches
Plain Diff
Add main IDA driver for decompiled normalization
parent
ebe715d5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripting/ida-extraction-scripts/clang-parser/ida-normalizer-wrapper.sh
+36
-0
36 additions, 0 deletions
...extraction-scripts/clang-parser/ida-normalizer-wrapper.sh
with
36 additions
and
0 deletions
scripting/ida-extraction-scripts/clang-parser/ida-normalizer-wrapper.sh
0 → 100755
+
36
−
0
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment