Created
March 5, 2021 02:08
-
-
Save nt153133/f5a7534238a707b1af06562f7e100c23 to your computer and use it in GitHub Desktop.
Get Skip Cutscene Setting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC ? 8B F2 48 8D B9 ? ? ? ? | |
public unsafe delegate IntPtr MyGetSetting(IntPtr a1, uint a2); | |
private IntPtr GetCutsceneSettingPtr() | |
{ | |
var ffxivBase = Process.GetCurrentProcess().MainModule.BaseAddress; | |
var settingFunction = Marshal.GetDelegateForFunctionPointer<MyGetSetting>(ffxivBase + 0x68F80); | |
IntPtr g_Framework_2 = ffxivBase + 0x1D68238; //This should be part of Dalamud somewhere | |
IntPtr intPtr= Marshal.ReadIntPtr(g_Framework_2) + 0x10; | |
uint settingID = 0xC2; //This settings ID | |
IntPtr resultingPtr = settingFunction(intPtr, settingID) + 0x20; | |
return resultingPtr; | |
} | |
private string ReadSetting() | |
{ | |
byte settingValue = Marshal.ReadByte(GetCutsceneSettingPtr()); | |
return $"Cutscene setting: {settingValue} ({settingValue == 1})"; | |
} | |
//0 off 1 on | |
private void WriteSetting(byte value) | |
{ | |
Marshal.WriteByte(GetCutsceneSettingPtr(), value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment