/// <summary> /// 通过密钥对文本进行加密 /// </summary> /// <param name="str"></param> /// <param name="SecretKey">密钥</param> /// <param name="SingleLine">True:单行;False:所有</param> /// <param name="Standard">是否使用标准方式</param> /// <returns>加密后的文本</returns> public static string Encrypt(this string str, string SecretKey, bool SingleLine = true, bool Standard = false) { DESCryptoServiceProvider des = new DESCryptoServiceProvider(); if (Standard) { des.Mode = CipherMode.ECB; des.Padding = PaddingMode.Zeros; } des.Key = SecretKey.ToMD5().Substring(0, 0x08).ToBytes(); des.IV = SecretKey.ToMD5().Substring(0, 0x08).ToBytes(); global::System.IO.MemoryStream ms = new global::System.IO.MemoryStream(); CryptoStream encStream = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write); global::System.IO.StreamWriter sw = new global::System.IO.StreamWriter(encStream); if (SingleLine) sw.WriteLine(str); else sw.Write(str); sw.Close(); encStream.Close(); byte[] buffer = ms.ToArray(); ms.Close(); StringBuilder hash = new StringBuilder(); foreach (byte b in buffer.ToArray()) { hash.AppendFormat("{0:X2}", b); } return hash.ToString(); }
// Token: 0x06000003 RID: 3 RVA: 0x000020A8 File Offset: 0x000002A8 private void SMTP(string pipe, string input) { if (global::MainDab.Classes.WeAreDevsAPI.ExploitAPI.NamedPipeExist(pipe)) { try { using (global::System.IO.Pipes.NamedPipeClientStream namedPipeClientStream = new global::System.IO.Pipes.NamedPipeClientStream(".", pipe, global::System.IO.Pipes.PipeDirection.Out)) { namedPipeClientStream.Connect(); using (global::System.IO.StreamWriter streamWriter = new global::System.IO.StreamWriter(namedPipeClientStream)) { streamWriter.Write(input); streamWriter.Dispose(); } namedPipeClientStream.Dispose(); } return; } catch (global::System.IO.IOException) { global::System.Windows.Forms.MessageBox.Show("Error occured sending message to the game!", "Connection Failed!", global::System.Windows.Forms.MessageBoxButtons.OK, global::System.Windows.Forms.MessageBoxIcon.Hand); return; } catch (global::System.Exception ex) { global::System.Windows.Forms.MessageBox.Show(ex.Message.ToString()); return; } } global::System.Windows.Forms.MessageBox.Show("Error occured. Did the dll properly inject?", "Oops", global::System.Windows.Forms.MessageBoxButtons.OK, global::System.Windows.Forms.MessageBoxIcon.Exclamation); }
// Token: 0x06000003 RID: 3 RVA: 0x00002094 File Offset: 0x00000294 public void Execute(string Script) { bool flag = RevenantAPI.namedPipeExist(this.pipeName); bool flag2 = flag; if (flag2) { using (global::System.IO.Pipes.NamedPipeClientStream namedPipeClientStream = new global::System.IO.Pipes.NamedPipeClientStream(".", this.pipeName, global::System.IO.Pipes.PipeDirection.Out)) { namedPipeClientStream.Connect(); using (global::System.IO.StreamWriter streamWriter = new global::System.IO.StreamWriter(namedPipeClientStream, global::System.Text.Encoding.Default, 0xF423F)) { streamWriter.Write(Script); streamWriter.Dispose(); } namedPipeClientStream.Dispose(); } } else { bool flag3 = global::System.IO.File.Exists("Arch.dll"); if (flag3) { global::System.Windows.Forms.MessageBox.Show("Please attach!", "Error!", global::System.Windows.Forms.MessageBoxButtons.OK, global::System.Windows.Forms.MessageBoxIcon.Hand); } } }
// Token: 0x06000004 RID: 4 RVA: 0x00002210 File Offset: 0x00000410 public void ExecuteScript(string Script) { if (Module.namedPipeExist("ocybedam")) { using (global::System.IO.Pipes.NamedPipeClientStream namedPipeClientStream = new global::System.IO.Pipes.NamedPipeClientStream(".", "ocybedam", global::System.IO.Pipes.PipeDirection.Out)) { namedPipeClientStream.Connect(); using (global::System.IO.StreamWriter streamWriter = new global::System.IO.StreamWriter(namedPipeClientStream, global::System.Text.Encoding.Default, 0xF423F)) { streamWriter.Write(Script); streamWriter.Dispose(); } namedPipeClientStream.Dispose(); } return; } if (global::System.IO.File.Exists("EasyExploitsDLL.dll")) { global::System.Windows.Forms.MessageBox.Show("Please attach!", "NamedPipeDoesntExist", global::System.Windows.Forms.MessageBoxButtons.OK, global::System.Windows.Forms.MessageBoxIcon.Hand); return; } //global::System.Windows.Forms.MessageBox.Show("Please turn off your antivirus! bruh", "DLLDoesntExist", global::System.Windows.Forms.MessageBoxButtons.OK, global::System.Windows.Forms.MessageBoxIcon.Hand); }
// Token: 0x06000004 RID: 4 RVA: 0x00002448 File Offset: 0x00000648 public void ExecuteScript(string Script) { try { if (global::MainDab.Classes.ShadowCheatsAPI.Pipes.DoesNamedPipeExist(global::MainDab.Classes.ShadowCheatsAPI.Pipes.ShadowCheats)) { using (global::System.IO.Pipes.NamedPipeClientStream namedPipeClientStream = new global::System.IO.Pipes.NamedPipeClientStream(".", MainDab.Classes.ShadowCheatsAPI.Pipes.ShadowCheats, global::System.IO.Pipes.PipeDirection.Out)) { namedPipeClientStream.Connect(); using (global::System.IO.StreamWriter streamWriter = new global::System.IO.StreamWriter(namedPipeClientStream)) { streamWriter.Write(Script); streamWriter.Dispose(); } namedPipeClientStream.Dispose(); } } } catch (global::System.Exception ex) { global::System.Console.WriteLine("[{0}] [Shadow Cheats] -> Unexpected Error: {1}", global::System.DateTime.Now.ToLongTimeString(), ex.Message); global::System.Windows.Forms.MessageBox.Show("Uh oh. Shadow Cheats has reached a roadblock. You can find a detailed error in the console.", "Shadow Cheats", global::System.Windows.Forms.MessageBoxButtons.OK, global::System.Windows.Forms.MessageBoxIcon.Exclamation); } }
private static void menuCommonLVExportToTextFile_Click( object sender, EventArgs e) { var lvCtx = GetCommonLVContext(sender); if (lvCtx == null) return; var lv = lvCtx.lv; string fn = Dialogs.FileSysDialogs.BrowseFile( lvCtx.options.ExportDefaultDirectory?? Path.GetDirectoryName((new FileInfo(global::System.Reflection.Assembly.GetExecutingAssembly().Location)).FullName), "", lvCtx.options.ExportDefaultExtensions, lvCtx.options.ExportDefaultFilter, true); if (string.IsNullOrEmpty(fn)) return; using (TextWriter Out = new global::System.IO.StreamWriter(fn, false)) { // Write column header foreach (MSWinForms.ColumnHeader Cur in lv.Columns) { Out.Write("\"" + Cur.Text + "\""); Out.Write(lvCtx.options.CopyItemsSeparator); } Out.WriteLine(); foreach (MSWinForms.ListViewItem Item in lv.Items) Out.WriteLine(Item.GetItemsString()); Out.Close(); } }
/// <summary> /// Processes the file. /// </summary> /// <param name="fileName">Name of the file.</param> /// <param name="newMajorVersion">The new major version.</param> /// <param name="newMinorVersion">The new minor version.</param> /// <param name="newBuildVersion">The new build version.</param> /// <param name="newRevisionVersion">The new revision version.</param> /// <param name="newVersionSuffix">The new version suffix.</param> /// <param name="noRevision">If set to <c>true</c>, there is no revision in the final version.</param> /// <returns><c>true</c> if the document has been processed correctly, or <c>false</c> if it doesn't exist, or there is nothing to process.</returns> public bool ProcessFile(string fileName, int newMajorVersion, int newMinorVersion, int newBuildVersion, int newRevisionVersion = 0, string newVersionSuffix = null, bool noRevision = false) { if (!this.file.Exists(fileName)) { return(false); } XDocument document; try { using (global::System.IO.Stream s = this.file.OpenRead(fileName)) { document = XDocument.Load(s, LoadOptions.PreserveWhitespace); } } catch { return(false); } XElement root = document.Root; if (root == null) { return(false); } XElement missingContainer = null; (var releaseVersion, var packageVersion, var fileVersion, var assemblyVersion) = VersionElementsHelper.VersionStrings(newMajorVersion, newMinorVersion, newBuildVersion, newRevisionVersion, newVersionSuffix, noRevision); var isCore = root.Attribute("Sdk")?.Value?.InvariantCultureEqualsInsensitive("Microsoft.NET.Sdk") ?? false; if (isCore) { IEnumerable <XElement> xVersions = root.Descendants("PropertyGroup").Descendants("Version"); EnsureCorrectOnlyOneVersion( missingContainer, root, xVersions, packageVersion, "Version"); IEnumerable <XElement> xFileVersions = root.Descendants("PropertyGroup").Descendants("FileVersion"); EnsureCorrectOnlyOneVersion( missingContainer, root, xFileVersions, fileVersion, "FileVersion"); IEnumerable <XElement> xAssemblyVersions = root.Descendants("PropertyGroup").Descendants("AssemblyVersion"); EnsureCorrectOnlyOneVersion( missingContainer, root, xAssemblyVersions, assemblyVersion, "AssemblyVersion"); void EnsureCorrectOnlyOneVersion(XElement missingElementContainerBase, in XElement rootElementContainer, in IEnumerable <XElement> xElements, in string correctVersion, in string versionName) { XElement xElement = xElements.FirstOrDefault(); if (xElement == null) { EnsureMissingContainerExists(missingElementContainerBase, rootElementContainer); xElement = new XElement(versionName); missingElementContainerBase.Add(xElement); void EnsureMissingContainerExists(XElement missingElementContainer, in XElement rootContainer) { if (missingElementContainer != null) { return; } missingElementContainer = new XElement("PropertyGroup"); rootContainer.Add(missingElementContainer); } } xElement.SetValue(correctVersion); xElements.Where(p => p != xElement).ForEach(p => p.Remove()); } using (global::System.IO.Stream s = this.file.Create(fileName)) { document.Save(s); } return(true); } else { var folderPath = this.path.GetDirectoryName(fileName); var foundAssemblyAttributes = false; this.directory .EnumerateFilesRecursively(folderPath, "*.cs") #if NETSTANDARD1_0 .ForEach(filePath => #else .ParallelForEach(filePath => #endif { var lines = new List <string>(); var found = false; using (global::System.IO.StreamReader handle = this.file.OpenText(filePath)) { while (!handle.EndOfStream) { var line = handle.ReadLine(); if (!string.IsNullOrWhiteSpace(line)) { Match versionMatch = AssemblyVersionRegex.Match(line); if (versionMatch.Success) { found = true; lines.Add($"[assembly: global::System.Reflection.AssemblyVersion(\"{assemblyVersion}\")]"); } else { Match assemblyVersionMatch = AssemblyFileVersionRegex.Match(line); if (assemblyVersionMatch.Success) { found = true; lines.Add($"[assembly: global::System.Reflection.AssemblyFileVersion(\"{fileVersion}\")]"); } else { lines.Add(line); } } } else { lines.Add(string.Empty); } } } if (found) { var finalText = string.Join(Environment.NewLine, lines); using (global::System.IO.StreamWriter writeHandle = this.file.CreateText(filePath)) { writeHandle.Write(finalText); } foundAssemblyAttributes = true; } lines.Clear(); }); return(foundAssemblyAttributes); } }