Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.29 KB | None | 0 0
  1. using System;
  2. using System.Diagnostics;
  3. using System.IO;
  4. using System.Linq;
  5.  
  6. namespace ConsoleApp1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Console.SetWindowSize(75, 12);
  13.  
  14.             //string path = "title.tik";
  15.             Console.WriteLine("enter ticket name (title.tik)");
  16.             string CustomTIKname = Console.ReadLine();
  17.  
  18.             Console.Clear();
  19.             Console.WriteLine("working....");
  20.  
  21.             var CDecryptOutput = "starting... and looking for output above 400 letters";
  22.  
  23.             while (CDecryptOutput.Length < 400)
  24.             {
  25.                 //Console.Clear();
  26.  
  27.                 Random randomHex = new Random();
  28.                 Byte[] randomHexArray = new Byte[16];
  29.                 randomHex.NextBytes(randomHexArray);
  30.  
  31.                 byte[] hextowrite = randomHexArray;
  32.                 using (var stream = new FileStream(CustomTIKname, FileMode.Open, FileAccess.ReadWrite))
  33.                 {
  34.                     stream.Position = 447; //the key starts here
  35.  
  36.                     using (var b = new BinaryWriter(stream))
  37.                     {
  38.                         //for manual testing i guess
  39.                         //byte[] tetete = { 0x0a, 0x64, 0x58, 0x3f, 0xf1, 0x1d, 0x81, 0xd6, 0x80, 0xc7, 0x40, 0x5a, 0xf5, 0x96, 0x8b, 0x37 };
  40.                         //b.Write(tetete);
  41.  
  42.                         b.Write(hextowrite);
  43.                     }
  44.                 }
  45.  
  46.                 //read output from cdecrypt
  47.                 Process compiler = new Process();
  48.                 compiler.StartInfo.FileName = "CDecrypt.exe";
  49.                 compiler.StartInfo.Arguments = "title.tmd " + CustomTIKname + " ckey.bin";
  50.                 compiler.StartInfo.UseShellExecute = false;
  51.                 compiler.StartInfo.RedirectStandardOutput = true;
  52.                 compiler.Start();
  53.  
  54.  
  55.  
  56.                 CDecryptOutput = compiler.StandardOutput.ReadToEnd();
  57.                 compiler.WaitForExit();
  58.                // Console.WriteLine(CDecryptOutput);
  59.             }
  60.  
  61.             // Keep the console window open in debug mode.
  62.             Console.Clear();
  63.             Console.WriteLine(CDecryptOutput);
  64.             Console.WriteLine("Press any key to exit.");
  65.             Console.ReadKey();
  66.         }
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement