Skip to content

Commit

Permalink
Merge pull request #77 from JuliaDebug/sp/no-overwrite-locals
Browse files Browse the repository at this point in the history
Stop overwriting locals with exfiltrate variables
  • Loading branch information
pfitzseb authored Jun 1, 2022
2 parents 1dc4b83 + 93ba6a8 commit ad5bba9
Show file tree
Hide file tree
Showing 6 changed files with 1,261 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Infiltrator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ function init_transient_eval_module(mod, locals)
# insert local variables into current scope
Core.eval(newmod, Expr(:block, map(x->Expr(:(=), x...), [(k, maybe_quote(v)) for (k, v) in locals])...))
# insert variables in safehouse
Core.eval(newmod, Expr(:block, map(x->Expr(:(=), x...), [(k, maybe_quote(v)) for (k, v) in get_store_names()])...))
Core.eval(newmod, Expr(:block, map(x->Expr(:(=), x...), [(k, maybe_quote(v)) for (k, v) in get_store_names() if !isdefined(newmod, k)])...))
# insert all bindings from the source module that aren't already defined in the eval module
Core.eval(newmod, Expr(:block, map(x->Expr(:(=), x...), [(k, maybe_quote(v)) for (k, v) in modns if !isdefined(newmod, k)])...))

Expand Down
312 changes: 312 additions & 0 deletions test/Julia_multi_exfiltrate_1.1.multiout
Original file line number Diff line number Diff line change
@@ -0,0 +1,312 @@
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>:
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>:
|
|infil> i
|1
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBC
|C
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>:
|
|infil> i
|1
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>:
|
|infil> i
|1
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil> i
|2
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBC
|C
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>:
|
|infil> i
|1
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil> i
|2
|
|infil> @exfiltrate
|Exfiltrating 1 local variable into the safehouse.
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCCCC
|CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>:
|
|infil> i
|1
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil> i
|2
|
|infil> @exfiltrate
|Exfiltrating 1 local variable into the safehouse.
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCCCC
|CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>:
|
|infil> i
|1
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil> i
|2
|
|infil> @exfiltrate
|Exfiltrating 1 local variable into the safehouse.
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil> i
|3
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCCCC
|CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBC
|C
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>:
|
|infil> i
|1
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil> i
|2
|
|infil> @exfiltrate
|Exfiltrating 1 local variable into the safehouse.
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil> i
|3
|
|infil> safehouse.i
|2
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCCCC
|CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCCCC
|C
|
|BBBBBBB
++++++++++++++++++++++++++++++++++++++++++++++++++
|Infiltrating <unknown>:
|
|infil> i
|1
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil> i
|2
|
|infil> @exfiltrate
|Exfiltrating 1 local variable into the safehouse.
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil> i
|3
|
|infil> safehouse.i
|2
|
|infil> @continue
|
|Infiltrating <unknown>:
|
|infil>
--------------------------------------------------
|AAAAAAAAAAAAAAAAAAAAAAA
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCCCC
|CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBBC
|C
|
|BBBBBBBCCCCCCCCCCC
|C
|
|BBBBBBBCCCCCCCCC
|
|CCCCCCCCCCCCCCCCCCCCCCC
|
|BBBBBBB
Loading

0 comments on commit ad5bba9

Please sign in to comment.