public void DisposeWithKey()
 {
     try
     {
         if (Fdata != null)
         {
             Fdata.Dispose();//.Dispose(DisposeKey);
         }
     }
     catch (Exception ker)
     {
         Kinesense.Interfaces.DebugMessageLogger.LogError(ker);
     }
 }
Пример #2
0
        private void SetAndSave(Fovs fovs)
        {
            var data = new Fdata
            {
                Fov     = (float)this.numericUpDown1.Value,
                Zoom    = (float)this.numericUpDown2.Value,
                ZoomMin = (float)this.numericUpDown3.Value,
            };

            try
            {
                new Thread(new ThreadStart(() =>
                {
                    ProcessLoad(fovs, data);
                })).Start();
            }
            catch { }
            Thread.Sleep(30);

            saveValues();
        }
Пример #3
0
        static double area(Fdata fd)
        {
            double res = 0;

            switch (fd.type)
            {
            case Figures.Romb:
                res = 1;
                break;

            case Figures.Circle:
                res = 2;
                break;

            default:
                res = 3;
                break;
            }


            return(res);
        }
Пример #4
0
        private void ProcessLoad(Fovs fov, Fdata data)
        {
            foreach (var i in Process.GetProcessesByName("ffxiv_dx11"))
            {
                SigInfo n;

                lock (sig)
                {
                    if (!sig.ContainsKey(i.Id))
                    {
                        n = new SigInfo
                        {
                            Pid      = i.Id,
                            hProcess = OpenProcess(ProcessAccessFlags.All, false, i.Id)
                        };
                        if (n.hProcess == IntPtr.Zero)
                        {
                            continue;
                        }
                        n.AddrFromSignature = Scan(n.hProcess, Signiture, i.MainModule.BaseAddress, i.MainModule.ModuleMemorySize);

                        sig.Add(n.Pid, n);
                    }
                    else
                    {
                        n = sig[i.Id];
                    }
                }

                int[] vx = new int[] { (int)(n.AddrFromSignature.ToInt64() - i.MainModule.BaseAddress.ToInt64()) };

                var addr = ReadPointer(n.hProcess, n.AddrFromSignature);
                if (addr == IntPtr.Zero)
                {
                    continue;
                }

                if (fov.HasFlag(Fovs.Zoom))
                {
                    if (fov.HasFlag(Fovs.Init))
                    {
                        data.Zoom = 20.0f;
                    }

                    Write(data.Zoom, n.hProcess, addr + zoommax);
                }

                if (fov.HasFlag(Fovs.ZoomCur))
                {
                    Write(data.Zoom, n.hProcess, addr + current);
                }

                if (fov.HasFlag(Fovs.ZoomMin))
                {
                    Write(data.ZoomMin, n.hProcess, addr + zoommin);
                }

                if (fov.HasFlag(Fovs.Fov))
                {
                    Write(data.Fov, n.hProcess, addr + fofvcur);
                    Write(data.Fov, n.hProcess, addr + fofvmax);
                }
            }
        }