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
b41de23e
Commit
b41de23e
authored
4 years ago
by
Andrea Gussoni
Browse files
Options
Downloads
Patches
Plain Diff
Modify matching scripts to use config.sh
parent
54ca0d01
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripting/boundaries-comparison-scripts/boundaries-percentage.py
+5
-3
5 additions, 3 deletions
...ng/boundaries-comparison-scripts/boundaries-percentage.py
scripting/boundaries-comparison-scripts/compare-all.sh
+8
-9
8 additions, 9 deletions
scripting/boundaries-comparison-scripts/compare-all.sh
with
13 additions
and
12 deletions
scripting/boundaries-comparison-scripts/boundaries-percentage.py
+
5
−
3
View file @
b41de23e
...
...
@@ -19,13 +19,13 @@ def get_change(current, previous):
return
100.0
# Function that takes as parameter a platform and computes averages and variance of the results, and saves them in two dedicated files (averages.dat and variances.dat)
def
compute_matches
(
binaries_list
,
arch
,
output_name
):
def
compute_matches
(
binaries_list
,
arch
,
matching_folder
,
output_name
):
average_list
=
[]
average_dimension_list
=
[]
for
binary
in
binaries_list
:
inputfile
=
'
result-
'
+
arch
+
"
/
"
+
binary
inputfile
=
matching_folder
+
"
/
"
+
binary
print
(
"
Analyzing:
"
+
inputfile
)
with
open
(
inputfile
,
'
r
'
)
as
input
:
data_dict
=
json
.
load
(
input
)
...
...
@@ -59,17 +59,19 @@ def main():
parser
=
argparse
.
ArgumentParser
(
description
=
'
My nice tool.
'
)
parser
.
add_argument
(
'
binaries
'
,
metavar
=
'
BINARIESFILE
'
,
help
=
'
File containing the names of the binaries
'
)
parser
.
add_argument
(
'
arch
'
,
metavar
=
'
ARCH
'
,
help
=
'
Architecture
'
)
parser
.
add_argument
(
'
matching_folder
'
,
metavar
=
'
MATCHINGFOLDER
'
,
help
=
'
Folder containing matching information
'
)
parser
.
add_argument
(
'
output_name
'
,
metavar
=
'
OUTPUT_NAME
'
,
help
=
'
Output Name
'
)
args
=
parser
.
parse_args
()
arch
=
args
.
arch
binaries
=
args
.
binaries
matching_folder
=
args
.
matching_folder
output_name
=
args
.
output_name
with
open
(
binaries
,
'
r
'
)
as
binaries_file
:
binaries_list
=
[
line
.
rstrip
(
'
\n
'
)
for
line
in
binaries_file
]
# Call the funciton that computes the results
compute_matches
(
binaries_list
,
arch
,
output_name
)
compute_matches
(
binaries_list
,
arch
,
matching_folder
,
output_name
)
if
__name__
==
"
__main__
"
:
main
()
This diff is collapsed.
Click to expand it.
scripting/boundaries-comparison-scripts/compare-all.sh
+
8
−
9
View file @
b41de23e
...
...
@@ -5,20 +5,19 @@ if [ $# -eq 0 ]; then
exit
1
fi
basepath
=
$(
pwd
)
result_dir
=
$basepath
/result-
$1
arch
=
$1
if
[
!
-d
$result_dir
]
;
then
mkdir
$result_dir
;
fi
# Import the config
.
./config.sh
revng_dir
=
$basepath
/workdir-
$1
/revng-json
ida_dir
=
$basepath
/workdir-
$1
/ida-json-normalized
if
[
!
-d
$matching_dir
]
;
then
mkdir
$matching_dir
;
fi
cd
$
1
cd
$
arch
for
filename
in
*
do
echo
-e
"
\n
Analyzing binary:
$filename
"
$
basepath
/scripting/boundaries-comparison-scripts
/compare-functions.py
$ida_dir
/
$filename
.stripped.json.ida
$revng_dir
/
$filename
.ll.isolated.json.revng
$filename
$
result
_dir
/
$filename
$
result
_dir
/
$filename
.matching
$
matching_script_dir
/compare-functions.py
$ida_
json_
dir
/
$filename
.stripped.json.ida
$revng_
json_
dir
/
$filename
.ll.isolated.json.revng
$filename
$
matching
_dir
/
$filename
$
matching
_dir
/
$filename
.matching
done
;
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