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.
Files changed (404) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +10 -9
  4. data/THIRD_PARTY_LICENSES/README.md +71 -254
  5. data/THIRD_PARTY_LICENSES/{derive_builder_macro-0.20.2/LICENSE-APACHE → bytecount-0.6.9/LICENSE.Apache2} +0 -1
  6. data/THIRD_PARTY_LICENSES/{darling-0.20.11/LICENSE → bytecount-0.6.9/LICENSE.MIT} +1 -3
  7. data/THIRD_PARTY_LICENSES/{ident_case-1.0.1/LICENSE → cobs-0.3.0/LICENSE-MIT} +1 -1
  8. data/THIRD_PARTY_LICENSES/cow-utils-0.1.3/LICENSE +21 -0
  9. data/THIRD_PARTY_LICENSES/{hashbrown-0.14.5 → embedded-io-0.4.0}/LICENSE-MIT +1 -1
  10. data/THIRD_PARTY_LICENSES/{ahash-0.8.12 → embedded-io-0.6.1}/LICENSE-MIT +1 -1
  11. data/THIRD_PARTY_LICENSES/{browserslist-data-0.1.4 → escape-simd-0.1.1}/LICENSE +1 -1
  12. data/THIRD_PARTY_LICENSES/escape-simd-0.1.1/NOTICE +62 -0
  13. data/THIRD_PARTY_LICENSES/json-escape-simd-3.1.3/LICENSE +21 -0
  14. data/THIRD_PARTY_LICENSES/{miette-7.6.0/LICENSE → json-escape-simd-3.1.3/LICENSE-APACHE} +0 -1
  15. data/THIRD_PARTY_LICENSES/json-escape-simd-3.1.3/NOTICE +62 -0
  16. data/THIRD_PARTY_LICENSES/memchr-2.8.3/UNLICENSE +24 -0
  17. data/THIRD_PARTY_LICENSES/{derive_builder_core-0.20.2 → nonmax-0.5.5}/LICENSE-APACHE +1 -2
  18. data/THIRD_PARTY_LICENSES/{dashmap-5.5.3/LICENSE → nonmax-0.5.5/LICENSE-MIT} +2 -4
  19. data/THIRD_PARTY_LICENSES/{rand-0.8.5 → num-bigint-0.5.1}/LICENSE-MIT +0 -1
  20. data/THIRD_PARTY_LICENSES/oxc-0.157.0/LICENSE +22 -0
  21. data/THIRD_PARTY_LICENSES/oxc-0.157.0/THIRD-PARTY-LICENSE +763 -0
  22. data/THIRD_PARTY_LICENSES/{browserslist-rs-0.19.0 → oxc-browserslist-5.0.1}/LICENSE +1 -0
  23. data/THIRD_PARTY_LICENSES/oxc_allocator-0.157.0/LICENSE +22 -0
  24. data/THIRD_PARTY_LICENSES/oxc_allocator-0.157.0/THIRD-PARTY-LICENSE +763 -0
  25. data/THIRD_PARTY_LICENSES/oxc_ast-0.157.0/LICENSE +22 -0
  26. data/THIRD_PARTY_LICENSES/oxc_ast-0.157.0/THIRD-PARTY-LICENSE +763 -0
  27. data/THIRD_PARTY_LICENSES/oxc_ast_macros-0.157.0/LICENSE +22 -0
  28. data/THIRD_PARTY_LICENSES/oxc_ast_macros-0.157.0/THIRD-PARTY-LICENSE +763 -0
  29. data/THIRD_PARTY_LICENSES/oxc_ast_visit-0.157.0/LICENSE +22 -0
  30. data/THIRD_PARTY_LICENSES/oxc_ast_visit-0.157.0/THIRD-PARTY-LICENSE +763 -0
  31. data/THIRD_PARTY_LICENSES/oxc_codegen-0.157.0/LICENSE +22 -0
  32. data/THIRD_PARTY_LICENSES/oxc_codegen-0.157.0/THIRD-PARTY-LICENSE +763 -0
  33. data/THIRD_PARTY_LICENSES/oxc_compat-0.157.0/LICENSE +22 -0
  34. data/THIRD_PARTY_LICENSES/oxc_compat-0.157.0/THIRD-PARTY-LICENSE +763 -0
  35. data/THIRD_PARTY_LICENSES/oxc_data_structures-0.157.0/LICENSE +22 -0
  36. data/THIRD_PARTY_LICENSES/oxc_data_structures-0.157.0/THIRD-PARTY-LICENSE +763 -0
  37. data/THIRD_PARTY_LICENSES/oxc_diagnostics-0.157.0/LICENSE +22 -0
  38. data/THIRD_PARTY_LICENSES/oxc_diagnostics-0.157.0/THIRD-PARTY-LICENSE +763 -0
  39. data/THIRD_PARTY_LICENSES/oxc_ecmascript-0.157.0/LICENSE +22 -0
  40. data/THIRD_PARTY_LICENSES/oxc_ecmascript-0.157.0/THIRD-PARTY-LICENSE +763 -0
  41. data/THIRD_PARTY_LICENSES/oxc_estree-0.157.0/LICENSE +22 -0
  42. data/THIRD_PARTY_LICENSES/oxc_estree-0.157.0/THIRD-PARTY-LICENSE +763 -0
  43. data/THIRD_PARTY_LICENSES/oxc_index-5.0.0/LICENSE +22 -0
  44. data/THIRD_PARTY_LICENSES/oxc_parser-0.157.0/LICENSE +22 -0
  45. data/THIRD_PARTY_LICENSES/oxc_parser-0.157.0/THIRD-PARTY-LICENSE +763 -0
  46. data/THIRD_PARTY_LICENSES/oxc_regular_expression-0.157.0/LICENSE +22 -0
  47. data/THIRD_PARTY_LICENSES/oxc_regular_expression-0.157.0/THIRD-PARTY-LICENSE +763 -0
  48. data/THIRD_PARTY_LICENSES/oxc_semantic-0.157.0/LICENSE +22 -0
  49. data/THIRD_PARTY_LICENSES/oxc_semantic-0.157.0/THIRD-PARTY-LICENSE +763 -0
  50. data/THIRD_PARTY_LICENSES/oxc_span-0.157.0/LICENSE +22 -0
  51. data/THIRD_PARTY_LICENSES/oxc_span-0.157.0/THIRD-PARTY-LICENSE +763 -0
  52. data/THIRD_PARTY_LICENSES/oxc_str-0.157.0/LICENSE +22 -0
  53. data/THIRD_PARTY_LICENSES/oxc_str-0.157.0/THIRD-PARTY-LICENSE +763 -0
  54. data/THIRD_PARTY_LICENSES/oxc_syntax-0.157.0/LICENSE +22 -0
  55. data/THIRD_PARTY_LICENSES/oxc_syntax-0.157.0/THIRD-PARTY-LICENSE +763 -0
  56. data/THIRD_PARTY_LICENSES/{fixedbitset-0.5.7 → postcard-1.1.3}/LICENSE-MIT +1 -1
  57. data/THIRD_PARTY_LICENSES/{bytes-str-0.2.7/LICENSE → self_cell-1.3.0/LICENSE-APACHE} +1 -2
  58. data/THIRD_PARTY_LICENSES/self_cell-1.3.0/LICENSE-GPLv2 +339 -0
  59. data/THIRD_PARTY_LICENSES/{darling_core-0.20.11 → smawk-0.3.3}/LICENSE +1 -1
  60. data/UPSTREAM.md +10 -8
  61. data/ext/cfsolve/Cargo.lock +534 -1727
  62. data/ext/cfsolve/Cargo.toml +4 -0
  63. data/ext/cfsolve/src/main.rs +1 -1
  64. data/lib/cfsolve/profiles/safari-26-ios/answers.json +2570 -1894
  65. data/lib/cfsolve/profiles/safari-26-ios/challenge-page-answers.json +1867 -1192
  66. data/lib/cfsolve/profiles/safari-26-ios.json +102 -156
  67. data/lib/cfsolve/version.rb +2 -2
  68. data/vendor/cfsolve/Cargo.lock +561 -1729
  69. data/vendor/cfsolve/Cargo.toml +26 -8
  70. data/vendor/cfsolve/README.md +4 -35
  71. data/vendor/cfsolve/examples/build_profile.rs +17 -15
  72. data/vendor/cfsolve/examples/capture_session.rs +37 -0
  73. data/vendor/cfsolve/examples/check_answers.rs +66 -0
  74. data/vendor/cfsolve/examples/compare_session.rs +189 -0
  75. data/vendor/cfsolve/examples/solver_profile.rs +84 -0
  76. data/vendor/cfsolve/examples/solver_smoke.rs +9 -8
  77. data/vendor/cfsolve/examples/stage2_snapshot.rs +6 -3
  78. data/vendor/cfsolve/examples/tls_echo.rs +3 -3
  79. data/vendor/cfsolve/examples/vm_snapshot.rs +32 -33
  80. data/vendor/cfsolve/profiles/safari-26-ios/answers.json +2570 -1894
  81. data/vendor/cfsolve/profiles/safari-26-ios/challenge-page-answers.json +1867 -1192
  82. data/vendor/cfsolve/profiles/safari-26-ios.json +102 -156
  83. data/vendor/cfsolve/scripts/capture_cssom.mjs +42 -0
  84. data/vendor/cfsolve/scripts/serve_cssom.py +111 -0
  85. data/vendor/cfsolve/src/bin/capture-proxy/main.rs +3 -2
  86. data/vendor/cfsolve/src/bin/challenge/cli.rs +8 -2
  87. data/vendor/cfsolve/src/bin/challenge/main.rs +7 -2
  88. data/vendor/cfsolve/src/capture/profile.rs +7 -18
  89. data/vendor/cfsolve/src/capture/proxy/tests.rs +1 -1
  90. data/vendor/cfsolve/src/capture/proxy.rs +44 -13
  91. data/vendor/cfsolve/src/capture/recorded.rs +42 -7
  92. data/vendor/cfsolve/src/capture/sessions.rs +4 -3
  93. data/vendor/cfsolve/src/capture/upstream.rs +1 -1
  94. data/vendor/cfsolve/src/challenge/codec.rs +4 -2
  95. data/vendor/cfsolve/src/challenge/expression.rs +161 -117
  96. data/vendor/cfsolve/src/challenge/installed/audit.rs +132 -0
  97. data/vendor/cfsolve/src/challenge/installed.rs +127 -269
  98. data/vendor/cfsolve/src/challenge/merge.rs +120 -80
  99. data/vendor/cfsolve/src/challenge/orchestrator.rs +57 -44
  100. data/vendor/cfsolve/src/challenge/payload.rs +175 -35
  101. data/vendor/cfsolve/src/challenge/program.rs +197 -178
  102. data/vendor/cfsolve/src/challenge/reduced_timing.rs +55 -40
  103. data/vendor/cfsolve/src/challenge/source.rs +151 -96
  104. data/vendor/cfsolve/src/challenge/state.rs +236 -122
  105. data/vendor/cfsolve/src/challenge/tally.rs +64 -50
  106. data/vendor/cfsolve/src/challenge.rs +1 -0
  107. data/vendor/cfsolve/src/deobfuscate/analysis/bindings.rs +187 -185
  108. data/vendor/cfsolve/src/deobfuscate/analysis/effects.rs +42 -51
  109. data/vendor/cfsolve/src/deobfuscate/analysis/hoisting.rs +147 -228
  110. data/vendor/cfsolve/src/deobfuscate/analysis/properties.rs +250 -425
  111. data/vendor/cfsolve/src/deobfuscate/analysis/unconditional.rs +79 -0
  112. data/vendor/cfsolve/src/deobfuscate/analysis.rs +259 -41
  113. data/vendor/cfsolve/src/deobfuscate/argument_arrays.rs +70 -73
  114. data/vendor/cfsolve/src/deobfuscate/arrow_blocks.rs +91 -104
  115. data/vendor/cfsolve/src/deobfuscate/ast.rs +383 -0
  116. data/vendor/cfsolve/src/deobfuscate/bitwise.rs +44 -54
  117. data/vendor/cfsolve/src/deobfuscate/blocks.rs +36 -29
  118. data/vendor/cfsolve/src/deobfuscate/call_helpers.rs +80 -131
  119. data/vendor/cfsolve/src/deobfuscate/control_flow.rs +239 -297
  120. data/vendor/cfsolve/src/deobfuscate/copy_propagation.rs +114 -135
  121. data/vendor/cfsolve/src/deobfuscate/dead_branches.rs +62 -61
  122. data/vendor/cfsolve/src/deobfuscate/dead_properties.rs +197 -214
  123. data/vendor/cfsolve/src/deobfuscate/dispatch.rs +238 -298
  124. data/vendor/cfsolve/src/deobfuscate/encoded_strings.rs +201 -205
  125. data/vendor/cfsolve/src/deobfuscate/function_lengths.rs +32 -38
  126. data/vendor/cfsolve/src/deobfuscate/helper_objects.rs +346 -536
  127. data/vendor/cfsolve/src/deobfuscate/hygiene.rs +197 -0
  128. data/vendor/cfsolve/src/deobfuscate/int32_helpers.rs +121 -155
  129. data/vendor/cfsolve/src/deobfuscate/literals.rs +116 -67
  130. data/vendor/cfsolve/src/deobfuscate/loops.rs +43 -43
  131. data/vendor/cfsolve/src/deobfuscate/memoized_strings.rs +127 -131
  132. data/vendor/cfsolve/src/deobfuscate/merged_functions.rs +262 -220
  133. data/vendor/cfsolve/src/deobfuscate/pipeline.rs +199 -244
  134. data/vendor/cfsolve/src/deobfuscate/register_arrays.rs +361 -322
  135. data/vendor/cfsolve/src/deobfuscate/removal.rs +83 -52
  136. data/vendor/cfsolve/src/deobfuscate/simplify.rs +147 -0
  137. data/vendor/cfsolve/src/deobfuscate/state_machines.rs +88 -110
  138. data/vendor/cfsolve/src/deobfuscate/statements.rs +228 -228
  139. data/vendor/cfsolve/src/deobfuscate/static_members.rs +46 -31
  140. data/vendor/cfsolve/src/deobfuscate/testing.rs +49 -59
  141. data/vendor/cfsolve/src/deobfuscate/unused_bindings.rs +92 -102
  142. data/vendor/cfsolve/src/deobfuscate.rs +15 -11
  143. data/vendor/cfsolve/src/embedding_page/extra_params.rs +23 -32
  144. data/vendor/cfsolve/src/embedding_page/page.rs +28 -2
  145. data/vendor/cfsolve/src/embedding_page/render_sample.rs +184 -147
  146. data/vendor/cfsolve/src/error.rs +40 -5
  147. data/vendor/cfsolve/src/fingerprint.rs +8 -2
  148. data/vendor/cfsolve/src/http/client.rs +9 -1
  149. data/vendor/cfsolve/src/http/requests.rs +2 -2
  150. data/vendor/cfsolve/src/js/ast.rs +479 -254
  151. data/vendor/cfsolve/src/js/objects.rs +9 -2
  152. data/vendor/cfsolve/src/lib.rs +1 -0
  153. data/vendor/cfsolve/src/listing/fold.rs +19 -92
  154. data/vendor/cfsolve/src/listing/query.rs +26 -291
  155. data/vendor/cfsolve/src/listing.rs +0 -1
  156. data/vendor/cfsolve/src/performance_clock.rs +20 -1
  157. data/vendor/cfsolve/src/profiling.rs +49 -0
  158. data/vendor/cfsolve/src/script.rs +35 -24
  159. data/vendor/cfsolve/src/session/challenge_page.rs +41 -21
  160. data/vendor/cfsolve/src/session/channel.rs +2 -2
  161. data/vendor/cfsolve/src/session/initial.rs +19 -10
  162. data/vendor/cfsolve/src/session/probes.rs +160 -125
  163. data/vendor/cfsolve/src/session/sink.rs +26 -1
  164. data/vendor/cfsolve/src/session/tests/challenge_page.rs +36 -1
  165. data/vendor/cfsolve/src/session/timing.rs +58 -53
  166. data/vendor/cfsolve/src/session/widget.rs +5 -6
  167. data/vendor/cfsolve/src/session.rs +1 -1
  168. data/vendor/cfsolve/src/solver.rs +3 -1
  169. data/vendor/cfsolve/src/stage2/analysis/analyze.rs +50 -33
  170. data/vendor/cfsolve/src/stage2/analysis/audit.rs +4 -2
  171. data/vendor/cfsolve/src/stage2/analysis/discovery.rs +61 -66
  172. data/vendor/cfsolve/src/stage2/analysis/envelope.rs +33 -22
  173. data/vendor/cfsolve/src/stage2/analysis/recognize.rs +3 -5
  174. data/vendor/cfsolve/src/stage2/analysis.rs +0 -1
  175. data/vendor/cfsolve/src/stage2/audit_globals.rs +378 -0
  176. data/vendor/cfsolve/src/stage2/benchmark.rs +66 -38
  177. data/vendor/cfsolve/src/stage2/call_stack.rs +1463 -1017
  178. data/vendor/cfsolve/src/stage2/challenge_page.rs +3 -2
  179. data/vendor/cfsolve/src/stage2/interaction/checkbox.rs +202 -150
  180. data/vendor/cfsolve/src/stage2/interaction/click.rs +2 -2
  181. data/vendor/cfsolve/src/stage2/interaction/native.rs +2 -1
  182. data/vendor/cfsolve/src/stage2/interaction/plan.rs +5 -7
  183. data/vendor/cfsolve/src/stage2/payload/recover.rs +56 -25
  184. data/vendor/cfsolve/src/stage2/probes/clock.rs +1 -3
  185. data/vendor/cfsolve/src/stage2/probes/ice.rs +11 -10
  186. data/vendor/cfsolve/src/stage2/probes/media.rs +47 -33
  187. data/vendor/cfsolve/src/stage2/probes/performance.rs +13 -8
  188. data/vendor/cfsolve/src/stage2/probes/rects.rs +12 -17
  189. data/vendor/cfsolve/src/stage2/probes/stack.rs +50 -103
  190. data/vendor/cfsolve/src/stage2/probes/websocket_echo.rs +17 -86
  191. data/vendor/cfsolve/src/stage2/probes.rs +0 -1
  192. data/vendor/cfsolve/src/stage2/queries.rs +50 -0
  193. data/vendor/cfsolve/src/stage2/records.rs +4 -13
  194. data/vendor/cfsolve/src/stage2/reference.json +1 -1
  195. data/vendor/cfsolve/src/stage2/reference.rs +98 -100
  196. data/vendor/cfsolve/src/stage2/registry.rs +41 -34
  197. data/vendor/cfsolve/src/stage2/replay.rs +182 -254
  198. data/vendor/cfsolve/src/stage2/stylesheets.rs +176 -0
  199. data/vendor/cfsolve/src/stage2/syntax.rs +88 -0
  200. data/vendor/cfsolve/src/stage2/trace.rs +152 -108
  201. data/vendor/cfsolve/src/stage2/vocabulary.rs +103 -403
  202. data/vendor/cfsolve/src/stage2.rs +4 -1
  203. data/vendor/cfsolve/src/vm/disassemble.rs +46 -13
  204. data/vendor/cfsolve/src/vm/dispatch.rs +93 -65
  205. data/vendor/cfsolve/src/vm/extract.rs +347 -250
  206. data/vendor/cfsolve/src/vm/interpret/access.rs +67 -68
  207. data/vendor/cfsolve/src/vm/interpret/builtin.rs +16 -63
  208. data/vendor/cfsolve/src/vm/interpret/call.rs +192 -51
  209. data/vendor/cfsolve/src/vm/interpret/compile.rs +643 -0
  210. data/vendor/cfsolve/src/vm/interpret/copies.rs +232 -120
  211. data/vendor/cfsolve/src/vm/interpret/evaluate/tests.rs +149 -40
  212. data/vendor/cfsolve/src/vm/interpret/evaluate.rs +189 -572
  213. data/vendor/cfsolve/src/vm/interpret/explore.rs +159 -46
  214. data/vendor/cfsolve/src/vm/interpret/formula.rs +131 -0
  215. data/vendor/cfsolve/src/vm/interpret/frozen.rs +169 -0
  216. data/vendor/cfsolve/src/vm/interpret/intrinsic.rs +414 -0
  217. data/vendor/cfsolve/src/vm/interpret/mix32.rs +189 -0
  218. data/vendor/cfsolve/src/vm/interpret/native_dispatch.rs +220 -0
  219. data/vendor/cfsolve/src/vm/interpret/pattern.rs +1736 -0
  220. data/vendor/cfsolve/src/vm/interpret/plan.rs +605 -330
  221. data/vendor/cfsolve/src/vm/interpret/register_helpers.rs +384 -0
  222. data/vendor/cfsolve/src/vm/interpret/run.rs +314 -54
  223. data/vendor/cfsolve/src/vm/interpret/semantics.rs +71 -46
  224. data/vendor/cfsolve/src/vm/interpret/setup.rs +80 -45
  225. data/vendor/cfsolve/src/vm/interpret/string_decoder.rs +482 -0
  226. data/vendor/cfsolve/src/vm/interpret.rs +16 -3
  227. data/vendor/cfsolve/src/vm/machine.rs +58 -47
  228. data/vendor/cfsolve/src/vm/output.rs +13 -5
  229. data/vendor/cfsolve/src/vm/packed_names.rs +311 -0
  230. data/vendor/cfsolve/src/vm/session.rs +197 -110
  231. data/vendor/cfsolve/src/vm/value.rs +35 -19
  232. data/vendor/cfsolve/src/vm.rs +3 -1
  233. data/vendor/cfsolve/vendor/btls-sys/Cargo.toml +3 -0
  234. data/vendor/cfsolve/vendor/btls-sys/build/main.rs +20 -0
  235. data/vendor/cfsolve/vendor/btls-sys/src/lib.rs +3 -0
  236. metadata +106 -183
  237. data/THIRD_PARTY_LICENSES/Inflector-0.11.4/LICENSE.md +0 -22
  238. data/THIRD_PARTY_LICENSES/arrayvec-0.7.6/LICENSE-MIT +0 -25
  239. data/THIRD_PARTY_LICENSES/ascii-1.1.0/LICENSE-APACHE +0 -201
  240. data/THIRD_PARTY_LICENSES/ascii-1.1.0/LICENSE-MIT +0 -22
  241. data/THIRD_PARTY_LICENSES/ast_node-5.0.0/LICENSE +0 -201
  242. data/THIRD_PARTY_LICENSES/better_scoped_tls-1.0.1/LICENSE +0 -201
  243. data/THIRD_PARTY_LICENSES/bitvec-1.0.1/LICENSE.txt +0 -21
  244. data/THIRD_PARTY_LICENSES/bstr-1.12.1/COPYING +0 -8
  245. data/THIRD_PARTY_LICENSES/bstr-1.12.1/LICENSE-MIT +0 -21
  246. data/THIRD_PARTY_LICENSES/cargo-platform-0.1.9/LICENSE-APACHE +0 -201
  247. data/THIRD_PARTY_LICENSES/cargo_metadata-0.19.2/LICENSE-MIT +0 -23
  248. data/THIRD_PARTY_LICENSES/darling_macro-0.20.11/LICENSE +0 -21
  249. data/THIRD_PARTY_LICENSES/debugid-0.8.0/LICENSE +0 -201
  250. data/THIRD_PARTY_LICENSES/derive_builder-0.20.2/LICENSE-MIT +0 -21
  251. data/THIRD_PARTY_LICENSES/derive_builder_core-0.20.2/LICENSE-MIT +0 -21
  252. data/THIRD_PARTY_LICENSES/derive_builder_macro-0.20.2/LICENSE-MIT +0 -21
  253. data/THIRD_PARTY_LICENSES/foldhash-0.1.5/LICENSE +0 -19
  254. data/THIRD_PARTY_LICENSES/from_variant-3.0.0/LICENSE +0 -201
  255. data/THIRD_PARTY_LICENSES/funty-2.0.0/LICENSE.txt +0 -21
  256. data/THIRD_PARTY_LICENSES/hashbrown-0.16.1/LICENSE-MIT +0 -25
  257. data/THIRD_PARTY_LICENSES/heck-0.5.0/LICENSE-APACHE +0 -201
  258. data/THIRD_PARTY_LICENSES/hermit-abi-0.5.2/LICENSE-APACHE +0 -201
  259. data/THIRD_PARTY_LICENSES/hermit-abi-0.5.2/LICENSE-MIT +0 -23
  260. data/THIRD_PARTY_LICENSES/hstr-3.0.3/LICENSE +0 -202
  261. data/THIRD_PARTY_LICENSES/if_chain-1.0.3/LICENSE-APACHE +0 -201
  262. data/THIRD_PARTY_LICENSES/if_chain-1.0.3/LICENSE-MIT +0 -25
  263. data/THIRD_PARTY_LICENSES/is-macro-0.3.7/LICENSE +0 -202
  264. data/THIRD_PARTY_LICENSES/itoa-1.0.17/LICENSE-MIT +0 -23
  265. data/THIRD_PARTY_LICENSES/jsonc-parser-0.26.3/LICENSE +0 -21
  266. data/THIRD_PARTY_LICENSES/lazy_static-1.5.0/LICENSE-APACHE +0 -201
  267. data/THIRD_PARTY_LICENSES/lazy_static-1.5.0/LICENSE-MIT +0 -25
  268. data/THIRD_PARTY_LICENSES/lru-0.16.2/LICENSE +0 -21
  269. data/THIRD_PARTY_LICENSES/memchr-2.7.6/COPYING +0 -3
  270. data/THIRD_PARTY_LICENSES/memchr-2.7.6/LICENSE-MIT +0 -21
  271. data/THIRD_PARTY_LICENSES/miette-derive-7.6.0/LICENSE +0 -229
  272. data/THIRD_PARTY_LICENSES/normpath-0.2.0/COPYRIGHT +0 -7
  273. data/THIRD_PARTY_LICENSES/normpath-0.2.0/LICENSE-MIT +0 -21
  274. data/THIRD_PARTY_LICENSES/normpath-0.2.0/LICENSE-THIRD-PARTY +0 -210
  275. data/THIRD_PARTY_LICENSES/num_cpus-1.17.0/LICENSE-APACHE +0 -201
  276. data/THIRD_PARTY_LICENSES/num_cpus-1.17.0/LICENSE-MIT +0 -20
  277. data/THIRD_PARTY_LICENSES/owo-colors-4.2.3/LICENSE +0 -21
  278. data/THIRD_PARTY_LICENSES/par-core-2.0.0/LICENSE +0 -202
  279. data/THIRD_PARTY_LICENSES/par-iter-2.0.0/LICENSE +0 -202
  280. data/THIRD_PARTY_LICENSES/path-clean-0.1.0/LICENSE-APACHE +0 -13
  281. data/THIRD_PARTY_LICENSES/path-clean-0.1.0/LICENSE-MIT +0 -18
  282. data/THIRD_PARTY_LICENSES/path-clean-1.0.1/LICENSE-APACHE +0 -13
  283. data/THIRD_PARTY_LICENSES/path-clean-1.0.1/LICENSE-MIT +0 -18
  284. data/THIRD_PARTY_LICENSES/pathdiff-0.2.3/LICENSE-APACHE +0 -201
  285. data/THIRD_PARTY_LICENSES/pathdiff-0.2.3/LICENSE-MIT +0 -23
  286. data/THIRD_PARTY_LICENSES/petgraph-0.7.1/LICENSE-APACHE +0 -201
  287. data/THIRD_PARTY_LICENSES/precomputed-map-0.2.0/LICENSE +0 -21
  288. data/THIRD_PARTY_LICENSES/preset_env_base-6.0.0/LICENSE +0 -201
  289. data/THIRD_PARTY_LICENSES/radium-0.7.0/LICENSE.txt +0 -21
  290. data/THIRD_PARTY_LICENSES/radix_fmt-1.0.0/LICENSE +0 -201
  291. data/THIRD_PARTY_LICENSES/rand-0.8.5/COPYRIGHT +0 -12
  292. data/THIRD_PARTY_LICENSES/rand-0.8.5/LICENSE-APACHE +0 -176
  293. data/THIRD_PARTY_LICENSES/rand_core-0.6.4/COPYRIGHT +0 -12
  294. data/THIRD_PARTY_LICENSES/rand_core-0.6.4/LICENSE-APACHE +0 -187
  295. data/THIRD_PARTY_LICENSES/rand_core-0.6.4/LICENSE-MIT +0 -26
  296. data/THIRD_PARTY_LICENSES/regress-0.10.5/LICENSE-APACHE +0 -201
  297. data/THIRD_PARTY_LICENSES/regress-0.10.5/LICENSE-MIT +0 -21
  298. data/THIRD_PARTY_LICENSES/ryu-1.0.22/LICENSE-APACHE +0 -176
  299. data/THIRD_PARTY_LICENSES/ryu-1.0.22/LICENSE-BOOST +0 -23
  300. data/THIRD_PARTY_LICENSES/scoped-tls-1.0.1/LICENSE-APACHE +0 -201
  301. data/THIRD_PARTY_LICENSES/scoped-tls-1.0.1/LICENSE-MIT +0 -25
  302. data/THIRD_PARTY_LICENSES/siphasher-0.3.11/COPYING +0 -7
  303. data/THIRD_PARTY_LICENSES/smallvec-1.15.1/LICENSE-APACHE +0 -201
  304. data/THIRD_PARTY_LICENSES/smartstring-1.0.1/LICENCE.md +0 -355
  305. data/THIRD_PARTY_LICENSES/st-map-0.2.4/LICENSE +0 -202
  306. data/THIRD_PARTY_LICENSES/static-map-macro-0.3.4/LICENSE +0 -202
  307. data/THIRD_PARTY_LICENSES/string_enum-1.0.2/LICENSE +0 -201
  308. data/THIRD_PARTY_LICENSES/strsim-0.11.1/LICENSE +0 -23
  309. data/THIRD_PARTY_LICENSES/swc-52.0.0/LICENSE +0 -201
  310. data/THIRD_PARTY_LICENSES/swc_allocator-4.0.1/LICENSE +0 -201
  311. data/THIRD_PARTY_LICENSES/swc_atoms-9.0.0/LICENSE +0 -201
  312. data/THIRD_PARTY_LICENSES/swc_common-18.0.1/LICENSE +0 -201
  313. data/THIRD_PARTY_LICENSES/swc_compiler_base-45.0.0/LICENSE +0 -201
  314. data/THIRD_PARTY_LICENSES/swc_config-3.1.2/LICENSE +0 -201
  315. data/THIRD_PARTY_LICENSES/swc_config_macro-1.0.1/LICENSE +0 -201
  316. data/THIRD_PARTY_LICENSES/swc_core-54.0.0/LICENSE +0 -201
  317. data/THIRD_PARTY_LICENSES/swc_ecma_ast-19.0.0/LICENSE +0 -201
  318. data/THIRD_PARTY_LICENSES/swc_ecma_codegen-21.0.0/LICENSE +0 -201
  319. data/THIRD_PARTY_LICENSES/swc_ecma_codegen_macros-2.0.2/LICENSE +0 -201
  320. data/THIRD_PARTY_LICENSES/swc_ecma_compat_bugfixes-39.0.0/LICENSE +0 -201
  321. data/THIRD_PARTY_LICENSES/swc_ecma_compat_common-30.0.0/LICENSE +0 -201
  322. data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2015-39.0.0/LICENSE +0 -201
  323. data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2016-35.0.0/LICENSE +0 -201
  324. data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2017-35.0.0/LICENSE +0 -201
  325. data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2018-36.0.0/LICENSE +0 -201
  326. data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2019-35.0.0/LICENSE +0 -201
  327. data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2020-37.0.0/LICENSE +0 -201
  328. data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2021-35.0.0/LICENSE +0 -201
  329. data/THIRD_PARTY_LICENSES/swc_ecma_compat_es2022-37.0.0/LICENSE +0 -201
  330. data/THIRD_PARTY_LICENSES/swc_ecma_compat_es3-26.0.0/LICENSE +0 -201
  331. data/THIRD_PARTY_LICENSES/swc_ecma_ext_transforms-25.0.0/LICENSE +0 -201
  332. data/THIRD_PARTY_LICENSES/swc_ecma_hooks-0.3.0/LICENSE +0 -201
  333. data/THIRD_PARTY_LICENSES/swc_ecma_loader-18.0.0/LICENSE +0 -201
  334. data/THIRD_PARTY_LICENSES/swc_ecma_minifier-42.0.0/LICENSE +0 -201
  335. data/THIRD_PARTY_LICENSES/swc_ecma_parser-32.0.0/LICENSE +0 -201
  336. data/THIRD_PARTY_LICENSES/swc_ecma_preset_env-45.0.0/LICENSE +0 -201
  337. data/THIRD_PARTY_LICENSES/swc_ecma_transformer-6.0.0/LICENSE +0 -201
  338. data/THIRD_PARTY_LICENSES/swc_ecma_transforms-44.0.0/LICENSE +0 -201
  339. data/THIRD_PARTY_LICENSES/swc_ecma_transforms_base-35.0.0/LICENSE +0 -201
  340. data/THIRD_PARTY_LICENSES/swc_ecma_transforms_classes-35.0.0/LICENSE +0 -201
  341. data/THIRD_PARTY_LICENSES/swc_ecma_transforms_compat-40.0.0/LICENSE +0 -201
  342. data/THIRD_PARTY_LICENSES/swc_ecma_transforms_macros-1.0.1/LICENSE +0 -201
  343. data/THIRD_PARTY_LICENSES/swc_ecma_transforms_module-38.0.0/LICENSE +0 -201
  344. data/THIRD_PARTY_LICENSES/swc_ecma_transforms_optimization-37.0.0/LICENSE +0 -201
  345. data/THIRD_PARTY_LICENSES/swc_ecma_transforms_proposal-35.0.0/LICENSE +0 -201
  346. data/THIRD_PARTY_LICENSES/swc_ecma_transforms_react-38.0.0/LICENSE +0 -201
  347. data/THIRD_PARTY_LICENSES/swc_ecma_transforms_typescript-38.0.0/LICENSE +0 -201
  348. data/THIRD_PARTY_LICENSES/swc_ecma_usage_analyzer-27.0.0/LICENSE +0 -201
  349. data/THIRD_PARTY_LICENSES/swc_ecma_utils-25.0.0/LICENSE +0 -201
  350. data/THIRD_PARTY_LICENSES/swc_ecma_visit-19.0.0/LICENSE +0 -201
  351. data/THIRD_PARTY_LICENSES/swc_eq_ignore_macros-1.0.1/LICENSE +0 -201
  352. data/THIRD_PARTY_LICENSES/swc_error_reporters-20.0.0/LICENSE +0 -201
  353. data/THIRD_PARTY_LICENSES/swc_macros_common-1.0.1/LICENSE +0 -201
  354. data/THIRD_PARTY_LICENSES/swc_node_comments-18.0.0/LICENSE +0 -201
  355. data/THIRD_PARTY_LICENSES/swc_timer-1.0.0/LICENSE +0 -201
  356. data/THIRD_PARTY_LICENSES/swc_trace_macro-2.0.2/LICENSE +0 -201
  357. data/THIRD_PARTY_LICENSES/swc_transform_common-12.0.0/LICENSE +0 -201
  358. data/THIRD_PARTY_LICENSES/swc_visit-2.0.1/LICENSE +0 -201
  359. data/THIRD_PARTY_LICENSES/tap-1.0.1/LICENSE.txt +0 -21
  360. data/THIRD_PARTY_LICENSES/tracing-0.1.44/LICENSE +0 -25
  361. data/THIRD_PARTY_LICENSES/tracing-attributes-0.1.31/LICENSE +0 -25
  362. data/THIRD_PARTY_LICENSES/tracing-core-0.1.36/LICENSE +0 -25
  363. data/THIRD_PARTY_LICENSES/triomphe-0.1.15/LICENSE-APACHE +0 -201
  364. data/THIRD_PARTY_LICENSES/triomphe-0.1.15/LICENSE-MIT +0 -27
  365. data/THIRD_PARTY_LICENSES/unicode-width-0.1.14/LICENSE-APACHE +0 -201
  366. data/THIRD_PARTY_LICENSES/unicode-width-0.1.14/LICENSE-MIT +0 -25
  367. data/THIRD_PARTY_LICENSES/uuid-1.19.0/LICENSE-APACHE +0 -201
  368. data/THIRD_PARTY_LICENSES/uuid-1.19.0/LICENSE-MIT +0 -26
  369. data/THIRD_PARTY_LICENSES/vergen-9.0.6/LICENSE-APACHE +0 -201
  370. data/THIRD_PARTY_LICENSES/vergen-9.0.6/LICENSE-MIT +0 -25
  371. data/THIRD_PARTY_LICENSES/vergen-lib-0.1.6/LICENSE-APACHE +0 -201
  372. data/THIRD_PARTY_LICENSES/vergen-lib-0.1.6/LICENSE-MIT +0 -25
  373. data/THIRD_PARTY_LICENSES/wyz-0.5.1/LICENSE.txt +0 -21
  374. data/vendor/cfsolve/src/deobfuscate/analysis/globals.rs +0 -33
  375. data/vendor/cfsolve/src/deobfuscate/analysis/names.rs +0 -52
  376. data/vendor/cfsolve/src/listing/normalize.rs +0 -264
  377. data/vendor/cfsolve/src/stage2/analysis/outputs.rs +0 -327
  378. data/vendor/cfsolve/src/stage2/probes/stylesheets.rs +0 -249
  379. data/vendor/cfsolve/src/stage2/reference-expanded.json +0 -42
  380. data/vendor/cfsolve/src/stage2/session_names.rs +0 -470
  381. /data/THIRD_PARTY_LICENSES/{derive_builder-0.20.2 → cobs-0.3.0}/LICENSE-APACHE +0 -0
  382. /data/THIRD_PARTY_LICENSES/{compact_str-0.7.1 → compact_str-0.10.0}/LICENSE +0 -0
  383. /data/THIRD_PARTY_LICENSES/{ahash-0.8.12 → embedded-io-0.4.0}/LICENSE-APACHE +0 -0
  384. /data/THIRD_PARTY_LICENSES/{arrayvec-0.7.6 → embedded-io-0.6.1}/LICENSE-APACHE +0 -0
  385. /data/THIRD_PARTY_LICENSES/{normpath-0.2.0 → escape-simd-0.1.1}/LICENSE-APACHE +0 -0
  386. /data/THIRD_PARTY_LICENSES/{bstr-1.12.1 → itertools-0.15.0}/LICENSE-APACHE +0 -0
  387. /data/THIRD_PARTY_LICENSES/{petgraph-0.7.1 → itertools-0.15.0}/LICENSE-MIT +0 -0
  388. /data/THIRD_PARTY_LICENSES/{itoa-1.0.17 → itoa-1.0.19}/LICENSE-APACHE +0 -0
  389. /data/THIRD_PARTY_LICENSES/{camino-1.2.2 → itoa-1.0.19}/LICENSE-MIT +0 -0
  390. /data/THIRD_PARTY_LICENSES/{globset-0.4.18 → memchr-2.8.3}/COPYING +0 -0
  391. /data/THIRD_PARTY_LICENSES/{globset-0.4.18 → memchr-2.8.3}/LICENSE-MIT +0 -0
  392. /data/THIRD_PARTY_LICENSES/{camino-1.2.2 → num-bigint-0.5.1}/LICENSE-APACHE +0 -0
  393. /data/THIRD_PARTY_LICENSES/{swc_sourcemap-9.3.4 → oxc_sourcemap-9.0.0}/LICENSE +0 -0
  394. /data/THIRD_PARTY_LICENSES/{phf-0.11.3 → phf-0.14.0}/LICENSE +0 -0
  395. /data/THIRD_PARTY_LICENSES/{phf_generator-0.11.3 → phf_generator-0.14.0}/LICENSE +0 -0
  396. /data/THIRD_PARTY_LICENSES/{phf_macros-0.11.3 → phf_macros-0.14.0}/LICENSE +0 -0
  397. /data/THIRD_PARTY_LICENSES/{phf_shared-0.11.3 → phf_shared-0.14.0}/LICENSE +0 -0
  398. /data/THIRD_PARTY_LICENSES/{fixedbitset-0.5.7 → postcard-1.1.3}/LICENSE-APACHE +0 -0
  399. /data/THIRD_PARTY_LICENSES/{hashbrown-0.14.5 → smallvec-1.16.5}/LICENSE-APACHE +0 -0
  400. /data/THIRD_PARTY_LICENSES/{smallvec-1.15.1 → smallvec-1.16.5}/LICENSE-MIT +0 -0
  401. /data/THIRD_PARTY_LICENSES/{unicode-width-0.1.14 → unicode-segmentation-1.13.3}/COPYRIGHT +0 -0
  402. /data/THIRD_PARTY_LICENSES/{hashbrown-0.16.1 → unicode-segmentation-1.13.3}/LICENSE-APACHE +0 -0
  403. /data/THIRD_PARTY_LICENSES/{heck-0.5.0 → unicode-segmentation-1.13.3}/LICENSE-MIT +0 -0
  404. /data/THIRD_PARTY_LICENSES/{cargo-platform-0.1.9 → zmij_ecma-1.0.23}/LICENSE-MIT +0 -0
@@ -11,7 +11,6 @@ use super::initial::{self, EmbeddingPage, Fetched, Merged};
11
11
  use super::timing::Timer;
12
12
  use super::{Sink, interaction, probes};
13
13
  use crate::browser::{Page, Solve};
14
- use crate::challenge::installed::Installed;
15
14
  use crate::challenge::orchestrator::ChallengePage;
16
15
  use crate::challenge::program::{ExtractedProgram, PreparedSession, SessionEncoder};
17
16
  use crate::challenge::source::InitialRequest;
@@ -128,7 +127,7 @@ enum Landing {
128
127
  /// A site's page with a Turnstile widget.
129
128
  Site(EmbeddingPage),
130
129
  /// A challenge page, whose orchestrator has rendered its widget.
131
- ChallengePage(OrchestratorSession, EmbeddingPage),
130
+ ChallengePage(Box<OrchestratorSession>, EmbeddingPage),
132
131
  }
133
132
 
134
133
  impl Landing {
@@ -177,7 +176,10 @@ async fn land(
177
176
  document.referrer_policy,
178
177
  )
179
178
  .await?;
180
- Ok(Landing::ChallengePage(orchestrator, embedding_page))
179
+ Ok(Landing::ChallengePage(
180
+ Box::new(orchestrator),
181
+ embedding_page,
182
+ ))
181
183
  }
182
184
 
183
185
  /// Starts the session of the widget rendered by `embedding_page` by sending its first payload.
@@ -212,7 +214,6 @@ async fn start_widget<'caller>(
212
214
  sink,
213
215
  fetched,
214
216
  request: program.request,
215
- installed: program.installed,
216
217
  encoder,
217
218
  embedding: embedding_page.embedding,
218
219
  merged,
@@ -316,8 +317,6 @@ pub(crate) struct WidgetSession<'caller> {
316
317
  pub fetched: Fetched,
317
318
  /// POST destination and options reported by the first payload.
318
319
  pub request: InitialRequest,
319
- /// Initial-program facts reused when refreshing captured probe answers.
320
- pub installed: Installed,
321
320
  pub encoder: SessionEncoder,
322
321
  pub embedding: Embedding,
323
322
  pub merged: Merged,
@@ -16,8 +16,8 @@ mod timing;
16
16
  mod widget;
17
17
 
18
18
  pub use channel::Stage;
19
- pub(crate) use sink::Discard;
20
19
  pub use sink::Sink;
20
+ pub(crate) use sink::{Discard, SinkFailed};
21
21
  pub use widget::{Clearance, Outcome};
22
22
  pub(crate) use widget::{Expect, native, navigate, prepare, send_first_payload};
23
23
 
@@ -20,6 +20,8 @@ use crate::session::{self, Clearance, Discard, Expect, Outcome, Sink};
20
20
  pub struct Options {
21
21
  /// An `http://`, `https://`, `socks5://`, or `socks5h://` proxy for every request.
22
22
  pub proxy: Option<String>,
23
+ /// A PEM certificate to trust instead of the built-in roots, such as a recording proxy's CA.
24
+ pub trusted_root: Option<Vec<u8>>,
23
25
  /// Destination for artifacts and progress messages. Both are discarded if absent.
24
26
  pub sink: Option<Arc<dyn Sink>>,
25
27
  }
@@ -203,7 +205,7 @@ impl Browser {
203
205
 
204
206
  fn client(&self, options: &Options) -> Result<BrowserClient, Error> {
205
207
  self.transport
206
- .client(options.proxy.as_deref())
208
+ .client(options.proxy.as_deref(), options.trusted_root.as_deref())
207
209
  .map_err(Error::Config)
208
210
  }
209
211
  }
@@ -9,14 +9,15 @@ use serde::Serialize;
9
9
  use super::recognize::{ProbeView, Strings};
10
10
  use super::{audit, controller, discovery, envelope};
11
11
  use crate::candidates;
12
- use crate::js::JsValue;
12
+ use crate::js::{JsObject, JsValue};
13
13
  use crate::listing::Index;
