Exemplo n.º 1
0
 // Token: 0x06000004 RID: 4 RVA: 0x0000211C File Offset: 0x0000031C
 private void button_MakeFile_Click(object sender, EventArgs e)
 {
     this.saveCCFileDialog.FileName = CMLparser.outFile + CMLparser.GetFileType();
     if (this.saveCCFileDialog.ShowDialog() == DialogResult.OK)
     {
         Console.WriteLine(this.saveCCFileDialog.FileName);
         CMLparser.WriteFileData(this.saveCCFileDialog.FileName);
         if (this.CB_compressCCFile.Checked && CMLparser.latestWrittenFile != "")
         {
             try
             {
                 Process.Start("CharacterCrypt.exe", string.Concat(new string[]
                 {
                     "encrypt  \"",
                     CMLparser.latestWrittenFile,
                     "\" \"",
                     CMLparser.latestWrittenFile,
                     "\""
                 }));
             }
             catch (Win32Exception ex)
             {
                 this.textbox_OutText.AppendText(Environment.NewLine + ex.Message + Environment.NewLine + AppText.GetText("err_characrypt_notfound"));
             }
         }
     }
 }
Exemplo n.º 2
0
        // Token: 0x0600000F RID: 15 RVA: 0x00002994 File Offset: 0x00000B94
        public static void WriteFileData(string filename)
        {
            string fileType = CMLparser.GetFileType();
            string str      = Path.ChangeExtension(filename, null);

            if (CMLparser.FIGRdata == null || CMLparser.COLRdata == null || CMLparser.SLCTdata == null)
            {
                CMLparser.tb.AppendText(Environment.NewLine + AppText.GetText("err_file_couldnotsave_invalidcml"));
                CMLparser.latestWrittenFile = "";
                return;
            }
            try
            {
                CMLparser.bw = new BinaryWriter(new FileStream(str + fileType, FileMode.Create));
            }
            catch (IOException ex)
            {
                Console.WriteLine(ex.Message + AppText.GetText("err_file_couldnotsave_unknown"));
                return;
            }
            CMLparser.FIGRWriteOff = CMLparser.COLRPos - (CMLparser.FIGRPos + CMLparser.FIGRdata.Length * 4);
            CMLparser.COLRWriteOff = CMLparser.SLCTPos - (CMLparser.COLRPos + CMLparser.COLRdata.Length * 4);
            CMLparser.SLCTWriteOff = CMLparser.ACCPos - (CMLparser.SLCTPos + CMLparser.SLCTdata.Length * 4);
            byte[] buffer  = new byte[CMLparser.FIGRWriteOff];
            byte[] buffer2 = new byte[CMLparser.COLRWriteOff];
            byte[] buffer3 = new byte[CMLparser.SLCTWriteOff];
            int    value   = 6;
            int    value2  = 732;
            int    value3  = 0;

            CMLparser.bw.Write(value);
            CMLparser.bw.Write(value2);
            CMLparser.bw.Write(value3);
            CMLparser.bw.Write(value3);
            CMLparser.bw.Write(CMLparser.race);
            CMLparser.bw.Write(CMLparser.sex);
            CMLparser.bw.Write(value3);
            foreach (int value4 in CMLparser.FIGRdata)
            {
                CMLparser.bw.Write(value4);
            }
            CMLparser.bw.Write(buffer);
            foreach (int value5 in CMLparser.COLRdata)
            {
                CMLparser.bw.Write(value5);
            }
            CMLparser.bw.Write(buffer2);
            foreach (int value6 in CMLparser.SLCTdata)
            {
                CMLparser.bw.Write(value6);
            }
            CMLparser.bw.Write(buffer3);
            foreach (byte value7 in CMLparser.AccData)
            {
                CMLparser.bw.Write(value7);
            }
            foreach (byte value8 in CMLparser.endFileData)
            {
                CMLparser.bw.Write(value8);
            }
            CMLparser.bw.Close();
            CMLparser.tb.AppendText(Environment.NewLine + string.Format(AppText.GetText("log_system_filesaved"), str + fileType));
            CMLparser.latestWrittenFile = str + fileType;
        }