cfsolve 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +10 -9
- data/THIRD_PARTY_LICENSES/README.md +71 -254
- data/THIRD_PARTY_LICENSES/{derive_builder_macro-0.20.2/LICENSE-APACHE → bytecount-0.6.9/LICENSE.Apache2} +0 -1
- data/THIRD_PARTY_LICENSES/{darling-0.20.11/LICENSE → bytecount-0.6.9/LICENSE.MIT} +1 -3
- data/THIRD_PARTY_LICENSES/{ident_case-1.0.1/LICENSE → cobs-0.3.0/LICENSE-MIT} +1 -1
- data/THIRD_PARTY_LICENSES/cow-utils-0.1.3/LICENSE +21 -0
- data/THIRD_PARTY_LICENSES/{hashbrown-0.14.5 → embedded-io-0.4.0}/LICENSE-MIT +1 -1
- data/THIRD_PARTY_LICENSES/{ahash-0.8.12 → embedded-io-0.6.1}/LICENSE-MIT +1 -1
- data/THIRD_PARTY_LICENSES/{browserslist-data-0.1.4 → escape-simd-0.1.1}/LICENSE +1 -1
- data/THIRD_PARTY_LICENSES/escape-simd-0.1.1/NOTICE +62 -0
- data/THIRD_PARTY_LICENSES/json-escape-simd-3.1.3/LICENSE +21 -0
- data/THIRD_PARTY_LICENSES/{miette-7.6.0/LICENSE → json-escape-simd-3.1.3/LICENSE-APACHE} +0 -1
- data/THIRD_PARTY_LICENSES/json-escape-simd-3.1.3/NOTICE +62 -0
- data/THIRD_PARTY_LICENSES/memchr-2.8.3/UNLICENSE +24 -0
- data/THIRD_PARTY_LICENSES/{derive_builder_core-0.20.2 → nonmax-0.5.5}/LICENSE-APACHE +1 -2
- data/THIRD_PARTY_LICENSES/{dashmap-5.5.3/LICENSE → nonmax-0.5.5/LICENSE-MIT} +2 -4
- data/THIRD_PARTY_LICENSES/{rand-0.8.5 → num-bigint-0.5.1}/LICENSE-MIT +0 -1
- data/THIRD_PARTY_LICENSES/oxc-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/{browserslist-rs-0.19.0 → oxc-browserslist-5.0.1}/LICENSE +1 -0
- data/THIRD_PARTY_LICENSES/oxc_allocator-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_allocator-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_ast-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_ast-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_ast_macros-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_ast_macros-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_ast_visit-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_ast_visit-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_codegen-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_codegen-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_compat-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_compat-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_data_structures-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_data_structures-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_diagnostics-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_diagnostics-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_ecmascript-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_ecmascript-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_estree-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_estree-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_index-5.0.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_parser-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_parser-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_regular_expression-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_regular_expression-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_semantic-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_semantic-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_span-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_span-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_str-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_str-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/oxc_syntax-0.157.0/LICENSE +22 -0
- data/THIRD_PARTY_LICENSES/oxc_syntax-0.157.0/THIRD-PARTY-LICENSE +763 -0
- data/THIRD_PARTY_LICENSES/{fixedbitset-0.5.7 → postcard-1.1.3}/LICENSE-MIT +1 -1
- data/THIRD_PARTY_LICENSES/{bytes-str-0.2.7/LICENSE → self_cell-1.3.0/LICENSE-APACHE} +1 -2
- data/THIRD_PARTY_LICENSES/self_cell-1.3.0/LICENSE-GPLv2 +339 -0
- data/THIRD_PARTY_LICENSES/{darling_core-0.20.11 → smawk-0.3.3}/LICENSE +1 -1
- data/UPSTREAM.md +10 -8
- data/ext/cfsolve/Cargo.lock +534 -1727
- data/ext/cfsolve/Cargo.toml +4 -0
- data/ext/cfsolve/src/main.rs +1 -1
- data/lib/cfsolve/profiles/safari-26-ios/answers.json +2570 -1894
- data/lib/cfsolve/profiles/safari-26-ios/challenge-page-answers.json +1867 -1192
- data/lib/cfsolve/profiles/safari-26-ios.json +102 -156
- data/lib/cfsolve/version.rb +2 -2
- data/vendor/cfsolve/Cargo.lock +561 -1729
- data/vendor/cfsolve/Cargo.toml +26 -8
- data/vendor/cfsolve/README.md +4 -35
- data/vendor/cfsolve/examples/build_profile.rs +17 -15
- data/vendor/cfsolve/examples/capture_session.rs +37 -0
- data/vendor/cfsolve/examples/check_answers.rs +66 -0
- data/vendor/cfsolve/examples/compare_session.rs +189 -0
- data/vendor/cfsolve/examples/solver_profile.rs +84 -0
- data/vendor/cfsolve/examples/solver_smoke.rs +9 -8
- data/vendor/cfsolve/examples/stage2_snapshot.rs +6 -3
- data/vendor/cfsolve/examples/tls_echo.rs +3 -3
- data/vendor/cfsolve/examples/vm_snapshot.rs +32 -33
- data/vendor/cfsolve/profiles/safari-26-ios/answers.json +2570 -1894
- data/vendor/cfsolve/profiles/safari-26-ios/challenge-page-answers.json +1867 -1192
- data/vendor/cfsolve/profiles/safari-26-ios.json +102 -156
- data/vendor/cfsolve/scripts/capture_cssom.mjs +42 -0
- data/vendor/cfsolve/scripts/serve_cssom.py +111 -0
- data/vendor/cfsolve/src/bin/capture-proxy/main.rs +3 -2
- data/vendor/cfsolve/src/bin/challenge/cli.rs +8 -2
- data/vendor/cfsolve/src/bin/challenge/main.rs +7 -2
- data/vendor/cfsolve/src/capture/profile.rs +7 -18
- data/vendor/cfsolve/src/capture/proxy/tests.rs +1 -1
- data/vendor/cfsolve/src/capture/proxy.rs +44 -13
- data/vendor/cfsolve/src/capture/recorded.rs +42 -7
- data/vendor/cfsolve/src/capture/sessions.rs +4 -3
- data/vendor/cfsolve/src/capture/upstream.rs +1 -1
- data/vendor/cfsolve/src/challenge/codec.rs +4 -2
- data/vendor/cfsolve/src/challenge/expression.rs +161 -117
- data/vendor/cfsolve/src/challenge/installed/audit.rs +132 -0
- data/vendor/cfsolve/src/challenge/installed.rs +127 -269
- data/vendor/cfsolve/src/challenge/merge.rs +120 -80
- data/vendor/cfsolve/src/challenge/orchestrator.rs +57 -44
- data/vendor/cfsolve/src/challenge/payload.rs +175 -35
- data/vendor/cfsolve/src/challenge/program.rs +197 -178
- data/vendor/cfsolve/src/challenge/reduced_timing.rs +55 -40
- data/vendor/cfsolve/src/challenge/source.rs +151 -96
- data/vendor/cfsolve/src/challenge/state.rs +236 -122
- data/vendor/cfsolve/src/challenge/tally.rs +64 -50
- data/vendor/cfsolve/src/challenge.rs +1 -0
- data/vendor/cfsolve/src/deobfuscate/analysis/bindings.rs +187 -185
- data/vendor/cfsolve/src/deobfuscate/analysis/effects.rs +42 -51
- data/vendor/cfsolve/src/deobfuscate/analysis/hoisting.rs +147 -228
- data/vendor/cfsolve/src/deobfuscate/analysis/properties.rs +250 -425
- data/vendor/cfsolve/src/deobfuscate/analysis/unconditional.rs +79 -0
- data/vendor/cfsolve/src/deobfuscate/analysis.rs +259 -41
- data/vendor/cfsolve/src/deobfuscate/argument_arrays.rs +70 -73
- data/vendor/cfsolve/src/deobfuscate/arrow_blocks.rs +91 -104
- data/vendor/cfsolve/src/deobfuscate/ast.rs +383 -0
- data/vendor/cfsolve/src/deobfuscate/bitwise.rs +44 -54
- data/vendor/cfsolve/src/deobfuscate/blocks.rs +36 -29
- data/vendor/cfsolve/src/deobfuscate/call_helpers.rs +80 -131
- data/vendor/cfsolve/src/deobfuscate/control_flow.rs +239 -297
- data/vendor/cfsolve/src/deobfuscate/copy_propagation.rs +114 -135
- data/vendor/cfsolve/src/deobfuscate/dead_branches.rs +62 -61
- data/vendor/cfsolve/src/deobfuscate/dead_properties.rs +197 -214
- data/vendor/cfsolve/src/deobfuscate/dispatch.rs +238 -298
- data/vendor/cfsolve/src/deobfuscate/encoded_strings.rs +201 -205
- data/vendor/cfsolve/src/deobfuscate/function_lengths.rs +32 -38
- data/vendor/cfsolve/src/deobfuscate/helper_objects.rs +346 -536
- data/vendor/cfsolve/src/deobfuscate/hygiene.rs +197 -0
- data/vendor/cfsolve/src/deobfuscate/int32_helpers.rs +121 -155
- data/vendor/cfsolve/src/deobfuscate/literals.rs +116 -67
- data/vendor/cfsolve/src/deobfuscate/loops.rs +43 -43
- data/vendor/cfsolve/src/deobfuscate/memoized_strings.rs +127 -131
- data/vendor/cfsolve/src/deobfuscate/merged_functions.rs +262 -220
- data/vendor/cfsolve/src/deobfuscate/pipeline.rs +199 -244
- data/vendor/cfsolve/src/deobfuscate/register_arrays.rs +361 -322
- data/vendor/cfsolve/src/deobfuscate/removal.rs +83 -52
- data/vendor/cfsolve/src/deobfuscate/simplify.rs +147 -0
- data/vendor/cfsolve/src/deobfuscate/state_machines.rs +88 -110
- data/vendor/cfsolve/src/deobfuscate/statements.rs +228 -228
- data/vendor/cfsolve/src/deobfuscate/static_members.rs +46 -31
- data/vendor/cfsolve/src/deobfuscate/testing.rs +49 -59
- data/vendor/cfsolve/src/deobfuscate/unused_bindings.rs +92 -102
- data/vendor/cfsolve/src/deobfuscate.rs +15 -11
- data/vendor/cfsolve/src/embedding_page/extra_params.rs +23 -32
- data/vendor/cfsolve/src/embedding_page/page.rs +28 -2
- data/vendor/cfsolve/src/embedding_page/render_sample.rs +184 -147
- data/vendor/cfsolve/src/error.rs +40 -5
- data/vendor/cfsolve/src/fingerprint.rs +8 -2
- data/vendor/cfsolve/src/http/client.rs +9 -1
- data/vendor/cfsolve/src/http/requests.rs +2 -2
- data/vendor/cfsolve/src/js/ast.rs +479 -254
- data/vendor/cfsolve/src/js/objects.rs +9 -2
- data/vendor/cfsolve/src/lib.rs +1 -0
- data/vendor/cfsolve/src/listing/fold.rs +19 -92
- data/vendor/cfsolve/src/listing/query.rs +26 -291
- data/vendor/cfsolve/src/listing.rs +0 -1
- data/vendor/cfsolve/src/performance_clock.rs +20 -1
- data/vendor/cfsolve/src/profiling.rs +49 -0
- data/vendor/cfsolve/src/script.rs +35 -24
- data/vendor/cfsolve/src/session/challenge_page.rs +41 -21
- data/vendor/cfsolve/src/session/channel.rs +2 -2
- data/vendor/cfsolve/src/session/initial.rs +19 -10
- data/vendor/cfsolve/src/session/probes.rs +160 -125
- data/vendor/cfsolve/src/session/sink.rs +26 -1
- data/vendor/cfsolve/src/session/tests/challenge_page.rs +36 -1
- data/vendor/cfsolve/src/session/timing.rs +58 -53
- data/vendor/cfsolve/src/session/widget.rs +5 -6
- data/vendor/cfsolve/src/session.rs +1 -1
- data/vendor/cfsolve/src/solver.rs +3 -1
- data/vendor/cfsolve/src/stage2/analysis/analyze.rs +50 -33
- data/vendor/cfsolve/src/stage2/analysis/audit.rs +4 -2
- data/vendor/cfsolve/src/stage2/analysis/discovery.rs +61 -66
- data/vendor/cfsolve/src/stage2/analysis/envelope.rs +33 -22
- data/vendor/cfsolve/src/stage2/analysis/recognize.rs +3 -5
- data/vendor/cfsolve/src/stage2/analysis.rs +0 -1
- data/vendor/cfsolve/src/stage2/audit_globals.rs +378 -0
- data/vendor/cfsolve/src/stage2/benchmark.rs +66 -38
- data/vendor/cfsolve/src/stage2/call_stack.rs +1463 -1017
- data/vendor/cfsolve/src/stage2/challenge_page.rs +3 -2
- data/vendor/cfsolve/src/stage2/interaction/checkbox.rs +202 -150
- data/vendor/cfsolve/src/stage2/interaction/click.rs +2 -2
- data/vendor/cfsolve/src/stage2/interaction/native.rs +2 -1
- data/vendor/cfsolve/src/stage2/interaction/plan.rs +5 -7
- data/vendor/cfsolve/src/stage2/payload/recover.rs +56 -25
- data/vendor/cfsolve/src/stage2/probes/clock.rs +1 -3
- data/vendor/cfsolve/src/stage2/probes/ice.rs +11 -10
- data/vendor/cfsolve/src/stage2/probes/media.rs +47 -33
- data/vendor/cfsolve/src/stage2/probes/performance.rs +13 -8
- data/vendor/cfsolve/src/stage2/probes/rects.rs +12 -17
- data/vendor/cfsolve/src/stage2/probes/stack.rs +50 -103
- data/vendor/cfsolve/src/stage2/probes/websocket_echo.rs +17 -86
- data/vendor/cfsolve/src/stage2/probes.rs +0 -1
- data/vendor/cfsolve/src/stage2/queries.rs +50 -0
- data/vendor/cfsolve/src/stage2/records.rs +4 -13
- data/vendor/cfsolve/src/stage2/reference.json +1 -1
- data/vendor/cfsolve/src/stage2/reference.rs +98 -100
- data/vendor/cfsolve/src/stage2/registry.rs +41 -34
- data/vendor/cfsolve/src/stage2/replay.rs +182 -254
- data/vendor/cfsolve/src/stage2/stylesheets.rs +176 -0
- data/vendor/cfsolve/src/stage2/syntax.rs +88 -0
- data/vendor/cfsolve/src/stage2/trace.rs +152 -108
- data/vendor/cfsolve/src/stage2/vocabulary.rs +103 -403
- data/vendor/cfsolve/src/stage2.rs +4 -1
- data/vendor/cfsolve/src/vm/disassemble.rs +46 -13
- data/vendor/cfsolve/src/vm/dispatch.rs +93 -65
- data/vendor/cfsolve/src/vm/extract.rs +347 -250
- data/vendor/cfsolve/src/vm/interpret/access.rs +67 -68
- data/vendor/cfsolve/src/vm/interpret/builtin.rs +16 -63
- data/vendor/cfsolve/src/vm/interpret/call.rs +192 -51
- data/vendor/cfsolve/src/vm/interpret/compile.rs +643 -0
- data/vendor/cfsolve/src/vm/interpret/copies.rs +232 -120
- data/vendor/cfsolve/src/vm/interpret/evaluate/tests.rs +149 -40
- data/vendor/cfsolve/src/vm/interpret/evaluate.rs +189 -572
- data/vendor/cfsolve/src/vm/interpret/explore.rs +159 -46
- data/vendor/cfsolve/src/vm/interpret/formula.rs +131 -0
- data/vendor/cfsolve/src/vm/interpret/frozen.rs +169 -0
- data/vendor/cfsolve/src/vm/interpret/intrinsic.rs +414 -0
- data/vendor/cfsolve/src/vm/interpret/mix32.rs +189 -0
- data/vendor/cfsolve/src/vm/interpret/native_dispatch.rs +220 -0
- data/vendor/cfsolve/src/vm/interpret/pattern.rs +1736 -0
- data/vendor/cfsolve/src/vm/interpret/plan.rs +605 -330
- data/vendor/cfsolve/src/vm/interpret/register_helpers.rs +384 -0
- data/vendor/cfsolve/src/vm/interpret/run.rs +314 -54
- data/vendor/cfsolve/src/vm/interpret/semantics.rs +71 -46
- data/vendor/cfsolve/src/vm/interpret/setup.rs +80 -45
- data/vendor/cfsolve/src/vm/interpret/string_decoder.rs +482 -0
- data/vendor/cfsolve/src/vm/interpret.rs +16 -3
- data/vendor/cfsolve/src/vm/machine.rs +58 -47
- data/vendor/cfsolve/src/vm/output.rs +13 -5
- data/vendor/cfsolve/src/vm/packed_names.rs +311 -0
- data/vendor/cfsolve/src/vm/session.rs +197 -110
- data/vendor/cfsolve/src/vm/value.rs +35 -19
- data/vendor/cfsolve/src/vm.rs +3 -1
- data/vendor/cfsolve/vendor/btls-sys/Cargo.toml +3 -0
- data/vendor/cfsolve/vendor/btls-sys/build/main.rs +20 -0
- data/vendor/cfsolve/vendor/btls-sys/src/lib.rs +3 -0
- metadata +106 -183
- data/THIRD_PARTY_LICENSES/Inflector-0.11.4/LICENSE.md +0 -22
- data/THIRD_PARTY_LICENSES/arrayvec-0.7.6/LICENSE-MIT +0 -25
- data/THIRD_PARTY_LICENSES/ascii-1.1.0/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/ascii-1.1.0/LICENSE-MIT +0 -22
- data/THIRD_PARTY_LICENSES/ast_node-5.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/better_scoped_tls-1.0.1/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/bitvec-1.0.1/LICENSE.txt +0 -21
- data/THIRD_PARTY_LICENSES/bstr-1.12.1/COPYING +0 -8
- data/THIRD_PARTY_LICENSES/bstr-1.12.1/LICENSE-MIT +0 -21
- data/THIRD_PARTY_LICENSES/cargo-platform-0.1.9/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/cargo_metadata-0.19.2/LICENSE-MIT +0 -23
- data/THIRD_PARTY_LICENSES/darling_macro-0.20.11/LICENSE +0 -21
- data/THIRD_PARTY_LICENSES/debugid-0.8.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/derive_builder-0.20.2/LICENSE-MIT +0 -21
- data/THIRD_PARTY_LICENSES/derive_builder_core-0.20.2/LICENSE-MIT +0 -21
- data/THIRD_PARTY_LICENSES/derive_builder_macro-0.20.2/LICENSE-MIT +0 -21
- data/THIRD_PARTY_LICENSES/foldhash-0.1.5/LICENSE +0 -19
- data/THIRD_PARTY_LICENSES/from_variant-3.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/funty-2.0.0/LICENSE.txt +0 -21
- data/THIRD_PARTY_LICENSES/hashbrown-0.16.1/LICENSE-MIT +0 -25
- data/THIRD_PARTY_LICENSES/heck-0.5.0/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/hermit-abi-0.5.2/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/hermit-abi-0.5.2/LICENSE-MIT +0 -23
- data/THIRD_PARTY_LICENSES/hstr-3.0.3/LICENSE +0 -202
- data/THIRD_PARTY_LICENSES/if_chain-1.0.3/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/if_chain-1.0.3/LICENSE-MIT +0 -25
- data/THIRD_PARTY_LICENSES/is-macro-0.3.7/LICENSE +0 -202
- data/THIRD_PARTY_LICENSES/itoa-1.0.17/LICENSE-MIT +0 -23
- data/THIRD_PARTY_LICENSES/jsonc-parser-0.26.3/LICENSE +0 -21
- data/THIRD_PARTY_LICENSES/lazy_static-1.5.0/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/lazy_static-1.5.0/LICENSE-MIT +0 -25
- data/THIRD_PARTY_LICENSES/lru-0.16.2/LICENSE +0 -21
- data/THIRD_PARTY_LICENSES/memchr-2.7.6/COPYING +0 -3
- data/THIRD_PARTY_LICENSES/memchr-2.7.6/LICENSE-MIT +0 -21
- data/THIRD_PARTY_LICENSES/miette-derive-7.6.0/LICENSE +0 -229
- data/THIRD_PARTY_LICENSES/normpath-0.2.0/COPYRIGHT +0 -7
- data/THIRD_PARTY_LICENSES/normpath-0.2.0/LICENSE-MIT +0 -21
- data/THIRD_PARTY_LICENSES/normpath-0.2.0/LICENSE-THIRD-PARTY +0 -210
- data/THIRD_PARTY_LICENSES/num_cpus-1.17.0/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/num_cpus-1.17.0/LICENSE-MIT +0 -20
- data/THIRD_PARTY_LICENSES/owo-colors-4.2.3/LICENSE +0 -21
- data/THIRD_PARTY_LICENSES/par-core-2.0.0/LICENSE +0 -202
- data/THIRD_PARTY_LICENSES/par-iter-2.0.0/LICENSE +0 -202
- data/THIRD_PARTY_LICENSES/path-clean-0.1.0/LICENSE-APACHE +0 -13
- data/THIRD_PARTY_LICENSES/path-clean-0.1.0/LICENSE-MIT +0 -18
- data/THIRD_PARTY_LICENSES/path-clean-1.0.1/LICENSE-APACHE +0 -13
- data/THIRD_PARTY_LICENSES/path-clean-1.0.1/LICENSE-MIT +0 -18
- data/THIRD_PARTY_LICENSES/pathdiff-0.2.3/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/pathdiff-0.2.3/LICENSE-MIT +0 -23
- data/THIRD_PARTY_LICENSES/petgraph-0.7.1/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/precomputed-map-0.2.0/LICENSE +0 -21
- data/THIRD_PARTY_LICENSES/preset_env_base-6.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/radium-0.7.0/LICENSE.txt +0 -21
- data/THIRD_PARTY_LICENSES/radix_fmt-1.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/rand-0.8.5/COPYRIGHT +0 -12
- data/THIRD_PARTY_LICENSES/rand-0.8.5/LICENSE-APACHE +0 -176
- data/THIRD_PARTY_LICENSES/rand_core-0.6.4/COPYRIGHT +0 -12
- data/THIRD_PARTY_LICENSES/rand_core-0.6.4/LICENSE-APACHE +0 -187
- data/THIRD_PARTY_LICENSES/rand_core-0.6.4/LICENSE-MIT +0 -26
- data/THIRD_PARTY_LICENSES/regress-0.10.5/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/regress-0.10.5/LICENSE-MIT +0 -21
- data/THIRD_PARTY_LICENSES/ryu-1.0.22/LICENSE-APACHE +0 -176
- data/THIRD_PARTY_LICENSES/ryu-1.0.22/LICENSE-BOOST +0 -23
- data/THIRD_PARTY_LICENSES/scoped-tls-1.0.1/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/scoped-tls-1.0.1/LICENSE-MIT +0 -25
- data/THIRD_PARTY_LICENSES/siphasher-0.3.11/COPYING +0 -7
- data/THIRD_PARTY_LICENSES/smallvec-1.15.1/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/smartstring-1.0.1/LICENCE.md +0 -355
- data/THIRD_PARTY_LICENSES/st-map-0.2.4/LICENSE +0 -202
- data/THIRD_PARTY_LICENSES/static-map-macro-0.3.4/LICENSE +0 -202
- data/THIRD_PARTY_LICENSES/string_enum-1.0.2/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/strsim-0.11.1/LICENSE +0 -23
- data/THIRD_PARTY_LICENSES/swc-52.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_allocator-4.0.1/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_atoms-9.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_common-18.0.1/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_compiler_base-45.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_config-3.1.2/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_config_macro-1.0.1/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_core-54.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_ast-19.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_codegen-21.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_codegen_macros-2.0.2/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_compat_bugfixes-39.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_compat_common-30.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2015-39.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2016-35.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2017-35.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2018-36.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2019-35.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2020-37.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2021-35.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2022-37.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_compat_es3-26.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_ext_transforms-25.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_hooks-0.3.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_loader-18.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_minifier-42.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_parser-32.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_preset_env-45.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_transformer-6.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_transforms-44.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_transforms_base-35.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_transforms_classes-35.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_transforms_compat-40.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_transforms_macros-1.0.1/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_transforms_module-38.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_transforms_optimization-37.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_transforms_proposal-35.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_transforms_react-38.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_transforms_typescript-38.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_usage_analyzer-27.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_utils-25.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_ecma_visit-19.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_eq_ignore_macros-1.0.1/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_error_reporters-20.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_macros_common-1.0.1/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_node_comments-18.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_timer-1.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_trace_macro-2.0.2/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_transform_common-12.0.0/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/swc_visit-2.0.1/LICENSE +0 -201
- data/THIRD_PARTY_LICENSES/tap-1.0.1/LICENSE.txt +0 -21
- data/THIRD_PARTY_LICENSES/tracing-0.1.44/LICENSE +0 -25
- data/THIRD_PARTY_LICENSES/tracing-attributes-0.1.31/LICENSE +0 -25
- data/THIRD_PARTY_LICENSES/tracing-core-0.1.36/LICENSE +0 -25
- data/THIRD_PARTY_LICENSES/triomphe-0.1.15/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/triomphe-0.1.15/LICENSE-MIT +0 -27
- data/THIRD_PARTY_LICENSES/unicode-width-0.1.14/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/unicode-width-0.1.14/LICENSE-MIT +0 -25
- data/THIRD_PARTY_LICENSES/uuid-1.19.0/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/uuid-1.19.0/LICENSE-MIT +0 -26
- data/THIRD_PARTY_LICENSES/vergen-9.0.6/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/vergen-9.0.6/LICENSE-MIT +0 -25
- data/THIRD_PARTY_LICENSES/vergen-lib-0.1.6/LICENSE-APACHE +0 -201
- data/THIRD_PARTY_LICENSES/vergen-lib-0.1.6/LICENSE-MIT +0 -25
- data/THIRD_PARTY_LICENSES/wyz-0.5.1/LICENSE.txt +0 -21
- data/vendor/cfsolve/src/deobfuscate/analysis/globals.rs +0 -33
- data/vendor/cfsolve/src/deobfuscate/analysis/names.rs +0 -52
- data/vendor/cfsolve/src/listing/normalize.rs +0 -264
- data/vendor/cfsolve/src/stage2/analysis/outputs.rs +0 -327
- data/vendor/cfsolve/src/stage2/probes/stylesheets.rs +0 -249
- data/vendor/cfsolve/src/stage2/reference-expanded.json +0 -42
- data/vendor/cfsolve/src/stage2/session_names.rs +0 -470
- /data/THIRD_PARTY_LICENSES/{derive_builder-0.20.2 → cobs-0.3.0}/LICENSE-APACHE +0 -0
- /data/THIRD_PARTY_LICENSES/{compact_str-0.7.1 → compact_str-0.10.0}/LICENSE +0 -0
- /data/THIRD_PARTY_LICENSES/{ahash-0.8.12 → embedded-io-0.4.0}/LICENSE-APACHE +0 -0
- /data/THIRD_PARTY_LICENSES/{arrayvec-0.7.6 → embedded-io-0.6.1}/LICENSE-APACHE +0 -0
- /data/THIRD_PARTY_LICENSES/{normpath-0.2.0 → escape-simd-0.1.1}/LICENSE-APACHE +0 -0
- /data/THIRD_PARTY_LICENSES/{bstr-1.12.1 → itertools-0.15.0}/LICENSE-APACHE +0 -0
- /data/THIRD_PARTY_LICENSES/{petgraph-0.7.1 → itertools-0.15.0}/LICENSE-MIT +0 -0
- /data/THIRD_PARTY_LICENSES/{itoa-1.0.17 → itoa-1.0.19}/LICENSE-APACHE +0 -0
- /data/THIRD_PARTY_LICENSES/{camino-1.2.2 → itoa-1.0.19}/LICENSE-MIT +0 -0
- /data/THIRD_PARTY_LICENSES/{globset-0.4.18 → memchr-2.8.3}/COPYING +0 -0
- /data/THIRD_PARTY_LICENSES/{globset-0.4.18 → memchr-2.8.3}/LICENSE-MIT +0 -0
- /data/THIRD_PARTY_LICENSES/{camino-1.2.2 → num-bigint-0.5.1}/LICENSE-APACHE +0 -0
- /data/THIRD_PARTY_LICENSES/{swc_sourcemap-9.3.4 → oxc_sourcemap-9.0.0}/LICENSE +0 -0
- /data/THIRD_PARTY_LICENSES/{phf-0.11.3 → phf-0.14.0}/LICENSE +0 -0
- /data/THIRD_PARTY_LICENSES/{phf_generator-0.11.3 → phf_generator-0.14.0}/LICENSE +0 -0
- /data/THIRD_PARTY_LICENSES/{phf_macros-0.11.3 → phf_macros-0.14.0}/LICENSE +0 -0
- /data/THIRD_PARTY_LICENSES/{phf_shared-0.11.3 → phf_shared-0.14.0}/LICENSE +0 -0
- /data/THIRD_PARTY_LICENSES/{fixedbitset-0.5.7 → postcard-1.1.3}/LICENSE-APACHE +0 -0
- /data/THIRD_PARTY_LICENSES/{hashbrown-0.14.5 → smallvec-1.16.5}/LICENSE-APACHE +0 -0
- /data/THIRD_PARTY_LICENSES/{smallvec-1.15.1 → smallvec-1.16.5}/LICENSE-MIT +0 -0
- /data/THIRD_PARTY_LICENSES/{unicode-width-0.1.14 → unicode-segmentation-1.13.3}/COPYRIGHT +0 -0
- /data/THIRD_PARTY_LICENSES/{hashbrown-0.16.1 → unicode-segmentation-1.13.3}/LICENSE-APACHE +0 -0
- /data/THIRD_PARTY_LICENSES/{heck-0.5.0 → unicode-segmentation-1.13.3}/LICENSE-MIT +0 -0
- /data/THIRD_PARTY_LICENSES/{cargo-platform-0.1.9 → zmij_ecma-1.0.23}/LICENSE-MIT +0 -0
|
@@ -5,7 +5,7 @@ use std::collections::{BTreeMap, BTreeSet};
|
|
|
5
5
|
|
|
6
6
|
use anyhow::{Context, Result, anyhow, bail, ensure};
|
|
7
7
|
use indexmap::IndexMap;
|
|
8
|
-
use
|
|
8
|
+
use oxc::syntax::operator::BinaryOperator;
|
|
9
9
|
|
|
10
10
|
use super::{Expression, Layout, RecordTemplate, Scope, Template};
|
|
11
11
|
use crate::candidates;
|
|
@@ -126,7 +126,7 @@ fn resolve(term: &Term, frame: &Frame<Held>, pool: &str) -> Option<Known<Held>>
|
|
|
126
126
|
}
|
|
127
127
|
_ => return None,
|
|
128
128
|
},
|
|
129
|
-
Term::Binary(
|
|
129
|
+
Term::Binary(BinaryOperator::Subtraction, left, right) => match resolve(left)? {
|
|
130
130
|
Known::Ext(Held::Now) => Known::Ext(Held::Elapsed),
|
|
131
131
|
left => Known::Ext(Held::Expression(Expression::Subtract {
|
|
132
132
|
left: Box::new(expression(left)?),
|
|
@@ -180,7 +180,8 @@ pub(in crate::stage2) struct Recovered<'listing> {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
/// Recovers the payload and any checkbox record. Tries unique header names as record-counter
|
|
183
|
-
/// candidates
|
|
183
|
+
/// candidates, then, for programs whose header holds no names, the fields published objects
|
|
184
|
+
/// start at zero. Uses `program` to identify errors.
|
|
184
185
|
pub(in crate::stage2) fn recover_unique<'listing>(
|
|
185
186
|
index: &Index<'listing>,
|
|
186
187
|
program: &str,
|
|
@@ -191,23 +192,18 @@ pub(in crate::stage2) fn recover_unique<'listing>(
|
|
|
191
192
|
let scan = scan(index, pool);
|
|
192
193
|
let mut layouts = Vec::new();
|
|
193
194
|
let mut failure = None;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
);
|
|
207
|
-
for counter in counters {
|
|
208
|
-
match scan.layout(counter) {
|
|
209
|
-
Ok(layout) => layouts.push((counter.clone(), layout)),
|
|
210
|
-
Err(error) => failure = Some(error),
|
|
195
|
+
for candidates in [
|
|
196
|
+
index.header().values().cloned().collect(),
|
|
197
|
+
scan.zeroed_fields(),
|
|
198
|
+
] {
|
|
199
|
+
for counter in candidates {
|
|
200
|
+
match scan.layout(&counter) {
|
|
201
|
+
Ok(layout) => layouts.push((counter, layout)),
|
|
202
|
+
Err(error) => failure = Some(error),
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if !layouts.is_empty() {
|
|
206
|
+
break;
|
|
211
207
|
}
|
|
212
208
|
}
|
|
213
209
|
ensure!(layouts.len() <= 1, "ambiguous {program} payload counter");
|
|
@@ -243,6 +239,35 @@ pub(in crate::stage2) struct RecordLiteral {
|
|
|
243
239
|
pub(in crate::stage2) struct Scan(Vec<FunctionWrites>);
|
|
244
240
|
|
|
245
241
|
impl Scan {
|
|
242
|
+
/// Fields a published object starts at zero that the program also writes to the payload as
|
|
243
|
+
/// a computed value, as it does when it increments the record counter. Other zeroed fields,
|
|
244
|
+
/// such as the probe count, are published as literals.
|
|
245
|
+
fn zeroed_fields(&self) -> Vec<String> {
|
|
246
|
+
let incremented = |field: &str| {
|
|
247
|
+
let mut payload_writes = self.0.iter().flat_map(FunctionWrites::payload_writes);
|
|
248
|
+
payload_writes.any(|write| {
|
|
249
|
+
write.key == field
|
|
250
|
+
&& !matches!(write.value, Written::Expression(Expression::Literal { .. }))
|
|
251
|
+
})
|
|
252
|
+
};
|
|
253
|
+
let mut fields: Vec<String> = Vec::new();
|
|
254
|
+
for function in &self.0 {
|
|
255
|
+
let Some(publication) = function.published else {
|
|
256
|
+
continue;
|
|
257
|
+
};
|
|
258
|
+
for write in &function.writes {
|
|
259
|
+
if write.is_zero()
|
|
260
|
+
&& write.target == WriteTarget::Object(publication.object)
|
|
261
|
+
&& !fields.contains(&write.key)
|
|
262
|
+
&& incremented(&write.key)
|
|
263
|
+
{
|
|
264
|
+
fields.push(write.key.clone());
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
fields
|
|
269
|
+
}
|
|
270
|
+
|
|
246
271
|
/// Recovers field sources for the second payload. Identifies the replacement template as the
|
|
247
272
|
/// object published to the payload cell with its record `counter` initialized to zero.
|
|
248
273
|
pub(in crate::stage2) fn layout(&self, counter: &str) -> Result<Layout> {
|
|
@@ -256,11 +281,9 @@ impl Scan {
|
|
|
256
281
|
.filter(|write| write.target == WriteTarget::Object(publication.object))
|
|
257
282
|
.collect();
|
|
258
283
|
fields.len() > 20
|
|
259
|
-
&& fields
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
if value.as_f64() == Some(0.0))
|
|
263
|
-
})
|
|
284
|
+
&& fields
|
|
285
|
+
.iter()
|
|
286
|
+
.any(|write| write.key == counter && write.is_zero())
|
|
264
287
|
};
|
|
265
288
|
let templates = functions
|
|
266
289
|
.iter()
|
|
@@ -453,6 +476,14 @@ struct Write {
|
|
|
453
476
|
value: Written,
|
|
454
477
|
}
|
|
455
478
|
|
|
479
|
+
impl Write {
|
|
480
|
+
/// Whether the write stores a literal zero, as for the record counter in the template.
|
|
481
|
+
fn is_zero(&self) -> bool {
|
|
482
|
+
matches!(&self.value, Written::Expression(Expression::Literal { value })
|
|
483
|
+
if value.as_f64() == Some(0.0))
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
456
487
|
#[derive(Clone, Copy, PartialEq)]
|
|
457
488
|
enum WriteTarget {
|
|
458
489
|
/// A new object, identified by where it was created.
|
|
@@ -11,8 +11,6 @@ pub(crate) const PAIRS: usize = 5000;
|
|
|
11
11
|
|
|
12
12
|
/// The smallest positive difference between paired `readings`, capped at one millisecond.
|
|
13
13
|
pub(crate) fn collect(readings: &[[f64; 2]]) -> Result<JsObject> {
|
|
14
|
-
use swc_ecma_utils::number::ToJsString;
|
|
15
|
-
|
|
16
14
|
ensure!(
|
|
17
15
|
readings.len() >= PAIRS,
|
|
18
16
|
"clock probe needs {PAIRS} pairs of readings"
|
|
@@ -29,7 +27,7 @@ pub(crate) fn collect(readings: &[[f64; 2]]) -> Result<JsObject> {
|
|
|
29
27
|
}
|
|
30
28
|
Ok(JsObject::from_iter([(
|
|
31
29
|
reference::SHARED_RESULT.to_owned(),
|
|
32
|
-
JsValue::String(minimum.
|
|
30
|
+
JsValue::String(ryu_js::Buffer::new().format(minimum).to_owned()),
|
|
33
31
|
)]))
|
|
34
32
|
}
|
|
35
33
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
//! Refreshes recorded ICE connection state while preserving its format and timing.
|
|
2
2
|
//!
|
|
3
|
-
//! Reports recorded host candidates, matching a network that blocks UDP
|
|
4
|
-
//! servers, since they would report this machine's address instead of the proxy's.
|
|
3
|
+
//! Reports recorded host candidates only, matching a network that blocks UDP to STUN servers.
|
|
5
4
|
//!
|
|
6
5
|
//! The probe reuses a connection opened earlier. Chrome's recorded startup connection shares
|
|
7
6
|
//! one mDNS name among host candidates; WebKit's uses a separate name for each. Keeps candidate
|
|
8
7
|
//! lines, timing offsets, shared names and foundations, and offer codec and attribute order.
|
|
9
8
|
//! Generates a fresh session ID, credentials, certificate fingerprint, mDNS names, foundations,
|
|
10
|
-
//! and ports.
|
|
9
|
+
//! and host ports.
|
|
11
10
|
|
|
12
11
|
use std::collections::HashMap;
|
|
13
12
|
|
|
@@ -24,8 +23,9 @@ fn tokens(line: &str) -> Vec<String> {
|
|
|
24
23
|
line.split(' ').map(str::to_owned).collect()
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
/// Whether the candidate `line` has type `host` rather than, say, `srflx` (server-reflexive).
|
|
27
|
+
pub(crate) fn is_host(line: &str) -> bool {
|
|
28
|
+
line.split(' ').nth(7) == Some("host")
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/// Session identity shared by candidates and SDP.
|
|
@@ -82,6 +82,7 @@ impl Identity {
|
|
|
82
82
|
|
|
83
83
|
/// Replaces `previous`'s connection state with a fresh one, keeping its capabilities and timing.
|
|
84
84
|
/// Candidates that shared an mDNS name or a foundation in the recording share the fresh one.
|
|
85
|
+
/// Candidates other than host candidates are left out.
|
|
85
86
|
pub(crate) fn refresh(previous: Measurement) -> Result<Measurement> {
|
|
86
87
|
let Measurement::Observed {
|
|
87
88
|
preparation,
|
|
@@ -109,17 +110,17 @@ pub(crate) fn refresh(previous: Measurement) -> Result<Measurement> {
|
|
|
109
110
|
.candidate
|
|
110
111
|
.as_str()
|
|
111
112
|
.context("a recorded media candidate is not a line")?;
|
|
112
|
-
|
|
113
|
-
if !is_host(&tokens) {
|
|
113
|
+
if !is_host(line) {
|
|
114
114
|
continue;
|
|
115
115
|
}
|
|
116
|
-
let
|
|
116
|
+
let tokens = tokens(line);
|
|
117
|
+
let name = names
|
|
117
118
|
.entry(tokens[4].clone())
|
|
118
119
|
.or_insert_with(|| format!("{}.local", uuid()));
|
|
119
120
|
let foundation = *foundations
|
|
120
121
|
.entry(tokens[0].clone())
|
|
121
122
|
.or_insert_with(|| u32::from_le_bytes(random()));
|
|
122
|
-
let candidate = identity.candidate(&tokens, foundation,
|
|
123
|
+
let candidate = identity.candidate(&tokens, foundation, name, port());
|
|
123
124
|
let offset = media::delta(recorded_candidate.observed_ms, recorded_started_ms)?;
|
|
124
125
|
candidates.push(Candidate {
|
|
125
126
|
candidate: json!(candidate),
|
|
@@ -248,7 +249,7 @@ mod tests {
|
|
|
248
249
|
assert_eq!(offsets, [-100, -83]);
|
|
249
250
|
assert_eq!(snapshot.finished_ms - snapshot.started_ms, 154);
|
|
250
251
|
for tokens in &lines {
|
|
251
|
-
assert!(
|
|
252
|
+
assert!(tokens[7] == "host" && tokens[4].ends_with(".local"));
|
|
252
253
|
assert!(!HOST.contains(&tokens[4]) && !OTHER_HOST.contains(&tokens[4]));
|
|
253
254
|
}
|
|
254
255
|
assert_ne!(lines[0][4], lines[1][4], "WebKit names each host candidate");
|
|
@@ -349,6 +349,15 @@ impl Fields {
|
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
fn read(&self, record: &JsObject, started_ms: i64) -> Result<Measurement> {
|
|
352
|
+
/// The four-entry support array, deserialized from a JSON array in field order.
|
|
353
|
+
#[derive(Deserialize)]
|
|
354
|
+
struct Support {
|
|
355
|
+
audio_support: Vec<i8>,
|
|
356
|
+
video_support: Vec<i8>,
|
|
357
|
+
audio_decoding: Option<Vec<i32>>,
|
|
358
|
+
video_decoding: Option<Vec<i32>>,
|
|
359
|
+
}
|
|
360
|
+
|
|
352
361
|
let field = |name: &str| {
|
|
353
362
|
record
|
|
354
363
|
.get(name)
|
|
@@ -374,12 +383,12 @@ impl Fields {
|
|
|
374
383
|
.collect::<Result<_>>()?;
|
|
375
384
|
// Read MediaSource support bits followed by decoding bits or null, for audio first and then
|
|
376
385
|
// video.
|
|
377
|
-
let
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
386
|
+
let Support {
|
|
387
|
+
audio_support,
|
|
388
|
+
video_support,
|
|
389
|
+
audio_decoding,
|
|
390
|
+
video_decoding,
|
|
391
|
+
} = js::from_value(field(MEDIA_SUPPORT)?.clone())
|
|
383
392
|
.context("the media support is not four entries")?;
|
|
384
393
|
let reported = [
|
|
385
394
|
(&self.audio_types, &audio_decoding),
|
|
@@ -514,34 +523,39 @@ pub(crate) fn recognize(probe: &ProbeView<'_>) -> Option<Box<Fields>> {
|
|
|
514
523
|
.iter()
|
|
515
524
|
.find(|text| text.starts_with(prefix) && text.contains(codec))
|
|
516
525
|
};
|
|
517
|
-
let audio = find("audio/mp4;", "mp4a.40.2")?;
|
|
518
|
-
if !audio.contains('A') {
|
|
519
|
-
let arrays = probe.index.string_arrays(probe.entry);
|
|
520
|
-
let list = |prefix: &str, codec: &str| {
|
|
521
|
-
crate::candidates::exactly_one(
|
|
522
|
-
arrays.iter().filter(|items| {
|
|
523
|
-
items.first().is_some_and(|text| text.starts_with(prefix))
|
|
524
|
-
&& items.iter().any(|text| text.contains(codec))
|
|
525
|
-
}),
|
|
526
|
-
"media list",
|
|
527
|
-
)
|
|
528
|
-
.ok()
|
|
529
|
-
.cloned()
|
|
530
|
-
};
|
|
531
|
-
return Some(Box::new(Fields {
|
|
532
|
-
audio_types: list("audio/mp4;", "mp4a.40.2")?,
|
|
533
|
-
video_types: list("video/mp4;", "avc1.42E01E")?,
|
|
534
|
-
excluded_types: list("audio/mp4;", "theora")?,
|
|
535
|
-
}));
|
|
536
|
-
}
|
|
537
|
-
let video = find("video/mp4;", "avc1.42E01E")?;
|
|
538
|
-
let excluded = find("audio/mp4;", "theora")?;
|
|
539
526
|
let types = |list: &str| -> Vec<String> { list.split('A').map(str::to_owned).collect() };
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
527
|
+
let joined = || {
|
|
528
|
+
Some(Box::new(Fields {
|
|
529
|
+
audio_types: types(find("audio/mp4;", "mp4a.40.2")?),
|
|
530
|
+
video_types: types(find("video/mp4;", "avc1.42E01E")?),
|
|
531
|
+
excluded_types: types(find("audio/mp4;", "theora")?),
|
|
532
|
+
}))
|
|
533
|
+
};
|
|
534
|
+
joined().or_else(|| {
|
|
535
|
+
// Builds with hex names list each type: the audio types, the video types, then the
|
|
536
|
+
// excluded types, which mix both.
|
|
537
|
+
let is_media = |text: &str| text.starts_with("audio/") || text.starts_with("video/");
|
|
538
|
+
let run: Vec<String> = decoded
|
|
539
|
+
.iter()
|
|
540
|
+
.skip_while(|text| !is_media(text))
|
|
541
|
+
.take_while(|text| is_media(text))
|
|
542
|
+
.map(|text| text.to_string())
|
|
543
|
+
.collect();
|
|
544
|
+
let leading = |list: &[String], prefix: &str| {
|
|
545
|
+
list.iter()
|
|
546
|
+
.take_while(|text| text.starts_with(prefix))
|
|
547
|
+
.count()
|
|
548
|
+
};
|
|
549
|
+
let (audio, rest) = run.split_at(leading(&run, "audio/"));
|
|
550
|
+
let (video, excluded) = rest.split_at(leading(rest, "video/"));
|
|
551
|
+
(!audio.is_empty() && !video.is_empty() && !excluded.is_empty()).then(|| {
|
|
552
|
+
Box::new(Fields {
|
|
553
|
+
audio_types: audio.to_vec(),
|
|
554
|
+
video_types: video.to_vec(),
|
|
555
|
+
excluded_types: excluded.to_vec(),
|
|
556
|
+
})
|
|
557
|
+
})
|
|
558
|
+
})
|
|
545
559
|
}
|
|
546
560
|
|
|
547
561
|
#[cfg(test)]
|
|
@@ -5,8 +5,8 @@ use std::convert::Infallible;
|
|
|
5
5
|
use std::ops::ControlFlow;
|
|
6
6
|
|
|
7
7
|
use anyhow::{Result, bail};
|
|
8
|
+
use oxc::syntax::operator::{BinaryOperator, UnaryOperator};
|
|
8
9
|
use serde::{Deserialize, Serialize};
|
|
9
|
-
use swc_core::ecma::ast::{BinaryOp, UnaryOp};
|
|
10
10
|
|
|
11
11
|
use crate::engine::Engine;
|
|
12
12
|
use crate::js::{JsObject, JsValue, json};
|
|
@@ -57,6 +57,7 @@ impl Measurement {
|
|
|
57
57
|
/// loads, and this probe's mark at `marked_ms`. Reports times at 0.1 ms resolution relative
|
|
58
58
|
/// to iframe navigation.
|
|
59
59
|
#[must_use]
|
|
60
|
+
#[expect(clippy::too_many_arguments)]
|
|
60
61
|
pub(crate) fn observed(
|
|
61
62
|
plan: &ProbePlan,
|
|
62
63
|
index: usize,
|
|
@@ -375,13 +376,17 @@ fn marked(columns: &[RowWrite]) -> Option<(&str, &[RowWrite])> {
|
|
|
375
376
|
/// negations.
|
|
376
377
|
fn equality(condition: &Term, holds: bool) -> Option<(&Term, &Term)> {
|
|
377
378
|
match condition {
|
|
378
|
-
Term::Unary(
|
|
379
|
-
Term::Binary(
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
Term::Binary(BinaryOp::NotEqEq | BinaryOp::NotEq, left, right) if !holds => {
|
|
379
|
+
Term::Unary(UnaryOperator::LogicalNot, inner) => equality(inner, !holds),
|
|
380
|
+
Term::Binary(BinaryOperator::StrictEquality | BinaryOperator::Equality, left, right)
|
|
381
|
+
if holds =>
|
|
382
|
+
{
|
|
383
383
|
Some((left, right))
|
|
384
384
|
}
|
|
385
|
+
Term::Binary(
|
|
386
|
+
BinaryOperator::StrictInequality | BinaryOperator::Inequality,
|
|
387
|
+
left,
|
|
388
|
+
right,
|
|
389
|
+
) if !holds => Some((left, right)),
|
|
385
390
|
_ => None,
|
|
386
391
|
}
|
|
387
392
|
}
|
|
@@ -413,11 +418,11 @@ fn evaluate(frame: &Frame<Held>, term: &Term) -> Option<Known<Held>> {
|
|
|
413
418
|
(None, Some(Known::Literal(JsValue::String(name)))) => Known::Ext(Held::Field(name)),
|
|
414
419
|
_ => return None,
|
|
415
420
|
},
|
|
416
|
-
Term::Binary(
|
|
421
|
+
Term::Binary(BinaryOperator::Addition, left, _) => match frame.resolve(left)? {
|
|
417
422
|
Known::Literal(JsValue::String(prefix)) => Known::Ext(Held::Prefixed(prefix)),
|
|
418
423
|
_ => return None,
|
|
419
424
|
},
|
|
420
|
-
Term::Binary(
|
|
425
|
+
Term::Binary(BinaryOperator::Subtraction, left, right) => {
|
|
421
426
|
match (frame.resolve(left)?, frame.resolve(right)?) {
|
|
422
427
|
(Known::Ext(Held::Property(end)), Known::Ext(Held::Property(start)))
|
|
423
428
|
if end == "responseEnd" && start == "requestStart" =>
|
|
@@ -4,6 +4,7 @@ use percent_encoding::percent_decode_str;
|
|
|
4
4
|
use serde::{Deserialize, Serialize};
|
|
5
5
|
|
|
6
6
|
use crate::stage2::analysis::recognize::ProbeView;
|
|
7
|
+
use crate::stage2::vocabulary;
|
|
7
8
|
|
|
8
9
|
/// Number of strings from the opening `<style>#` to the closing button, including fragments
|
|
9
10
|
/// interleaved with 27 ID references.
|
|
@@ -42,24 +43,8 @@ pub(crate) fn recognize(probe: &ProbeView<'_>) -> Option<Fields> {
|
|
|
42
43
|
{
|
|
43
44
|
return None;
|
|
44
45
|
}
|
|
45
|
-
let arrays = probe
|
|
46
|
-
.index
|
|
47
|
-
.string_arrays(probe.entry)
|
|
48
|
-
.into_iter()
|
|
49
|
-
.filter(|items| {
|
|
50
|
-
items.len() == 10
|
|
51
|
-
&& items.iter().all(|text| {
|
|
52
|
-
!text.is_empty()
|
|
53
|
-
&& text
|
|
54
|
-
.bytes()
|
|
55
|
-
.all(|byte| byte.is_ascii_alphanumeric() || byte == b'_')
|
|
56
|
-
})
|
|
57
|
-
});
|
|
58
|
-
if let Ok(ids) = crate::candidates::exactly_one(arrays, "rectangle IDs") {
|
|
59
|
-
return Some(Fields { ids });
|
|
60
|
-
}
|
|
61
46
|
// Match `list.split(separator)`, including lists decoded from percent encoding first.
|
|
62
|
-
(2..strings.len()).find_map(|at| {
|
|
47
|
+
let split = (2..strings.len()).find_map(|at| {
|
|
63
48
|
let separator = &strings[at - 1];
|
|
64
49
|
if strings[at] != "split" || separator.is_empty() {
|
|
65
50
|
return None;
|
|
@@ -75,5 +60,15 @@ pub(crate) fn recognize(probe: &ProbeView<'_>) -> Option<Fields> {
|
|
|
75
60
|
.iter()
|
|
76
61
|
.all(|id| !id.is_empty() && id.bytes().all(|byte| byte.is_ascii_alphanumeric()));
|
|
77
62
|
valid.then_some(Fields { ids })
|
|
63
|
+
});
|
|
64
|
+
// Builds with hex names store the IDs as hex names in list order: the last ten of the last
|
|
65
|
+
// run of at least ten before the markup. An option read may precede them in the run.
|
|
66
|
+
split.or_else(|| {
|
|
67
|
+
let run = strings[..start]
|
|
68
|
+
.chunk_by(|left, right| vocabulary::is_hex_name(left) == vocabulary::is_hex_name(right))
|
|
69
|
+
.rfind(|run| run.len() >= 10 && vocabulary::is_hex_name(&run[0]))?;
|
|
70
|
+
Some(Fields {
|
|
71
|
+
ids: run[run.len() - 10..].to_vec(),
|
|
72
|
+
})
|
|
78
73
|
})
|
|
79
74
|
}
|
|
@@ -10,6 +10,7 @@ use crate::js::{JsObject, json};
|
|
|
10
10
|
use crate::listing::Index;
|
|
11
11
|
use crate::stage2::analysis::recognize::ProbeView;
|
|
12
12
|
use crate::stage2::call_stack::ProbeCalls;
|
|
13
|
+
use crate::stage2::vocabulary;
|
|
13
14
|
use crate::vm::Term;
|
|
14
15
|
|
|
15
16
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
@@ -29,7 +30,7 @@ impl Fields {
|
|
|
29
30
|
|
|
30
31
|
/// Finds the closure called by the probe function at `entry` to construct `new Error()`.
|
|
31
32
|
fn calls(index: &Index<'_>, entry: u32) -> Option<ProbeCalls> {
|
|
32
|
-
|
|
33
|
+
index
|
|
33
34
|
.effects_in(index.function_range(entry)?)
|
|
34
35
|
.find_map(|(pc, effect)| {
|
|
35
36
|
let (callee, _) = effect.call()?;
|
|
@@ -37,11 +38,8 @@ fn calls(index: &Index<'_>, entry: u32) -> Option<ProbeCalls> {
|
|
|
37
38
|
return None;
|
|
38
39
|
};
|
|
39
40
|
construction(index, closure)
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
construct,
|
|
43
|
-
arity: index.arity(entry)?,
|
|
44
|
-
})
|
|
41
|
+
})
|
|
42
|
+
.map(|construct| ProbeCalls { construct })
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
/// The opcode with which the function at `entry` constructs `new Error()`.
|
|
@@ -63,66 +61,52 @@ fn construction(index: &Index<'_>, entry: u32) -> Option<u8> {
|
|
|
63
61
|
})
|
|
64
62
|
}
|
|
65
63
|
|
|
66
|
-
///
|
|
67
|
-
|
|
64
|
+
/// Finds the output field hidden by base64 encoding and a two-byte XOR key. A name that decodes to
|
|
65
|
+
/// `stack` identifies the key. The output field is the remaining name after excluding `stack` and
|
|
66
|
+
/// the record counter from the header. Builds with hex names encode only `stack`.
|
|
67
|
+
fn encoded_result_field(features: &[String], header: &BTreeSet<String>) -> Option<String> {
|
|
68
68
|
use base64::Engine;
|
|
69
69
|
use base64::engine::general_purpose::STANDARD;
|
|
70
70
|
|
|
71
71
|
let decoded: Vec<Vec<u8>> = features
|
|
72
72
|
.iter()
|
|
73
|
-
.filter_map(|text|
|
|
74
|
-
|
|
75
|
-
let text = if text.starts_with('\0') {
|
|
76
|
-
decoded = crate::listing::decode_string(text, "").ok()?;
|
|
77
|
-
&decoded
|
|
78
|
-
} else {
|
|
79
|
-
text
|
|
80
|
-
};
|
|
81
|
-
STANDARD.decode(text).ok()
|
|
82
|
-
})
|
|
83
|
-
.filter(|bytes| (3..=25).contains(&bytes.len()))
|
|
73
|
+
.filter_map(|text| STANDARD.decode(text).ok())
|
|
74
|
+
.filter(|bytes| (3..=12).contains(&bytes.len()))
|
|
84
75
|
.collect();
|
|
85
|
-
let
|
|
76
|
+
let plain: BTreeSet<String> = features
|
|
86
77
|
.iter()
|
|
87
|
-
.filter(|
|
|
88
|
-
.filter_map(|candidate| {
|
|
89
|
-
let key = [candidate[0] ^ b's', candidate[1] ^ b't'];
|
|
90
|
-
candidate
|
|
91
|
-
.iter()
|
|
92
|
-
.zip(b"stack")
|
|
93
|
-
.enumerate()
|
|
94
|
-
.all(|(index, (cipher, plain))| cipher ^ key[index % 2] == *plain)
|
|
95
|
-
.then_some(key)
|
|
96
|
-
})
|
|
97
|
-
.collect();
|
|
98
|
-
let key = candidates::exactly_one(keys, "stack string key").ok()?;
|
|
99
|
-
Some(
|
|
100
|
-
decoded
|
|
101
|
-
.iter()
|
|
102
|
-
.filter_map(|bytes| {
|
|
103
|
-
String::from_utf8(
|
|
104
|
-
bytes
|
|
105
|
-
.iter()
|
|
106
|
-
.zip(key.iter().cycle())
|
|
107
|
-
.map(|(byte, mask)| byte ^ mask)
|
|
108
|
-
.collect(),
|
|
109
|
-
)
|
|
110
|
-
.ok()
|
|
111
|
-
})
|
|
112
|
-
.collect(),
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/// Ignore ordinary base64-looking words and the record counter when identifying the output.
|
|
117
|
-
fn encoded_result_field(names: &[String], header: &BTreeSet<String>) -> Option<String> {
|
|
118
|
-
let names = names.iter().filter(|name| {
|
|
119
|
-
crate::stage2::vocabulary::is_name(name)
|
|
120
|
-
&& name.as_str() != "stack"
|
|
121
|
-
&& !header.contains(*name)
|
|
122
|
-
});
|
|
123
|
-
candidates::at_most_one_distinct(names, "stack result field")
|
|
124
|
-
.ok()?
|
|
78
|
+
.filter(|name| vocabulary::is_hex_name(name))
|
|
125
79
|
.cloned()
|
|
80
|
+
.collect();
|
|
81
|
+
for candidate in decoded.iter().filter(|bytes| bytes.len() == "stack".len()) {
|
|
82
|
+
let key = [candidate[0] ^ b's', candidate[1] ^ b't'];
|
|
83
|
+
let reveal = |bytes: &Vec<u8>| {
|
|
84
|
+
let revealed = bytes
|
|
85
|
+
.iter()
|
|
86
|
+
.zip(key.iter().cycle())
|
|
87
|
+
.map(|(byte, mask)| byte ^ mask);
|
|
88
|
+
String::from_utf8(revealed.collect()).ok()
|
|
89
|
+
};
|
|
90
|
+
if reveal(candidate).as_deref() != Some("stack") {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
// Plain strings such as `this` can also be valid base64. Restrict candidates to the
|
|
94
|
+
// four-to-nine-character program names.
|
|
95
|
+
let revealed = decoded.iter().filter_map(reveal).filter(|name| {
|
|
96
|
+
(4..=9).contains(&name.len())
|
|
97
|
+
&& name.starts_with(|first: char| first.is_ascii_alphabetic())
|
|
98
|
+
&& name
|
|
99
|
+
.chars()
|
|
100
|
+
.all(|character| character.is_ascii_alphanumeric())
|
|
101
|
+
});
|
|
102
|
+
let names = revealed
|
|
103
|
+
.chain(plain.iter().cloned())
|
|
104
|
+
.filter(|name| name != "stack" && !header.contains(name));
|
|
105
|
+
if let Ok(result) = candidates::exactly_one(names, "stack result field") {
|
|
106
|
+
return Some(result);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
None
|
|
126
110
|
}
|
|
127
111
|
|
|
128
112
|
/// Finds the output field in the string table by excluding the header's record-counter name,
|
|
@@ -158,23 +142,12 @@ fn result_field(features: &[String], header: &BTreeSet<String>) -> Option<String
|
|
|
158
142
|
}
|
|
159
143
|
|
|
160
144
|
pub(crate) fn recognize(probe: &ProbeView<'_>) -> Option<Fields> {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
encoded.as_ref()?;
|
|
168
|
-
let fields = probe.writes.fields.iter().filter(|name| {
|
|
169
|
-
crate::stage2::vocabulary::is_name(name)
|
|
170
|
-
&& !probe.header.contains(*name)
|
|
171
|
-
&& !probe.wrapper.contains(*name)
|
|
172
|
-
});
|
|
173
|
-
candidates::exactly_one(fields, "plain stack result")
|
|
174
|
-
.ok()
|
|
175
|
-
.cloned()
|
|
176
|
-
})?;
|
|
177
|
-
Some(Fields { result, calls })
|
|
145
|
+
result_field(probe.session_features, probe.header)
|
|
146
|
+
.or_else(|| encoded_result_field(probe.session_features, probe.header))
|
|
147
|
+
.map(|result| Fields {
|
|
148
|
+
result,
|
|
149
|
+
calls: calls(probe.index, probe.entry),
|
|
150
|
+
})
|
|
178
151
|
}
|
|
179
152
|
|
|
180
153
|
#[cfg(test)]
|
|
@@ -215,38 +188,12 @@ mod tests {
|
|
|
215
188
|
],
|
|
216
189
|
] {
|
|
217
190
|
let features = features.map(str::to_owned);
|
|
218
|
-
let names = encoded_names(&features).unwrap();
|
|
219
191
|
assert_eq!(
|
|
220
|
-
encoded_result_field(&
|
|
192
|
+
encoded_result_field(&features, &header).as_deref(),
|
|
221
193
|
Some("CJkad9"),
|
|
222
194
|
"{features:?}"
|
|
223
195
|
);
|
|
224
|
-
assert!(encoded_result_field(&
|
|
196
|
+
assert!(encoded_result_field(&features, &BTreeSet::new()).is_none());
|
|
225
197
|
}
|
|
226
198
|
}
|
|
227
|
-
|
|
228
|
-
#[test]
|
|
229
|
-
fn decodes_inline_tables_and_rejects_conflicting_keys() {
|
|
230
|
-
use base64::{Engine, engine::general_purpose::STANDARD};
|
|
231
|
-
let encode = |text: &str, key: [u8; 2]| {
|
|
232
|
-
STANDARD.encode(
|
|
233
|
-
text.bytes()
|
|
234
|
-
.enumerate()
|
|
235
|
-
.map(|(index, byte)| byte ^ key[index % 2])
|
|
236
|
-
.collect::<Vec<_>>(),
|
|
237
|
-
)
|
|
238
|
-
};
|
|
239
|
-
let key = [17, 44];
|
|
240
|
-
let field = "_0123456789abcdef01234567";
|
|
241
|
-
let features = ["stack", field].map(|text| {
|
|
242
|
-
let encoded = encode(text, key);
|
|
243
|
-
format!("\0{}{encoded}padding", char::from(encoded.len() as u8))
|
|
244
|
-
});
|
|
245
|
-
let names = encoded_names(&features).unwrap();
|
|
246
|
-
assert_eq!(
|
|
247
|
-
encoded_result_field(&names, &BTreeSet::new()).as_deref(),
|
|
248
|
-
Some(field)
|
|
249
|
-
);
|
|
250
|
-
assert!(encoded_names(&[encode("stack", key), encode("stack", [18, 45])]).is_none());
|
|
251
|
-
}
|
|
252
199
|
}
|