Skip to content

Research: opt-in Extra Options-style local car object probe for FH2ML - #6

Draft
Refilewski wants to merge 11 commits into
mainfrom
research/extraoptions-car-object-probe
Draft

Refilewski wants to merge 11 commits into
mainfrom
research/extraoptions-car-object-probe

Conversation

@Refilewski

Copy link
Copy Markdown
Owner

Summary

Experimental opt-in native FH2ML in-process current-vehicle detector following the car getter path used by Extra Options. This is a stacked draft on top of #5; it currently includes #5's guarded heap-backed car ID reader.

  • Introduces CarObjectProbe.{h,cpp}: PlayerManager -> GetLocalPlayer -> GetPlayerCar, verifies car vtable, reads modelId at car + 0x118, releases the owned game-car reference through validated virtual method, catches access violations.
  • No game code/vtable patching; does not replace Extra Options' vehicle update hook.
  • OFF by default. To test: AZIMUTH_RPC_EXPERIMENTAL_CAR_OBJECT=1 (inherited by FH2ML process); automatically quarantines probe after a fault/unsafe release.
  • In a valid live vehicle snapshot, uses Vehicle model #ID only if the audio car name is unavailable; learns a friendly name for the observed model ID only after two matching model+name snapshots; no unsupported model-name assertions.
  • Logs status changes without logging raw pointers. Standalone EXE stays on separate safe memory-only detection.
  • Documents limits and experimental test matrix.

Risks / validation blockers

Calling FH2 game methods from the existing RPC worker thread is NOT verified thread-safe. This does not become a production default until live Azimuth 0.9.9+ testing proves safe access to the player/car getter, correct reference release, model IDs and consistency during loading/car changes. An FH2ML game-thread callback API would be preferable when available.

  • Windows CI build/tests
  • Live FH2 base game test without Extra Options
  • Live FH2 with Extra Options car changing (at least 5 swaps)
  • Garage -> Free roam -> Race -> Garage
  • Confirm no crashes, no incorrect car info, no stale names, and correctly bounded refcounts
  • Validate model-id <-> Data_Car.MediaName mapping before shipping names

Please do not merge #5 or this PR into main until the live tests pass.
Related: #4, #5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant