Ejemplo n.º 1
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.º 2
0
 public void AttachToProcess()
 {
     memory = new ProcessMemory(@"clragexe");
     if (!memory.CheckProcess())
         throw new ProcessNotFoundException("Process not found.");
     memory.StartProcess();
 }