Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
pub
frama-c
Commits
208929ae
Commit
208929ae
authored
6 years ago
by
Yaelle Vincont
Committed by
Julien Signoles
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[obfuscator] do not obfuscate stdlib and builtins
parent
39875c94
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/obfuscator/obfuscate.ml
+9
-5
9 additions, 5 deletions
src/plugins/obfuscator/obfuscate.ml
with
9 additions
and
5 deletions
src/plugins/obfuscator/obfuscate.ml
+
9
−
5
View file @
208929ae
...
@@ -38,7 +38,8 @@ class visitor = object
...
@@ -38,7 +38,8 @@ class visitor = object
method
!
vglob_aux
=
function
method
!
vglob_aux
=
function
|
GType
(
ty
,_
)
->
|
GType
(
ty
,_
)
->
ty
.
tname
<-
Dictionary
.
fresh
Obfuscator_kind
.
Type
ty
.
tname
;
if
not
(
Cil
.
typeHasAttribute
"fc_stdlib"
ty
.
ttype
)
then
ty
.
tname
<-
Dictionary
.
fresh
Obfuscator_kind
.
Type
ty
.
tname
;
Cil
.
DoChildren
Cil
.
DoChildren
|
GVarDecl
(
v
,
_
)
|
GVar
(
v
,
_
,
_
)
|
GFun
({
svar
=
v
}
,
_
)
|
GFunDecl
(
_
,
v
,
_
)
|
GVarDecl
(
v
,
_
)
|
GVar
(
v
,
_
,
_
)
|
GFun
({
svar
=
v
}
,
_
)
|
GFunDecl
(
_
,
v
,
_
)
when
Cil
.
is_unused_builtin
v
->
when
Cil
.
is_unused_builtin
v
->
...
@@ -83,10 +84,13 @@ class visitor = object
...
@@ -83,10 +84,13 @@ class visitor = object
if
Varinfo
.
Hashtbl
.
mem
varinfos_visited
vi
then
if
Varinfo
.
Hashtbl
.
mem
varinfos_visited
vi
then
Cil
.
SkipChildren
Cil
.
SkipChildren
else
begin
else
begin
if
Cil
.
isFunctionType
vi
.
vtype
then
begin
if
Cil
.
isFunctionType
vi
.
vtype
then
if
vi
.
vname
<>
"main"
then
try
vi
.
vname
<-
Dictionary
.
fresh
Obfuscator_kind
.
Function
vi
.
vname
if
vi
.
vname
<>
"main"
end
else
begin
&&
Kernel_function
.
is_definition
(
Globals
.
Functions
.
get
vi
)
then
vi
.
vname
<-
Dictionary
.
fresh
Obfuscator_kind
.
Function
vi
.
vname
with
Not_found
->
assert
false
else
begin
let
add
=
let
add
=
if
vi
.
vglob
then
Dictionary
.
fresh
Obfuscator_kind
.
Global_var
if
vi
.
vglob
then
Dictionary
.
fresh
Obfuscator_kind
.
Global_var
else
if
vi
.
vformal
then
Dictionary
.
fresh
Obfuscator_kind
.
Formal_var
else
if
vi
.
vformal
then
Dictionary
.
fresh
Obfuscator_kind
.
Formal_var
...
...
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