Ejemplo n.º 1
0
 private void BattleClientClearNameMemory()
 {
     for (int i = 0; i < BATTLECLIENTNAMEOFFSETLIST.Length; i++)
     {
         for (int j = 0; j < 26; j++)
         {
             m_battleClientGH.WriteByte(m_gameModuleAddress + BATTLECLIENTNAMEOFFSETLIST[i] + j, 0);
         }
     }
     for (int i = 0; i < ISSO_OFFSETLIST.Length; i++)
     {
         for (int j = 0; j < 26; j++)
         {
             m_battleClientGH.WriteByte(two + BATTLECLIENTNAMEOFFSETLIST[i] + j, 0);
         }
     }
     for (int i = 0; i < SSS_TRD_OFFSETLIST.Length; i++)
     {
         for (int j = 0; j < 26; j++)
         {
             m_battleClientGH.WriteByte(three + BATTLECLIENTNAMEOFFSETLIST[i] + j, 0);
         }
     }
     for (int i = 0; i < ASSOCKET_OFFSETLIST.Length; i++)
     {
         for (int j = 0; j < 26; j++)
         {
             m_battleClientGH.WriteByte(four + BATTLECLIENTNAMEOFFSETLIST[i] + j, 0);
         }
     }
 }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            Process battleClientTask = Process.GetProcessesByName("11Game")[0];

            if (battleClientTask == null)
            {
                MessageBox.Show("Task not found");
                return;
            }
            else
            {
                m_battleClientGH = new Tools.Tools.GameHelper();
                string name = null;
                byte[] bys  = Encoding.Unicode.GetBytes(textBox1.Text);
                foreach (byte b in bys)
                {
                    name += b.ToString() + " ";
                }
                Clipboard.SetText(name.Trim());
                if (bys.Length > 26)   //!=5
                {
                    textBox1.Text = "";
                    MessageBox.Show("长度太长");
                    return;
                }
                else
                {
                    name = textBox1.Text;
                    m_battleClientGH.ReadProcess = battleClientTask;
                    Tools.Tools.GameHelper.ModuleInfo[] moduleArray = m_battleClientGH.GetEntryPoint();
                    m_gameModuleAddress = (int)moduleArray[0].Address;

                    foreach (Tools.Tools.GameHelper.ModuleInfo mi in moduleArray)
                    {
                        if (mi.ModuleName.ToString().ToUpper().Contains("11SSO.DLL"))
                        {
                            two = (int)mi.Address;
                        }
                        if (mi.ModuleName.ToString().ToUpper().Contains("11SSO_TRD.DLL"))
                        {
                            three = (int)mi.Address;
                        }
                        if (mi.ModuleName.ToString().ToUpper().Contains("ASSOCKET.DLL"))
                        {
                            four = (int)mi.Address;
                        }
                    }
                    byte[] unicodeName = Encoding.Unicode.GetBytes(name);
                    BattleClientClearNameMemory();
                    for (int i = 0; i < BATTLECLIENTNAMEOFFSETLIST.Length; i++)
                    {
                        for (int j = 0; j < unicodeName.Length; j++)
                        {
                            m_battleClientGH.WriteByte(m_gameModuleAddress + BATTLECLIENTNAMEOFFSETLIST[i] + j, unicodeName[j]);
                        }
                    }

                    for (int i = 0; i < ISSO_OFFSETLIST.Length; i++)
                    {
                        for (int j = 0; j < unicodeName.Length; j++)
                        {
                            m_battleClientGH.WriteByte(two + BATTLECLIENTNAMEOFFSETLIST[i] + j, unicodeName[j]);
                        }
                    }
                    for (int i = 0; i < SSS_TRD_OFFSETLIST.Length; i++)
                    {
                        for (int j = 0; j < unicodeName.Length; j++)
                        {
                            m_battleClientGH.WriteByte(three + BATTLECLIENTNAMEOFFSETLIST[i] + j, unicodeName[j]);
                        }
                    }
                    for (int i = 0; i < ASSOCKET_OFFSETLIST.Length; i++)
                    {
                        for (int j = 0; j < unicodeName.Length; j++)
                        {
                            m_battleClientGH.WriteByte(four + BATTLECLIENTNAMEOFFSETLIST[i] + j, unicodeName[j]);
                        }
                    }
                    MessageBox.Show(" 修改完成");
                }
            }
        }