protected override void Setup64Bit(SigScanner sig) { BaseAddress = sig.GetStaticAddressFromSig("8B D0 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B D8 48 85 C0 74 3A"); LookupBattleCharaByObjectID = sig.ScanText("E8 ?? ?? ?? ?? 4C 8B F0 48 85 C0 0F 84 ?? ?? ?? ?? 0F 28 05"); }
public GetUiModule(SigScanner sigScanner) : base(sigScanner, "E8 ?? ?? ?? ?? 48 83 7F ?? 00 48 8B F0") { }
public void Start() { try { Configuration = DalamudConfiguration.Load(StartInfo.ConfigurationPath); // Initialize the process information. TargetModule = Process.GetCurrentProcess().MainModule; SigScanner = new SigScanner(TargetModule, true); AntiDebug = new AntiDebug(SigScanner); #if DEBUG AntiDebug.Enable(); #endif // Initialize game subsystem Framework = new Framework(SigScanner, this); WinSock2 = new WinSockHandlers(); NetworkHandlers = new NetworkHandlers(this, StartInfo.OptOutMbCollection); ClientState = new ClientState(this, StartInfo, SigScanner); LocalizationManager = new Localization(AssetDirectory.FullName); if (!string.IsNullOrEmpty(Configuration.LanguageOverride)) { LocalizationManager.SetupWithLangCode(Configuration.LanguageOverride); } else { LocalizationManager.SetupWithUiCulture(); } PluginRepository = new PluginRepository(this, StartInfo.PluginDirectory, StartInfo.GameVersion); DalamudUi = new DalamudInterface(this); var isInterfaceLoaded = false; if (!bool.Parse(Environment.GetEnvironmentVariable("DALAMUD_NOT_HAVE_INTERFACE") ?? "false")) { try { InterfaceManager = new InterfaceManager(this, SigScanner); InterfaceManager.OnDraw += DalamudUi.Draw; InterfaceManager.Enable(); isInterfaceLoaded = true; InterfaceManager.WaitForFontRebuild(); } catch (Exception e) { Log.Information(e, "Could not init interface."); } } Data = new DataManager(StartInfo.Language); try { Data.Initialize(AssetDirectory.FullName); } catch (Exception e) { Log.Error(e, "Could not initialize DataManager."); Unload(); return; } SeStringManager = new SeStringManager(Data); // Initialize managers. Basically handlers for the logic CommandManager = new CommandManager(this, StartInfo.Language); DalamudCommands = new DalamudCommands(this); DalamudCommands.SetupCommands(); ChatHandlers = new ChatHandlers(this); if (!bool.Parse(Environment.GetEnvironmentVariable("DALAMUD_NOT_HAVE_PLUGINS") ?? "false")) { try { PluginRepository.CleanupPlugins(); PluginManager = new PluginManager(this, StartInfo.PluginDirectory, StartInfo.DefaultPluginDirectory); PluginManager.LoadPlugins(); } catch (Exception ex) { Log.Error(ex, "Plugin load failed."); } } Framework.Enable(); ClientState.Enable(); IsReady = true; Troubleshooting.LogTroubleshooting(this, isInterfaceLoaded); Log.Information("Dalamud is ready."); } catch (Exception ex) { Log.Error(ex, "Oh no! Dalamud::Start() failed."); Unload(); } }
public Dalamud(DalamudStartInfo info, LoggingLevelSwitch loggingLevelSwitch) { this.StartInfo = info; this.loggingLevelSwitch = loggingLevelSwitch; this.Configuration = DalamudConfiguration.Load(info.ConfigurationPath); this.baseDirectory = info.WorkingDirectory; this.unloadSignal = new ManualResetEvent(false); // Initialize the process information. this.targetModule = Process.GetCurrentProcess().MainModule; this.SigScanner = new SigScanner(this.targetModule, true); // Initialize game subsystem this.Framework = new Framework(this.SigScanner, this); this.ClientState = new ClientState(this, info, this.SigScanner); this.WinSock2 = new WinSockHandlers(); Task.Run(async() => { try { var res = await AssetManager.EnsureAssets(this.baseDirectory); if (!res) { Log.Error("One or more assets failed to download."); Unload(); return; } } catch (Exception e) { Log.Error(e, "Error in asset task."); Unload(); return; } this.LocalizationManager = new Localization(this.StartInfo.WorkingDirectory); if (!string.IsNullOrEmpty(this.Configuration.LanguageOverride)) { this.LocalizationManager.SetupWithLangCode(this.Configuration.LanguageOverride); } else { this.LocalizationManager.SetupWithUiCulture(); } var pluginDir = this.StartInfo.PluginDirectory; if (this.Configuration.DoPluginTest) { pluginDir = Path.Combine(pluginDir, "..", "testPlugins"); } PluginRepository = new PluginRepository(this, pluginDir, this.StartInfo.GameVersion); var isInterfaceLoaded = false; if (!bool.Parse(Environment.GetEnvironmentVariable("DALAMUD_NOT_HAVE_INTERFACE") ?? "false")) { try { InterfaceManager = new InterfaceManager(this, this.SigScanner); InterfaceManager.OnDraw += BuildDalamudUi; InterfaceManager.Enable(); isInterfaceLoaded = true; } catch (Exception e) { Log.Information(e, "Could not init interface."); } } Data = new DataManager(this.StartInfo.Language); try { await Data.Initialize(this.baseDirectory); } catch (Exception e) { Log.Error(e, "Could not initialize DataManager."); Unload(); return; } SeStringManager = new SeStringManager(Data); NetworkHandlers = new NetworkHandlers(this, this.Configuration.OptOutMbCollection); // Initialize managers. Basically handlers for the logic CommandManager = new CommandManager(this, info.Language); SetupCommands(); ChatHandlers = new ChatHandlers(this); // Discord Bot Manager BotManager = new DiscordBotManager(this, this.Configuration.DiscordFeatureConfig); BotManager.Start(); if (!bool.Parse(Environment.GetEnvironmentVariable("DALAMUD_NOT_HAVE_PLUGINS") ?? "false")) { try { PluginRepository.CleanupPlugins(); PluginManager = new PluginManager(this, pluginDir, this.StartInfo.DefaultPluginDirectory); PluginManager.LoadPlugins(); } catch (Exception ex) { Log.Error(ex, "Plugin load failed."); } } this.Framework.Enable(); this.ClientState.Enable(); IsReady = true; Troubleshooting.LogTroubleshooting(this, isInterfaceLoaded); }); }
protected override void SetupInternal(SigScanner scanner) { // Xiv__UiManager__GetChatManager 000 lea rax, [rcx+13E0h] // Xiv__UiManager__GetChatManager+7 000 retn ChatManager = BaseAddress + 0x13E0; }
protected override void Setup64Bit(SigScanner sig) { this.RequestAction = sig.ScanText("40 53 55 57 41 54 41 57 48 83 EC 60 83 BC 24 ?? ?? ?? ?? ?? 49 8B E9 45 8B E0 44 8B FA 48 8B F9 41 8B D8 74 14 80 79 68 00 74 0E 32 C0 48 83 C4 60 41 5F 41 5C 5F 5D 5B C3"); this.SetUiMouseoverEntityId = sig.ScanText("48 89 91 ?? ?? ?? ?? C3 CC CC CC CC CC CC CC CC 48 89 5C 24 ?? 55 56 57 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 48 8D B1 ?? ?? ?? ?? 44 89 44 24 ?? 48 8B EA 48 8B D9 48 8B CE 48 8D 15 ?? ?? ?? ?? 41 B9 ?? ?? ?? ??"); }
public ProcessChatBox(SigScanner sigScanner) : base(sigScanner, "48 89 5C 24 ?? 57 48 83 EC 20 48 8B FA 48 8B D9 45 84 C9") { }
public PlaySound(SigScanner sigScanner) : base(sigScanner, "E8 ?? ?? ?? ?? 4D 39 BE") { }
protected override void Setup64Bit(SigScanner sig) { //ProcessZonePacket = sig.ScanText("48 89 74 24 18 57 48 83 EC 50 8B F2 49 8B F8 41 0F B7 50 02 8B CE E8 ?? ?? 7A FF 0F B7 57 02 8D 42 89 3D 5F 02 00 00 0F 87 60 01 00 00 4C 8D 05"); //ProcessZonePacket = sig.ScanText("48 89 74 24 18 57 48 83 EC 50 8B F2 49 8B F8 41 0F B7 50 02 8B CE E8 ?? ?? 73 FF 0F B7 57 02 8D 42 ?? 3D ?? ?? 00 00 0F 87 60 01 00 00 4C 8D 05"); ProcessZonePacket = sig.ScanText("48 89 74 24 ?? 57 48 83 EC 50 8B FA 49 8B F0"); }
/// <inheritdoc/> protected override void Setup64Bit(SigScanner sig) { this.ShowNormalToast = sig.ScanText("48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 48 83 EC 30 83 3D ?? ?? ?? ?? ??"); this.ShowQuestToast = sig.ScanText("48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 48 89 7C 24 ?? 41 56 48 83 EC 40 83 3D ?? ?? ?? ?? ??"); this.ShowErrorToast = sig.ScanText("48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 48 83 EC 20 83 3D ?? ?? ?? ?? ?? 41 0F B6 F0"); }
protected override void Setup64Bit(SigScanner sig) { this.GetLobbyMapString = sig.ScanText("48 83 EC 28 48 63 C1 48 8D 15 ?? ?? ?? ?? 48 8B 04 C2 85 C9 75 7B 38 0D ?? ?? ?? ?? 75 33 48 8B 0D ?? ?? ?? ?? 48 89 5C 24 ?? 0F BE 99 ?? ?? ?? ??"); }
public GetCurrentPoseState(SigScanner sigScanner) : base(sigScanner, "40 ?? 48 83 ?? ?? 48 ?? ?? ?? 48 8B ?? ?? 83 ?? ?? ?? ?? ?? ?? 0F") { }
public byte[] Bench() { return(SigScanner.ReadSignature("48 8B 01 A8 02 75 ? C3")); }
// private TitleScreenMenu _titleScreenMenu; public TitleEditPlugin( [RequiredVersion("1.0")] DalamudPluginInterface pluginInterface, [RequiredVersion("1.0")] CommandManager commandManager, [RequiredVersion("1.0")] DataManager dataManager, [RequiredVersion("1.0")] ClientState clientState, [RequiredVersion("1.0")] Framework framework, [RequiredVersion("1.0")] KeyState keyState, [RequiredVersion("1.0")] SigScanner sigScanner, [RequiredVersion("1.0")] GameGui gameGui, [RequiredVersion("1.0")] TitleScreenMenu titleScreenMenu) { PluginLog.Log("===== T I T L E E D I T ====="); _pluginInterface = pluginInterface; _commandManager = commandManager; _dataManager = dataManager; _clientState = clientState; _framework = framework; _keyState = keyState; // Load menu_icon.png from dll resources var assembly = Assembly.GetExecutingAssembly(); var resourceStream = assembly.GetManifestResourceStream("TitleEdit.menu_icon.png"); if (resourceStream != null) { var imageBytes = new byte[resourceStream.Length]; resourceStream.Read(imageBytes, 0, (int)resourceStream.Length); PluginLog.Information($"image is {imageBytes.Length} bytes"); try { var image = pluginInterface.UiBuilder.LoadImage(imageBytes); titleScreenMenu.AddEntry("Title Edit Menu", image, () => { _isImguiTitleEditOpen = true; }); } catch (Exception e) { PluginLog.Error(e, "Title Edit encountered an error loading menu icon"); } } _commandManager.AddHandler(TitleEditCommand, new CommandInfo(OnTitleEditCommand) { HelpMessage = "Display the Title Edit configuration interface." }); _configuration = pluginInterface.GetPluginConfig() as TitleEditConfiguration ?? new TitleEditConfiguration(); _configuration.Initialize(pluginInterface); _titleScreenFolder = _pluginInterface.GetPluginConfigDirectory(); if (!Directory.Exists(_titleScreenFolder)) { Directory.CreateDirectory(_titleScreenFolder); } PrepareAssets(); EnumerateTitleScreenFiles(); _territoryPaths = dataManager.GetExcelSheet <TerritoryType>() .ToDictionary(row => row.RowId, row => row); _weathers = dataManager.GetExcelSheet <Weather>() .ToDictionary(row => row.RowId, row => row.Name.ToString()); var bgms = dataManager.GetExcelSheet <BGM>() .ToDictionary(row => (ushort)row.RowId, row => row.File.ToString()); _bgmSheet = new BgmSheetManager(_titleScreenFolder, bgms); _titleEdit = new TitleEdit(sigScanner, clientState, gameGui, dataManager, _pluginInterface, _configuration, _titleScreenFolder); _titleEdit.Enable(); _pluginInterface.UiBuilder.Draw += UiBuilder_OnBuildUi; _framework.Update += CheckHotkey; _pluginInterface.UiBuilder.OpenConfigUi += () => _isImguiTitleEditOpen = true; PluginLog.Log("Init complete."); }
public UpdateParty(SigScanner sigScanner) : base(sigScanner, "40 ?? 48 83 ?? ?? 48 8B ?? 48 ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 83 ?? ?? ?? ?? ?? ?? 74 ?? 48") { }
protected override void Setup64Bit(SigScanner sig) { this.GetTarget = sig.ScanText("40 57 48 83 EC 40 48 8B F9 48 8B 49 08 48 8B 01 FF 50 40 66 83 B8 CA 81 00 00 00 74 33 48 8B 4F 08 48 8B 01 FF 50 40 66 83 B8 CA 81 00 00 04 74"); }
/// <inheritdoc/> protected override void Setup64Bit(SigScanner sig) { this.StdStringFromCstring = sig.ScanText("48895C2408 4889742410 57 4883EC20 488D4122 66C741200101 488901 498BD8"); this.StdStringDeallocate = sig.ScanText("80792100 7512 488B5108 41B833000000 488B09 E9??????00 C3"); }
/// <inheritdoc/> protected override void Setup64Bit(SigScanner sig) { this.GetResourceAsync = sig.ScanText("48 89 5C 24 08 48 89 54 24 10 57 48 83 EC 20 B8 03 00 00 00 48 8B F9 86 82 A1 00 00 00 48 8B 5C 24 38 B8 01 00 00 00 87 83 90 00 00 00 85 C0 74"); this.GetResourceSync = sig.ScanText("48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 54 41 55 41 56 41 57 48 83 EC 30 48 8B F9 49 8B E9 48 83 C1 30 4D 8B F0 4C 8B EA FF 15 CE F6"); // ReadResourceSync = sig.ScanText("48 89 74 24 18 57 48 83 EC 50 8B F2 49 8B F8 41 0F B7 50 02 8B CE E8 ?? ?? 7A FF 0F B7 57 02 8D 42 89 3D 5F 02 00 00 0F 87 60 01 00 00 4C 8D 05"); }
private void FindOffsets() { updatedOffsets = true; Program.PrintInfo("Beginning offset-scan..."); dllClientAddress = Program.GameImplementation.GameController.GetModuleBaseAddressByName(@"bin\client.dll").ToInt32(); dllEngineAddress = Program.GameImplementation.GameController.GetModuleBaseAddressByName(@"engine.dll").ToInt32(); dllClientSize = Program.GameImplementation.GameController.GetModuleSize(@"bin\client.dll"); dllEngineSize = Program.GameImplementation.GameController.GetModuleSize(@"engine.dll"); if (dllClientAddress == 0 || dllClientSize == 0L) { Program.PrintError(" > NOPE: Module client.dll not found"); Console.ReadKey(); return; } if (dllEngineAddress == 0 || dllEngineSize == 0) { Program.PrintError(" > NOPE: Module engine.dll not found"); Console.ReadKey(); return; } scanner = new SigScanner(Program.GameController.Process, IntPtr.Zero, MAX_DUMP_SIZE); FindEntityList(); FindLocalPlayer(); FindRadarBase(); FindScoreBoardBase(); FindCrosshairIndex(); FindServerBase(); FindEnginePointer(); FindAttack(); FindJump(); FindGlowObjectBase(); FindEngineBuffer(); FindViewMatrix(); FindFlashMaxAlpha(); FindFlashMaxDuration(); Program.PrintInfo("Offset-scan finished"); }
protected virtual void Setup32Bit(SigScanner scanner) { throw new NotSupportedException("32 bit version is not supported."); }
public static void Init(SigScanner scanner) { Instance = new HousingMemory(scanner); }
protected virtual void Setup64Bit(SigScanner sig) { throw new NotSupportedException("64 bit version is not supported."); }
public SeFunctionBase(SigScanner sigScanner, int offset) { Address = sigScanner.Module.BaseAddress + offset; PluginLog.Debug($"{GetType().Name} address 0x{Address.ToInt64():X16}, baseOffset 0x{offset:X16}."); }
protected virtual void SetupInternal(SigScanner scanner) { // Do nothing }
public AntiDebug(SigScanner scanner) { DebugCheckAddress = scanner.ScanText("FF 15 ?? ?? ?? ?? 85 C0 74 11"); Log.Verbose("IsDebuggerPresent address {IsDebuggerPresent}", DebugCheckAddress); }
protected override void Setup64Bit(SigScanner sig) { ActorTable = sig.Module.BaseAddress + 0x1C62218; LocalContentId = sig.Module.BaseAddress + 0x1C2E000; JobGaugeData = sig.Module.BaseAddress + 0x1C5E4A0; }
public InterfaceManager(Dalamud dalamud, SigScanner scanner) { this.dalamud = dalamud; try { var sigResolver = new SwapChainSigResolver(); sigResolver.Setup(scanner); Log.Verbose("Found SwapChain via signatures."); Address = sigResolver; } catch (Exception ex) { // The SigScanner method fails on wine/proton since DXGI is not a real DLL. We fall back to vtable to detect our Present function address. Log.Debug(ex, "Could not get SwapChain address via sig method, falling back to vtable..."); var vtableResolver = new SwapChainVtableResolver(); vtableResolver.Setup(scanner); Log.Verbose("Found SwapChain via vtable."); Address = vtableResolver; } try { var rtss = NativeFunctions.GetModuleHandle("RTSSHooks64.dll"); if (rtss != IntPtr.Zero) { var fileName = new StringBuilder(255); NativeFunctions.GetModuleFileName(rtss, fileName, fileName.Capacity); this.rtssPath = fileName.ToString(); Log.Verbose("RTSS at {0}", this.rtssPath); if (!NativeFunctions.FreeLibrary(rtss)) { throw new Win32Exception(); } } } catch (Exception e) { Log.Error(e, "RTSS Free failed"); } var setCursorAddr = LocalHook.GetProcAddress("user32.dll", "SetCursor"); Log.Verbose("===== S W A P C H A I N ====="); Log.Verbose("SetCursor address {SetCursor}", setCursorAddr); Log.Verbose("Present address {Present}", Address.Present); Log.Verbose("ResizeBuffers address {ResizeBuffers}", Address.ResizeBuffers); this.setCursorHook = new Hook <SetCursorDelegate>(setCursorAddr, new SetCursorDelegate(SetCursorDetour), this); this.presentHook = new Hook <PresentDelegate>(Address.Present, new PresentDelegate(PresentDetour), this); this.resizeBuffersHook = new Hook <ResizeBuffersDelegate>(Address.ResizeBuffers, new ResizeBuffersDelegate(ResizeBuffersDetour), this); }
/// <inheritdoc/> protected override void Setup64Bit(SigScanner sig) { this.ReceiveListing = sig.ScanText("40 53 41 57 48 83 EC 28 48 8B D9"); }
public Dalamud(DalamudStartInfo info, LoggingLevelSwitch loggingLevelSwitch) { this.StartInfo = info; this.loggingLevelSwitch = loggingLevelSwitch; this.Configuration = DalamudConfiguration.Load(info.ConfigurationPath); this.baseDirectory = info.WorkingDirectory; this.unloadSignal = new ManualResetEvent(false); // Initialize the process information. this.targetModule = Process.GetCurrentProcess().MainModule; this.SigScanner = new SigScanner(this.targetModule, true); // Initialize game subsystem this.Framework = new Framework(this.SigScanner, this); this.ClientState = new ClientState(this, info, this.SigScanner); this.WinSock2 = new WinSockHandlers(); AssetManager.EnsureAssets(this.baseDirectory).ContinueWith(async task => { if (task.IsCanceled || task.IsFaulted) { throw new Exception("Could not ensure assets.", task.Exception); } this.LocalizationManager = new Localization(this.StartInfo.WorkingDirectory); if (!string.IsNullOrEmpty(this.Configuration.LanguageOverride)) { this.LocalizationManager.SetupWithLangCode(this.Configuration.LanguageOverride); } else { this.LocalizationManager.SetupWithUiCulture(); } var pluginDir = this.StartInfo.PluginDirectory; if (this.Configuration.DoPluginTest) { pluginDir = Path.Combine(pluginDir, "..", "testPlugins"); } this.PluginRepository = new PluginRepository(this, pluginDir, this.StartInfo.GameVersion); if (Environment.GetEnvironmentVariable("DALAMUD_NOT_HAVE_INTERFACE") != "True") { try { this.InterfaceManager = new InterfaceManager(this, this.SigScanner); this.InterfaceManager.OnDraw += BuildDalamudUi; this.InterfaceManager.Enable(); } catch (Exception e) { Log.Information(e, "Could not init interface."); } } this.Data = new DataManager(this.StartInfo.Language); await this.Data.Initialize(this.baseDirectory); // TODO: better way to do this? basically for lumina injection SeString.Dalamud = this; this.NetworkHandlers = new NetworkHandlers(this, this.Configuration.OptOutMbCollection); // Initialize managers. Basically handlers for the logic this.CommandManager = new CommandManager(this, info.Language); SetupCommands(); this.ChatHandlers = new ChatHandlers(this); // Discord Bot Manager this.BotManager = new DiscordBotManager(this, this.Configuration.DiscordFeatureConfig); this.BotManager.Start(); try { this.PluginManager = new PluginManager(this, pluginDir, this.StartInfo.DefaultPluginDirectory); this.PluginManager.LoadPlugins(); } catch (Exception ex) { Log.Error(ex, "Plugin load failed."); } IsReady = true; }); }
public override void GetOffsets() { base.GetOffsets(); MarkingController = SigScanner.GetStaticAddressFromSig("48 8B 94 24 ? ? ? ? 48 8D 0D ? ? ? ? 41 B0 01"); Waymarks = MarkingController + 432; }