Skip to content

Instantly share code, notes, and snippets.

@nt153133
Created March 5, 2021 02:08
Show Gist options
  • Save nt153133/f5a7534238a707b1af06562f7e100c23 to your computer and use it in GitHub Desktop.
Save nt153133/f5a7534238a707b1af06562f7e100c23 to your computer and use it in GitHub Desktop.
Get Skip Cutscene Setting
//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