Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentFishGuide.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public struct PlaceNameEntry {
public partial struct FishGuideSheetWaiter {
[FieldOffset(0x70)] public void* CallbackFn; // 5 args!?
[FieldOffset(0x80)] public void* CallbackThisArg;
[FieldOffset(0x88)] public uint SheetIndex;
[FieldOffset(0x88)] public uint TargetSheetIndex;
}

// Client::UI::Agent::AgentFishGuide::FishGuideData
Expand All @@ -146,7 +146,7 @@ public partial struct FishGuideData {
public partial struct SpearfishGuideSheetWaiter {
[FieldOffset(0x70)] public void* CallbackFn; // 5 args!?
[FieldOffset(0x80)] public void* CallbackThisArg;
[FieldOffset(0x88)] public uint SheetIndex;
[FieldOffset(0x88)] public uint TargetSheetIndex;
}

// Client::UI::Agent::AgentFishGuide::SpearfishGuideData
Expand Down
43 changes: 35 additions & 8 deletions FFXIVClientStructs/FFXIV/Common/Component/Excel/ExcelSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,28 @@ namespace FFXIVClientStructs.FFXIV.Common.Component.Excel;
public unsafe partial struct ExcelSheet {
[FieldOffset(0x00), CExporterBaseType] public LinkList<ExcelSheet> Base;
[FieldOffset(0x18)] public ExcelLanguage Language;
[FieldOffset(0x20)] public CStringPointer SheetName; // 32 Bytes
[FieldOffset(0x20)] public ExcelSheetNameVar SheetNameVar;
[FieldOffset(0x20), Obsolete("Use SheetNameVar.SheetName")] public CStringPointer SheetName; // 32 Bytes
[FieldOffset(0x30)] public uint RowCount;
[FieldOffset(0x38)] public ColumnInfo* ColumnDefinitions;
[FieldOffset(0x40)] public uint DataOffset;
[FieldOffset(0x44)] public uint RowLength; // in bytes

//[FieldOffset(0x70)] public LinkList<ExcelPage> ExcelPages;
// 0x88 LinkList for subrows?
[FieldOffset(0x70)] public LinkedListContainer ExcelPages;

[FieldOffset(0xA8)] private uint CachedAllocatedRowCount; // not sure how it's cached yet. use the function which falls back to calling the function on RowResolver

[FieldOffset(0xB0)] public IExcelPageRowResolver* RowResolver;

[FieldOffset(0xD0)] public ExcelVariant Variant;
[FieldOffset(0xD4)] public ushort ColumnCount;
[FieldOffset(0xD6)] public short StartColumn; // initialized with -1. then, if -1, set to the current index in a loop over ColumnDefinitions. so technically always 0 unless there are no columns
[FieldOffset(0xD6)] public short StartColumn; // initialized with -1. then, if -1, set to the current index in a loop over ColumnDefinitions. so technically always 0 unless there are no columns

[FieldOffset(0xD8)] public ushort Version;
[FieldOffset(0xDA)] public ushort SheetIndex;

[FieldOffset(0xF8)] public uint WaiterCount;
[FieldOffset(0xDD)] public bool ExcelPagesLinked;
[FieldOffset(0xE0)] public WaiterContainer Waiters;
[FieldOffset(0xF8), Obsolete("Use WaiterContainer.Count")] public uint WaiterCount;

[MemberFunction("E8 ?? ?? ?? ?? 8B D0 BD")]
public partial uint GetAllocatedRowCount();
Expand All @@ -46,13 +47,39 @@ public unsafe partial struct ExcelSheet {
[MemberFunction("E8 ?? ?? ?? ?? 8B D3 48 8B F8")]
public partial IExcelRowWrapper* GetRowById(uint rowId, uint* outErrorCode = null);

[MemberFunction("E9 ?? ?? ?? ?? 13 6D")]
public partial bool AddWaiter(ExcelSheetWaiter* waiter);

[MemberFunction("E8 ?? ?? ?? ?? 8B 53 ?? 44 8B C5")]
public partial void RemoveWaiter(ExcelSheetWaiter* waiter);

public Span<ColumnInfo> ColumnDefinitionSpan => new(ColumnDefinitions, ColumnCount);

[StructLayout(LayoutKind.Explicit, Size = 0x06)]
public struct ColumnInfo {
[FieldOffset(0x00), CExporterIgnore] private ExcelColumnType ColumnType;
[FieldOffset(0x00)] public ushort Type; // TODO: use ExcelColumnType
[FieldOffset(0x00)] public ExcelColumnType ColumnType;
[FieldOffset(0x00), Obsolete("Use ColumnType")] public ushort Type;
[FieldOffset(0x02)] public ushort Index;
[FieldOffset(0x04)] public ushort Offset;
}

[StructLayout(LayoutKind.Explicit, Size = 0x38)]
public struct LinkedListContainer {
[FieldOffset(0x00)] public LinkList<ExcelPage> List1;
[FieldOffset(0x18)] public LinkList<ExcelPage> List2;
[FieldOffset(0x30)] public int NumCreatedExcelPages;
}

[StructLayout(LayoutKind.Explicit, Size = 0x20)]
public struct WaiterContainer {
[FieldOffset(0x00), CExporterBaseType] public LinkList<WaiterEntry> Base;
[FieldOffset(0x18)] public int Count;

[StructLayout(LayoutKind.Explicit, Size = 0x18)]
public struct WaiterEntry {
[FieldOffset(0x00)] public ExcelSheetWaiter* Waiter;
[FieldOffset(0x08)] public int Index; // ?
[FieldOffset(0x10)] public WaiterEntry* Next;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace FFXIVClientStructs.FFXIV.Common.Component.Excel;

// Common::Component::Excel::ExcelSheetNameVar
[GenerateInterop]
[StructLayout(LayoutKind.Explicit, Size = 0x10)]
public partial struct ExcelSheetNameVar {
[FieldOffset(0x00)] public CStringPointer SheetNamePtr; // 32 Bytes
[FieldOffset(0x00), CExporterIgnore, FixedSizeArray] internal FixedSizeArray8<byte> _sheetName;
[FieldOffset(0x08)] public ushort SheetNameHash;
[FieldOffset(0x0A)] public byte Type; // 0 = Pointer, 1 = Inline? not entirely sure
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
using FFXIVClientStructs.FFXIV.Component.Excel;

namespace FFXIVClientStructs.FFXIV.Common.Component.Excel;

// Common::Component::Excel::ExcelSheetWaiter
[GenerateInterop(isInherited: true)]
[StructLayout(LayoutKind.Explicit, Size = 0x30)]
public unsafe partial struct ExcelSheetWaiter {
[FieldOffset(0x08)] public uint RowDescriptorCount;
[FieldOffset(0x0C)] private uint UnkC; // row counter?

[FieldOffset(0x18)] public long SheetIndex;
[FieldOffset(0x20)] public DescriptorRowWrapperEntry* RowDescriptors;
[FieldOffset(0x28)] public ExcelRow** Rows;

[VirtualFunction(0)]
public partial ExcelSheetWaiter* Dtor(byte freeFlags);

[MemberFunction("E8 ?? ?? ?? ?? C0 E3")]
public partial void Reset();

[MemberFunction("E8 ?? ?? ?? ?? 48 39 6B")]
public partial void Prepare(uint a2, uint rowDescriptorCount);

[MemberFunction("E8 ?? ?? ?? ?? 48 8D 74 24 ?? BF")]
public partial void SetSheetIndex(long sheetIndex);

[MemberFunction("E8 ?? ?? ?? ?? FF C7 4D 8D B6")]
public partial void SetRowDescriptor(uint index, ExcelRowDescriptor* descriptor);

/// <summary> Sets a <see cref="ExcelRowDescriptor"/> with the given <paramref name="rowId"/> at given <paramref name="index"/>. </summary>
[MemberFunction("E8 ?? ?? ?? ?? 49 8B 94 EE")]
public partial void EnqueueRowLookup(uint index, uint rowId);

[StructLayout(LayoutKind.Explicit, Size = 0x18)]
public struct DescriptorRowWrapperEntry {
[FieldOffset(0x00)] public ExcelRowDescriptor Descriptor;
[FieldOffset(0x10)] public IExcelRowWrapper* RowWrapper;
}
}
19 changes: 19 additions & 0 deletions FFXIVClientStructs/FFXIV/Component/Excel/ExcelPage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using FFXIVClientStructs.FFXIV.Common.Component.Excel;

namespace FFXIVClientStructs.FFXIV.Component.Excel;

// Component::Excel::ExcelPage
[GenerateInterop]
[StructLayout(LayoutKind.Explicit, Size = 0x2C0)]
public unsafe partial struct ExcelPage {
[FieldOffset(0x00), CExporterBaseType] public LinkList<ExcelPage> Base;
[FieldOffset(0x20)] ExcelSheet* Sheet;
[FieldOffset(0x28)] ExcelSheetNameVar SheetNameVar;

[FieldOffset(0x38)] public uint StartRowId;
[FieldOffset(0x3C)] public uint EndRowId;
[FieldOffset(0x40)] public uint RowCount;

[MemberFunction("E8 ?? ?? ?? ?? 84 C0 75 ?? 48 85 DB 74 ?? 48 8B 5B ?? 48 3B DD")]
public partial bool ContainsRowId(ExcelRowDescriptor* descriptor);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ namespace FFXIVClientStructs.FFXIV.Component.Excel;
[GenerateInterop]
[StructLayout(LayoutKind.Explicit, Size = 0x10)]
public unsafe partial struct ExcelRowDescriptor {
[FieldOffset(0x0)] public uint RowId;
[FieldOffset(0x4)] public ushort LowerRowIdPart; // found to be assigned with = (ushort)RowId in a few calls
[FieldOffset(0x6)] public ushort SubRowCount;
[FieldOffset(0x8), FixedSizeArray] internal FixedSizeArray4<ushort> _subRowIds;
[FieldOffset(0x00)] public uint RowId;
[FieldOffset(0x04)] public ushort LowerRowIdPart; // found to be assigned with = (ushort)RowId in a few calls
[FieldOffset(0x06)] public ushort SubRowCount; // TODO: change to short (seen as -1 and -2)
[FieldOffset(0x08), FixedSizeArray] internal FixedSizeArray4<ushort> _subRowIds; // TODO: change ushort to short

// [MemberFunction("E8 ?? ?? ?? ?? EB ?? 48 8B DF 48 8D 4E")]
// public partial void Assign0xFFFF();

Expand Down
24 changes: 22 additions & 2 deletions ida/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4424,10 +4424,14 @@ classes:
vtbls:
- ea: 0x14257F588
funcs:
0x14208C870: ctor
0x14208C780: ctor_From
0x14208C870: ctor
0x14208C8A0: Finalizer
0x14208CC30: Reset
0x14208CCF0: Prepare
0x14208CDE0: SetRowDescriptor
0x14208CEE0: EnqueueRowLookup
0x14208CF30: SetSheetIndex
vfuncs:
0: dtor
1: Finish
Expand Down Expand Up @@ -5017,11 +5021,19 @@ classes:
base: Common::Component::Environment::ResourceInterface::ResourceHandleInterface
- ea: 0x142178338
base: Common::Component::Excel::LinkList<Component::Exd::ExdModuleResourceHandle>
Common::Component::Excel::LinkList<Component::Excel::ExcelPage>:
vtbls:
- ea: 0x14257F3E8
vfuncs:
0: dtor
Common::Component::Excel::LinkList<Common::Component::Excel::ExcelSheet>:
vtbls:
- ea: 0x14257F3F0
vfuncs:
0: dtor
Common::Component::Excel::ExcelSheet::WaiterContainer:
vtbls:
- ea: 0x14257F450
Common::Component::Excel::ExcelSheet:
vtbls:
- ea: 0x14257F458
Expand All @@ -5039,14 +5051,22 @@ classes:
0x142088BB0: GetColumnStringByDescriptor
0x142088DC0: GetRowByIndex
0x142088E30: GetRowByDescriptor
0x142088F60: GetSheetName
0x142088F60: GetSheetInfo
0x142088F70: GetColumnOffset
0x142089020: GetColumnIndex2
0x142089030: GetColumnType
0x142089050: GetColumnTypeLength
0x142089060: GetWaiterCount
0x1420893D0: RemoveWaiter
Common::Component::Excel::ExcelSheetNameVar:
funcs:
0x142084E90: SetSheetName
Component::Excel::ExcelPage:
vtbls:
- ea: 0x14257F5C8
base: Common::Component::Excel::LinkList<Component::Excel::ExcelPage>
- ea: 0x14257F5D0
base: Common::Component::Excel::ExcelResourceListener
funcs:
0x14208D4D0: ctor # (ExcelPage* this, ExcelDataPagination* exhPageInfo, ExcelSheetContainer* pOwner)
0x14208E350: ContainsRowId # (ExcelPage* this, int* pnRowId) -> bool
Expand Down
Loading