Skip to content

File I/O and resource initialization stuff#1782

Merged
wolfcomp merged 24 commits intoaers:mainfrom
universalconquistador:file-io-research
Apr 27, 2026
Merged

File I/O and resource initialization stuff#1782
wolfcomp merged 24 commits intoaers:mainfrom
universalconquistador:file-io-research

Conversation

@universalconquistador
Copy link
Copy Markdown
Contributor

This builds on my earlier PR #1780. I started based on Penumbra stuff but it ended up being mostly original research. This is in support of my plugin that loads modded resources from memory rather than from disk/sqpack.

Copy link
Copy Markdown
Collaborator

@Haselnussbomber Haselnussbomber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't review this in-depth, because I don't know anything about graphics stuff, but I got a couple comments in regards to using InteropGenerator correctly.

Comment thread FFXIVClientStructs/FFXIV/Client/System/File/FileDescriptor.cs Outdated
Comment thread FFXIVClientStructs/FFXIV/Client/System/File/FileHandleManager.cs Outdated
Comment thread FFXIVClientStructs/FFXIV/Client/System/Resource/Handle/TextureResourceHandle.cs Outdated
Copy link
Copy Markdown
Collaborator

@wolfcomp wolfcomp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few changes required due to bad signatures and offsets.

Comment thread FFXIVClientStructs/FFXIV/Client/System/File/FileInterface.cs
public partial ulong GetLength();

[VirtualFunction(19u)]
public partial ulong GetBlobAlignment(); // Seems nothing overrides the base ResourceHandle which returns 128 bytes
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add that vf20 is a IMemorySpace* getter for most likely GetBlobMemorySpace

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I'm seeing, vf20 doesn't return an IMemorySpace but instead something allocated from it. See the end of CreateMemorySpaces where sub_14008FBB0 creates the object being returned from DefaultResourceHandle.vf20 by allocating 0x28 bytes from DefaultMemorySpace, and its vtable doesn't reference IMemorySpace at all despite it seeming to function as a memory allocator of a kind.
I mapped out what a few of the various vfuncs involved do but it doesn't seem to be super interesting IMO.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When i looked at what vfs and everything used it lines up with what is the IMemorySpace but yeah it doesn't have the exact same vtable size

Comment thread ida/data.yml Outdated
Comment thread FFXIVClientStructs/FFXIV/Client/System/File/FileDescriptor.cs
Comment thread FFXIVClientStructs/FFXIV/Client/System/Resource/ResourceManager.cs Outdated
Comment thread ida/data.yml Outdated
Comment thread FFXIVClientStructs/FFXIV/Client/Graphics/Scene/BgObject.cs Outdated
Comment thread FFXIVClientStructs/FFXIV/Client/Graphics/Scene/BgObject.cs Outdated
@wolfcomp wolfcomp added the requested changes Changes requested through comments label Apr 27, 2026
@universalconquistador
Copy link
Copy Markdown
Contributor Author

Thanks, I have addressed your feedback!

@github-actions github-actions Bot removed the requested changes Changes requested through comments label Apr 27, 2026
@wolfcomp wolfcomp merged commit 0ec4a4a into aers:main Apr 27, 2026
2 checks passed
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.

3 participants