Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Issue 3003583002: [VM, Precompiler] PoC Obfuscator (Closed)

Created:
3 years, 4 months ago by Vyacheslav Egorov (Google)
Modified:
3 years, 3 months ago
Reviewers:
rmacnak
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

[VM, Precompiler] Support obfuscation of the symbolic information in precompiler Obfuscation is controlled by obfuscate flag in Dart_IsolateFlags. Obfuscation of identifiers is performed during script tokenization - when TokenStream is generated from the source. All kIDENT and kINTERPOL_VAR tokens are renamed consistently using a persistent obfuscation map stored in ObjectStore::obfuscation_map. Some identifiers (pseudo-keywords, arithmetic operators, builtin recognized methods and entry-points) are not renamed to keep name based lookups from breaking. All other identifiers are renamed. Constant instances of Symbol-s (both created via literal syntax #ident and using constant constructor const Symbol("ident")) are renamed consistently with corresponding identifiers. Script urls and Library urls and names are also obfuscated. Obfuscation map can be dumped as a JSON array at the end of precompilation using Dart_GetObfuscationMap API. BUG=https://github.com/dart-lang/sdk/issues/30524 R=rmacnak@google.com Committed: https://github.com/dart-lang/sdk/commit/7d5231796ee466d2f1399dc9eb56f64c84625bd3

Patch Set 1 #

Patch Set 2 : Things work #

Patch Set 3 : Discard obfuscation map #

Total comments: 12

Patch Set 4 : address comments and fix stuff #

Total comments: 3

Patch Set 5 : feature complete #

Patch Set 6 : comments #

Patch Set 7 : Fix bad refactoring in NewAtomicRename #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1371 lines, -413 lines) Patch
M runtime/bin/gen_snapshot.cc View 1 2 3 4 13 chunks +188 lines, -239 lines 0 comments Download
M runtime/bin/main.cc View 1 2 3 7 chunks +95 lines, -41 lines 0 comments Download
M runtime/include/dart_api.h View 1 2 3 4 5 5 chunks +26 lines, -7 lines 0 comments Download
M runtime/tests/vm/vm.status View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/class_finalizer.cc View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 2 chunks +45 lines, -0 lines 0 comments Download
M runtime/vm/intrinsifier.cc View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M runtime/vm/isolate.h View 1 2 3 4 5 chunks +73 lines, -64 lines 0 comments Download
M runtime/vm/isolate.cc View 1 2 3 4 4 chunks +74 lines, -6 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 7 chunks +34 lines, -9 lines 0 comments Download
M runtime/vm/object_store.h View 1 2 3 2 chunks +8 lines, -4 lines 0 comments Download
M runtime/vm/object_store.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/parser.h View 1 1 chunk +6 lines, -4 lines 0 comments Download
M runtime/vm/parser.cc View 1 5 chunks +15 lines, -4 lines 0 comments Download
M runtime/vm/precompiler.h View 1 2 3 4 5 2 chunks +208 lines, -0 lines 0 comments Download
M runtime/vm/precompiler.cc View 1 2 3 4 5 6 6 chunks +524 lines, -25 lines 0 comments Download
M runtime/vm/raw_object.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M tests/co19/co19-runtime.status View 1 1 chunk +5 lines, -0 lines 0 comments Download
M tests/corelib_2/corelib_2.status View 1 1 chunk +4 lines, -0 lines 0 comments Download
M tests/kernel/kernel.status View 1 1 chunk +3 lines, -0 lines 0 comments Download
M tests/kernel/unsorted/nsm_dispatcher_test.dart View 1 1 chunk +6 lines, -8 lines 0 comments Download
M tests/language/language.status View 1 2 3 1 chunk +29 lines, -0 lines 0 comments Download
M tools/testing/dart/compiler_configuration.dart View 1 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (3 generated)
rmacnak
looks good overall https://codereview.chromium.org/3003583002/diff/40001/runtime/vm/class_finalizer.cc File runtime/vm/class_finalizer.cc (right): https://codereview.chromium.org/3003583002/diff/40001/runtime/vm/class_finalizer.cc#newcode3468 runtime/vm/class_finalizer.cc:3468: return; if (isolate->flags->obfuscate) return; https://codereview.chromium.org/3003583002/diff/40001/runtime/vm/intrinsifier.cc File ...
3 years, 3 months ago (2017-08-23 01:16:50 UTC) #2
Vyacheslav Egorov (Google)
Thank you for initial comments. I have addressed them. The CL is now feature complete. ...
3 years, 3 months ago (2017-08-23 15:54:53 UTC) #4
rmacnak
I'm not sure I understand what the obfuscator means by "atomic". I think this is ...
3 years, 3 months ago (2017-08-24 01:00:27 UTC) #5
Vyacheslav Egorov (Google)
I am using "atomic" in a sense "inseparable entity", e.g. in this case "atomic rename" ...
3 years, 3 months ago (2017-08-24 14:27:20 UTC) #6
rmacnak
On 2017/08/24 14:27:20, Vyacheslav Egorov (Google) wrote: > I am using "atomic" in a sense ...
3 years, 3 months ago (2017-08-25 01:00:46 UTC) #7
Vyacheslav Egorov (Google)
3 years, 3 months ago (2017-08-25 07:48:27 UTC) #9
Message was sent while issue was closed.
Committed patchset #7 (id:120001) manually as
7d5231796ee466d2f1399dc9eb56f64c84625bd3 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698