Compare commits

..
2 Commits
24 changed files with 1249 additions and 22 deletions

No files matched your search

+14 -12
View File
@@ -38,22 +38,24 @@ other agents' active changes. Keep updates concise, save detailed evidence to di
Use bounded endian-aware parsers, portable paths, clear C#, deterministic tests,
and explicit unmanaged ownership. Build frequently. Update `docs/progress.md`,
`docs/tasks.md`, `docs/decisions.md`, and compatibility evidence before transitions.
Current direction (2026-11-05): user requests decompilation before further
implementation. Keep runtime/package baseline a2e89c6/dae13ac unchanged while
recovering Carl's skip-to-idle lifecycle; current entry reset does not close the
post-skip tilt bug. Trace original state ownership/update order before another
movement reset or scheduler change. See docs/gameplay/jimmy-cutscene-decompilation.md.
Current direction: preserve exact original movement; keep gameplay expansion
paused. The menu/background→successful TSK-load lifetime now establishes retained
Jimmy-before-level-input order on first story entry. Correct that initialization
classification, preserving fresh direct-scene order and all movement/rotation
algorithms. See docs/gameplay/main-menu-player-lifetime.md. The strengthened
Vulkan Carl fixture reproduces the old first-neutral-tick bank and passes after
the correction; broader/native Windows comparison remains separate.
The broader priority remains Jimmy movement stabilization, with gadgets paused. Preserve current movement as baseline; do not substitute
JN-Engine native/Godot movement. Use its original decompiler index only as leads,
verified with REA/authoritative originals. See docs/gameplay/jimmy-movement-stabilization.md.
2026-11-06 continuation: docs/gameplay/jimmy-cutscene-lifecycle.md records292
new bounded original-code cases, mapped DEFAULT recovery and a read-only copied-
original launch/attach observer. No source-supported reset is established; actual
original Carl entry/return state remains the implementation gate. Wine32 observer
attach works but only MAIN/no Jimmy/black frames were observed locally. Preserve
runtime a2e89c6/packages dae13ac and normal landing bank. The user reiterates exact
original behavior; do not substitute a leveling reset or global scheduling change.
2026-11-06 continuation: the earlier292 original component cases plus50 derived-
caller cases and body/visual-sync audit supply no extra reset. Startup diagnostics
now observe backgroundLevel1D/Jimmy allocation after an explicit OS repaint
acknowledgement, with black frames/timing perturbation recorded. Source lifetime,
not those frames, proves the TSK ordering correction. Preserve normal landing
bank; never substitute a leveling reset. Historical runtime/package baseline is
a2e89c6/dae13ac. Read the current progress/compatibility results before packaging.
The prior collision work is resumed where needed for movement; preserve the
35a2a66/0272f7b checkpoints and their source gates before broader body admission.
Controller checkpoint integrates108 native ground/air/facing/jump comparisons;
+11
View File
@@ -1,5 +1,16 @@
# Core architecture coverage map
2026-11-06 TSK-entry correction: [menu/player lifetime](../gameplay/main-menu-player-lifetime.md)
establishes backgroundJimmy construction and reuse before the first playable
story scene. Input is now after Jimmy for that TSK path, while direct fresh-GAM
order remains. This replaces the named assumption that initial story equals fresh
registry insertion. First-neutral-tick/300-idle native Vulkan and eight managed
Carl trajectories pass; full-suite/platform results are tracked in progress.md.
50 more native derived-caller cases and body/transform ownership are documented.
Original startup diagnostics now reach background allocation after a recorded
repaint intervention, with black frames; no full-original visual/runtime parity
or native Windows execution is claimed.
2026-11-06: [Carl lifecycle trace](../gameplay/jimmy-cutscene-lifecycle.md) adds
292 bounded original-code cases and closes local contact/task/animation/STOP and
DEFAULT-provider questions. Actual first-resumed-frame state remains unobserved.
+12
View File
@@ -11,6 +11,18 @@ read-only copied-original observer. Steps1–2 remain open at the actual origina
Carl entry/resumed-frame observation. Step3 has not begun; source composition
agrees with the port's stale writer under the same synthetic order/state.
Later execution update: [menu/player lifetime](../gameplay/main-menu-player-lifetime.md)
closes the successful TSK story path's source ordering gate. MAIN loads a background
Level1D/Jimmy; successful TSK load uses that controlled Jimmy and the ordinary
retained-object loader. Program's first-story classification is corrected without
another angle reset. Step3's first-neutral-tick/300-idle Vulkan and eight managed
trajectories pass. Integrated/native SDL checks and clean ea04210 packages now
pass, including4 identical standalone Linux readbacks and a preliminary isolated
Wine64 Carl replay. All539 originals remain unchanged. Original
Windows comparison remains a step5 obligation, not a completed claim. Step4's
derived-caller/body-transform investigation is also recorded, with broader
dynamic/special contacts and playback dependencies still open.
## Objective
Establish the original ownership and timing of player state across gameplay,
+32 -1
View File
@@ -1,6 +1,37 @@
# Compatibility and validation
Post-skip tilt is still open (2026-11-05). User original comparison specifically
2026-11-06 TSK startup correction: the original menu creates backgroundLevel1D/
Jimmy before successful TSK story entry, then retains that player ahead of the
new level-game input callback. Program now models this on first story entry as
well as retained transitions; direct fresh-scene order stays separate. The
baseline native Vulkan replay fails on first neutral tick0 with destination
roll−10.000001. Corrected first input and300 idle ticks stay upright, preserving
heading, held-input return and body/fire continuation with zero Vulkan errors.
Eight managed Carl trajectories coverLeft/Right, natural/skip and repeated scenes.
All336 Python+2 HUD, managed projects and36 GPU/render passes succeed. Native Linux
SDL/Vulkan1920×1080 control replay and VR04 powered keyboard/steering/resize pass
with zero validation errors. The returned-frame readback is inspected upright.
Final build has zero warnings/errors; Windows x64 cross-publish succeeds. Both
packages identify clean ea04210 and have519 matching original copies,4285 scene
files and7 prepared audio files each. Standalone Linux from /tmp without SDK/
development-library paths passes the control replay with4 identical development
readbacks. Its validation is disabled; development validation is enabled with zero
errors. Removing the optional validation layer's library path produces
ErrorLayerNotPresent; that diagnostic is preserved separately. The Windows
package passes the32-frame Carl replay under isolated Wine64, including first
neutral input/300 idle ticks and held-input return. This is preliminary Wine
evidence, not native Windows verification. All539 originals are unchanged.
Source details:
[menu/player lifetime](gameplay/main-menu-player-lifetime.md). Normal landing bank
and the actual movement/facing algorithms are preserved. Airborne control return,
whole-original timing/rendering and native Windows comparison remain separate.
The50 new copied-original derived-caller cases and static body/visual-sync audit
are bounded source/component evidence. Matched Wine startup diagnostics progress
past MAIN only after an explicit OS repaint acknowledgement; they show background
allocation with black frames and perturbed timing, not a playable Carl reference.
Earlier checkpoint (2026-11-05): post-skip tilt was still open. User original comparison specifically
identifies skipping Carl; the previous validation covered entry and held movement
on resume, not subsequent idle. A48-case managed port diagnostic isolates stale
mode/turn republishing a bank target in fresh order. New original skip/control/
+11
View File
@@ -373,3 +373,14 @@ assets and generated packages stay excluded.
registry membership. Its successful Wine32 attach is tool validation, while
MAIN-only black frames are not gameplay evidence. Keep runtime/packages fixed
until the source/differential gate closes. See gameplay/jimmy-cutscene-lifecycle.md.
54. **Classify successful TSK story entry as retained-player order.**
Source application startup loads backgroundLevel1D/Jimmy; successful TSK
destination requests use an existing controlled C3DJIMMY and the ordinary
selective teardown/reuse path. The new level game follows that retained node,
including first playable New Game. Program's carriedSave-only test was too
narrow. Include TSK-backed story entry, keep fresh direct-scene simulations,
and preserve rotation/movement algorithms. Baseline first-neutral input
republishes−10° bank; corrected startup order stays upright through300 idle
ticks. Original runtime/native Windows comparison remains distinct. See
gameplay/main-menu-player-lifetime.md.
@@ -0,0 +1,125 @@
# Jimmy body-context alignment and transform publication on return
2026-11-06. Static follow-up to the null-body-context limitation in
[the base/STOP probe](jimmy-base-return.md). Original identity and cached REA
instructions are reused; no new native cases or gameplay changes are claimed.
## Source identity and guard
Canonical Neutron.exe SHA256:
`f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`.
Complete EXE instruction Evidence:
`ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904`.
The read-only `tools/binary/jimmy_body_transform_return.py` verifies that subject,
12 source sites,16 virtual bindings and13 bounded source ranges. Its generated
report contains PE file offsets, hashes and the matching retained REA extracts:
`artifacts/jimmy-body-transform-return/source.json`.
The prior OMT transform Evidence is
`ev_af082632c98b34ccfcedef01466cafa03365e7fbf482496d01a4cda6d2f8f787`.
It is a truncated DLL disassembly prefix, not complete DLL coverage. Existing
transform ranges are present and rechecked against the supplied DLL through
`jimmy_model_bridge.collect`; see [render transform](jimmy-render-transform.md)
for the earlier12 angle and14 hierarchy/final-matrix observations and limitations.
JN-Engine's original class notes supplied field/navigation leads only.
## The live context bridge can write current Euler, behind a separate gate
| Original VA / EXE file offset | Recovered receiver and state effect |
|---|---|
|462520..462649 /62520..62649|Runs before common458930→473240/facing. Requires475CA0, own game210→4719F0(byte13E), and nonnull own game338→472570(pointer234) for the context path.|
|46255D..46258F /6255D..6258F|Reads support polygon's+4 link and linked+80 payload; invokes current game complete130(actor game pointer,linked record,payload,dt). Lab4C3CD0,VR044CE910 and outside4C5A80 all bind130→44E030. The callback occurs **before** the alignment gate.|
|462595..4625A2 /62595..625A2|Own game1E8→471950 reads live byte138. False bypasses normal→Euler publication but still reaches common update/facing. This gate is independent of cached support218 and raw input owner.|
|4625A8..462632 /625A8..62632|For true138, obtains current Euler328→4723F0, copies support normal Vec4 from polygon+8..14, calls476FF0 and writes resulting XYZ through330→472420. This changes **current Euler only**: target274, dirtyA, mode704 and turn614 are not written by this suffix.|
|471080/471090 /71080/71090|Property getterC4 reads byte10. Property setterC8 writes byte10 and invokes live setter1EC.|
|471950/471960 /71950/71960|Live getter1E8/setter1EC read/write byte138. Property10 and live138 are separate fields.|
|47059C..4705A9 /7059C..705A9|Generic Init470540 restores live138 through1EC from propertyC4. It does not infer alignment from landing or input ownership.|
Crucially, the ordinary Player constructor explicitly disables this path:
43729E clears EBX;437332 installs the active Player game table4AF6C4;437426
pushes EBX=0 and437429 calls471090. The active constructor table's1EC resolves
471960, as does the eventual Jimmy table4A373C. Thus both property10 and live138
are set false. The inspected constructor interval contains no intervening EBX
assignment; its callees follow the recovered x86 nonvolatile-register convention.
Subsequent generic Init restores the false property into live138. This is a
positive constructor/Init chain, not an assumption from the old null-context probe.
This does **not** prove no uninspected runtime path ever changes the property.
The previously recovered Carl camera preparation/STOP/DEFAULT boundaries do not
supply such a write. Enabling this surface-alignment path for Jimmy, or using it
as a new cutscene-exit leveling rule, would therefore introduce unsupported state.
The generic normal-angle helper's existing Scooter observations remain separate
from whether Jimmy is eligible to invoke it.
## The supplied static lab terrain takes the ordinary callback path
The authoritative `omt/level1b.omt` SHA256 is
`5a33d11311fc222631eb8f7384d1863192cb1f55f7e67035caa0ae12fd9892ab`.
Using the existing bounded OMT parser and source shape/checkpoint exclusions,
the helper inventories2869 polygons,2851 eligible for static registration.
Among eligible polygons,2526 have texture references with IDs0..30 and325 have
no texture. The report retains counts, shape IDs/names, original payload offsets
and payload hashes. No texture ID is guessed from the port's material index.
44E030 requires both linked record and payload. It reads polygon material+0C,
then the material's texture-definition ID+8; missing material/payload bypasses
the callback's state paths. All identified static-lab IDs0..30 fall below its
first special selector range50..55, so they select ordinary surface sound5 at
44E407. This excludes the callback's higher-numbered lava/ground-hazard branches
for **that supplied static geometry**.
When desired surface sound changes,44E426 invokes Jimmy **complete**1E4→42AEC0.
That method stops/restarts an existing floor-loop handle at completeA44 only if
the prior handle is valid. It writes the new handle, without touching either
Euler vector, mode704 or turn614. This is distinct from game-interface1E4, which
is another field accessor. The ordinary path supplies no movement reset and
does not grant/remove raw control.
This is not a complete runtime collision-world inventory. It does not prove the
provenance of a retained338 context, rule out additional runtime geometry or
dynamic interactions, or execute the full original body/derived Jimmy frame.
The old Bubble floor component investigation already covers this same callback
with explicit synthetic dependencies; another duplicated finite negative probe
would not establish the missing original Carl entry/resume state.
## Transform publication does not conditionally hide the bank
The later473770 pass calls each game interface3DC and3E0, **not3C8**.
Jimmy3C8→4235B0 is the separate supervisor/editor update selected by470280 when
app+8C is set. It must not be described as normal render synchronization.
For Jimmy,3DC→4624B0 copies current logical/body XYZ into complete44/48/4C.
3E0→4624F0→473540 reads current Euler, converts each degree axis to masked
14-bit angle units, then3E4→462500 writes complete50/52/54. These routines do
not test raw control, movement mode, animation name or cutscene state, and do
not replace current or destination Euler. Previously verified OMT hierarchy
construction consumes those cached pitch/yaw/roll angles. The known publication
path therefore provides no scene-return branch that conceals a residual bank.
Whole-world parent transforms, full morph playback and final render flags remain
separate from the already-probed identity-parent/unit-scale contract.
## Result, implementation and remaining observation
The optional body-context bridge contains a real current-Euler writer, but the
ordinary Jimmy constructor/Init disables its alignment gate. The identified
static lab terrain path affects surface audio, not banking state. The normal
logical→visual synchronization publishes current pitch/roll rather than dropping
them. These facts close specific omissions in the composed return explanation;
they do not explain the user's upright whole-original return or justify a new
reset. Keep the existing playable port unchanged until actual original entry,
registry placement and resumed input state are measured.
Integration follow-up: [the menu/player lifetime chain](main-menu-player-lifetime.md)
subsequently establishes retained player-before-input order for successful original
TSK story entry. The resulting correction changes that entry classification; it
does not enable this optional surface-alignment gate or alter visual publication.
Verification is static: source hash/site/binding/range checks, revalidated prior
transform contracts and complete supplied-static-lab polygon inventory. No new
original execution, native Windows comparison, runtime edit or commit is made.
```sh
python3 tools/binary/jimmy_body_transform_return.py ../Original \
--rea artifacts/jimmy-movement-audit/rea-original-disassembly.json \
--output artifacts/jimmy-body-transform-return
```
@@ -1,5 +1,13 @@
# Focused decompilation checkpoint: cutscene lifecycle
Follow-up: the source gate for successful TSK story entry is now closed by
[menu/player lifetime](main-menu-player-lifetime.md). BackgroundJimmy is reused
before the first playable game, making input follow his update. Program's initial
story order is corrected; camera preparation/landing algorithms are unchanged.
First-neutral-tick/300-idle native Vulkan and eight managed trajectories pass.
The investigation below records the earlier open state; whole-original/native
Windows comparison and integrated package validation remain separate.
2026-11-05. User redirects work toward understanding the original before further
implementation. Preserve runtime baseline a2e89c6 and packaged runtime dae13ac.
No src/, regression test, build script, original or packaged binary changes are
@@ -1,5 +1,14 @@
# Carl skip lifecycle: recovered boundaries and the remaining observation
Follow-up: [menu/player lifetime](main-menu-player-lifetime.md) resolves the
successful TSK story entry ordering omitted by this earlier checkpoint. The port
now includes first story entry in retained Jimmy-before-input order. Its baseline
native regression fails on neutral tick0 and passes first input plus300 idle ticks
with the correction. No additional movement/angle reset is introduced.50 derived-
caller source cases and the body/visual-sync audit close other local omissions;
the historical findings below remain scoped to their earlier evidence. Full
original/native Windows gameplay comparison is still unverified.
2026-11-06. Execution of the accepted next-work plan, with the user's requirement
to preserve original behavior exactly. Runtime a2e89c6 and packages dae13ac remain
unchanged. This checkpoint adds evidence and observation tools, not a tilt fix.
+51
View File
@@ -0,0 +1,51 @@
# Derived Jimmy frame around the controller
2026-11-06. This closes a caller-level omission in the earlier component
composition; the lifecycle correction is separately established by
[menu/player lifetime](main-menu-player-lifetime.md).
Canonical EXE SHA256f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8;
retained REA instruction Evidence
`ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904`.
The guard verifies14 source sites,21 virtual bindings,15 ranges and the actual
controller call. Text file offsets below equal preferred VA−400000; the helper
PE-maps them independently.
| Source boundary | Recovered ownership |
|---|---|
|424600..424D10 /24600..24D10|Actual Jimmy game3C4 caller. Null raw control closes/hides helper UI and stops sound handles. It does not itself clear movement mode or stored turn.|
|424721..424751|If the menu exists and shared4F8181 is set, poll menu4A8→403A10. State2 calls menu460; both state2 and other states return before the controller. This lock is distinct from raw ownership.|
|424767 complete208→424D10|Objective/UI helper before the controller. The separate objective presentation does not set modal input gate4F8198; that explicit-modal opener is406F90. See objective-timing.md.|
|424BFC complete1A4→425170|Upward world query/velocity handling. Its falling callback425120 maintains mode1; it is not a grounded resume reset.|
|424C08 complete1A8→4252E0|Downward/shadow-distance query and own helper state.|
|424C2B complete194→42AAC0|Airborne sound cleanup.|
|424C34→437940|Actual ordinary player wrapper. The source ownership/support/input-order conclusions remain here.|
|424C3F complete1C8→424E80|Invisible upkeep, with its own mode gate and ordinary non-Invisible return.|
|424C88 complete1B4→4255C0|Impact/material helper; world-hit dependencies remain separate.|
|424C94 complete1B0→425490|History/position correction. Calls game314→472360 Vec4 **root** setter; this is not an Euler setter.|
`jimmy_derived_frame_probe.c` executes the complete derived caller and ordinary
helpers on private copied source.437940 is a recording adapter, upward/downward
world queries return no hit, and menu/resource/visibility transports are explicit
adapters. Thus these cases test what the caller changes outside its controller,
not another execution of the controller/body/whole game.
All50 cases pass:48 combinations of raw ownerNULL/Jimmy/other, menu lock0/1,
menu state1/2, supported0/1 and rising0/1, plus two180-tick unlocked intervals.
The caller dispatches the controller only while the menu lock is clear; raw
ownership is passed onward rather than becoming another caller-side gate.
Mode1, turn11.666668 and distinct current/destination Euler stay unchanged outside
the recorded controller. Queries and menu-close callbacks have checked counts.
Artifacts: `artifacts/jimmy-derived-frame/native-observations.json` binds generated
source, executable, source contracts, original identity, capture metadata and log
hashes; capture wineExit0 and `JIMMY_DERIVED_FRAME_COMPLETE` are required. Primary
integration reran the parser/guards and verified all50 cases. No full body/world
hits, OMT playback, native Windows or actual original Carl frame is claimed.
```sh
python3 tools/binary/jimmy_derived_frame.py ../Original \
--output artifacts/jimmy-derived-frame/build \
--rea artifacts/jimmy-movement-audit/rea-original-disassembly.json \
--capture artifacts/jimmy-derived-frame/probe
```
+110
View File
@@ -0,0 +1,110 @@
# First story entry inherits the menu's Jimmy registry position
2026-11-06. This closes the missing source lifetime distinction behind the Carl
neutral-return failure. It does not establish a universal rotation reset or a
native Windows/full-original cutscene capture.
## Source and supplied data
Canonical Neutron.exe SHA256
`f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`;
retained REA instruction Evidence
`ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904`.
`tools/binary/main_menu_player_lifetime.py` verifies8 calls,15 sites,15 bindings,
12 instruction spans and both actual GAMs. Coordinates below are preferred VAs;
the helper PE-maps file offsets independently (these text offsets equal VA−400000).
| Boundary | Source fact |
|---|---|
|46A641→46B160;46A660→46A310→44D0E0|Construct application and MAIN. This bounded prefix alone does not create Jimmy.|
|46BA12/46BA18|Application constructor seeds elapsed+804=0 and splash stage+808=0.|
|46BEC0..46C067|Application update increments elapsed. Strict elapsed>3s or an accepted Escape edge advances stages0→1→2→3; the3s float is48E5A0.|
|46BF2F..46C00A|Stage1 advances to2, clears elapsed and dispatches app114(`level1d.gam`) at46C004. This is the previously omitted positive background-load edge.|
|app114→46DFB0;46BEDF;app104→46DFF0|Queues filename+74D with signed callback countdown+7FA=2; underflow sets pending+74C; the application then invokes ordinary selective teardown/load.|
|Level1D GAM|LV1D,54 records, first3JIM/JIM1 at raw8. SHA256276133d750eaa82724b35c12a91fce41a9e074224e3ef12c3624564ae8ed4d9e. Loading the supplied background creates Jimmy before a user story load.|
|46E570..46E67D|After GAM records, the whole surviving registry receives Init28 then PostLoad40C, including retained MAIN; Init is not limited to newly parsed records.|
|MAIN/Level1D game28→44D4E0→4587F0→470540|Common Init restores stored+11 into live+139 through4705B3/4705BC. Both games' stored value is1. MAIN's constructor-default live0 therefore does not imply indefinite retention after background initialization. Their40C is44DF30, a noop call plus own game520=0 store, with no later lifetime reset.|
|404B4F→460E70→460EA0/460EF0→4603F0|The NewGame action queues NewGame.tsk; the reader consumes that request. The request itself does not initialize Jimmy.|
|460A50..460A6A;460BD1|The reader requests a destination GAM only through an existing non-null controlled receiver accepting **C3DJIMMY** at4ECB20. It dispatches Jimmy complete168→43B5A0 with the staged filename/start/root data. The no-Jimmy path does not supply that request.|
|43B5A0→app100/46DF70|Uses the ordinary player scene-transition request. The successful TSK-to-GAM path does not construct a new player before teardown.|
|Jimmy4226B5..BF;42275A|Stored/live teardown predicate0 via470F40(0), reusable game09=1. The initialized old games qualify for removal; Jimmy survives.|
|46E38B/46E45A→46E6A0,46E6E0|Matching reusable3JIM is found in the existing registry. Reuse does not invoke its constructor or re-append its node. The new game header is allocated/appended after that existing node.|
Lab Level1B has129 records and first3JIM/JIM1 at raw8, SHA256
316fff40db565c2add5b07cbccdef640ddb67c64d6625fea1429ce2a0542a234.
The prior [game-lifetime proof](../checkpoint/level-game-lifetime.md) supplies
the initialized-game predicate, destructor unlink and retained-character order.
The earlier fresh game→Jimmy proof remains correct **when no reusable Jimmy
exists**. It was incorrectly applied to the port's first TSK-backed story scene.
## Causal consequence and implementation boundary
A successful original TSK character/destination load requires an existing Jimmy;
the ordinary loader retains him and appends the new game afterward. Thus the
normal New Game story path has **Jimmy update before level-game input**, even
though it is the first playable lab. The background edge explains where that
player comes from; successful-request and retention guards establish the ordering
without treating a black screenshot as proof of the complete New Game sequence.
At Carl completion, grounded/released Jimmy clears mode704/turn614 in437940
before438A60 can select air input. The stale airborne destination is not republished.
This agrees with the already-executed original-component composition and the
user's upright-original observation. No Euler/turn reset is added to control grant,
DEFAULT, landing, task or animation callbacks.
The port previously selected retained input order only when `carriedSave!=null`.
Its initial story also consumes NewGame.tsk, but incorrectly used fresh order.
Correct only that scene-entry classification: TSK-backed story and retained
transitions use player-before-input; direct scene inspection/fresh simulations
keep fresh order. Remaining scalar/helper/lifetime reconstruction stays bounded.
## Runtime evidence and limits
An isolated generated-copy diagnostic observed MAIN followed by Level1D allocation
and a Jimmy registry node. It required a recorded, one-time Win32 ValidateRect
acknowledgement after a pending full-window WM_PAINT. Thread snapshots suspend/
resume owned threads briefly, so timing is perturbed. The supplied HDnoCD and
640×480 NoCD variants have separately authenticated identities; their only mutual
byte differences are the3 resolution-data bytes. Neither is silently equated with
the canonical EXE. These captures show allocation/lifetime progress, not usable
rendering, completed PostLoad, user New Game or Carl playback.
Local artifacts: `artifacts/original-startup-diagnostic/{before-ack,with-ack,long-hd}/`
and `artifacts/main-menu-player-lifetime/source.json`. The baseline port's strengthened
native Vulkan control-phase regression fails on **first neutral tick0**:
inputAfterPlayer=false, current roll360, destination roll−10.000001, mode0/turn0.
This is the exact source-composed stale writer. After the correction, the native
Vulkan fixture stays upright on first resumed input and300 neutral ticks, then
resumes held movement. It preserves heading and locked body/fire/energy updates.
The existing standing/landing/air algorithms are unchanged; airborne return is
still governed by original air input, not an invented blanket leveling rule.
Verification: all336 Python plus2 HUD checks, all managed projects and36
GPU/render passes succeed. Eight new managed trajectories coverLeft/Right,
natural/skip and repeated Carl scenes. Native Linux SDL/Vulkan1920×1080 control
replay and VR04 powered steering/keyboard/800×600 resize pass, zero Vulkan errors.
The first post-return held-input readback is inspected upright. Final Debug build
has zero warnings/errors and Windows x64 cross-publish succeeds. No native Windows
execution or full-original Carl runtime is claimed.
Both self-contained packages identify clean runtime commit ea04210f524faae7dc1caff8afbc608fbb8144f4.
Each contains519 byte-identical original copies,4285 matching prepared scene files
and7 matching prepared audio files. Their runtime DLLs match the corresponding
published outputs. Standalone Linux from /tmp without SDK/development-library
paths passes first input/300 neutral ticks and held-input return; all4 captured
readbacks match development byte-for-byte. Validation is disabled for that
standalone run; the development native run has validation enabled and zero errors.
The optional validation layer needs its development library path; its initial
ErrorLayerNotPresent diagnostic is retained as package-control.log.
The Windows package also passes the32-frame Carl/control fixture under isolated
Wine64 with no Original-directory mount or network, including the neutral-return
assertion and held-input resumption. Wine exit0 is recorded; this remains
preliminary compatibility evidence, not native Windows testing. All539 original
files remain unchanged.
Logs, baseline failure, source contracts, capture hashes, verified-change.json,
package-identity.json and package-verification.json are in
artifacts/main-menu-player-lifetime/. Wine capture metadata/logs are in
artifacts/tsk-entry-windows/. Full original/native Windows comparison remains
separate from this source-supported initialization correction.
@@ -0,0 +1,88 @@
# Original startup: pending repaint and background Jimmy allocation
2026-11-06. This is a local Wine diagnostic, not an untouched timing or visual
reference. Originals remain unmounted in the execution namespace and unchanged.
`tools/recon/original_startup_probe.c` reuses the observer's exact-subject/live
instruction guards and runs only at the generated wrapper directory
`Z:\work\game`. It samples registry/actor state, loaded modules and owned thread
contexts. Each successful SuspendThread is paired with ResumeThread; all recorded
resumes succeed. Stack words are retained as raw candidates, not a full validated
unwind. Suspension perturbs timing. No game code or actor memory is written.
## Repaint observation and controlled test
Two initial main-thread snapshots contain the guarded OMT window-procedure return
100F1ADA and its consistent local message value0F (WM_PAINT), with internal event7.
Read-only GetUpdateRect later reports the entire1024×768 window pending. Original
DLL source100F1330 converts paint to event7 and calls100F7050; its validation of
engine-owned rectangles includes100F70BA→ValidateRect. The message pump
100F11D0..100F129C drains queued messages before returning to the periodical loop.
These bounded facts explain the diagnostic target; they do not prove all startup
time is spent in a single call or that native Windows has the same failure.
`--acknowledge-repaint` makes one ordinary Win32 ValidateRect(window,NULL) call
after the second sample. The operation is explicit in output and changes only
the OS window update region. It is an intervention, so no result is presented as
an untouched original frame/timing trace.
Matched24s tests use the same standard-resolution executable, generated prefix,
sampling tool and no synthetic keyboard input:
| Condition | Observed result |
|---|---|
|No acknowledgement|16 samples through24.35s: MAIN only, no Jimmy.|
|One acknowledgement at3.10s|Pending full-window region acknowledged. By9.18s, current game table4C444C (Level1D), Jimmy table4A373C, with MAIN still in the registry.|
The HD variant also progresses to the same allocation boundary after the recorded
acknowledgement. Both resolutions remain black with sampled gameplay-viewport
delta0 and raw ownerNULL. No usable Carl, completed New Game, completed PostLoad,
or playable-render reference is established. The source trace of
[menu/player lifetime](main-menu-player-lifetime.md) supplies the subsequent
successful-TSK retention proof; these captures establish the previously unseen
background allocation, not that complete later route.
## Subject and code identity
HDnoCD SHA2568cd5d21997835a40978b8b83e344c97c92217bf6cd6858f7458b76935d64dedb,
standard NoCD SHA2565e1d3bed2d649d16ec62ead02514119a16590380d4d5a6a73103db900a15c62e.
Their only mutual byte differences are resolution-data offsetsF655E,F655F,F6561:
standard640×480 versus HD1920×1080, both16-bit. The Xvfb desktop is1024×768.
This difference prompted the controlled standard-resolution check; switching
resolution alone is not claimed to repair rendering. Neither variant is assumed
equivalent to canonical Neutron.exe.
Standard-subject REA file-header Evidence:
`ev_62814154b8ddc13d5db3c1150082b91f0f7bf1eaccf1bca208b36671a7a1bd81`.
HDnoCD complete instruction Evidence:
`ev_23555fac476985c913a80805a12b25c26c25347c6e8210ee188471dd815c276d`.
Relevant OMT instructions come from retained DLL Evidence
`ev_af082632c98b34ccfcedef01466cafa03365e7fbf482496d01a4cda6d2f8f787`;
that saved disassembly is a prefix, not complete DLL coverage. The relevant
window/message ranges are present. Original file identity is independently
checked by the project inventory and PE mapping.
Artifacts under `artifacts/original-startup-diagnostic/` retain each probe binary,
capture identity, stdout, screenshots, module/stack/state samples and final
standard probe/dependency source. `standard/` is the acknowledged matched run;
`standard-no-ack/` is the control. All actual live anchors pass. Successful capture
requires process exit0 and `ORIGINAL_STARTUP_DIAGNOSTIC_COMPLETE`.
## Reproduction
Build against the source observer in the same tools directory. Reuse only the
existing generated game copy/prefix; never use an original directory as output.
```sh
i686-w64-mingw32-gcc -std=c11 -O2 -Wall -Wextra -Werror \
tools/recon/original_startup_probe.c -lbcrypt -o artifacts/startup-probe.exe
python3 tools/recon/reference_capture.py --asset-probe \
--probe-executable artifacts/startup-probe.exe \
--probe-model=--standard-resolution --probe-arg=--seconds=24 \
--probe-arg=--acknowledge-repaint \
--probe-success ORIGINAL_STARTUP_DIAGNOSTIC_COMPLETE --seconds 30 \
--output artifacts/jimmy-skip-original-sw
```
Omit the acknowledgement argument for the control. Keep each capture in a
separate generated directory or preserve its logs/identity before another run.
+10
View File
@@ -59,6 +59,16 @@ The supplied HD resolution variant preserves the observed operands. The HDnoCD
profile is independently identified; its observation is not automatically a
canonical-original behavior claim. Other supplied variants are rejected.
2026-11-06 follow-up: the supplied standard-resolution NoCD image is now a fourth
exact profile, SHA256
`5e1d3bed2d649d16ec62ead02514119a16590380d4d5a6a73103db900a15c62e`.
Its eight live global operands match the HDnoCD profile; independent source checks
verify32 anchors across four subjects. The two NoCD images differ only at three
resolution bytes; canonical-equivalence is still not assumed. Source checks are
in artifacts/original-state-observer/profiles-4.json. Standard-subject REA Evidence
and perturbed startup observations are in
[the startup diagnostic](original-startup-diagnostic.md).
Each global address is independently guarded by its actual live instruction
operand before sampling. Runtime inspection is refused if those anchors do not
match within5s. This avoids assuming that the other variant has identical data
+40 -1
View File
@@ -7,7 +7,46 @@ Next-work plan: [recover interactions, then implement verified changes](checkpoi
It defines the Carl source/differential gate, the bounded implementation step,
movement/contact/animation recovery and the end-to-end platform checkpoint.
## Carl lifecycle investigation and original-state observer
## Carl neutral return: TSK startup lifetime correction
[Menu/player lifetime](gameplay/main-menu-player-lifetime.md) closes the missing
ordering distinction: the original initializes a backgroundLevel1D/Jimmy before
a successful TSK story load. The loader retains Jimmy and appends the new level
game later. First playable story entry therefore uses player-before-input, just
like subsequent retained transitions. Fresh direct-GAM order remains separate.
Program previously used that order only when carriedSave was non-null. The
correction includes TSK-backed story entry and adds no movement/Euler reset.
The strengthened Vulkan control-phase replay fails on baseline neutral tick0
(destination roll−10.000001), then passes first input plus300 idle ticks after
the correction, preserving heading and held-input/body/fire continuation.
Eight managed trajectories coverLeft/Right, natural/skip and repeated scenes.
All336 Python+2 HUD, managed projects and36 GPU/render passes succeed. Native Linux
SDL/Vulkan1920×1080 control replay and VR04 powered keyboard/steering/resize pass
with zero validation errors; the first returned-frame readback is inspected upright.
Final build has zero warnings/errors; Windows x64 cross-publish passes. Source/
test provenance is in artifacts/main-menu-player-lifetime/verified-change.json.
Both packages identify clean runtime commit ea04210; each has519 byte-identical
original copies,4285 matching prepared scene files and7 matching prepared audio
files. Standalone Linux from /tmp, without SDK/development-library paths, passes
the Carl neutral-return replay with all4 readbacks identical to development.
That standalone run disables validation; the development run enables it and
reports zero errors. The optional validation layer cannot load without its
development library path (ErrorLayerNotPresent, retained diagnostic).
The Windows package passes the same32-frame control replay under isolated
Wine64, including first input/300 idle ticks and held-input return. Wine is
preliminary compatibility evidence. Native Windows/original Carl execution stays
unverified. All539 originals remain unchanged. Package identities and verification
are in artifacts/main-menu-player-lifetime/package-{identity,verification}.json.
The additional derived-frame caller50 native cases and static body/visual-sync
audit close their bounded omissions. A matched original-resolution Wine startup
diagnostic progresses to backgroundJimmy allocation only after the recorded
repaint acknowledgement; frames remain black. See
[startup observations](gameplay/original-startup-diagnostic.md). These are
perturbed allocation observations, not full original Carl or Windows fidelity.
## Earlier Carl lifecycle investigation and original-state observer
The accepted plan is underway; its gameplay correction gate remains open.
[Integrated lifecycle trace](gameplay/jimmy-cutscene-lifecycle.md) records292 new
+26 -5
View File
@@ -48,6 +48,24 @@ compile, runtime and original-fidelity verification are separate.
Execution order and acceptance criteria: [next work plan](checkpoint/next-work-plan.md).
- [x] Close the first-story ordering distinction through original menu background,
controlled-Jimmy TSK request, ordinary selective teardown and registry reuse.
See gameplay/main-menu-player-lifetime.md. Preserve conditional fresh-GAM order.
- [x] Correct TSK story-entry order; native Vulkan regression fails on baseline
tick0 and passes first neutral input plus300 idle ticks after the change.
Eight managed Left/Right/natural/skip/repeated-scene cases pass.
- [x] Verify50 additional derived Jimmy caller cases and audit body-context/
surface-alignment/visual-sync ownership without inventing an angle reset.
- [x] Complete integrated suite:336 Python+2 HUD, all managed projects and36
GPU/render passes; native Linux SDL control/VR04 input-steering-resize and
Windows x64 cross-publish pass. No native Windows execution is inferred.
- [x] Build clean ea04210 Linux/Windows packages; verify519 original copies,
4285 scene files and7 audio files per platform. Standalone Linux from /tmp
passes with4 identical readbacks; isolated Wine64 passes the Carl control
replay. Native Windows and original-game comparisons remain separate.
- [ ] Obtain native Windows/whole-original Carl feedback for that same scenario;
local Wine allocation diagnostics remain visually unusable.
- [x] Expand original lifecycle coverage:96 Carl contact,8 composed input/
controller/skip-prefix,48 task/objective and140 base/STOP cases; recover complete
DEFAULT pseudocode through a mapped carrier. See gameplay/jimmy-cutscene-lifecycle.md.
@@ -57,12 +75,15 @@ Execution order and acceptance criteria: [next work plan](checkpoint/next-work-p
- [ ] Capture the actual original Carl banked-entry/skip/neutral-return interval.
Local Wine reaches MAIN with black frames and no Jimmy; the composed original
routines do not establish a reset. Use the observer on a working copied original
before changing gameplay. Preserve ordinary landing bank.
for the remaining full-runtime comparison. The separately recovered TSK lifetime
now supports the bounded startup-order correction. Preserve ordinary landing bank.
- [ ] Current user direction: decompile the complete Carl skip-to-idle state
lifecycle before further gameplay implementation. Preserve a2e89c6/dae13ac.
Close original support/mode/turn/input/skip ownership and same-frame ordering;
see gameplay/jimmy-cutscene-decompilation.md.
- [x] Current user direction: decompile the Carl skip-to-idle state
lifecycle before further gameplay implementation. Baseline a2e89c6/dae13ac was
preserved through that research checkpoint.
Establish the missing source ordering before implementation. The successful TSK
entry chain now closes that bounded gate; full original runtime comparison and
broader core reconstruction stay open. See gameplay/main-menu-player-lifetime.md.
- [x] Reproduce the remaining post-skip bug with48 managed port traces: all24
fresh-order cases retilt, all24 retained-order cases stay upright. This is
diagnostic evidence, not a source-justified scheduling or reset correction.
@@ -0,0 +1,32 @@
using GamePort.Game;
namespace GamePort.Application;
/// <summary>Exercise grounded neutral input after skipping the real Carl chain.
/// Kept separate from the held-input check, which cannot detect stale bank.</summary>
internal static class CutsceneIdleSmoke
{
public static void LandWhileLocked(PlayerSceneBinding binding, SceneDirector director, LabSimulation player)
{
for (var tick = 0; tick < 180; tick++) binding.Step(default);
if (director.Controlled || !player.Grounded || player.MovementMode != 1 || player.TurnRate == 0)
throw new InvalidOperationException("Carl idle fixture did not retain airborne mode/turn through an uncontrolled landing");
}
public static void VerifyReturn(PlayerSceneBinding binding, SceneDirector director, LabSimulation player)
{
var yaw = player.Yaw;
for (var tick = 0; tick < 300; tick++)
{
binding.Step(default);
if (!director.Controlled || player.MovementMode != 0 || player.TurnRate != 0
|| MathF.Abs(MathF.IEEERemainder(player.Pitch, 360)) > .001f
|| MathF.Abs(MathF.IEEERemainder(player.Roll, 360)) > .001f
|| MathF.Abs(MathF.IEEERemainder(player.Yaw - yaw, 360)) > .001f
|| MathF.Abs(player.FacingTarget.X) > .001f || MathF.Abs(player.FacingTarget.Z) > .001f)
throw new InvalidOperationException($"Carl neutral return republished airborne bank on tick{tick}: "
+ $"inputAfterPlayer={player.InputAfterPlayerUpdate}, Euler={player.Rotation}, target={player.FacingTarget}, mode={player.MovementMode}, turn={player.TurnRate}");
}
Console.WriteLine("Carl neutral return: upright on first resumed input and300 idle ticks; heading preserved.");
}
}
+10 -1
View File
@@ -362,7 +362,10 @@ internal static class Program
cameraRay == null ? null : (look, eye) => cameraRay.Trace(look, eye),
cameraRay == null ? null : (start, end) => cameraRay.TraceGeometry(start, end),
level.Code is "VR01" or "VR02" or "VR04" or "VR07" or "VR08" ? OriginalStaticCollision.FromRouteScene(world,level.Code) : null, energy)
{ LevelCode = level.Code, InputAfterPlayerUpdate = carriedSave != null };
//Successful TSK entry reuses the menu-background Jimmy, whose
//node precedes the new level game. Direct scene inspection
//still has fresh game-before-player order. See main-menu-player-lifetime.md.
{ LevelCode = level.Code, InputAfterPlayerUpdate = story || carriedSave != null };
if(level.Code=="VR08")simulation.EnableGrappler(world,grapplerMemory);
if (carriedPlayer != null)
{
@@ -1502,6 +1505,8 @@ internal static class Program
count++;
if (controlPhaseSmoke && (count == 1 || count == 15) && Option(args, "--screenshot") is { } phaseCapture)
renderer.SavePpm(Path.ChangeExtension(phaseCapture, count == 1 ? ".locked-start.ppm" : ".locked-fall.ppm"));
if (controlPhaseSmoke && count == 16 && Option(args, "--screenshot") is { } returnCapture)
renderer.SavePpm(Path.ChangeExtension(returnCapture, ".returned.ppm"));
if (controlPhaseSmoke && count == 15)
{
phasesLocked = director is { Controlled: false, Playing: true }
@@ -1511,7 +1516,11 @@ internal static class Program
&& simulation.Rotation == controlRotation && simulation.FacingTarget == controlRotation && !simulation.FacingDirty
&& simulation.ActorRoot.Y < controlEntry.Y && simulation.JetpackRemaining is > 0 and < 6.125f
&& simulation.Energy < 20 && Vector2.Distance(new(simulation.ActorRoot.X, simulation.ActorRoot.Z), new(controlEntry.X, controlEntry.Z)) < .001f;
CutsceneIdleSmoke.LandWhileLocked(playerBinding!, director!, simulation!);
sceneAudio?.StopSpeech();
director!.Skip();
CutsceneIdleSmoke.VerifyReturn(playerBinding!, director, simulation!);
controlControllers = simulation!.ControllerSteps;
}
if (controlPhaseSmoke && count == 30)
phasesResumed = director!.Controlled && simulation!.ControllerSteps == controlControllers + 15 && simulation.Travel > 1;
+46
View File
@@ -242,6 +242,52 @@ foreach (var kind in new[] { "3CAM", "3MCA" })
}
Console.WriteLine("PASS CAM and original Carl MCA banked-jump preparation, destination yaw/dirty ownership and sustained control lock");
foreach (var left in new[] { false, true })
foreach (var skipPlayback in new[] { false, true })
{
var scene = new SceneDirector(level, new TaskStates(save.Tasks), (_, _) => 2);
var body = ControlBody();
//Normal TSK story entry retains the background Jimmy before the new game.
//The application's control-phase smoke separately checks this entry wiring.
body.InputAfterPlayerUpdate = true;
using var binding = new PlayerSceneBinding(scene, body, new SceneInventory(new int[19]), "JIM1");
for (var carlCycle = 0; carlCycle < 2; carlCycle++)
{
for (var tick = 0; tick < 8; tick++) binding.Step(new(true, false, left, !left, true));
Check(!body.Grounded && body.MovementMode == 1 && body.TurnRate != 0,
"Neutral return starts with a banked jump on either turn direction");
scene.SyncActor("JIM1", body.ActorRoot, body.Rotation);
scene.Trigger("neutron1a");
for (var tick = 0; tick < 180; tick++)
{
binding.Step(default);
scene.Step(FixedStepClock.Step);
}
Check(body.Grounded && !scene.Controlled && body.MovementMode == 1 && body.TurnRate != 0,
"Uncontrolled landing retains mode and stored turn before Carl finishes");
var yaw = body.Yaw;
if (skipPlayback) scene.Skip();
else
{
for (var tick = 0; scene.Playing && tick < 1200; tick++)
{
binding.Step(default);
scene.Step(FixedStepClock.Step);
}
}
Check(scene.Controlled && !scene.Playing, "Carl completes naturally or through skip");
for (var tick = 0; tick < 300; tick++)
{
binding.Step(default);
Near(body.Rotation, new(0, yaw, 0), "First and sustained neutral return stay upright with heading preserved");
Near(body.FacingTarget, new(0, yaw, 0), "Neutral return never republishes airborne bank");
Check(body.MovementMode == 0 && body.TurnRate == 0,
"Original grounded controller clears movement state before resumed input");
}
}
}
Console.WriteLine("PASS eight Carl neutral-return trajectories: Left/Right, natural/skip, repeated scenes and first resumed input");
using (var reference = JsonDocument.Parse(File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "original-camera-rotation-reference.json"))))
{
var cases = 0;
+140
View File
@@ -0,0 +1,140 @@
#!/usr/bin/env python3
"""Guard the original body-context/normal-alignment and visual-sync boundary.
Reads authoritative files and existing REA Evidence. The generated report is
static evidence, not original gameplay or a new component execution.
"""
import argparse
from collections import Counter
import hashlib
import json
from pathlib import Path
import re
import struct
from bubble_body import geometry
from checkpoint_script_state import EXE_SHA256, find_case, read_va, rel_call_target
from jimmy_model_bridge import collect as transform_contract
from pe_inspect import PE
REA_ID = 'ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904'
DLL_REA_ID = 'ev_af082632c98b34ccfcedef01466cafa03365e7fbf482496d01a4cda6d2f8f787'
LAB_SHA = '5a33d11311fc222631eb8f7384d1863192cb1f55f7e67035caa0ae12fd9892ab'
SLOTS = (
('Player active constructor alignment setter', 0x4af6c4, 0x1ec, 0x471960),
('Jimmy property getter', 0x4a373c, 0xc4, 0x471080),
('Jimmy property setter', 0x4a373c, 0xc8, 0x471090),
('Jimmy alignment getter', 0x4a373c, 0x1e8, 0x471950),
('Jimmy alignment setter', 0x4a373c, 0x1ec, 0x471960),
('Jimmy eligible getter', 0x4a373c, 0x210, 0x4719f0),
('Jimmy context getter', 0x4a373c, 0x338, 0x472570),
('Jimmy current Euler getter', 0x4a373c, 0x328, 0x4723f0),
('Jimmy current Euler setter', 0x4a373c, 0x330, 0x472420),
('Jimmy position publication', 0x4a373c, 0x3dc, 0x4624b0),
('Jimmy Euler publication', 0x4a373c, 0x3e0, 0x4624f0),
('Jimmy cached render angle setter', 0x4a373c, 0x3e4, 0x462500),
('Lab terrain callback', 0x4c3cd0, 0x130, 0x44e030),
('VR04 terrain callback', 0x4ce910, 0x130, 0x44e030),
('Outside terrain callback', 0x4c5a80, 0x130, 0x44e030),
('Jimmy floor-loop retarget', 0x4a3bdc, 0x1e4, 0x42aec0),
)
SITES = (
('Player constructor clears argument register', 0x43729e, '33db'),
('Player installs constructor game table', 0x437332, 'c706c4f64a00'),
('player disables alignment property', 0x437426, '538bcee8629c0300'),
('property setter mirrors to live field', 0x471090, '8b4424048b1150884110ff92ec010000c20400'),
('Init restores live alignment from property', 0x47059c, '8b3e8bceff97c4000000508bceff97ec010000'),
('alignment live getter', 0x471950, '8a8138010000c3'),
('alignment live setter', 0x471960, '8a442404888138010000c20400'),
('body callback precedes alignment gate', 0x46258f, 'ff95300100008b168bceff92e8010000'),
('alignment write current XYZ', 0x462630, '8bceff9230030000'),
('visual position before angle', 0x473784, 'ff90dc0300008b168bceff92e0030000'),
('default terrain sound selector', 0x44e407, 'c7824c05000005000000'),
('floor-loop retarget call', 0x44e426, 'ff92e4010000'),
)
RANGES = (
('body-context bridge', 0x462520, 0x462649),
('Player constructor alignment initialization', 0x43729e, 0x43743e),
('generic property initialization', 0x470540, 0x470610),
('property getter and setter', 0x471080, 0x4710a3),
('live alignment getter and setter', 0x471950, 0x47196d),
('context getter', 0x472570, 0x472577),
('current Euler setter', 0x472420, 0x472450),
('terrain callback', 0x44e030, 0x44e444),
('floor-loop retarget', 0x42aec0, 0x42aef1),
('position publication', 0x4624b0, 0x4624f0),
('angle publication forwarding and setter', 0x4624f0, 0x46251e),
('angle conversion', 0x473540, 0x4735da),
('whole-registry transform publication', 0x473770, 0x4737a2),
)
def collect(original, rea):
original = Path(original)
pe = PE(find_case(original, 'Neutron.exe'))
if hashlib.sha256(pe.data).hexdigest() != EXE_SHA256:
raise ValueError('Unexpected original EXE')
evidence = next(r for r in json.loads(Path(rea).read_text())['records']
if r['evidence_id'] == REA_ID)
if evidence['subject']['digest']['sha256'] != EXE_SHA256:
raise ValueError('Wrong REA subject')
sites, slots = [], []
for name, va, expected in SITES:
actual = read_va(pe, va, len(bytes.fromhex(expected))).hex()
if actual != expected:
raise ValueError(f'Changed {name} at {va:#x}: {actual}')
sites.append(dict(name=name, va=hex(va), file_offset=hex(pe.offset(va-pe.base)), bytes=actual))
for name, table, slot, expected in SLOTS:
actual, = struct.unpack('<I', read_va(pe, table+slot, 4))
if actual != expected:
raise ValueError(f'Changed {name} binding')
slots.append(dict(name=name, table=hex(table), slot=hex(slot), target=hex(actual),
file_offset=hex(pe.offset(table+slot-pe.base))))
if rel_call_target(pe, 0x437429) != 0x471090:
raise ValueError('Changed player property initialization')
rows = []
for line in evidence['raw_result']['stdout'].splitlines():
match = re.match(r'\s*([0-9a-f]+):', line)
if match:
rows.append((int(match[1], 16), line))
extracts = {name: '\n'.join(line for va, line in rows if a <= va < b)+'\n'
for name, a, b in RANGES}
if any(not value.strip() for value in extracts.values()):
raise ValueError('Missing retained REA source range')
lab = geometry(original, 'level1b.omt')
if lab['sha256'] != LAB_SHA:
raise ValueError('Changed lab geometry')
ids = Counter(p['texture']['id'] if p['texture'] else None
for p in lab['polygons'] if p['registered'])
if any(value is not None and not 0 <= value <= 30 for value in ids):
raise ValueError('Static lab texture identity outside ordinary terrain branch')
transforms = transform_contract(original)
return dict(source_sha256=EXE_SHA256, rea_evidence_id=REA_ID,
prior_dll_rea_evidence_id=DLL_REA_ID, sites=sites, slots=slots,
ranges=[dict(name=name, va=hex(a), file_offset=hex(pe.offset(a-pe.base)),
length=b-a, sha256=hashlib.sha256(read_va(pe, a, b-a)).hexdigest())
for name, a, b in RANGES], rea_extracts=extracts,
static_lab=dict(source='omt/level1b.omt', sha256=lab['sha256'],
polygons=lab['polygon_count'], eligible=lab['registered'],
texture_counts={str(key) if key is not None else 'missing': value
for key, value in ids.items()},
shapes=lab['shapes']),
prior_transform_contract=transforms,
scope='Static known body/context/visual-publication closure, not a whole original frame or new native probe.')
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('original', type=Path)
parser.add_argument('--rea', required=True, type=Path)
parser.add_argument('--output', required=True, type=Path)
args = parser.parse_args()
original, output = args.original.resolve(), args.output.resolve()
if output.is_relative_to(original) or original.is_relative_to(output):
raise ValueError('Output must be separate from originals')
report = collect(original, args.rea)
output.mkdir(parents=True, exist_ok=True)
(output/'source.json').write_text(json.dumps(report, indent=2)+'\n')
print(json.dumps(dict(sites=len(report['sites']), slots=len(report['slots']),
ranges=len(report['ranges']), static_lab=report['static_lab']['texture_counts'],
scope=report['scope']), indent=2))
+153
View File
@@ -0,0 +1,153 @@
#!/usr/bin/env python3
"""Guard the original derived Jimmy frame and prepare a bounded caller probe."""
import argparse
import hashlib
import json
from pathlib import Path
import re
import struct
import subprocess
from checkpoint_script_state import EXE_SHA256, find_case, read_va, rel_call_target
from pe_inspect import PE
REA_ID = 'ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904'
RANGES = (
(0x424600, 0x425110), (0x425120, 0x42516f),
(0x425170, 0x425488), (0x425490, 0x4255b4),
(0x4255c0, 0x425862), (0x42aac0, 0x42aaf2),
(0x409f60, 0x409f80), (0x458960, 0x458985),
(0x471a10, 0x471a18), (0x471b40, 0x471b4d),
(0x471f10, 0x471f3a), (0x472300, 0x47232a),
(0x403a10, 0x403a18), (0x403700, 0x403723),
(0x406590, 0x406645),
)
SLOTS = (
(0x4a3bdc, 0x208, 0x424d10), (0x4a3bdc, 0x1a4, 0x425170),
(0x4a3bdc, 0x1a8, 0x4252e0), (0x4a3bdc, 0x194, 0x42aac0),
(0x4a3bdc, 0x1c8, 0x424e80), (0x4a3bdc, 0x1b4, 0x4255c0),
(0x4a3bdc, 0x1b0, 0x425490), (0x4a3bdc, 0x1e0, 0x425120),
(0x4a373c, 0x218, 0x458960), (0x4a373c, 0x264, 0x471b40),
(0x4a373c, 0x2bc, 0x471f10), (0x4a373c, 0x310, 0x472300),
(0x4a373c, 0x314, 0x472360), (0x4a373c, 0x318, 0x472330),
(0x4a373c, 0x2c0, 0x471f70), (0x4a3bdc, 0xfc, 0x40dd40),
(0x4a3bdc, 0x114, 0x40e4a0), (0x48d414, 0x4a8, 0x403a10),
(0x48d414, 0x4c4, 0x406590), (0x48d414, 0x488, 0x403700),
(0x48d414, 0x460, 0x4033f0),
)
SITES = (
(0x424721, 'a081814f00', 'menu lock load'),
(0x424732, '663d0200', 'menu state2 comparison'),
(0x424736, '0f85ca050000', 'locked other state returns'),
(0x424744, 'ff9060040000', 'locked state2 menu callback'),
(0x424767, 'ff9208020000', 'objective helper before controller'),
(0x424bfc, 'ff92a4010000', 'rising helper before controller'),
(0x424c08, 'ff90a8010000', 'shadow helper before controller'),
(0x424c2b, 'ff9094010000', 'airborne sound cleanup'),
(0x424c3f, 'ff92c8010000', 'post-controller Invisible helper'),
(0x424c88, 'ff92b4010000', 'post-controller impact helper'),
(0x424c94, 'ff90b0010000', 'post-controller root history helper'),
(0x425521, 'ff9214030000', 'history root setter'),
(0x425142, '668986c4070000', 'ceiling fall mode remains1'),
(0x424ea6, '0f8564020000', 'non-Invisible upkeep return'),
)
def generate(original, output, rea):
original, output = Path(original).resolve(), Path(output).resolve()
if output.is_relative_to(original) or original.is_relative_to(output):
raise ValueError('Output must be separate from originals')
pe = PE(find_case(original, 'Neutron.exe'))
if hashlib.sha256(pe.data).hexdigest() != EXE_SHA256:
raise ValueError('Unexpected source EXE')
record = next(r for r in json.loads(Path(rea).read_text())['records']
if r['evidence_id'] == REA_ID)
if record['subject']['digest']['sha256'] != EXE_SHA256:
raise ValueError('REA subject identity mismatch')
for table, slot, target in SLOTS:
if struct.unpack('<I', read_va(pe, table+slot, 4))[0] != target:
raise ValueError(f'Virtual binding {table:#x}+{slot:#x}')
for address, expected, name in SITES:
if read_va(pe, address, len(bytes.fromhex(expected))).hex() != expected:
raise ValueError(name)
if rel_call_target(pe, 0x424c34) != 0x437940:
raise ValueError('Controller direct call')
rows = []
for line in record['raw_result']['stdout'].splitlines():
match = re.match(r'\s*([0-9a-f]+):', line)
if match:
rows.append((int(match[1], 16), line))
targets, excerpts = set(), {}
for a, b in RANGES:
excerpts[hex(a)] = '\n'.join(line for va, line in rows if a <= va < b)+'\n'
if not excerpts[hex(a)].strip():
raise ValueError('Missing retained REA range')
asm = subprocess.run(['objdump', '-d', '-Mintel', f'--start-address={a}',
f'--stop-address={b}', str(pe.path)],
capture_output=True, text=True, check=True).stdout
targets.update(int(v, 16) for v in re.findall(r'ds:0x([0-9a-f]+)', asm))
targets.update(int(v, 16) for v in re.findall(r'(?:push|mov\s+\w+,)\s*0x([0-9a-f]+)', asm)
if 0x48d000 <= int(v, 16) < 0x699000)
output.mkdir(parents=True, exist_ok=True)
source = Path(__file__).with_name('jimmy_derived_frame_probe.c').read_text()
source = source.replace('/* RELOCATIONS */', ','.join(hex(v) for v in sorted(targets)))
source = source.replace('/* RANGES */', ','.join('{'+hex(a)+','+hex(b)+'}' for a,b in RANGES))
(output/'jimmy_derived_frame_probe.c').write_text(source)
(output/'grappler_scalar_probe.c').write_text(Path(__file__).with_name('grappler_scalar_probe.c').read_text())
result = dict(source_sha256=EXE_SHA256, rea_evidence_id=REA_ID,
slots=[dict(table=hex(t), slot=hex(s), target=hex(v), file_offset=hex(pe.offset(t+s-pe.base)))
for t,s,v in SLOTS],
sites=[dict(va=hex(a), file_offset=hex(pe.offset(a-pe.base)), bytes=e, name=n) for a,e,n in SITES],
controller_call=dict(va='0x424c34', target='0x437940'),
ranges=[dict(va=hex(a), file_offset=hex(pe.offset(a-pe.base)), length=b-a,
sha256=hashlib.sha256(read_va(pe,a,b-a)).hexdigest()) for a,b in RANGES],
relocations=[hex(v) for v in sorted(targets)], rea_extracts=excerpts,
scope='Derived caller with recorded controller and no-hit queries; no whole physics/gameplay.')
(output/'source.json').write_text(json.dumps(result, indent=2)+'\n')
return result
def observe(output, capture):
output, capture = Path(output), Path(capture)
if json.loads((capture/'capture.json').read_text())['captures'][-1]['wineExit'] != 0:
raise ValueError('Probe exit was not zero')
log = (capture/'wine.log').read_text()
if 'JIMMY_DERIVED_FRAME_COMPLETE' not in log or 'DERIVED_FRAME_CASES 50' not in log:
raise ValueError('Missing full completion marker')
cases = [dict(word.split('=',1) for word in line.split()[1:])
for line in log.splitlines() if line.startswith('FRAME_CASE ')]
if len(cases) != 50:
raise ValueError('Incomplete frame matrix')
for row in cases:
ticks, lock, state, rising = (int(row[k]) for k in ('ticks','lock','state','rising'))
ran = 0 if lock else ticks
if int(row['controllers']) != ran or int(row['up']) != (ran if rising else 0) or int(row['down']) != ran:
raise ValueError('Controller/query dispatch')
if int(row['closed']) != (ticks if lock and state==2 else 0):
raise ValueError('Menu transition dispatch')
if row['mode'] != '1' or abs(float(row['turn'])-11.666668)>1e-6:
raise ValueError('Movement state changed outside controller')
if row['current'] != '13,155,17' or row['target'] != '-40,154,-12':
raise ValueError('Euler changed outside controller')
paths = [output/'probe.exe', output/'jimmy_derived_frame_probe.c', output/'source.json',
capture/'wine.log', capture/'capture.json', capture/'game/Neutron.exe']
if hashlib.sha256(paths[-1].read_bytes()).hexdigest() != EXE_SHA256:
raise ValueError('Executed mapped source copy identity')
result = dict(cases=cases, source_sha256=EXE_SHA256, rea_evidence_id=REA_ID,
provenance={str(p):hashlib.sha256(p.read_bytes()).hexdigest() for p in paths},
scope='50 derived-caller cases; recorded controller, no-hit world queries and UI adapters.')
(output.parent/'native-observations.json').write_text(json.dumps(result, indent=2)+'\n')
return dict(cases=len(cases), wine_exit=0)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('original', type=Path)
parser.add_argument('--output', type=Path, required=True)
parser.add_argument('--rea', type=Path, required=True)
parser.add_argument('--capture', type=Path)
args = parser.parse_args()
result = generate(args.original, args.output, args.rea)
if args.capture:
result['observations'] = observe(args.output, args.capture)
print(json.dumps({k:v for k,v in result.items() if k != 'rea_extracts'}, indent=2))
+93
View File
@@ -0,0 +1,93 @@
/* Actual derived424600 and its ordinary pre/post helpers. The controller437940
is a recording adapter: this isolates caller-owned writes/gates, not physics.
World queries return no hit; UI visibility/menu transitions are adapters. */
#define main unused_scalar_main
#include "grappler_scalar_probe.c"
#undef main
static uintptr_t game_table[0x450/4], complete_table[0x220/4];
static uintptr_t menu_table[0x500/4], helper_table[0x60/4];
static unsigned char menu_object[0x600], helper[0x100], current_game[0x600];
static int controllers, upward_queries, downward_queries, closed, hidden;
#define GF(o) (*(float*)(object+0xc0+(o)))
#define MODE (*(short*)(object+0x7c4))
static void fix(uint32_t a, uint32_t b) {
const uint32_t targets[]={/* RELOCATIONS */};
for(;a+4<=b;a++) {
uint32_t v;memcpy(&v,AT(a),4);
for(unsigned i=0;i<sizeof(targets)/sizeof(targets[0]);i++)if(v==targets[i]) {
v=(uintptr_t)AT(v);memcpy(AT(a),&v,4);a+=3;break;
}
}
}
static LONG CALLBACK exception(EXCEPTION_POINTERS*e) {
fprintf(stderr,"PROBE_EXCEPTION source=%lx code=%lx fault=%lx\n",e->ContextRecord->Eip-(uintptr_t)mapped+0x400000,e->ExceptionRecord->ExceptionCode,e->ExceptionRecord->ExceptionInformation[1]);
ExitProcess(2);return EXCEPTION_CONTINUE_SEARCH;
}
static void TC controller(void*self,float dt) {
require(self==object+0xc0&&dt==1.f/60,"controller owner/delta");controllers++;
}
static void TC close_menu(void*self) {require(self==menu_object,"menu owner");closed++;}
static void TC visibility(void*self,int value) {require(self==helper&&value==1,"helper visibility owner");hidden++;}
static int no_up_hit(void) {upward_queries++;return 0;}
static int no_down_hit(void) {downward_queries++;return 0;}
static void draw(void) {require(0,"unexpected HUD draw in ordinary fixture");}
static void one(int owner,int lock,int state,int supported,int rising,int ticks) {
memset(object,0,sizeof(object));memset(menu_object,0,sizeof(menu_object));
*(void**)object=complete_table;*(void**)(object+0xc0)=game_table;
*(void**)menu_object=menu_table;*(short*)(menu_object+0x4d4)=(short)state;
/* Menu layout0 makes actual406590 a no-op; resources are not synthesized. */
*(void**)(object+0xa18)=menu_object;
*(void**)(object+0xc0+0x1d94)=helper+0xc0;
*(void**)helper=helper_table;
*(void**)AT(0x509948)=current_game;*(uint32_t*)(current_game+0x490)=0x4c563142;
*(void**)AT(0x5099e4)=owner==0?NULL:owner==1?object+0xc0:helper+0xc0;
*AT(0x4f8181)=(unsigned char)lock;*AT(0x509a12)=0;*AT(0x4f8210)=0;
*(short*)AT(0x4f0588)=-1;F(0x4eefc8)=F(0x4eefd0)=-1;
F(0x4f83d4)=100;F(0x4f83c8)=0;F(0x4f8408)=0;
*(void**)AT(0x4f7cb0)=*(void**)AT(0x4f8028)=NULL;
*(int*)(object+0xc0+0x974)=*(int*)(object+0xc0+0x97c)=-1;
*(int*)(object+0x1e08)=-1;
object[0xc0+0x13f]=(unsigned char)supported;object[0xc0+0x1d41]=1;
GF(0x214)=10;GF(0x218)=20;GF(0x21c)=30;GF(0x220)=1;
GF(0x224)=13;GF(0x228)=155;GF(0x22c)=17;GF(0x230)=1;
GF(0x274)=-40;GF(0x278)=154;GF(0x27c)=-12;GF(0x280)=1;
GF(0x1a8)=rising?100:0;MODE=1;GF(0x614)=11.666668f;object[0xca]=1;
unsigned char euler[32];memcpy(euler,object+0x2e4,16);memcpy(euler+16,object+0x334,16);
controllers=upward_queries=downward_queries=closed=hidden=0;
for(int i=0;i<ticks;i++)((void(TC*)(void*,float))AT(0x424600))(object+0xc0,1.f/60);
int ran=lock?0:ticks;
require(controllers==ran,"derived controller gate");
require(upward_queries==(rising?ran:0)&&downward_queries==ran,"ordinary probe dispatch");
require(closed==(lock&&state==2?ticks:0),"menu state2 transition dispatch");
require(hidden==(owner==0?ticks:0),"null-control visibility prelude");
require(MODE==1&&GF(0x614)==11.666668f,"caller retained movement mode/turn");
require(!memcmp(euler,object+0x2e4,16)&&!memcmp(euler+16,object+0x334,16),"caller retained both Euler vectors");
printf("FRAME_CASE owner=%d lock=%d state=%d support=%d rising=%d ticks=%d controllers=%d up=%d down=%d closed=%d mode=%d turn=%.9g current=%.9g,%.9g,%.9g target=%.9g,%.9g,%.9g\n",owner,lock,state,supported,rising,ticks,controllers,upward_queries,downward_queries,closed,MODE,GF(0x614),GF(0x224),GF(0x228),GF(0x22c),GF(0x274),GF(0x278),GF(0x27c));
}
int main(void) {
setbuf(stdout,NULL);map_source();AddVectoredExceptionHandler(1,exception);
const uint32_t ranges[][2]={/* RANGES */};
for(unsigned i=0;i<sizeof(ranges)/sizeof(ranges[0]);i++)fix(ranges[i][0],ranges[i][1]);
jump(AT(0x437940),controller);jump(AT(0x47c210),no_up_hit);jump(AT(0x47c6e0),no_down_hit);jump(AT(0x468660),draw);
game_table[0x218/4]=(uintptr_t)AT(0x458960);
game_table[0x264/4]=(uintptr_t)AT(0x471b40);game_table[0x2bc/4]=(uintptr_t)AT(0x471f10);
game_table[0x310/4]=(uintptr_t)AT(0x472300);
complete_table[0x208/4]=(uintptr_t)AT(0x424d10);
complete_table[0x1a4/4]=(uintptr_t)AT(0x425170);complete_table[0x1a8/4]=(uintptr_t)AT(0x4252e0);
complete_table[0x194/4]=(uintptr_t)AT(0x42aac0);complete_table[0x1c8/4]=(uintptr_t)AT(0x424e80);
complete_table[0x1b4/4]=(uintptr_t)AT(0x4255c0);complete_table[0x1b0/4]=(uintptr_t)AT(0x425490);
menu_table[0x4c4/4]=(uintptr_t)AT(0x406590);menu_table[0x4a8/4]=(uintptr_t)AT(0x403a10);
menu_table[0x488/4]=(uintptr_t)AT(0x403700);menu_table[0x460/4]=(uintptr_t)close_menu;
helper_table[0x58/4]=(uintptr_t)visibility;
int cases=0;
for(int owner=0;owner<3;owner++)for(int lock=0;lock<2;lock++)for(int state=1;state<3;state++)
for(int supported=0;supported<2;supported++)for(int rising=0;rising<2;rising++) {
one(owner,lock,state,supported,rising,1);cases++;
}
for(int owner=0;owner<2;owner++){one(owner,0,1,1,0,180);cases++;}
printf("DERIVED_FRAME_CASES %d\n",cases);puts("JIMMY_DERIVED_FRAME_COMPLETE");return 0;
}
+106
View File
@@ -0,0 +1,106 @@
#!/usr/bin/env python3
"""Guard the original menu background and successful TSK-to-level reuse chain.
This proves a conditional source lifecycle, not a whole-original Carl capture.
Originals remain read-only; output contains source coordinates and evidence.
"""
import argparse
import hashlib
import json
from pathlib import Path
import re
import struct
import sys
from checkpoint_script_state import EXE_SHA256, find_case, read_va, rel_call_target
from pe_inspect import PE
sys.path.insert(0, str(Path(__file__).resolve().parents[1]/'levels'))
import gam
REA_ID = 'ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904'
CALLS = ((0x46a641, 0x46b160), (0x46a660, 0x46a310), (0x46a33d, 0x44d0e0),
(0x44d122, 0x459110), (0x404b54, 0x460e70), (0x460ef0, 0x4603f0),
(0x4587f3, 0x470540), (0x46e0d9, 0x473710))
SITES = (
(0x46ba18, '899d08080000', 'initial splash stage0'),
(0x46bf07, 'd81da0e54800', 'strict elapsed3s stage gate'),
(0x46bfef, 'c7860808000002000000', 'stage1 to stage2'),
(0x46bff9, '68004a4f00', 'background level1d.gam'),
(0x46c004, 'ff9214010000', 'delayed background request app114'),
(0x46dfb6, '66c781fa0700000200', 'two-callback countdown'),
(0x46bedf, 'c6864c07000001', 'countdown underflow requests teardown/load'),
(0x46c05e, 'ff9204010000', 'consume pending request app104'),
(0x46e5c3, 'ff5228', 'every existing nonnull object gets Init28'),
(0x4705b3, 'ff978c000000', 'Init reads stored lifetime'),
(0x4705bc, 'ff9704020000', 'Init restores live lifetime'),
(0x460a50, '8b0de4995000', 'TSK character request requires raw controlled owner'),
(0x460a65, 'ff5218', 'TSK owner must accept C3DJIMMY type'),
(0x460bd1, 'ff9268010000', 'TSK requests level through player168'),
(0x42275a, 'c685c900000001', 'Jimmy reusable game09=1'),
)
SLOTS = ((0x4d5ea0, 0xc4, 0x46bec0), (0x4d5ea0, 0x114, 0x46dfb0),
(0x4d5ea0, 0x104, 0x46dff0), (0x4d5ea0, 0x128, 0x46e570),
(0x4d0c0c, 0x28, 0x44d4e0), (0x4c444c, 0x28, 0x44d4e0),
(0x4d0c0c, 0x200, 0x4719b0), (0x4c444c, 0x200, 0x4719b0),
(0x4d0c0c, 0x420, 0x472970), (0x4c444c, 0x420, 0x472970),
(0x4d0c0c, 0x40c, 0x44df30), (0x4c444c, 0x40c, 0x44df30),
(0x4a3bdc, 0x168, 0x43b5a0), (0x4a373c, 0x200, 0x4719b0),
(0x4a373c, 0x420, 0x472970))
RANGES = ((0x46b9e0, 0x46ba2a), (0x46bec0, 0x46c067), (0x46df70, 0x46dfe5),
(0x44d0e0, 0x44d161), (0x460e70, 0x460f00), (0x460a50, 0x460bdd),
(0x46e570, 0x46e680), (0x46e6a0, 0x46e710), (0x46ff4a, 0x46ff81),
(0x4226b5, 0x4226c5), (0x422750, 0x422765), (0x44df30, 0x44df44))
def collect(original, rea):
pe = PE(find_case(original, 'Neutron.exe'))
if hashlib.sha256(pe.data).hexdigest() != EXE_SHA256:
raise ValueError('Unexpected executable')
if struct.unpack('<f', read_va(pe, 0x48e5a0, 4))[0] != 3:
raise ValueError('Splash duration changed')
if read_va(pe, 0x4f4a00, 12) != b'level1d.gam\0':
raise ValueError('Background filename changed')
if read_va(pe, 0x4ecb20, 9) != b'C3DJIMMY\0':
raise ValueError('TSK receiver class changed')
for a, b in CALLS:
if rel_call_target(pe, a) != b:
raise ValueError(f'Call {a:x}')
for a, expected, name in SITES:
if read_va(pe, a, len(bytes.fromhex(expected))).hex() != expected:
raise ValueError(f'{name} at {a:x}')
for table, slot, expected in SLOTS:
if struct.unpack('<I', read_va(pe, table+slot, 4))[0] != expected:
raise ValueError(f'Binding {table:x}+{slot:x}')
levels=[]
for filename in ('level1d.gam', 'level1b.gam'):
path=find_case(original, 'gam/'+filename)
level=gam.parse(path.read_bytes())
jimmy=next(e for e in level.entities if e.kind=='3JIM')
levels.append(dict(file=filename, sha256=hashlib.sha256(path.read_bytes()).hexdigest(),
code=level.code, count=len(level.entities), jimmy_offset=jimmy.offset,
jimmy_tag=jimmy.values()['ObjectTag']))
record=next(r for r in json.loads(Path(rea).read_text())['records'] if r['evidence_id']==REA_ID)
if record['subject']['digest']['sha256'] != EXE_SHA256:
raise ValueError('REA subject mismatch')
rows=[]
for line in record['raw_result']['stdout'].splitlines():
m=re.match(r'\s*([0-9a-f]+):',line)
if m:rows.append((int(m[1],16),line))
extracts={hex(a):'\n'.join(l for va,l in rows if a<=va<b)+'\n' for a,b in RANGES}
if any(not s.strip() for s in extracts.values()):
raise ValueError('Missing retained instructions')
return dict(source_sha256=EXE_SHA256, rea_evidence_id=REA_ID, levels=levels,
calls=[dict(va=hex(a), target=hex(b), file_offset=hex(pe.offset(a-pe.base)))for a,b in CALLS],
sites=[dict(va=hex(a), bytes=e, role=n, file_offset=hex(pe.offset(a-pe.base)))for a,e,n in SITES],
slots=[dict(table=hex(t), slot=hex(s), target=hex(v), file_offset=hex(pe.offset(t+s-pe.base)))for t,s,v in SLOTS],
ranges=[dict(va=hex(a),length=b-a,file_offset=hex(pe.offset(a-pe.base)),sha256=hashlib.sha256(read_va(pe,a,b-a)).hexdigest())for a,b in RANGES],
rea_extracts=extracts,
scope='Conditional successful TSK entry reuses existing Jimmy; source lifecycle, not a native Windows/Carl trace.')
if __name__=='__main__':
cli=argparse.ArgumentParser(description=__doc__)
cli.add_argument('original',type=Path)
cli.add_argument('--rea',type=Path,required=True)
args=cli.parse_args()
print(json.dumps(collect(args.original,args.rea),indent=2))
+116
View File
@@ -0,0 +1,116 @@
/* Diagnose the copied original's black startup under the isolated Wine wrapper.
Thread suspension perturbs timing: this is not a gameplay timing reference.
No code/actor memory writes; every successfully suspended thread is resumed. */
#define main observer_unused_main
#include "original_state_observer.c"
#undef main
#include <tlhelp32.h>
static void threads(HANDLE process, DWORD pid, unsigned elapsed) {
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
THREADENTRY32 entry = {0};
entry.dwSize = sizeof(entry);
if (snapshot == INVALID_HANDLE_VALUE) return;
if (Thread32First(snapshot, &entry)) do {
if (entry.th32OwnerProcessID != pid) continue;
HANDLE thread = OpenThread(THREAD_SUSPEND_RESUME|THREAD_GET_CONTEXT|THREAD_QUERY_INFORMATION,
FALSE, entry.th32ThreadID);
CONTEXT context = {0};
uint32_t stack[64] = {0};
int context_ok = 0, stack_ok = 0;
if (!thread) continue;
DWORD prior = SuspendThread(thread);
if (prior != (DWORD)-1) {
context.ContextFlags = CONTEXT_CONTROL;
context_ok = GetThreadContext(thread, &context);
if (context_ok) stack_ok = read_memory(process, context.Esp, stack, sizeof(stack));
/* Resume even when context/stack reads fail. Keep prior suspension count. */
DWORD resumed = ResumeThread(thread);
printf("{\"kind\":\"thread\",\"elapsed_ms\":%u,\"tid\":%lu,\"prior_suspend\":%lu,"
"\"resume_ok\":%s,\"context_ok\":%s,\"eip\":%lu,\"esp\":%lu,\"stack_ok\":%s,\"stack\":[",
elapsed, entry.th32ThreadID, prior, resumed!=(DWORD)-1?"true":"false",
context_ok?"true":"false", context.Eip, context.Esp, stack_ok?"true":"false");
for (unsigned i=0; stack_ok && i<sizeof(stack)/sizeof(stack[0]); ++i)
printf("%s%lu", i?",":"", (unsigned long)stack[i]);
puts("]}");
}
CloseHandle(thread);
} while (Thread32Next(snapshot, &entry));
CloseHandle(snapshot);
}
static void modules(DWORD pid) {
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid);
MODULEENTRY32 entry = {0};
entry.dwSize = sizeof(entry);
if (snapshot == INVALID_HANDLE_VALUE) return;
if (Module32First(snapshot, &entry)) do {
fputs("{\"kind\":\"module\",\"name\":", stdout); json_string(entry.szModule);
printf(",\"base\":%lu,\"size\":%lu}\n", (unsigned long)(uintptr_t)entry.modBaseAddr, entry.modBaseSize);
} while (Module32Next(snapshot, &entry));
CloseHandle(snapshot);
}
static BOOL CALLBACK close_window(HWND window, LPARAM pid) {
DWORD actual;
GetWindowThreadProcessId(window, &actual);
if (actual == (DWORD)pid && IsWindowVisible(window)) PostMessageA(window, WM_CLOSE, 0, 0);
return TRUE;
}
int main(int argc, char **argv) {
char cwd[MAX_PATH], digest[65], command[]="NeutronHDnoCD.exe";
STARTUPINFOA start = {0}; PROCESS_INFORMATION child = {0};
int acknowledge=0, standard=0;
unsigned duration=11;
for (int i=1; i<argc; ++i) {
if (!strcmp(argv[i],"--acknowledge-repaint")) acknowledge=1;
else if (!strcmp(argv[i],"--standard-resolution")) standard=1;
else if (!strncmp(argv[i],"--seconds=",10)) {
char *end; unsigned long n=strtoul(argv[i]+10,&end,10);
if (*end || n<3 || n>60) return 7;
duration=(unsigned)n;
} else if (strcmp(argv[i],"ASE\\jimstop.ase")) return 7;
}
const Profile *profile=&profiles[standard?3:2];
if (standard) strcpy(command,"NeutronNoCD.exe");
setbuf(stdout, NULL);
if (!GetCurrentDirectoryA(sizeof(cwd),cwd) || _stricmp(cwd,"Z:\\work\\game")) return 2;
HANDLE file = CreateFileA(command,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);
if (file == INVALID_HANDLE_VALUE) return 3;
if (!sha256(file,digest) || strcmp(digest,profile->sha)) { CloseHandle(file); return 4; }
start.cb = sizeof(start);
if (!CreateProcessA(command,command,NULL,NULL,FALSE,0,NULL,cwd,&start,&child)) { CloseHandle(file); return 5; }
CloseHandle(file); CloseHandle(child.hThread);
printf("{\"kind\":\"diagnostic_subject\",\"sha256\":\"%s\",\"pid\":%lu,\"timing_perturbed\":true}\n",digest,child.dwProcessId);
DWORD began=GetTickCount(); int identified=0;
for (unsigned sample=0; GetTickCount()-began<duration*1000; ++sample) {
Sleep(1500);
identified=runtime_identity(child.hProcess,profile);
if (!identified) continue;
Registry state;
registry_snapshot(child.hProcess,profile,&state);
print_registry(&state,GetTickCount()-began);
print_sample(child.hProcess,profile,&state,GetTickCount()-began);
uint32_t code=0;
if (read_memory(child.hProcess,state.current+0x490,&code,4))
printf("{\"kind\":\"level_identity\",\"elapsed_ms\":%lu,\"code\":%lu}\n",GetTickCount()-began,(unsigned long)code);
modules(child.dwProcessId);
threads(child.hProcess,child.dwProcessId,GetTickCount()-began);
if (acknowledge && sample == 1) {
HWND window=find_window(child.dwProcessId);
RECT rect={0};
BOOL pending=window&&GetUpdateRect(window,&rect,FALSE);
BOOL acknowledged=window&&ValidateRect(window,NULL);
printf("{\"kind\":\"window_repaint_acknowledgement\",\"elapsed_ms\":%lu,\"window\":%lu,"
"\"pending\":%s,\"acknowledged\":%s,\"rect\":[%ld,%ld,%ld,%ld]}\n",
GetTickCount()-began,(unsigned long)(uintptr_t)window,
pending?"true":"false",acknowledged?"true":"false",rect.left,rect.top,rect.right,rect.bottom);
}
}
EnumWindows(close_window,child.dwProcessId);
CloseHandle(child.hProcess);
if (!identified) return 6;
puts("ORIGINAL_STARTUP_DIAGNOSTIC_COMPLETE");
return 0;
}
+3 -1
View File
@@ -20,6 +20,7 @@
#define CANONICAL_SHA "f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8"
#define HD_SHA "b6675b7e7f3fc37512185ddb4d6ce1fbe9a36c8b83f3b4b3ed6979a56db3d2d4"
#define HD_NOCD_SHA "8cd5d21997835a40978b8b83e344c97c92217bf6cd6858f7458b76935d64dedb"
#define NOCD_SHA "5e1d3bed2d649d16ec62ead02514119a16590380d4d5a6a73103db900a15c62e"
typedef struct {
const char *name, *sha;
@@ -28,7 +29,8 @@ typedef struct {
static const Profile profiles[] = {
{"canonical",CANONICAL_SHA,0x5099e4,0x50999c,0x696030,0x509948,0x4f83e4,0x4f8430,0x4f8198,0x4f8182},
{"hd-resolution",HD_SHA,0x5099e4,0x50999c,0x696030,0x509948,0x4f83e4,0x4f8430,0x4f8198,0x4f8182},
{"hd-nocd",HD_NOCD_SHA,0x509a04,0x5099bc,0x696050,0x509968,0x4f8404,0x4f8450,0x4f81b8,0x4f81a2}
{"hd-nocd",HD_NOCD_SHA,0x509a04,0x5099bc,0x696050,0x509968,0x4f8404,0x4f8450,0x4f81b8,0x4f81a2},
{"standard-nocd",NOCD_SHA,0x509a04,0x5099bc,0x696050,0x509968,0x4f8404,0x4f8450,0x4f81b8,0x4f81a2}
};
typedef struct { uint32_t payload, vtable; } Node;
+3 -1
View File
@@ -58,6 +58,8 @@ def inside(args):
frames, mode = 180, ['--smoke-objective-window']
elif args.port_regression == 'carl':
frames, mode = 60, ['--smoke-carl-cutscene']
elif args.port_regression == 'control':
frames, mode = 32, ['--smoke-control-phases']
elif args.port_jetpack:
frames, mode = 300, ['--smoke-jetpack']
elif args.port_walk:
@@ -126,7 +128,7 @@ def main():
p.add_argument('--port-practice', action='store_true', help='Windows port practice modal/input/resize under Wine64')
p.add_argument('--port-cutscene-audio', action='store_true', help='Windows port cutscene music lifecycle under Wine64')
p.add_argument('--port-jetpack', action='store_true', help='Windows port VR04 powered steering/input/resize under Wine64')
p.add_argument('--port-regression', choices=['objectives', 'carl'], help='Windows lab popup or conversation runtime regression under Wine64')
p.add_argument('--port-regression', choices=['objectives', 'carl', 'control'], help='Windows lab popup, conversation lock or grounded skip-to-idle regression under Wine64')
p.add_argument('--asset-probe', action='store_true', help='Run compiled read-only OMT shape probe inside isolated copy')
p.add_argument('--probe-model', default=r'ASE\jimstop.ase')
p.add_argument('--probe-arg', action='append', default=[], help='Additional explicit argument for the generated component probe (repeatable)')