Files
sp00nz c330ee8c17 tools.seed_from_log: also seed PsCreateSystemThreadEx's StartContext1
The Xbox thread convention hands the entry wrapper its real entry point
through the context pointer, so on several titles ctx1 *is* the game's
main and nothing in the image calls it directly. Wreckless needed exactly
two seeds here for that reason -- its regen.sh notes the wrapper "copies
init data and calls the game's main through a context pointer".

Half-Life 2 showed the same shape one step later. With the start routine
seeded the thread now runs, but it only takes and releases a critical
section twice and calls PsTerminateSystemThread: the wrapper does its
bookkeeping and exits without ever reaching the game. The address it
should have gone through is in the log as ctx1=0x0059C59E, undetected,
sitting immediately past the end of sub_0059C571.

ctx1 is not always a function -- it is a context pointer in the general
case -- so this leans on the existing gates rather than trusting the log:
it must be in an executable section and read as a function body. On HL2
it clears both.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BuW5WGcXFFrLAYEfvCNGs1
2026-09-01 00:40:23 -07:00
..