public static void Init() { // Current texthook.dll version 4.15 string textractorPath = Directory.GetCurrentDirectory() + @"\libs\texthost.dll"; if (!File.Exists(textractorPath)) { throw new FileNotFoundException(textractorPath); } _createThread = CreateThreadHandle; _output = OutputHandle; _removeThread = RemoveThreadHandle; _callback = OnConnectCallBackHandle; _ = TextHostLib.TextHostInit(_callback, _ => { }, _createThread, _removeThread, _output); foreach (Process p in DataRepository.GameProcesses) { _ = TextHostLib.InjectProcess((uint)p.Id); Log.Info($"attach to PID {p.Id}."); } }
public static void Init() { log.Info("initilize start."); string textractorPath = Directory.GetCurrentDirectory() + @"\libs\texthost.dll"; if (!File.Exists(textractorPath)) { throw new FileNotFoundException(textractorPath); } createthread = CreateThreadHandle; output = OutputHandle; removethread = RemoveThreadHandle; callback = OnConnectCallBackHandle; TextHostLib.TextHostInit(callback, _ => { }, createthread, removethread, output); foreach (Process p in DataRepository.GameProcesses) { TextHostLib.InjectProcess((uint)p.Id); log.Info($"attach to PID {p.Id}."); } }