Advertisement
ExIIL

.dds .bin Image Cutter (80 Bytes) (example for BO2, BO1,etc)

Jun 8th, 2019
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.80 KB | None | 0 0
  1. // Can be used on any COD! Just insert the inject script and the right image address
  2.  
  3. using System;
  4. using System.IO;
  5. using System.Linq;
  6. using System.Windows.Forms;
  7.  
  8. namespace CamoCutter
  9. {
  10.     public partial class Form1 : Form
  11.     {
  12.         public Form1()
  13.         {
  14.             InitializeComponent();
  15.         }
  16.  
  17.         public byte[] BeforePic;
  18.         public byte[] AfterPic;
  19.  
  20.         private void button1_Click(object sender, EventArgs e)
  21.         {
  22.             //Open File | Only .dds .bin format allowed.
  23.             OpenFileDialog openFileDialog1 = new OpenFileDialog();
  24.  
  25.             openFileDialog1.InitialDirectory = "c:\\";
  26.             openFileDialog1.Filter = "Database files (*.dds, *.bin)|*.dds;*.bin";
  27.             openFileDialog1.FilterIndex = 0;
  28.             openFileDialog1.RestoreDirectory = true;
  29.  
  30.             if (openFileDialog1.ShowDialog() == DialogResult.OK)
  31.             {                
  32.                 //AfterPic is the new File with the first 80 Bytes cut
  33.  
  34.                 byte[] BeforePic = File.ReadAllBytes(openFileDialog1.FileName); //Read all Bytes of the chosen Picture
  35.                 byte[] AfterPic = BeforePic.Skip(80).ToArray(); //Skips the first 80 Bytes (deletes the first 80 bytes in Beforepic and stores/copies the rest in the new byte[] AfterPic)
  36.                
  37.                 string Before = BitConverter.ToString(BeforePic).Replace("-", " ");
  38.                 string After = BitConverter.ToString(AfterPic).Replace("-", " ");
  39.                
  40.                 //beforebox.Text = Before;
  41.                 //afterbox.Text = After;
  42.                
  43.                 if (Before.Contains("44 44 53 20 7C") || Before.Contains("42 49 4E 20 7C"))
  44.                 { /*Inject AfterPic*/ }
  45.                 else
  46.                 { /*Inject BeforePic*/ }
  47.             }
  48.         }
  49.    }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement