Repository navigation
sf-patch-day 0.5.1
Fixed
The dlls text report now shows every control character in text it takes from a DLL, a zip member name or a file name as \xNN (or \uNNNN, or \UNNNNNNNN above U+FFFF), including the plugin's author, which 0.5.0 printed as it was. A hostile DLL could put an ESC sequence or a newline in the author field of its version data and so rewrite the terminal or fake a report line. The same escape now covers every other line of the text report (file names, zip member names, reasons, notes) and every line of the troubleshooting log (--verbose, --log), which also printed file and zip member names as they were, and the RESULT: CANNOT CHECK line of a run that stops (with any command), which can quote a file, zip member or BA2 member name. The invisible format characters (such as the zero-width joiner U+200D and the soft hyphen U+00AD) are shown the same way. A file name with a broken character (a lone UTF-16 surrogate) is shown as \uNNNN and no longer stops a run with --log with an unexpected error. Other text prints exactly as before, and the JSON output was already safe. Verdicts and exit codes don't change.
Example
This run uses one made-up DLL whose author field holds an escape code and a line break that would otherwise have printed a fake RESULT: line (every name in it is made up; output shortened to the DLL's own lines):
> .\sf-patch-day.cmd dlls C:\Example\Plugins --game-version 1.16.244
WORKS ExampleHostile.dll
'ExampleHostile' by Mallory\x1b[2J\x0aRESULT: everything checked loads, plugin version 16.0.0; fixed addresses; no structure promise
why: lists 1.16.244
SHA-256 of sf-patch-day-0.5.1.zip: b6da6e6edd8f71aa05e8347d8e0abb42eb28a3246f51a8eda2f8f97646d1bfd8