Commit 935ac15
fix: handle hex payloads whose first byte starts with 'A'
Previously, extractHex() would match the INSPECT_URL_RE pattern
(?:%20|\s|\+)A([0-9A-Fa-f]+) and strip the leading 'A', treating it as
the classic asset-ID prefix marker. When the actual XOR key byte happened
to encode as hex 'A' (i.e. 0xAx), this produced an odd-length hex string
(e.g. 47 chars) which caused hex2bin() to return false and throw
InvalidArgumentException.
Fix: add an even-length guard — if stripping 'A' yields an odd number of
hex characters, 'A' is part of the payload, not a prefix marker. Fall
through to the pure-masked regex which captures the full hex blob
(including the leading 'A').
Add regression tests for URL and bare-hex forms of a payload whose XOR
key byte is 0xA6, verifying defindex = 1377 after decryption.1 parent a1e4d97 commit 935ac15
2 files changed
Lines changed: 46 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
117 | | - | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
342 | 381 | | |
343 | 382 | | |
344 | 383 | | |
| |||
0 commit comments