Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- using System.Globalization;
- namespace Pro_Generator
- {
- class WriteTextFile
- {
- static void Main()
- {
- int i;
- int a = 100; // number of characters with multiple attires
- int b = 10; // number of attires per character in list
- int c = 100; // CH to start at
- using (Stream fileStream = new FileStream(@"0005.cos", FileMode.OpenOrCreate, FileAccess.Write))
- using (BinaryWriter writer = new BinaryWriter(fileStream))
- {
- string str = "43 4F 53 00 01 00 00 00";
- List<string> parts = new List<string>(str.Split(' '));
- byte[] bytesToWrite = parts.Select(s => byte.Parse(s, NumberStyles.HexNumber)).ToArray();
- writer.Write(bytesToWrite);
- writer.Write(BitConverter.GetBytes(a));
- for (i = c; i <= (c + a - 1); i++) // How many to generate from c to c + a
- {
- writer.Write(BitConverter.GetBytes(i));
- writer.Write(BitConverter.GetBytes(b));
- string str2 = "39 4A 00 00 FF FF FF FF 00 00 00 00 FF 00 00 00";
- if (b > 1) str2 += " 3A 4A 00 00 FF FF FF FF 00 00 00 00 FF 00 00 00";
- if (b > 2) str2 += " 3B 4A 00 00 FF FF FF FF 00 00 00 00 FF 00 00 00";
- if (b > 3) str2 += " 3C 4A 00 00 FF FF FF FF 00 00 00 00 FF 00 00 00";
- if (b > 4) str2 += " 3D 4A 00 00 FF FF FF FF 00 00 00 00 FF 00 00 00";
- if (b > 5) str2 += " 3E 4A 00 00 FF FF FF FF 00 00 00 00 FF 00 00 00";
- if (b > 6) str2 += " 3F 4A 00 00 FF FF FF FF 00 00 00 00 FF 00 00 00";
- if (b > 7) str2 += " 40 4A 00 00 FF FF FF FF 00 00 00 00 FF 00 00 00";
- if (b > 8) str2 += " 41 4A 00 00 FF FF FF FF 00 00 00 00 FF 00 00 00";
- if (b > 9) str2 += " 42 4A 00 00 FF FF FF FF 00 00 00 00 FF 00 00 00";
- List<string> parts2 = new List<string>(str2.Split(' '));
- byte[] bytesToWrite2 = parts2.Select(s => byte.Parse(s, NumberStyles.HexNumber)).ToArray();
- writer.Write(bytesToWrite2);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement