import assert from 'node:assert/strict'; import {compiledCandidate as baseCompiled,physicalCase as basePhysical,checked} from './remote-wake-artifacts.mjs'; import {migrationSymbols} from './thread-migration-capture.mjs'; export {artifact,checked,read} from './remote-wake-artifacts.mjs'; export function compiledCandidate(candidate){ const result=baseCompiled(candidate),{symbols,compiled}=result,image=checked(candidate.artifacts.image),start=symbols._image_start.address; for(const name of [...Object.keys(migrationSymbols),'OS_K2055_TICKETS']){const s=symbols[name];assert.ok(s,name);const at=s.address-start;if(at>=0&&at+s.size<=image.length)compiled[name]=Buffer.from(image.subarray(at,at+s.size));else{assert.ok(s.address>=symbols.__bss_start.address&&s.address+s.size<=symbols.__bss_end.address);compiled[name]=Buffer.alloc(s.size);}} return result; } export function physicalCase(candidate,diagnostic){return {...basePhysical(candidate,diagnostic),...compiledCandidate(candidate),migration:diagnostic.migration};}