// 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")); } } } }
// Token: 0x0600000C RID: 12 RVA: 0x00002729 File Offset: 0x00000929 public static void ReloadCML() { if (CMLparser.inFile != "") { CMLparser.ParseCML(CMLparser.inFile); } }
// Token: 0x06000003 RID: 3 RVA: 0x000020FA File Offset: 0x000002FA private void button1_Click(object sender, EventArgs e) { if (this.loadCMLDialog.ShowDialog() == DialogResult.OK) { CMLparser.ParseCML(this.loadCMLDialog.FileName); } }
// Token: 0x0600000D RID: 13 RVA: 0x00002748 File Offset: 0x00000948 public static void ParseCML(string cmlFile) { CMLparser.inFile = cmlFile; CMLparser.outFile = Path.GetFileNameWithoutExtension(CMLparser.inFile); CMLparser.LoadDictionariesFromInternal(); if (CMLparser.br != null) { CMLparser.br.Close(); } try { FileInfo fileInfo = new FileInfo(CMLparser.inFile); Console.WriteLine("File size: " + fileInfo.Length + Environment.NewLine); if (fileInfo.Length > 1048576L) { throw new Exception(); } CMLparser.br = new BinaryReader(new MemoryStream(File.ReadAllBytes(CMLparser.inFile))); } catch (IOException ex) { CMLparser.tb.Text = ex.Message + AppText.GetText("err_file_notfound"); return; } catch (ArgumentException ex2) { CMLparser.tb.Text = ex2.Message + AppText.GetText("err_file_notfound"); return; } catch (UnauthorizedAccessException ex3) { CMLparser.tb.Text = ex3.Message; return; } catch (Exception ex4) { CMLparser.tb.Text = ex4.Message; return; } CMLparser.tb.Text = CMLparser.inFile; CMLparser.FindFileData(); CMLparser.GetBioData(); CMLparser.tb.AppendText(Environment.NewLine + string.Format(AppText.GetText("log_bioinfo"), AppText.GetRace(CMLparser.race), AppText.GetSex(CMLparser.sex))); CMLparser.GetFIGRData(); CMLparser.GetCOLRData(); CMLparser.GetSLCTData(); CMLparser.GetAccessoriesData(); if (CMLparser.outputParts) { CMLparser.outputPartsInfo(); } }
// Token: 0x06000011 RID: 17 RVA: 0x00002CF8 File Offset: 0x00000EF8 private static void GetBioData() { CMLparser.FindDataTag("DOC "); CMLparser.br.ReadInt32(); CMLparser.br.ReadInt16(); CMLparser.race = CMLparser.br.ReadInt32(); CMLparser.br.ReadInt16(); CMLparser.sex = CMLparser.br.ReadInt32(); if (CMLparser.showLog) { Console.WriteLine("Race: " + CMLparser.race.ToString() + "\nSex: " + CMLparser.sex.ToString()); } }
// Token: 0x06000007 RID: 7 RVA: 0x00002240 File Offset: 0x00000440 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (this.comboBox1.SelectedItem.ToString() == "English") { this.ChangeLanguage("en"); Form1._currentLanguage = Form1.CurrentLanguage.en; } else if (this.comboBox1.SelectedItem.ToString() == "日本語") { this.ChangeLanguage("ja-JP"); Form1._currentLanguage = Form1.CurrentLanguage.jp; } CMLparser.ReloadCML(); }
// Token: 0x06000016 RID: 22 RVA: 0x000030D8 File Offset: 0x000012D8 private static void GetSLCTData() { if (!CMLparser.FindDataTag("SLCT")) { return; } CMLparser.br.ReadInt16(); int num = (int)CMLparser.br.ReadInt16(); if (num > 20) { CMLparser.SLCTdata = new int[num]; } else { CMLparser.SLCTdata = new int[20]; } if (CMLparser.showLog) { Console.WriteLine("SLCT elements: " + num.ToString()); } for (int i = 0; i < num; i++) { int byteFromBCD = (int)CMLparser.GetByteFromBCD((byte)(CMLparser.br.ReadByte() - 64)); if (CMLparser.showLog) { Console.WriteLine("datatag: " + byteFromBCD.ToString()); } CMLparser.br.ReadByte(); CMLparser.SLCTdata[byteFromBCD] = CMLparser.br.ReadInt32(); } if (CMLparser.showLog) { int num3 = 0; foreach (int num2 in CMLparser.SLCTdata) { Console.WriteLine(Enum.GetName(typeof(CMLparser.SLCTtypes), num3) + " " + num2.ToString()); num3++; } } if (CMLparser.SLCTdata[17] == 0) { CMLparser.SLCTdata[17] = 20001; } if (CMLparser.SLCTdata[18] == 0) { CMLparser.SLCTdata[18] = 20001; } }
// Token: 0x0600001D RID: 29 RVA: 0x00003664 File Offset: 0x00001864 private static void outputPartsInfo() { string partkey = CMLparser.SLCTdata[0].ToString("D5"); string partkey2 = CMLparser.SLCTdata[0].ToString("D5"); string partkey3 = CMLparser.SLCTdata[0].ToString("D5"); string partkey4 = CMLparser.SLCTdata[14].ToString("D5"); string partkey5 = CMLparser.SLCTdata[15].ToString("D5"); string partkey6 = CMLparser.SLCTdata[17].ToString("D5"); string partkey7 = CMLparser.SLCTdata[18].ToString("D5"); string partkey8 = CMLparser.SLCTdata[1].ToString("D5"); string partkey9 = CMLparser.SLCTdata[19].ToString("D5"); string partkey10 = CMLparser.SLCTdata[2].ToString("D5"); string partkey11 = CMLparser.SLCTdata[3].ToString("D5"); string partkey12 = CMLparser.SLCTdata[3].ToString("D5"); string partkey13 = CMLparser.SLCTdata[4].ToString("D5"); string partkey14 = CMLparser.SLCTdata[5].ToString("D5"); string partkey15 = CMLparser.SLCTdata[6].ToString("D5"); string partkey16 = CMLparser.SLCTdata[8].ToString("D5"); string partkey17 = CMLparser.SLCTdata[13].ToString("D5"); string partkey18 = CMLparser.SLCTdata[9].ToString("D5"); string partkey19 = CMLparser.SLCTdata[10].ToString("D5"); string partkey20 = CMLparser.SLCTdata[11].ToString("D5"); string partkey21 = CMLparser.SLCTdata[12].ToString("D5"); string partkey22 = CMLparser.SLCTdata[16].ToString("D5"); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_costume"), partkey, CMLparser.costumes); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_outerwear"), partkey3, CMLparser.costumes); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_part"), partkey2, CMLparser.bodyparts); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_legpart"), partkey4, CMLparser.legs); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_armpart"), partkey5, CMLparser.arms); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_basewear"), partkey6, CMLparser.basewears); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_innerwear"), partkey7, CMLparser.innerwears); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_bodypaint1"), partkey8, CMLparser.bodypaints); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_bodypaint2"), partkey9, CMLparser.bodypaints); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_sticker"), partkey10, CMLparser.stickers); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_right_eye"), partkey11, CMLparser.eyes); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_eyes"), partkey12, CMLparser.eyes); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_eyebrows"), partkey13, CMLparser.eyebrows); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_eyelash"), partkey14, CMLparser.eyelashes); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_facetype"), partkey15, CMLparser.faces); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_makeup1"), partkey16, CMLparser.makeups); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_makeup2"), partkey17, CMLparser.makeups); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_hairstyle"), partkey18, CMLparser.hairstyles); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_accessory1"), partkey19, CMLparser.accessories); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_accessory2"), partkey20, CMLparser.accessories); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_accessory3"), partkey21, CMLparser.accessories); CMLparser.WriteOutPartInfo(AppText.GetText("log_partinfo_accessory4"), partkey22, CMLparser.accessories); }
// Token: 0x0600001A RID: 26 RVA: 0x0000347C File Offset: 0x0000167C private static void LoadDictionariesFromInternal() { CMLparser.TextToDictionary(CMLparser.emb_accessoryFile, CMLparser.accessories, true); CMLparser.TextToDictionary(CMLparser.emb_bodypaint1File, CMLparser.bodypaints, true); CMLparser.TextToDictionary(CMLparser.emb_eyesFile, CMLparser.eyes, true); CMLparser.TextToDictionary(CMLparser.emb_eyebrowFile, CMLparser.eyebrows, true); CMLparser.TextToDictionary(CMLparser.emb_eyelashFile, CMLparser.eyelashes, true); CMLparser.TextToDictionary(CMLparser.emb_facepaint2File, CMLparser.makeups, true); CMLparser.TextToDictionary(CMLparser.emb_facevariationsFile, CMLparser.faces, true); CMLparser.TextToDictionary(CMLparser.emb_hairstylesFile, CMLparser.hairstyles, true); CMLparser.TextToDictionary(CMLparser.emb_bodypaint2File, CMLparser.stickers, true); CMLparser.TextToDictionary(CMLparser.emb_legFile, CMLparser.legs, true); CMLparser.TextToDictionary(CMLparser.emb_armFile, CMLparser.arms, true); CMLparser.TextToDictionary(CMLparser.emb_costumeFile, CMLparser.costumes, true); CMLparser.TextToDictionary(CMLparser.emb_bodyFile, CMLparser.bodyparts, true); CMLparser.TextToDictionary(CMLparser.emb_baseFile, CMLparser.basewears, true); CMLparser.TextToDictionary(CMLparser.emb_innerFile, CMLparser.innerwears, true); }
// Token: 0x06000019 RID: 25 RVA: 0x0000338C File Offset: 0x0000158C private static void LoadDictionaries() { CMLparser.TextToDictionary(CMLparser.accessoryFile, CMLparser.accessories); CMLparser.TextToDictionary(CMLparser.bodypaint1File, CMLparser.bodypaints); CMLparser.TextToDictionary(CMLparser.eyesFile, CMLparser.eyes); CMLparser.TextToDictionary(CMLparser.eyebrowFile, CMLparser.eyebrows); CMLparser.TextToDictionary(CMLparser.eyelashFile, CMLparser.eyelashes); CMLparser.TextToDictionary(CMLparser.facepaint2File, CMLparser.makeups); CMLparser.TextToDictionary(CMLparser.facevariationsFile, CMLparser.faces); CMLparser.TextToDictionary(CMLparser.hairstylesFile, CMLparser.hairstyles); CMLparser.TextToDictionary(CMLparser.bodypaint2File, CMLparser.stickers); CMLparser.TextToDictionary(CMLparser.legFile, CMLparser.legs); CMLparser.TextToDictionary(CMLparser.armFile, CMLparser.arms); CMLparser.TextToDictionary(CMLparser.costumeFile, CMLparser.costumes); CMLparser.TextToDictionary(CMLparser.bodyFile, CMLparser.bodyparts); CMLparser.TextToDictionary(CMLparser.baseFile, CMLparser.basewears); CMLparser.TextToDictionary(CMLparser.innerFile, CMLparser.innerwears); }
// Token: 0x06000010 RID: 16 RVA: 0x00002C50 File Offset: 0x00000E50 private static void FindFileData() { CMLparser.FindDataTag("cml"); CMLparser.br.ReadByte(); CMLparser.FileSizeTotal = CMLparser.br.ReadInt32(); CMLparser.FileSize = CMLparser.br.ReadInt32(); CMLparser.VTBFLoc = CMLparser.br.ReadInt32(); if (CMLparser.showLog) { Console.WriteLine(string.Concat(new string[] { "File Size Total: ", CMLparser.FileSizeTotal.ToString(), "\nFileSize: ", CMLparser.FileSize.ToString(), "\nVTBFLoc: ", CMLparser.VTBFLoc.ToString() })); } }
// Token: 0x06000015 RID: 21 RVA: 0x00002FDC File Offset: 0x000011DC private static void GetCOLRData() { if (!CMLparser.FindDataTag("COLR")) { return; } CMLparser.br.ReadInt16(); int num = (int)CMLparser.br.ReadInt16(); CMLparser.COLRdata = new int[num * 3]; if (CMLparser.showLog) { Console.WriteLine("COLR elements: " + num.ToString()); } for (int i = 0; i < num; i++) { int num2 = (int)(CMLparser.br.ReadByte() - 32); int num3 = 0; if (CMLparser.showLog) { Console.WriteLine("datatag: " + num2.ToString()); } CMLparser.br.ReadBytes(2); for (int j = 0; j < 3; j++) { CMLparser.COLRdata[num2 * 3 + num3] = CMLparser.br.ReadInt32(); num3++; } } if (CMLparser.showLog) { int num3 = 0; foreach (int num4 in CMLparser.COLRdata) { Console.WriteLine(Enum.GetName(typeof(CMLparser.COLRtypes), num3 / 3) + " " + num4.ToString()); num3++; } } }
// Token: 0x06000005 RID: 5 RVA: 0x00002210 File Offset: 0x00000410 private void CB_outputParts_CheckedChanged(object sender, EventArgs e) { CMLparser.outputParts = this.CB_outputParts.Checked; CMLparser.ReloadCML(); }
// Token: 0x06000013 RID: 19 RVA: 0x00002D90 File Offset: 0x00000F90 private static void GetFIGRData() { if (!CMLparser.FindDataTag("FIGR")) { return; } CMLparser.br.ReadInt16(); int b = (int)CMLparser.br.ReadByte(); CMLparser.br.ReadByte(); CMLparser.FIGRdata = new int[60]; if (CMLparser.showLog) { Console.WriteLine("FIGR elements: " + b.ToString()); } for (int i = 0; i < b; i++) { int num = (int)CMLparser.br.ReadByte(); CMLparser.br.ReadBytes(2); int num2 = 0; for (int j = 0; j < 3; j++) { try { CMLparser.FIGRdata[i * 3 + num2] = CMLparser.br.ReadInt32(); } catch (IndexOutOfRangeException) { CMLparser.tb.AppendText(Environment.NewLine + "Unhandled datatag: " + num); } num2++; } } if (b < 13) { CMLparser.DupeSliderData(CMLparser.FIGRdata, 0, 13); } if (b < 14) { CMLparser.DupeSliderData(CMLparser.FIGRdata, 1, 14); } if (b < 15) { CMLparser.DupeSliderData(CMLparser.FIGRdata, 2, 15); } if (b < 16) { CMLparser.DupeSliderData(CMLparser.FIGRdata, 3, 16); } if (b < 17) { CMLparser.DupeSliderData(CMLparser.FIGRdata, 4, 17); } if (b < 18) { CMLparser.DupeSliderData(CMLparser.FIGRdata, 11, 18); } if (b < 19) { CMLparser.DupeSliderData(CMLparser.FIGRdata, 12, 19); } if (CMLparser.showLog) { int num3 = 0; foreach (int num4 in CMLparser.FIGRdata) { Console.WriteLine(Enum.GetName(typeof(CMLparser.FIGRtypes), num3 / 3) + " " + num4.ToString()); num3++; } } }
// 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; }
// Token: 0x06000022 RID: 34 RVA: 0x00003DF0 File Offset: 0x00001FF0 public static void InitializeDictionaries() { CMLparser.TextToDictionary(AppText.emb_text_en, AppText.EnglishText, true); CMLparser.TextToDictionary(AppText.emb_text_jp, AppText.JapaneseText, true); }