Exemplo n.º 1
0
        public FFXIVLogStatus Search()
        {
            _stat = null;
            threadList.Clear();
            StartSearch();
            Label_0018:
            if (this._stat != null) return _stat;

            foreach (Thread thread in threadList) {
                if (thread.IsAlive) {
                    Thread.Sleep(100);
                    goto Label_0018;
                }
            }
            return null;
        }
Exemplo n.º 2
0
 /// <summary>
 /// PLINQ版メモリサーチ。
 /// </summary>
 /// <returns></returns>
 public FFXIVLogStatus SearchPLINQ()
 {
     _stat = null;
     var st = EnRangePair()
         .AsParallel()
         .SelectMany(a => EnSearch(a.Entry, a.Size, 0x40))
         .FirstOrDefault();
     if (st != null) OnLogStatusFound(st);
     _stat = st;
     return st;
 }
Exemplo n.º 3
0
 private void SearchTask(int ent, int size)
 {
     var buffer = this.ffxiv.ReadBytes(ent, size);
     var input = new MemoryStream();
     input.Write(buffer, 0, buffer.Length);
     input.Position = 0L;
     var reader = new BinaryReader(input);
     for (int i = 0; i < (size - 4); i += 4) {
         if (this._stat != null) {
             return;
         }
         var address = reader.ReadInt32() + 0x40;
         var num3 = ffxiv.ReadInt32(address);
         if ((num3 >= 0x10000) && (num3 <= 0x7ffff000)) {
             var bytes = this.ffxiv.ReadBytes(num3, 5);
             if (((bytes[4] == 0x3a) && (bytes[0] == 0x30)) && (bytes[1] == 0x30)) {
                 bytes = this.ffxiv.ReadBytes(num3, 50);
                 string str = Encoding.GetEncoding("utf-8").GetString(bytes);
                 if (this.reLogEntry.IsMatch(str)) {
                     var status = new FFXIVLogStatus(this.ffxiv, address);
                     OnLogStatusFound(status);
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
        private void OnLogStatusFound(FFXIVLogStatus stat)
        {
            Log.Trace("OnLogStatusFound({0})", stat);

            _stat = stat;
            if (LogStatusFound != null) {
                LogStatusFound(this, new LogStatusFoundEventArgs(stat));
            }
            if (Completed != null) {
                Completed(this, EventArgs.Empty);
            }
        }
Exemplo n.º 5
0
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     Process fFXIVGameProcess = FFXIVMemoryProvidor.GetFFXIVGameProcess();
     if (fFXIVGameProcess != null)
     {
     this.logstat = new LogStatusSearcher(new FFXIVProcess(fFXIVGameProcess)).Search();
     }
 }
Exemplo n.º 6
0
 public LogStatusFoundEventArgs(FFXIVLogStatus logStatus)
 {
     LogStatus = logStatus;
 }