Skip to content
Snippets Groups Projects
Commit 208929ae authored by Yaelle Vincont's avatar Yaelle Vincont Committed by Julien Signoles
Browse files

[obfuscator] do not obfuscate stdlib and builtins

parent 39875c94
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment