예제 #1
0
 private void bScanForProcess_Click(object sender, EventArgs e)
 {
     dataGridView1.Rows.Clear();
     Process[] pWowProcesses = Process.GetProcessesByName("WoW");
     foreach (Process p in pWowProcesses)
     {
         wow.Open(p.Id);
         dataGridView1.Rows.Add(wow.ReadUInt(0x00C7B2A4) == 0 ? true : false, p.Id.ToString(), wow.ReadASCIIString((uint)0x827D88 + (uint)wow.MainModule.BaseAddress, 10).Trim());
     }
 }
예제 #2
0
        public bool Init()
        {
            // Open the Diablo III process
            int processID = SProcess.GetProcessFromProcessName(PROCESS_NAME);

            if (processID == 0)
            {
                Log.Error("Diablo III process not found");
                return(false);
            }

            // Attempt to open the D3 process with read/write permission
            if (!d3.IsProcessOpen && !d3.Open(processID))
            {
                d3 = null;
                Log.Error("Failed to open Diablo III process " + processID);
                return(false);
            }

            if (!computedHash)
            {
                // Compute the MD5 hash of the D3 executable to make sure we're working with the right version
                byte[] md5Bytes;
                using (FileStream exeStream = File.OpenRead(d3.GetModuleFilePath()))
                    md5Bytes = new MD5CryptoServiceProvider().ComputeHash(exeStream);
                string md5Hash = ProcessUtils.BytesToHexString(md5Bytes);
                if (md5Hash != Offsets.MD5_CLIENT)
                {
                    throw new Exception("MD5 checksum failed: " + md5Hash);
                }

                computedHash = true;
            }

            // Initialize the memory reader, including important global pointer addresses
            if (!memReader.UpdatePointers())
            {
                return(false);
            }

            // Install our detour into the DirectX9 EndScene() method
            try
            {
                injector = new Injector(d3, memReader.EndSceneAddr);
            }
            catch (Exception ex)
            {
                Log.Error("Failed to inject custom code", ex);
                return(false);
            }

            return(true);
        }