14
14
  use crate::script::Source;
15
15
  use crate::stage2::payload::{self, Layout};
16
16
  use crate::stage2::records::{Envelope, Probe, ProbePlan, WriteOrder};
17
- use crate::stage2::registry::{AUDIT_PROBE, Operation};
17
+ use crate::stage2::reference::ISOLATION_FAILURE_FIELDS;
18
+ use crate::stage2::registry::{AUDIT_PROBE, Kind, Operation};
18
19
  use crate::stage2::trace::Trace;
19
- use crate::stage2::vocabulary::Vocabulary;
20
+ use crate::stage2::vocabulary::{self, Vocabulary};
20
21
  use crate::vm::{Failure, Position};
21
22
 
22
23
  /// A recovered probe plan with supporting analysis evidence.
@@ -66,8 +67,8 @@ impl Analysis {
66
67
  function: (evidence.function.pc, evidence.function.key),
67
68
  operation: probe.operation.as_ref(),
68
69
  features: &probe.features,
69
- expanded_features: &probe.expanded_features,
70
70
  writes: &probe.writes,
71
+ replay_literals: &probe.replay_literals,
71
72
  reference: evidence.reference,
72
73
  });
73
74
  Artifact {
@@ -112,8 +113,8 @@ struct ProbeArtifact<'analysis> {
112
113
  function: (u32, u8),
113
114
  operation: Option<&'analysis Operation>,
114
115
  features: &'analysis [String],
115
- expanded_features: &'analysis [String],
116
116
  writes: &'analysis WriteOrder,
117
+ replay_literals: &'analysis JsObject,
117
118
  reference: Option<usize>,
118
119
  }
