private void listView1_DoubleClick(object sender, EventArgs e)
        {
            int           b   = listView1.SelectedItems[0].Index;
            ProcessModule tpm = MyProc.Modules[b];

            EditMemory.ReadMemory(MyProc.Handle, tpm.BaseAddress, 0x4000, bv);
            //EditMemory.ReadMemory(MyProc.Handle, tpm.BaseAddress, 0x4000, listView2);
        }
 private void btn_search_Click(object sender, EventArgs e)
 {
     listBox1.Items.Clear();
     this.findaddress.Clear();
     EditMemory.MemoryScanAOB(MyProc.Handle, Convert.ToInt32(textBox2.Text, 16), Convert.ToInt32(textBox3.Text, 16), textBox1.Text, ref this.findaddress);
     foreach (int tmp in this.findaddress)
     {
         listBox1.Items.Add(Convert.ToString(tmp, 16).PadLeft(8, '0').ToUpper());
     }
 }
        private void label1_Click_1(object sender, EventArgs e)
        {
            MemoryReadDialog mrd = new MemoryReadDialog();

            if (mrd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                int startAddress = mrd.range1;
                int endAddress   = mrd.range2;
                int size         = endAddress - startAddress;
                EditMemory.ReadMemory(MyProc.Handle, (IntPtr)startAddress, size, bv);
            }
        }
        private void listView1_DoubleClick(object sender, EventArgs e)
        {
            MemoryWriteDialog mwd = new MemoryWriteDialog(listView1.SelectedItems[0].SubItems[4].Text);

            if (mwd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                bool result = EditMemory.WriteMemoryAOB(MyProc.Handle, (IntPtr)Convert.ToInt32(listView1.SelectedItems[0].SubItems[2].Text, 16), mwd.AOB);
                if (result == false)
                {
                    MessageBox.Show("WriteMemoryAOB Error");
                }
            }
        }
        private void mydataupdate_Tick(object sender, EventArgs e)
        {
            MyProc.Refresh();
            if (MyProc.HasExited == true)
            {
                return;
            }

            for (int i = 0; i < mysavedata.Count; i++)
            {
                string tmp;
                mydata md = mysavedata[i] as mydata;
                EditMemory.ReadMemory(MyProc.Handle, md.address, 10, out tmp);
                ListViewItem lvi = new ListViewItem();
                lvi.SubItems.Add(md.desc);
                lvi.SubItems.Add(Convert.ToString((int)md.address, 16).PadLeft(8, '0').ToUpper());
                lvi.SubItems.Add(md.type);
                lvi.SubItems.Add(tmp);

                if (EditMemory.listviewexist(listView1, i))
                {
                    if (Convert.ToString((int)md.address, 16).PadLeft(8, '0').ToUpper() != listView1.Items[i].SubItems[2].Text)
                    {
                        listView1.Items.RemoveAt(i);
                        listView1.Items.Insert(i, lvi);
                    }
                    if (md.desc != listView1.Items[i].SubItems[1].Text)
                    {
                        listView1.Items.RemoveAt(i);
                        listView1.Items.Insert(i, lvi);
                    }
                    if (md.type != listView1.Items[i].SubItems[3].Text)
                    {
                        listView1.Items.RemoveAt(i);
                        listView1.Items.Insert(i, lvi);
                    }
                    if (tmp != listView1.Items[i].SubItems[4].Text)
                    {
                        listView1.Items.RemoveAt(i);
                        listView1.Items.Insert(i, lvi);
                    }
                }
                else
                {
                    listView1.Items.Insert(i, lvi);
                }
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            AddMemoryDialog amd = new AddMemoryDialog();

            if (amd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string buffer;
                bool   result = EditMemory.ReadMemory(MyProc.Handle, (IntPtr)amd.address, 0x10, out buffer);
                if (result == false)
                {
                    return;
                }

                mysavedata.Add(new mydata((IntPtr)amd.address, amd.type, amd.decription));
            }
        }
        private void label33_Click(object sender, EventArgs e)
        {
            MemoryAllocDialog mad = new MemoryAllocDialog();

            if (mad.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                IntPtr tmp = Win32API.VirtualAllocEx(MyProc.Handle, (IntPtr)mad.address, mad.size, Win32API.MEM_COMMIT, Win32API.PAGE_READWRITE);
                if (tmp == IntPtr.Zero)
                {
                    MessageBox.Show("할당 실패");
                }
                else
                {
                    EditMemory.ReadMemory(MyProc.Handle, tmp, mad.size, bv);
                    listBox2.Items.Add(Convert.ToString((int)tmp, 16).PadLeft(8, '0').ToUpper() + "  size : " + mad.size);
                }
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            IntPtr kernel = Win32API.GetModuleHandle("kernel32.dll");

            if (kernel == IntPtr.Zero)
            {
                label2.Text = "ERROR";
            }
            else
            {
                label2.Text = Convert.ToString(kernel.ToInt64(), 16);
                progressBar1.PerformStep();
            }

            IntPtr lploadlibrary = Win32API.GetProcAddress(kernel, "LoadLibraryA");

            if (lploadlibrary == IntPtr.Zero)
            {
                label4.Text = "ERROR";
            }
            else
            {
                label4.Text = Convert.ToString(lploadlibrary.ToInt64(), 16);
                progressBar1.PerformStep();
            }

            IntPtr param = Win32API.VirtualAllocEx(MyProc.Handle, (IntPtr)0, 100, Win32API.MEM_COMMIT, Win32API.PAGE_EXECUTE_READWRITE);

            if (param == IntPtr.Zero)
            {
                label6.Text = "ERROR";
            }
            else
            {
                label6.Text = Convert.ToString(param.ToInt64(), 16);
                progressBar1.PerformStep();
            }
            bool wpm = EditMemory.WriteMemoryAOB(MyProc.Handle, param, richTextBox1.Text);

            if (wpm == false)
            {
                label8.Text = "ERROR";
            }
            else
            {
                label8.Text = Convert.ToString(wpm);
                progressBar1.PerformStep();
            }
            IntPtr remoteThread = Win32API.CreateRemoteThread(MyProc.Handle, 0, 0, lploadlibrary, param, 0, (IntPtr)0);

            if (remoteThread == IntPtr.Zero)
            {
                label10.Text = "ERROR";
            }
            else
            {
                label10.Text = Convert.ToString(remoteThread.ToInt64(), 16);
                progressBar1.PerformStep();
                Win32API.CloseHandle(remoteThread);
            }
        }