Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cwe_checker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-gitdep
cwe_checker
Commits
c177eace
Commit
c177eace
authored
Sep 09, 2020
by
Enkelmann
Committed by
Enkelmann
Nov 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a new caller implementation
parent
38aaf701
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
2 deletions
+85
-2
Cargo.toml
Cargo.toml
+1
-1
Cargo.toml
caller/Cargo.toml
+9
-0
main.rs
caller/src/main.rs
+74
-0
Cargo.toml
cwe_checker_rs/Cargo.toml
+1
-1
No files found.
Cargo.toml
View file @
c177eace
[workspace]
members
=
["cwe_checker_rs"]
members
=
[
"cwe_checker_rs"
,
"caller"
]
caller/Cargo.toml
0 → 100644
View file @
c177eace
[package]
name
=
"cwe_checker"
version
=
"0.4.0-dev"
authors
=
[
"Enkelmann <nils-edvin.enkelmann@fkie.fraunhofer.de>"
]
edition
=
"2018"
[dependencies]
structopt
=
"0.3"
\ No newline at end of file
caller/src/main.rs
0 → 100644
View file @
c177eace
use
std
::
process
::
Command
;
use
structopt
::
StructOpt
;
#[derive(Debug,
StructOpt)]
/// Find vulnerable patterns in binary executables
struct
CmdlineArgs
{
/// The path to the binary.
binary
:
String
,
/// Path to a custom configuration file to use instead of the standard one.
#[structopt(long,
short)]
config
:
Option
<
String
>
,
/// Write the results to a file.
#[structopt(long,
short)]
out
:
Option
<
String
>
,
/// Specify a specific set of checks to be run.
#[structopt(long,
short)]
partial
:
Option
<
String
>
,
/// Generate JSON output.
#[structopt(long,
short)]
json
:
bool
,
/// Do not print log messages. This prevents polluting STDOUT for json output.
#[structopt(long,
short)]
quiet
:
bool
,
/// Checks if there is a path from an input function to a CWE hit.
#[structopt(long)]
check_path
:
bool
,
/// Prints out the version numbers of all known modules.
#[structopt(long)]
module_versions
:
bool
,
}
fn
main
()
{
let
cmdline_args
=
CmdlineArgs
::
from_args
();
if
let
Some
(
exit_code
)
=
build_bap_command
(
&
cmdline_args
)
.status
()
.unwrap
()
.code
()
{
std
::
process
::
exit
(
exit_code
);
}
}
/// Build the BAP command corresponding to the given command line arguments.
fn
build_bap_command
(
args
:
&
CmdlineArgs
)
->
Command
{
let
mut
command
=
Command
::
new
(
"bap"
);
command
.arg
(
&
args
.binary
);
command
.arg
(
"--pass=cwe-checker"
);
if
let
Some
(
ref
string
)
=
args
.config
{
command
.arg
(
"--cwe-checker-config="
.to_string
()
+
string
);
}
if
let
Some
(
ref
string
)
=
args
.out
{
command
.arg
(
"--cwe-checker-out="
.to_string
()
+
string
);
}
if
let
Some
(
ref
string
)
=
args
.partial
{
command
.arg
(
"--cwe-checker-partial="
.to_string
()
+
string
);
}
if
args
.json
{
command
.arg
(
"--cwe-checker-json"
);
}
if
args
.quiet
{
command
.arg
(
"--cwe-checker-no-logging"
);
}
if
args
.check_path
{
command
.arg
(
"--cwe-checker-check-path"
);
}
if
args
.module_versions
{
command
.arg
(
"--cwe-checker-module-versions"
);
}
command
}
cwe_checker_rs/Cargo.toml
View file @
c177eace
[package]
name
=
"cwe_checker_rs"
version
=
"0.
1.0
"
version
=
"0.
4.0-dev
"
authors
=
[
"Nils-Edvin Enkelmann <nils-edvin.enkelmann@fkie.fraunhofer.de>"
]
edition
=
"2018"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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