Advertisement
PrimeNotorious

Ghosts 1.12 CMD .SELF/.BIN File Builder Source By: Notorious

May 9th, 2014
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.40 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7. using System.Net;
  8. using System.Web;
  9. using System.Windows.Forms;
  10. using System.Threading;
  11. using System.Diagnostics;
  12.  
  13. namespace _1._12__BIN_SELF_Builder
  14. {
  15. class Program
  16. {
  17. public static bool isDefault;
  18. public static bool isViewingFiles;
  19. public static bool fileLoaded;
  20. public static FileFunctions.BigEndianWriter bw = new FileFunctions.BigEndianWriter(new MemoryStream(File.ReadAllBytes(Directory.GetCurrentDirectory() + "/default_mp.elf")));
  21. //public static FileStream stream = File.Open(Directory.GetCurrentDirectory() + "/default_mp.elf", FileMode.Open);
  22. static void Main(string[] args)
  23. {
  24. Console.Title = "BIN/SELF Builder CoD Ghosts";
  25. setDefault();
  26. runProcess();
  27. }
  28. public static void setDefault()
  29. {
  30. isDefault = true;
  31. isViewingFiles = false;
  32. Console.Clear();
  33. // string filePath = stream.Name;
  34. // string getExtension = Path.GetExtension(filePath);
  35. Console.WriteLine("Welcome: " + System.Environment.MachineName + " " + "To Ghosts BIN/SELF File Builder");
  36. Console.WriteLine("");
  37. Console.WriteLine("-----Modifications-------------Important--------------------File-Infos----------");
  38. Console.WriteLine("|wallhack |load.....loads .elf file |File Name: ");
  39. Console.WriteLine("|steadyaim |self.....builds .self |File Size: ");
  40. Console.WriteLine("|redboxes |bin......builds .bin |Last Edited: ");
  41. Console.WriteLine("|norecoil |bles.....builds for BLES |File Type: ");
  42. Console.WriteLine("|chromeplayers |blus.....builds for BLUS |File Path: ");
  43. Console.WriteLine("");
  44. Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  45. }
  46. public static void ThreadProc()
  47. {
  48. }
  49. public static void runProcess()
  50. {
  51. string command = Console.ReadLine().ToLower();
  52. if (command == "load")
  53. {
  54. viewFileScreen();
  55. }
  56. if (command == "wallhack")
  57. {
  58. applyWallhack();
  59. }
  60. if(command == "bin")
  61. {
  62. buildDebugBin();
  63. }
  64. }
  65. public static void applyWallhack()
  66. {
  67. Thread.Sleep(200);
  68. setDefault();
  69. int myMod = 0x38C000;
  70. bw.BaseStream.Position = 0x00169850;
  71. bw.Write(myMod);
  72. bw.Close();
  73. Thread.Sleep(200);
  74. setDefault();
  75. Console.ReadLine();
  76.  
  77. }
  78. public static void buildDebugBin()
  79. {
  80. Thread.Sleep(200);
  81. setDefault();
  82. if (File.Exists("DebugBIN.bat"))
  83. {
  84. System.Threading.Thread loading = new System.Threading.Thread(new System.Threading.ThreadStart(ThreadProc));
  85. Process pro = new Process();
  86. pro.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
  87. pro.StartInfo.FileName = "DebugBIN.bat";
  88. pro.Start();
  89. Console.WriteLine("Your Modified .BIN has been built");
  90. }
  91. else
  92. {
  93. Console.WriteLine("You need to make sure you have the batch file !");
  94.  
  95. }
  96. Thread.Sleep(200);
  97. setDefault();
  98. Console.ReadLine();
  99. }
  100. public static void viewFileScreen()
  101. {
  102. isViewingFiles = true;
  103. isDefault = false;
  104. Console.Clear();
  105. System.Threading.Thread.Sleep(100);
  106. Console.WriteLine("");
  107. Console.WriteLine(" List of ELF Files in Current Directory:");
  108. Console.WriteLine("");
  109. Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  110. string[] filePaths = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.elf");
  111.  
  112. for (int i = 0; i < filePaths.Length; ++i)
  113. {
  114. string path = filePaths[i];
  115. Console.WriteLine(" " + i.ToString() + ". " + System.IO.Path.GetFileName(path));
  116. }
  117. Console.WriteLine("");
  118. Console.WriteLine(" Enter File Number to Load into Program:");
  119. Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  120. for (int i = 0; i < filePaths.Length; ++i)
  121. {
  122. string path = filePaths[i];
  123.  
  124. string fileNum = Console.ReadLine().ToLower();
  125.  
  126. if (fileNum == i.ToString())
  127. {
  128. FileStream load = File.Open(path, FileMode.Open);
  129. setDefault();
  130. Console.WriteLine("File Successfully Loaded, Ready To add modifications");
  131. fileLoaded = true;
  132. System.Threading.Thread.Sleep(1555);
  133. setDefault();
  134. // fileName = path;
  135. }
  136. }
  137. }
  138. }
  139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement