/
Extraction.cs
47 lines (41 loc) · 1.34 KB
/
Extraction.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using OpenMetaverse;
using OpenMetaverse.Assets;
namespace FirstBot
{
static class Extraction
{
private static List<string> foundData = new List<string>();
public static void DownloadSteg(byte[] fileData, UUID fileID, GridClient Client)
{
Console.WriteLine("Found Something!");
string fileName = fileID.ToString() + ".jp2";
foundData.Add(fileName);
try
{
File.WriteAllBytes(fileName, fileData);
}
catch (Exception ex)
{
Logger.Log(ex.Message, Helpers.LogLevel.Error, Client, ex);
}
}
public static void ExtractSteg()
{
Process commandLine = new Process();
commandLine.StartInfo.FileName = "7za.exe";
commandLine.StartInfo.UseShellExecute = false;
commandLine.StartInfo.RedirectStandardOutput = true;
foreach (string file in foundData)
{
commandLine.StartInfo.Arguments = "x " + file;
commandLine.Start();
string stringOutput = commandLine.StandardOutput.ReadToEnd();
commandLine.WaitForExit();
}
}
}
}