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-depend
cwe_checker
Commits
d701731b
Commit
d701731b
authored
Sep 30, 2020
by
Enkelmann
Committed by
Enkelmann
Nov 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cargo fmt
parent
5343432e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
28 deletions
+16
-28
mod.rs
cwe_checker_rs/src/analysis/pointer_inference/mod.rs
+1
-1
expression.rs
cwe_checker_rs/src/intermediate_representation/expression.rs
+2
-8
mod.rs
cwe_checker_rs/src/intermediate_representation/mod.rs
+0
-0
term.rs
cwe_checker_rs/src/intermediate_representation/term.rs
+4
-16
variable.rs
cwe_checker_rs/src/intermediate_representation/variable.rs
+0
-0
mod.rs
cwe_checker_rs/src/term/mod.rs
+9
-3
No files found.
cwe_checker_rs/src/analysis/pointer_inference/mod.rs
View file @
d701731b
...
...
@@ -14,13 +14,13 @@
use
super
::
interprocedural_fixpoint
::{
Computation
,
NodeValue
};
use
crate
::
abstract_domain
::{
BitvectorDomain
,
DataDomain
};
use
crate
::
analysis
::
graph
::{
Graph
,
Node
};
use
crate
::
prelude
::
*
;
use
crate
::
term
::
*
;
use
crate
::
utils
::
log
::
*
;
use
petgraph
::
graph
::
NodeIndex
;
use
petgraph
::
visit
::
IntoNodeReferences
;
use
petgraph
::
Direction
;
use
std
::
collections
::
HashMap
;
use
crate
::
prelude
::
*
;
mod
context
;
mod
object
;
...
...
cwe_checker_rs/src/intermediate_representation/expression.rs
View file @
d701731b
...
...
@@ -33,10 +33,7 @@ pub enum Expression {
rhs
:
Box
<
Expression
>
,
},
/// A unary operation
UnOp
{
op
:
UnOpType
,
arg
:
Box
<
Expression
>
,
},
UnOp
{
op
:
UnOpType
,
arg
:
Box
<
Expression
>
},
/// A cast operation for type cast between integer and floating point types of different byte lengths.
Cast
{
op
:
CastOpType
,
...
...
@@ -46,10 +43,7 @@ pub enum Expression {
/// An unknown value but with known size.
/// This may be generated for e.g. unsupported assembly instructions.
/// Note that computation of an unknown value is still required to be side-effect-free!
Unknown
{
description
:
String
,
size
:
ByteSize
,
},
Unknown
{
description
:
String
,
size
:
ByteSize
},
/// Extracting a sub-bitvector from the argument expression.
Subpiece
{
low_byte
:
ByteSize
,
...
...
cwe_checker_rs/src/intermediate_representation/mod.rs
View file @
d701731b
cwe_checker_rs/src/intermediate_representation/term.rs
View file @
d701731b
...
...
@@ -53,10 +53,7 @@ pub enum Def {
///
/// The size of `var` also determines the number of bytes read from memory.
/// The size of `address` is required to match the pointer size of the corresponding CPU architecture.
Load
{
var
:
Variable
,
address
:
Expression
,
},
Load
{
var
:
Variable
,
address
:
Expression
},
/// A memory store operation.
///
/// The size of `value` determines the number of bytes written.
...
...
@@ -66,10 +63,7 @@ pub enum Def {
value
:
Expression
,
},
/// A register assignment, assigning the result of the expression `value` to the register `var`.
Assign
{
var
:
Variable
,
value
:
Expression
,
},
Assign
{
var
:
Variable
,
value
:
Expression
},
}
/// A `Jmp` instruction affects the control flow of a program, i.e. it may change the instruction pointer.
...
...
@@ -87,18 +81,12 @@ pub enum Jmp {
/// An indirect intraprocedural jump to the address that the given expression evaluates to.
BranchInd
(
Expression
),
/// A direct intraprocedural jump that is only taken if the condition evaluates to true (i.e. not zero).
CBranch
{
target
:
Tid
,
condition
:
Expression
,
},
CBranch
{
target
:
Tid
,
condition
:
Expression
},
/// A direct interprocedural jump representing a subroutine call.
///
/// Note that this is syntactically equivalent to a `Jmp::Branch`.
/// If the `return_` is `None`, then the called function does not return to its caller.
Call
{
target
:
Tid
,
return_
:
Option
<
Tid
>
,
},
Call
{
target
:
Tid
,
return_
:
Option
<
Tid
>
},
/// An indirect interprocedural jump to the address the `target` expression evaluates to
/// and representing a subroutine call.
///
...
...
cwe_checker_rs/src/intermediate_representation/variable.rs
View file @
d701731b
cwe_checker_rs/src/term/mod.rs
View file @
d701731b
...
...
@@ -7,8 +7,8 @@ use crate::intermediate_representation::Jmp as IrJmp;
use
crate
::
intermediate_representation
::
Program
as
IrProgram
;
use
crate
::
intermediate_representation
::
Project
as
IrProject
;
use
crate
::
intermediate_representation
::
Sub
as
IrSub
;
use
serde
::{
Deserialize
,
Serialize
};
use
crate
::
intermediate_representation
::{
Term
,
Tid
};
use
serde
::{
Deserialize
,
Serialize
};
pub
mod
symbol
;
use
symbol
::
ExternSymbol
;
...
...
@@ -207,7 +207,10 @@ impl From<Blk> for IrBlk {
}
else
{
for
(
counter
,
ir_def
)
in
ir_defs
.into_iter
()
.enumerate
()
{
ir_def_terms
.push
(
Term
{
tid
:
def_term
.tid
.clone
()
.with_id_suffix
(
&
format!
(
"_{}"
,
counter
)),
tid
:
def_term
.tid
.clone
()
.with_id_suffix
(
&
format!
(
"_{}"
,
counter
)),
term
:
ir_def
,
});
}
...
...
@@ -224,7 +227,10 @@ impl From<Blk> for IrBlk {
}
for
(
counter
,
ir_def
)
in
ir_defs
.into_iter
()
.enumerate
()
{
ir_def_terms
.push
(
Term
{
tid
:
jmp_term
.tid
.clone
()
.with_id_suffix
(
&
format!
(
"_{}"
,
counter
)),
tid
:
jmp_term
.tid
.clone
()
.with_id_suffix
(
&
format!
(
"_{}"
,
counter
)),
term
:
ir_def
,
});
}
...
...
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