Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop overwriting locals with exfiltrate variables #77

Merged
merged 2 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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