/// <summary> /// Spy address event /// </summary> /// <param name="address"></param> private protected override void OnSpyAddress(uint address) { // read 256 bytes of the current context area byte[] data = ReadProcessMemory(m_ContextBuffer.Ecx, 256); // initialize the data length int length = 0; // find the data for (int i = 0; i < data.Length && length == 0; i++) { if (data[i] == 0) { length = i; } } // build the string of the file name string name = m_Encoding.GetString(data, 0, length); // get the file hash ulong hash = ((ulong)m_ContextBuffer.Edx << 32) | m_ContextBuffer.Eax; // if we found the hash we store it into the dictionary HashFound?.Invoke(hash, name); }
/// <summary> /// Метод выполняющий майнинг. /// </summary> private void Mine(IAlgorithm algorithm) { while (true) { var hashResult = algorithm.Hash(); HashFound?.Invoke(this, hashResult); } }