mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 12:44:19 +01:00
Update to new resourcehandler handling.
This commit is contained in:
parent
93840e30f0
commit
123dd3aacc
5 changed files with 15 additions and 7 deletions
|
|
@ -1,5 +1,3 @@
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Penumbra.GameData.Enums;
|
namespace Penumbra.GameData.Enums;
|
||||||
|
|
||||||
public enum WeaponCategory : byte
|
public enum WeaponCategory : byte
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ public static class Sigs
|
||||||
{
|
{
|
||||||
// ResourceLoader.Debug
|
// ResourceLoader.Debug
|
||||||
public const string ResourceHandleDestructor = "48 89 5C 24 ?? 57 48 83 EC ?? 48 8D 05 ?? ?? ?? ?? 48 8B D9 48 89 01 B8";
|
public const string ResourceHandleDestructor = "48 89 5C 24 ?? 57 48 83 EC ?? 48 8D 05 ?? ?? ?? ?? 48 8B D9 48 89 01 B8";
|
||||||
public const string ResourceManager = "48 8B 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 32 C0";
|
public const string ResourceManager = "48 8B 05 ?? ?? ?? ?? 33 ED F0";
|
||||||
|
|
||||||
// ResourceLoader.Replacement
|
// ResourceLoader.Replacement
|
||||||
public const string GetResourceSync = "E8 ?? ?? 00 00 48 8D 8F ?? ?? 00 00 48 89 87 ?? ?? 00 00";
|
public const string GetResourceSync = "E8 ?? ?? 00 00 48 8D 8F ?? ?? 00 00 48 89 87 ?? ?? 00 00";
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ public class Dalamud
|
||||||
[PluginService][RequiredVersion("1.0")] public static TitleScreenMenu TitleScreenMenu { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public static TitleScreenMenu TitleScreenMenu { get; private set; } = null!;
|
||||||
[PluginService][RequiredVersion("1.0")] public static GameGui GameGui { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public static GameGui GameGui { get; private set; } = null!;
|
||||||
[PluginService][RequiredVersion("1.0")] public static KeyState KeyState { get; private set; } = null!;
|
[PluginService][RequiredVersion("1.0")] public static KeyState KeyState { get; private set; } = null!;
|
||||||
|
[PluginService][RequiredVersion("1.0")] public static SigScanner SigScanner { get; private set; } = null!;
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
private static readonly object? DalamudConfig;
|
private static readonly object? DalamudConfig;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public unsafe partial class ResourceLoader
|
||||||
}
|
}
|
||||||
|
|
||||||
// A static pointer to the SE Resource Manager
|
// A static pointer to the SE Resource Manager
|
||||||
[Signature( Sigs.ResourceManager, ScanType = ScanType.StaticAddress, UseFlags = SignatureUseFlags.Pointer )]
|
[Signature( Sigs.ResourceManager, ScanType = ScanType.StaticAddress)]
|
||||||
public static ResourceManager** ResourceManager;
|
public static ResourceManager** ResourceManager;
|
||||||
|
|
||||||
// Gather some debugging data about penumbra-loaded objects.
|
// Gather some debugging data about penumbra-loaded objects.
|
||||||
|
|
@ -177,11 +177,11 @@ public unsafe partial class ResourceLoader
|
||||||
ref var manager = ref *ResourceManager;
|
ref var manager = ref *ResourceManager;
|
||||||
foreach( var resourceType in Enum.GetValues< ResourceCategory >().SkipLast( 1 ) )
|
foreach( var resourceType in Enum.GetValues< ResourceCategory >().SkipLast( 1 ) )
|
||||||
{
|
{
|
||||||
var graph = ( ResourceGraph.CategoryContainer* )manager->ResourceGraph->ContainerArray + ( int )resourceType;
|
ref var graph = ref manager->ResourceGraph->ContainerArraySpan[(int) resourceType];
|
||||||
for( var i = 0; i < 20; ++i )
|
for( var i = 0; i < 20; ++i )
|
||||||
{
|
{
|
||||||
var map = ( StdMap< uint, Pointer< StdMap< uint, Pointer< ResourceHandle > > > >* )graph->CategoryMaps[ i ];
|
var map = graph.CategoryMapsSpan[i];
|
||||||
if( map != null )
|
if( map.Value != null )
|
||||||
{
|
{
|
||||||
action( resourceType, map, i );
|
action( resourceType, map, i );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
|
|
@ -9,6 +10,7 @@ using FFXIVClientStructs.STD;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Raii;
|
using OtterGui.Raii;
|
||||||
|
using Penumbra.GameData;
|
||||||
using Penumbra.Interop.Loader;
|
using Penumbra.Interop.Loader;
|
||||||
using Penumbra.String.Classes;
|
using Penumbra.String.Classes;
|
||||||
|
|
||||||
|
|
@ -42,6 +44,13 @@ public partial class ConfigWindow
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe
|
||||||
|
{
|
||||||
|
Dalamud.SigScanner.TryGetStaticAddressFromSig( Sigs.ResourceManager, out var x );
|
||||||
|
ImGui.TextUnformatted( $"Static Address: 0x{( ulong )ResourceLoader.ResourceManager:X} (+0x{(ulong) ResourceLoader.ResourceManager - (ulong) Dalamud.SigScanner.Module.BaseAddress:X})" );
|
||||||
|
ImGui.TextUnformatted( $"Actual Address: 0x{( ulong )*ResourceLoader.ResourceManager:X}" );
|
||||||
|
}
|
||||||
|
|
||||||
// Filter for resources containing the input string.
|
// Filter for resources containing the input string.
|
||||||
ImGui.SetNextItemWidth( -1 );
|
ImGui.SetNextItemWidth( -1 );
|
||||||
ImGui.InputTextWithHint( "##resourceFilter", "Filter...", ref _resourceManagerFilter, Utf8GamePath.MaxGamePathLength );
|
ImGui.InputTextWithHint( "##resourceFilter", "Filter...", ref _resourceManagerFilter, Utf8GamePath.MaxGamePathLength );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue