The shutdown check covers the cheat engine: destroyed before the services close

This commit is contained in:
BlackBearReloaded committed 2026-10-02 12:30:18 -04:00
1 parent 19ad7f5444
commit 85406584e5
1 file changed
+7 -3
+7 -3
View File
@@ -13,16 +13,20 @@ def check(text):
assert all(body.count(step) == 1 for step in steps)
offsets = [body.index(step) for step in steps]
assert offsets == sorted(offsets), 'Audio callbacks outlive service owners'
# The cheat engine's timer callback asks the service manager for HID: it is destroyed first.
assert body.index('cheat_engine.reset();') < body.index('kernel.CloseServices();'), \
'The cheat engine outlives the services'
if __name__ == '__main__':
fixed, original = (Path(name).read_text() for name in sys.argv[1:])
check(fixed)
for bad in (original, fixed.replace('GameSettings::LoadOverrides(params.program_id,',
'GameSettings::LoadOverrides(program_id,'), fixed.replace('if (audio_core) audio_core->Shutdown();', '').replace(
'services.reset();', 'services.reset();\nif (audio_core) audio_core->Shutdown();')):
'services.reset();', 'services.reset();\nif (audio_core) audio_core->Shutdown();'),
fixed.replace(' cheat_engine.reset();\n', '', 1)):
try:
check(bad)
except AssertionError:
continue
raise AssertionError('Accepted missing or late audio worker shutdown')
print('Resolved program ID and early audio shutdown coexist; rejection controls PASS')
raise AssertionError('Accepted missing or late audio worker shutdown, or a late cheat engine')
print('Resolved program ID, early audio shutdown and early cheat engine teardown; rejection controls PASS')