Пример #1
0
        public async Task Search(string byteText, int start, int stop)
        {
            byteText = byteText.Trim(' ', '\r', '\n');

            _messages.AddHeading($"Searching For Byte Array {byteText}");

            var bytes = byteText.ToByteArray();

            for (var blockNumber = start; blockNumber <= stop; blockNumber++)
            {
                if (_messages.Cancel)
                {
                    break;
                }

                var fileName = Path.Combine(Settings.Default.InputPath, $"blk{blockNumber:D5}.dat");

                _messages.Add($"File: {Path.GetFileNameWithoutExtension(fileName)}", MessageType.Heading);

                if (Path.GetFileName(fileName) == "blk00000.dat")
                {
                    continue;
                }

                Blocks.ClearAll();
                await Blocks.Add(fileName);

                foreach (var transaction in Blocks.TransactionList)
                {
                    SearchTransaction(transaction.Value, bytes);
                }
            }

            _messages.AddCompletion();
        }
        public async Task Search(int start, int stop)
        {
            _messages.AddHeading("Finding Wikileak Hashes stored in the BlockChain");

            for (var blockNumber = start; blockNumber <= stop; blockNumber++)
            {
                if (_messages.Cancel)
                {
                    break;
                }

                var fileName = Path.Combine(Settings.Default.InputPath, $"blk{blockNumber:D5}.dat");

                _messages.Add($"File: {Path.GetFileNameWithoutExtension(fileName)}", MessageType.Heading);

                if (Path.GetFileName(fileName) == "blk00000.dat")
                {
                    continue;
                }

                Blocks.ClearAll();
                await Blocks.Add(fileName);

                SearchTransaction();
            }

            _messages.AddCompletion();
        }
Пример #3
0
        public async Task Search(string txId)
        {
            txId = txId.Trim(' ', '\r', '\n');

            _messages.AddHeading("Finding Transactions in Wikileaks Hash Trailer");

            try{
                await SearchTransaction(txId);
            }
            catch (Exception ex) {
                _messages.Add(ex.Message, MessageType.Error);
            }

            _messages.AddCompletion();
        }
Пример #4
0
        public async Task Search(string txId)
        {
            txId = txId.Trim(' ', '\r', '\n');

            _messages.AddHeading("Walking down Transactions");

            try{
                await SearchTransaction(txId);
            }
            catch (Exception ex) {
                _messages.Add(ex.Message, MessageType.Error);
            }

            _messages.AddCompletion();
        }
Пример #5
0
        public void Download(string txId)
        {
            txId = txId.Trim(' ', '\r', '\n');

            _messages.AddHeading("Combining all strange transactions");

            var fileData = _block.DownloadStrangeFile(txId);

            if (fileData == null)
            {
                throw new InvalidDataException($"The transaction ID {txId} was not found");
            }

            // Now check for headers

            var fileName = Path.Combine(Settings.Default.OutputPath, Path.ChangeExtension(txId, fileData.Extension));

            File.Delete(fileName);
            File.WriteAllBytes(fileName, fileData.Data);

            _messages.Add($"File saved to {fileName}");

            _messages.AddCompletion();
        }
Пример #6
0
        public async Task Search(int start, int stop)
        {
            _messages.AddHeading("Searching for Known Extensions");

            for (var blockNumber = start; blockNumber <= stop; blockNumber++)
            {
                var fileName = Path.Combine(Settings.Default.InputPath, $"blk{blockNumber:D5}.dat");

                _messages.Add($"File: {Path.GetFileNameWithoutExtension(fileName)}", MessageType.Heading);

                if (Path.GetFileName(fileName) == "blk00000.dat")
                {
                    continue;
                }

                Blocks.ClearAll();
                await Blocks.Add(fileName);

                foreach (var block in Blocks)
                {
                    if (_messages.Cancel)
                    {
                        break;
                    }

                    foreach (var transaction in block.Transactions)
                    {
                        if (_messages.Cancel)
                        {
                            break;
                        }

                        var fileData = Blocks.GetFile(transaction.ToString());

                        if (fileData == null)
                        {
                            continue;
                        }

                        var message = $"{fileData.Extension}: {transaction}";

                        switch (fileData.Extension)
                        {
                        case "dat":
                            break;

                        case "gif":
                        case "jpg":
                        case "png":
                            var data = transaction.Outs.GetFileBytes();

                            try{
                                var imageSource = GetImageSource(data);
                                _messages.Add(message, imageSource);
                            }
                            catch {
                                _messages.Add(message);
                            }

                            break;

                        case "txt":
                            _messages.Add(message);
                            _messages.Add(Encoding.ASCII.GetString(fileData.Data));
                            break;

                        default:
                            _messages.Add(message);
                            break;
                        }
                    }
                }
            }

            _messages.AddCompletion();
        }