Skip to content

Correct SCRIPT_FUNCTION callback layout and map packed execute arguments#3

Draft
Quantumyilmaz wants to merge 1 commit into
mainfrom
agent/script-function-layout
Draft

Correct SCRIPT_FUNCTION callback layout and map packed execute arguments#3
Quantumyilmaz wants to merge 1 commit into
mainfrom
agent/script-function-layout

Conversation

@Quantumyilmaz

@Quantumyilmaz Quantumyilmaz commented Jul 17, 2026

Copy link
Copy Markdown

Summary

  • correct the Starfield SCRIPT_FUNCTION callback offsets
  • map the runtime selector at +0x38 and the alternate packed-arguments execute ABI
  • move compileFunction to +0x40, conditionFunction to +0x48, and the two tail flags to +0x50/+0x51
  • add explicit layout assertions while preserving the verified 0x58 total size

RE notes

  • descriptor construction and an independent copy path both establish the recovered field positions
  • execute dispatchers branch on the byte at +0x38 and call the function at +0x30 using either the legacy eight-argument ABI or ExecuteFunctionArgs&
  • compiler and condition dispatchers directly load their callbacks from +0x40 and +0x48
  • the runtime directly consumes invalidatesCellList at +0x51
  • compile-callback parameter semantics remain intentionally unmapped as void*

Validation

  • direct Starfield 1.16.244 construction, copy, and call-site disassembly
  • repo clang-format and whitespace checks
  • MSVC C++23 layout probe and class-layout report
  • full CommonLibSF MSVC debug and release builds

QTR internal review draft. This has not been submitted upstream.

Integration check

All four QTR draft branches cherry-pick together cleanly, and the combined tree passes full CommonLibSF MSVC debug and release builds.

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