Ejemplo n.º 1
0
        protected virtual MemoryVariableData GetMessagesCounterData()
        {
            var data = new MemoryVariableData();
            var mainModuleAddress = base._process.MainModule.BaseAddress;
            var offsetsList = MessagesData.Offsets.TakeWhile(p => p != null).Select(p => Convert.ToInt32(p)).ToList();

            var baseAddress= _process.MainModule.BaseAddress;
            var address = baseAddress;

            for (int i = 0; i < offsetsList.Count - 1; i++)
                address = GetMemoryAddress(address, offsetsList[i]);

            data.Address = address;
            data.Offset = offsetsList.Last();
            data.Size = MessagesData.Size;
            return data;
        }
Ejemplo n.º 2
0
 protected override void OnMessageProcessingSubscribe()
 {
     _messagesCounter = GetMessagesCounterData();
     if (_messageProcessingTimer == null)
         _messageProcessingTimer = new Timer(MessagesProcessingTimerCallback, null, 0, 1000);
 }
Ejemplo n.º 3
0
 protected override void Dispose(bool disposing)
 {
     if (_disposed)
         return;
     if (disposing)
     {
         _messagesCounter = null;
         MessagesProcessingTimerTick -= DesktopMessenger_MessagesProcessingTimerTick;
         _instanceList.Remove(this);
     }
     _disposed = true;
     base.Dispose(disposing);
 }