119
120
 
@@ -122,23 +123,10 @@ pub fn analyze(source: &Source, program: &[u8]) -> Result<Analysis> {
122
123
  // Include `cf-chl-peek` when resolving hashed comparisons. The worker-fetch probe reads
123
124
  // this header but does not store its name as a program string.
124
125
  let machine = source.machine()?;
125
- let mut listing = machine.disassemble_from(program, &[machine.entry()], &["cf-chl-peek"])?;
126
- crate::listing::normalize::constants(&mut listing);
126
+ let listing = machine.disassemble_from(program, &[machine.entry()], &["cf-chl-peek"])?;
127
127
  let index = Index::new(&listing);
128
128
  let (pool_pc, pool) = index.pool()?;
129
129
  let discovery = discovery::discover(&index, pool)?;
130
- let session_features: Vec<&[String]> = discovery
131
- .probes
132
- .iter()
133
- .map(|probe| probe.features.as_slice())
134
- .collect();
135
- let mut vocabulary = Vocabulary::infer(&session_features);
136
- let expanded_features: Vec<&[String]> = discovery
137
- .probes
138
- .iter()
139
- .map(|probe| probe.expanded_features.as_slice())
140
- .collect();
141
- vocabulary.extend_expanded(&expanded_features);
142
130
  let mut wrapper: BTreeSet<String> = discovery
143
131
  .probes
144
132
  .first()
@@ -147,27 +135,29 @@ pub fn analyze(source: &Source, program: &[u8]) -> Result<Analysis> {
147
135
  for probe in &discovery.probes {
148
136
  wrapper.retain(|text| probe.features.contains(text));
149
137
  }
138
+ // Builds with hex names decode program-wide names, such as the record envelope's, in every
139
+ // probe instead of loading them once in the header. Recognizers treat them as header names.
140
+ let hex_names = wrapper.iter().filter(|text| vocabulary::is_hex_name(text));
141
+ let header: BTreeSet<String> = index.header().values().chain(hex_names).cloned().collect();
142
+ let session_features: Vec<&[String]> = discovery
143
+ .probes
144
+ .iter()
145
+ .map(|probe| probe.features.as_slice())
146
+ .collect();
147
+ let mut vocabulary = Vocabulary::infer(&session_features);
150
148
  for (position, raw) in discovery.probes.iter().enumerate() {
151
- if let Some(reference) = vocabulary.partner(position) {
152
- vocabulary.pin(
153
- position,
154
- super::outputs::names(&index, raw.function.pc, reference, &wrapper),
155
- );
156
- }
157
149
  if vocabulary.partner(position) == Some(AUDIT_PROBE)
158
150
  && let Some(names) = audit::names(&index, &raw.writes.fields)
159
151
  {
160
152
  vocabulary.pin(position, names);
161
153
  }
162
154
  }
163
- let mut header: BTreeSet<String> = index.header().values().cloned().collect();
164
- header.extend(envelope::counter(&index, &discovery.creation));
165
155
  let mut probes = Vec::new();
166
156
  let mut evidence = Vec::new();
167
157
  for (position, raw) in discovery.probes.into_iter().enumerate() {
168
158
  let to_reference = |text: &String| vocabulary.to_reference(position, text).to_owned();
169
159
  let features: Vec<String> = raw.features.iter().map(to_reference).collect();
170
- let outputs: BTreeSet<String> = raw.writes.fields.iter().map(to_reference).collect();
160
+ let outputs: BTreeSet<String> = raw.outputs.iter().map(to_reference).collect();
171
161
  let reference = vocabulary.partner(position);
172
162
  // Treat an unrecognized computed probe as a device fact and replay its paired reference
173
163
  // answer.
@@ -184,14 +174,38 @@ pub fn analyze(source: &Source, program: &[u8]) -> Result<Analysis> {
184
174
  strings: Strings::new(&features, &outputs),
185
175
  })
186
176
  .or(reference.map(|reference| Operation::Replay { reference }));
177
+ let mut replay_literals = JsObject::new();
178
+ // The last history result write is its exception branch. The eval callback reports the
179
+ // same failure marker. Both are program literals.
180
+ if reference.and_then(Kind::from_reference) == Some(Kind::Isolation)
181
+ && let Some(marker) = index
182
+ .stores()
183
+ .iter()
184
+ .rev()
185
+ .filter(|store| {
186
+ vocabulary.to_reference(position, &store.key) == ISOLATION_FAILURE_FIELDS[1]
187
+ })
188
+ .find_map(|store| {
189
+ index
190
+ .text(store.pc, &store.value)
191
+ .filter(|text| vocabulary::is_hex_name(text))
192
+ })
193
+ {
194
+ for name in ISOLATION_FAILURE_FIELDS {
195
+ replay_literals.insert(
196
+ vocabulary.to_session(position, name).to_owned(),
197
+ JsValue::String(marker.clone()),
198
+ );
199
+ }
200
+ }
187
201
  probes.push(Probe {
188
202
  index: raw.index,
189
203
  token: raw.token,
190
204
  input: raw.input,
191
205
  operation,
192
206
  features: raw.features,
193
- expanded_features: raw.expanded_features,
194
207
  writes: raw.writes,
208
+ replay_literals,
195
209
  });
196
210
  evidence.push(ProbeEvidence {
197
211
  states: raw.states,
@@ -228,12 +242,15 @@ pub fn analyze(source: &Source, program: &[u8]) -> Result<Analysis> {
228
242
  })
229
243
  }
230
244
 
231
- /// Finds the frame left by the probe immediately before the uniquely paired environment audit.
232
- /// If the audit runs first, retains the iframe's root frames.
245
+ /// The early audit runs in the worker-navigator continuation if that probe has finished.
246
+ /// Synchronous probes between the worker and the audit do not replace that continuation.
247
+ /// Without a preceding worker, the iframe callback remains the controller frame.
233
248
  fn controller_frame(index: &Index<'_>, evidence: &[ProbeEvidence], push: &str) -> Option<String> {
234
249
  let audits =
235
250
  (0..evidence.len()).filter(|&position| evidence[position].reference == Some(AUDIT_PROBE));
236
251
  let position = candidates::exactly_one(audits, "environment audit").ok()?;
237
- let preceding = evidence.get(position.checked_sub(1)?)?;
238
- controller::controller_trace(index, push, preceding.function.pc)
252
+ let worker = evidence[..position].iter().rev().find(|probe| {
253
+ probe.reference.and_then(Kind::from_reference) == Some(Kind::WorkerNavigator)
254
+ })?;
255
+ controller::controller_trace(index, push, worker.function.pc)
239
256
  }
@@ -6,7 +6,7 @@
6
6
 
7
7
  use std::collections::{BTreeMap, BTreeSet};
8
8
 
9
- use swc_core::ecma::ast::BinaryOp;
9
+ use oxc::syntax::operator::BinaryOperator;
10
10
 
11
11
  use crate::candidates;
12
12
  use crate::listing::Index;
@@ -77,7 +77,9 @@ fn value_role(index: &Index<'_>, store: &Store) -> Option<&'static str> {
77
77
  }
78
78
  match index.dereference(pc, value)? {
79
79
  // The decoded size less a Server-Timing duration.
80
- (at, Term::Binary(BinaryOp::Sub, left, _)) if index.reads(at, &left, "decodedBodySize") => {
80
+ (at, Term::Binary(BinaryOperator::Subtraction, left, _))
81
+ if index.reads(at, &left, "decodedBodySize") =>
82
+ {
81
83
  Some(ENVIRONMENT_AUDIT_REDUCTION)
82
84
  }
83
85
  // A touch-support check given the probe frame's document.
@@ -40,7 +40,8 @@ pub(super) struct RawProbe {
40
40
  pub function: Position,
41
41
  /// Collection-function strings in order, including duplicates.
42
42
  pub features: Vec<String>,
43
- pub expanded_features: Vec<String>,
43
+ /// The names it stores into registers or properties.
44
+ pub outputs: BTreeSet<String>,
44
45
  pub writes: WriteOrder,
45
46
  }
46
47
 
@@ -128,8 +129,7 @@ pub(super) fn discover(index: &Index<'_>, pool: &str) -> Result<ProbeDiscovery>
128
129
  _ => None,
129
130
  })
130
131
  .context("probe has no collection function")?;
131
- let (features, expanded_features) =
132
- collection_strings(index, function.pc, &dispatcher, pool);
132
+ let (features, outputs) = collection_strings(index, function.pc, &dispatcher);
133
133
  traced.push(trace_writes(index, function.pc, &dispatcher));
134
134
  probes.push(RawProbe {
135
135
  index: index_one,
@@ -138,7 +138,7 @@ pub(super) fn discover(index: &Index<'_>, pool: &str) -> Result<ProbeDiscovery>
138
138
  input,
139
139
  function,
140
140
  features,
141
- expanded_features,
141
+ outputs,
142
142
  writes: WriteOrder::default(),
143
143
  });
144
144
  }
@@ -244,23 +244,10 @@ fn collection_strings(
244
244
  index: &Index<'_>,
245
245
  entry: u32,
246
246
  dispatcher: &RangeInclusive<u32>,
247
- pool: &str,
248
- ) -> (Vec<String>, Vec<String>) {
247
+ ) -> (Vec<String>, BTreeSet<String>) {
249
248
  let mut strings: BTreeMap<u32, Vec<String>> = BTreeMap::new();
250
- let mut expanded: BTreeMap<u32, Vec<String>> = BTreeMap::new();
249
+ let mut outputs = BTreeSet::new();
251
250
  let outside = |pc: u32| !dispatcher.contains(&pc);
252
- // Keep the original feature sequence stable as newly recovered exception paths add
253
- // evidence. The expanded sequence includes those paths for cross-build name recovery.
254
- let ordinary = query::walk(
255
- index.listing(),
256
- entry,
257
- outside,
258
- |pc, instruction, pending| {
259
- pending.extend(instruction.exits());
260
- pending.extend(index.closures_in(pc..=pc));
261
- pending.extend(index.hidden_at(pc).iter().map(|hidden| hidden.target.pc));
262
- },
263
- );
264
251
  query::walk(
265
252
  index.listing(),
266
253
  entry,
@@ -269,62 +256,64 @@ fn collection_strings(
269
256
  pending.extend(instruction.exits());
270
257
  for path in &instruction.paths {
271
258
  let mut at_pc = Vec::new();
272
- let mut expanded_at_pc = Vec::new();
273
259
  for effect in &path.effects {
274
- effect.visit_terms(&mut |term| {
275
- if let Some(text) = index
276
- .text(pc, term)
277
- .filter(|text| text.len() <= FEATURE_LENGTH)
278
- {
279
- let decoded = (text.starts_with('\0') || text.starts_with("ÿÿ"))
280
- .then(|| listing::decode_string(&text, pool).ok())
281
- .flatten()
282
- .filter(|decoded| crate::stage2::vocabulary::is_name(decoded));
283
- let text = decoded.unwrap_or(text);
284
- if !expanded_at_pc.contains(&text) {
285
- expanded_at_pc.push(text);
286
- }
287
- }
288
- });
260
+ let output = match effect {
261
+ Effect::Set(_, term) => Some(term),
262
+ Effect::SetProperty { key, .. } => Some(&**key),
263
+ _ => None,
264
+ };
265
+ if let Some(Term::Const(Constant::String(name))) = output {
266
+ outputs.insert(name.clone());
267
+ }
289
268
  effect.visit_terms(&mut |term| match term {
290
269
  Term::Const(Constant::String(text)) if text.len() <= FEATURE_LENGTH => {
291
- let decoded = (text.starts_with('\0') || text.starts_with("ÿÿ"))
292
- .then(|| listing::decode_string(text, pool).ok())
293
- .flatten()
294
- .filter(|decoded| crate::stage2::vocabulary::is_name(decoded));
295
- let text = decoded.as_ref().unwrap_or(text);
296
270
  if !at_pc.contains(text) {
297
271
  at_pc.push(text.clone());
298
272
  }
299
273
  }
300
274
  Term::Closure { pc, .. } => pending.push(*pc),
301
- // A frame pushed for a catch handler: [pc, key, ...].
302
- Term::Array(frame) => {
303
- pending.extend(vm::catch_frame(frame).map(|handler| handler.pc));
304
- }
275
+ // Exception results are recovered separately from collection paths.
305
276
  _ => {}
306
277
  });
307
278
  }
308
- if ordinary.contains(&pc) {
309
- strings.entry(pc).or_default().extend(at_pc);
310
- }
311
- expanded.entry(pc).or_default().extend(expanded_at_pc);
279
+ strings.entry(pc).or_default().extend(at_pc);
312
280
  }
313
281
  for hidden in index.hidden_at(pc) {
314
- if ordinary.contains(&pc) {
315
- strings.entry(pc).or_default().push(hidden.string.clone());
316
- }
317
- expanded.entry(pc).or_default().push(hidden.string.clone());
282
+ strings.entry(pc).or_default().push(hidden.string.clone());
318
283
  pending.push(hidden.target.pc);
319
284
  }
320
285
  },
321
286
  );
322
287
  (
323
- strings.into_values().flatten().collect(),
324
- expanded.into_values().flatten().collect(),
288
+ without_inline_descriptors(strings.into_values().flatten()),
289
+ outputs,
325
290
  )
326
291
  }
327
292
 
293
+ /// Drops string descriptors the program decodes in place, keeping the decoded text that follows
294
+ /// each one (see `vm::packed_names`). Other builds decode descriptors where the listing cannot
295
+ /// follow, so recognizers read those descriptors themselves.
296
+ fn without_inline_descriptors(strings: impl Iterator<Item = String>) -> Vec<String> {
297
+ // An inline descriptor: a two-unit big-endian length, then at least that much text.
298
+ let describes = |descriptor: &str, text: &str| {
299
+ let units: Vec<u16> = descriptor.encode_utf16().collect();
300
+ let [high @ 0..=255, low @ 0..=255, rest @ ..] = units.as_slice() else {
301
+ return false;
302
+ };
303
+ let length = usize::from(*high) * 256 + usize::from(*low);
304
+ rest.get(..length)
305
+ .is_some_and(|described| described.iter().copied().eq(text.encode_utf16()))
306
+ };
307
+ let mut kept: Vec<String> = Vec::new();
308
+ for text in strings {
309
+ if kept.last().is_some_and(|last| describes(last, &text)) {
310
+ kept.pop();
311
+ }
312
+ kept.push(text);
313
+ }
314
+ kept
315
+ }
316
+
328
317
  /// Writes made by a collection function, in execution order.
329
318
  #[derive(Default)]
330
319
  struct Writes {
@@ -369,22 +358,11 @@ impl Writes {
369
358
  .min()
370
359
  else {
371
360
  return WriteOrder {
372
- internal: Vec::new(),
373
361
  fields: self.fields,
374
362
  late: Vec::new(),
375
363
  };
376
364
  };
377
365
  let descriptors: HashSet<u32> = descriptor_pushes.iter().map(|push| push.object).collect();
378
- let internal: Vec<String> = self
379
- .body_stores
380
- .iter()
381
- .filter(|store| {
382
- store
383
- .object
384
- .is_some_and(|object| descriptors.contains(&object))
385
- })
386
- .map(|store| store.key.clone())
387
- .collect();
388
366
  // Objects stored into a descriptor hold its defaults.
389
367
  let defaults: HashSet<u32> = self
390
368
  .body_stores
@@ -409,7 +387,6 @@ impl Writes {
409
387
  .cloned()
410
388
  .collect();
411
389
  WriteOrder {
412
- internal,
413
390
  fields: self.fields,
414
391
  late,
415
392
  }
@@ -540,3 +517,21 @@ fn pushed_object(
540
517
  stores_before,
541
518
  })
542
519
  }
520
+
521
+ #[cfg(test)]
522
+ mod tests {
523
+ use super::without_inline_descriptors;
524
+
525
+ #[test]
526
+ fn drops_only_descriptors_followed_by_their_text() {
527
+ let strings = [
528
+ "\0\u{3}abc\0\0", // decoded in place
529
+ "abc",
530
+ "\0\u{3}xyz\0", // decoded elsewhere
531
+ "toString", // reads as an oversized length
532
+ "String",
533
+ ];
534
+ let kept = without_inline_descriptors(strings.into_iter().map(String::from));
535
+ assert_eq!(kept, ["abc", "\0\u{3}xyz\0", "toString", "String"]);
536
+ }
537
+ }
@@ -3,32 +3,16 @@
3
3
  use std::collections::BTreeSet;
4
4
 
5
5
  use anyhow::{Context, Result};
6
- use swc_core::ecma::ast::BinaryOp;
7
6
 
8
7
  use crate::js::JsValue;
9
8
  use crate::listing::fold::{Frame, Known};
10
9
  use crate::listing::query::Store;
11
10
  use crate::listing::{Index, query};
12
11
  use crate::stage2::payload::RecordLiteral;
12
+ use crate::stage2::queries;
13
13
  use crate::stage2::records::{Completion, Envelope, INITIAL_STATUS, Probe};
14
14
  use crate::vm::{Effect, Term};
15
15
 
16
- pub(super) fn counter(index: &Index<'_>, creation: &BTreeSet<u32>) -> Option<String> {
17
- let fields: BTreeSet<String> = index
18
- .stores()
19
- .iter()
20
- .filter(|store| creation.contains(&store.pc))
21
- .filter(|store| {
22
- matches!(
23
- index.dereference(store.pc, &store.value),
24
- Some((_, Term::Binary(BinaryOp::Add, _, _)))
25
- )
26
- })
27
- .map(|store| store.key.clone())
28
- .collect();
29
- crate::candidates::exactly_one(fields, "record counter").ok()
30
- }
31
-
32
16
  /// Recovers record-envelope fields: creation counter, literal token and input, wrapper status
33
17
  /// and message, and completion timestamps and duration.
34
18
  pub(super) fn recover(
@@ -40,7 +24,28 @@ pub(super) fn recover(
40
24
  literals: &[RecordLiteral],
41
25
  ) -> Result<Envelope> {
42
26
  let listing = index.listing();
43
- let counter = counter(index, creation).context("record counter field not found")?;
27
+ let header = index.header();
28
+ // The counter's key is a header register, or, in programs that unpack names where they
29
+ // use them, a register loaded in the creation state.
30
+ let keys = || {
31
+ let instructions = creation
32
+ .iter()
33
+ .filter_map(|pc| listing.instructions.get(pc));
34
+ instructions.flat_map(|instruction| {
35
+ instruction
36
+ .effects()
37
+ .filter_map(move |effect| match effect {
38
+ Effect::SetProperty { key, .. } if let Term::Reg(register) = **key => {
39
+ Some((instruction.pc, register))
40
+ }
41
+ _ => None,
42
+ })
43
+ })
44
+ };
45
+ let counter = keys()
46
+ .find_map(|(_, register)| header.get(&register).cloned())
47
+ .or_else(|| keys().find_map(|(pc, register)| index.text(pc, &Term::Reg(register))))
48
+ .context("record counter field not found")?;
44
49
  let written_from = |matches: &dyn Fn(&Probe, &JsValue) -> bool| {
45
50
  literals
46
51
  .iter()
@@ -63,11 +68,17 @@ pub(super) fn recover(
63
68
  },
64
69
  );
65
70
  let wrapper = property_values(index, &main);
71
+ // Prefers header names, as for the counter.
66
72
  let wrapper_field = |what: &str, wanted: fn(&Known<Term>) -> bool| {
67
- wrapper
73
+ let mut fields = wrapper
68
74
  .iter()
69
- .find(|(_, value)| wanted(value))
70
- .map(|(field, _)| field.clone())
75
+ .filter(|(_, value)| wanted(value))
76
+ .map(|(field, _)| field);
77
+ fields
78
+ .clone()
79
+ .find(|field| header.values().any(|name| name == *field))
80
+ .or_else(|| fields.next())
81
+ .cloned()
71
82
  .with_context(|| format!("record {what} field not found"))
72
83
  };
73
84
  let status = wrapper_field("status", |value| {
@@ -83,7 +94,7 @@ pub(super) fn recover(
83
94
  .iter()
84
95
  .filter(|store| finish.contains(&store.pc))
85
96
  .collect();
86
- let [started, finished, duration] = index.clock_marks(&finishing)?;
97
+ let [started, finished, duration] = queries::clock_marks(index, &finishing)?;
87
98
  Ok(Envelope {
88
99
  counter,
89
100
  token,
@@ -57,10 +57,8 @@ impl<'probe> Strings<'probe> {
57
57
  /// Decodes the inline descriptor after the first occurrence of `text` that has one.
58
58
  #[must_use]
59
59
  pub(crate) fn decoded_after(&self, text: &str) -> Option<String> {
60
- self.features
61
- .windows(2)
62
- .filter(|pair| pair[0] == text && pair[1].starts_with('\0'))
63
- .find_map(|pair| listing::decode_string(&pair[1], "").ok())
60
+ let pair = self.features.windows(2).find(|pair| pair[0] == text)?;
61
+ listing::decode_string(&pair[1], "").ok()
64
62
  }
65
63
 
66
64
  /// Returns the first inline-decoded string starting with `prefix`.
@@ -168,7 +166,7 @@ mod tests {
168
166
  #[test]
169
167
  fn each_recognizer_recovers_only_its_own_reference_probe() {
170
168
  let probes = &REFERENCE.probes;
171
- assert_eq!(probes.len(), 38);
169
+ assert_eq!(probes.len(), 39);
172
170
  for kind in [
173
171
  Kind::Media,
174
172
  Kind::PrivateToken,
@@ -16,7 +16,6 @@ mod controller;
16
16
  mod discovery;
17
17
  mod envelope;
18
18
  mod outcome;
19
- mod outputs;
20
19
  pub(crate) mod recognize;
21
20
 
22
21
  pub use analyze::{Analysis, Artifact, ProbeEvidence, analyze};