upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/pe_loader.cpp
diff options
context:
space:
mode:
authorLeonardo Guimaraes <leozinhoszg@gmail.com>2026-11-22 12:06:49 -0300
committerLeonardo Guimaraes <leozinhoszg@gmail.com>2026-11-22 12:06:49 -0300
commitd6443b152469c467f6295889de855b2931095161 (patch)
treedb225e8cbcf1a2cb45e867c2cb4b507191a39140 /runtime/src/pe_loader.cpp
parent2dca597bd9f143992032010037f2d5c3b970d312 (diff)
Startup trace: never replace an existing file; write UTF-8 only
Review on #1756 (Vonsek): - The trace is opened before the loader reads the image, so `wb` could truncate an input named by mistake (the image itself). open() now uses "x" mode and fails with EEXIST on an existing path; gta6rt says so and exits with 2. - OutputDebugStringA text is in the ANSI code page. It is converted to UTF-8 before quoting, so a byte such as 0xE9 no longer breaks the JSON lines. Host module names now come from GetModuleFileNameW, converted to UTF-8, for the same reason. startup_trace_test: an existing file is refused with EEXIST and its bytes survive, the trace stays off; an ANSI debug string with 0xE9 appears as its UTF-8 form and the whole file is valid UTF-8.
Diffstat (limited to 'runtime/src/pe_loader.cpp')
0 files changed, 0 insertions, 0 deletions