Ejemplo n.º 1
0
 public bool StartProcess()
 {
     if (this.ProcessName != "")
     {
         this.MyProcess = Process.GetProcessesByName(this.ProcessName);
         if (this.MyProcess.Length == 0)
         {
             int num = (int)MessageBox.Show(this.ProcessName + " is not running or has not been found. Please check and try again", "Process Not Found", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             return(false);
         }
         else
         {
             this.processHandle = ProcessMemory.OpenProcess(2035711U, false, this.MyProcess[0].Id);
             if (this.processHandle != 0)
             {
                 return(true);
             }
             int num = (int)MessageBox.Show(this.ProcessName + " is not running or has not been found. Please check and try again", "Process Not Found", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             return(false);
         }
     }
     else
     {
         int num = (int)MessageBox.Show("Define process name first!");
         return(false);
     }
 }
Ejemplo n.º 2
0
 public Character(int index, Client client)
 {
     this.client = client;
     this.memory = new ProcessMemory(client == Client.Classic ? @"clragexe" : @"ragexe", index);
     memory.StartProcess();
     String filename = client == Client.Classic ? @"memoryaddress.dat" : @"renewalmemory.dat";
     try
     {
         using (StreamReader reader = new StreamReader(filename))
         {
             String line = reader.ReadLine();
             HP = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             SP = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             MAX_HP = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             MAX_SP = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             NAME = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             MAP_NAME = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             WEIGHT = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             MAX_WEIGHT = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             EXP = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             EXP_TO_NEXT = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             BASE_LEVEL = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             JOB_LEVEL = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             JOB_EXP = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
             line = reader.ReadLine();
             JOB_EXP_TO_NEXT = int.Parse(line, System.Globalization.NumberStyles.HexNumber);
         }
     }
     catch (Exception)
     {
         if (client == Client.Classic)
         {
             HP = 0x008b78dc;
             SP = 0x008b78e4;
             MAX_HP = 0x008b78e0;
             MAX_SP = 0x008b78e8;
             NAME = 0x008b7bf8;
             MAP_NAME = 0x008b57a4;
             WEIGHT = 0x008b64d8;
             MAX_WEIGHT = 0x008b64cc;
             EXP = 0x008b6418;
             EXP_TO_NEXT = 0x008b6424;
             BASE_LEVEL = 0x008b641c;
             JOB_LEVEL = 0x008b6428;
             JOB_EXP = 0x008b64d4;
             JOB_EXP_TO_NEXT = 0x008b64d0;
         }
         else
         {
             HP = 0x99DAC4;
             SP = 0x99DACC;
             MAX_HP = 0x99DAC8;
             MAX_SP = 0x99DAD0;
             NAME = 0x99e000;
             MAP_NAME = 0x99aa0c;
             WEIGHT = 0x99b74c;
             MAX_WEIGHT = 0x99b740;
             EXP = 0x99b68c;
             EXP_TO_NEXT = 0x99b698;
             BASE_LEVEL = 0x99b690;
             JOB_LEVEL = 0x99b69c;
             JOB_EXP = 0x99b748;
             JOB_EXP_TO_NEXT = 0x99b744;
         }
     }
 }
Ejemplo n.º 3
0
 public void Dispose()
 {
     ReadWriteMemory.ProcessMemory.CloseHandle(memory.ProcessHandle);
     memory = null;
 }
Ejemplo n.º 4
0
 public void AttachToProcess()
 {
     memory = new ProcessMemory(@"clragexe");
     if (!memory.CheckProcess())
         throw new ProcessNotFoundException("Process not found.");
     memory.StartProcess();
 }
Ejemplo n.º 5
0
 public void WriteMem(int pOffset, byte[] pBytes, bool AddToImageAddress)
 {
     ProcessMemory.WriteProcessMemory(this.processHandle, AddToImageAddress ? this.ImageAddress(pOffset) : pOffset, pBytes, pBytes.Length, 0);
 }
Ejemplo n.º 6
0
 public void WriteMem(int pOffset, byte[] pBytes)
 {
     ProcessMemory.WriteProcessMemory(this.processHandle, pOffset, pBytes, pBytes.Length, 0);
 }
Ejemplo n.º 7
0
 public byte[] ReadMem(int pOffset, int pSize, bool AddToImageAddress)
 {
     byte[] buffer = new byte[pSize];
     ProcessMemory.ReadProcessMemory(this.processHandle, AddToImageAddress ? this.ImageAddress(pOffset) : pOffset, buffer, pSize, 0);
     return(buffer);
 }
Ejemplo n.º 8
0
 public byte[] ReadMem(int pOffset, int pSize)
 {
     byte[] buffer = new byte[pSize];
     ProcessMemory.ReadProcessMemory(this.processHandle, pOffset, buffer, pSize, 0);
     return(buffer);
 }
Ejemplo n.º 9
0
 public byte ReadByte(string Module, int pOffset)
 {
     byte[] buffer = new byte[1];
     ProcessMemory.ReadProcessMemory(this.processHandle, this.DllImageAddress(Module) + pOffset, buffer, 1, 0);
     return(buffer[0]);
 }
Ejemplo n.º 10
0
 public byte ReadByte(bool AddToImageAddress, int pOffset)
 {
     byte[] buffer = new byte[1];
     ProcessMemory.ReadProcessMemory(this.processHandle, AddToImageAddress ? this.ImageAddress(pOffset) : pOffset, buffer, 1, 0);
     return(buffer[0]);
 }
Ejemplo n.º 11
0
 public byte ReadByte(int pOffset)
 {
     byte[] buffer = new byte[1];
     ProcessMemory.ReadProcessMemory(this.processHandle, pOffset, buffer, 1, 0);
     return(buffer[0]);
 }