private void ButtonDetach_Click(object sender, RoutedEventArgs e)
        {
            if (TrashMem != null)
            {
                TrashMem.Detach();
            }

            ResetTrashMemViews();
        }
        private void ButtonAttach_Click(object sender, RoutedEventArgs e)
        {
            if (listboxProcesses != null)
            {
                if (TrashMem != null)
                {
                    TrashMem.Detach();
                    ResetTrashMemViews();
                }

                TrashMem = new TrashMem(((CProcess)listboxProcesses.SelectedItem).Process);

                labelTrashMemAttachedId.Content    = $"{TrashMem.Process.Id} => 0x{TrashMem.Process.Id.ToString("X")}";
                labelTrashMemProcessHandle.Content = $"0x{TrashMem.ProcessHandle.ToString("X")}";
                labelTrashMemAllocs.Content        = $"{TrashMem.MemoryAllocations.Count}";
                labelTrashMemCachedSizes.Content   = $"{TrashMem.CachedSizeManager.SizeCache.Count}";
                labelTrashMemThreads.Content       = $"{TrashMem.CachedSizeManager.SizeCache.Count}";
                labelKernel32Module.Content        = $"0x{TrashMem.Kernel32ModuleHandle.ToString("X")}";
                labelLoadLibaryA.Content           = $"0x{TrashMem.LoadLibraryAAddress.ToString("X")}";
                labelTrashMemThreads.Content       = $"{TrashMem.RemoteThreads.Count}";
            }
        }
        public static List <WowProcess> GetRunningWows(IOffsetList offsetList)
        {
            List <WowProcess> wows        = new List <WowProcess>();
            List <Process>    processList = new List <Process>(Process.GetProcessesByName("Wow"));

            foreach (Process p in processList)
            {
                TrashMem trashMem = new TrashMem(p);
                uint     pDevice  = trashMem.ReadUnmanaged <uint>(offsetList.StaticEndSceneDevice);
                uint     pEnd     = trashMem.ReadUnmanaged <uint>(pDevice + offsetList.EndSceneOffsetDevice);
                uint     pScene   = trashMem.ReadUnmanaged <uint>(pEnd);
                uint     endscene = trashMem.ReadUnmanaged <uint>(pScene + offsetList.EndSceneOffset);

                bool isAlreadyHooked = false;
                try
                {
                    isAlreadyHooked = trashMem.ReadChar(endscene + 0x2) == 0xE9;
                }
                catch { }

                string name = trashMem.ReadString(offsetList.StaticPlayerName, Encoding.ASCII, 12);
                if (name.Length == 0)
                {
                    name = "";
                }

                string realm = trashMem.ReadString(offsetList.StaticRealmName, Encoding.ASCII, 12);
                if (realm.Length == 0)
                {
                    realm = "";
                }

                wows.Add(new WowProcess(p, name, realm, isAlreadyHooked));
                trashMem.Detach();
            }

            return(wows);
        }