public RootNode(byte[] file, UInt32 offset) : base(file, offset) { values = new Values[2]; values[0] = new Values("Root Offset", offset, 0x00, Values.Types.UInt32, false, file); values[1] = new Values("String Table Offset", offset, 0x04, Values.Types.UInt32, false, file); RootOffset0x0 = (UInt32) values[0].value; StringTableOffset0x4 = (UInt32) values[1].value; }
public DatHeader(byte[] file, UInt32 offset) : base(file, offset) { values = new Values[8]; values[0] = new Values("File Size", offset, 0x00, Values.Types.UInt32, false, file); values[1] = new Values("Data Block Size", offset, 0x04, Values.Types.UInt32, false, file); values[2] = new Values("Relocation Table Count", offset, 0x08, Values.Types.UInt32, false, file); values[3] = new Values("Root Count 1", offset, 0x0C, Values.Types.UInt32, false, file); values[4] = new Values("Root Count 2", offset, 0x10, Values.Types.UInt32, false, file); values[5] = new Values("Unknown", offset, 0x14, Values.Types.UInt32, false, file); values[6] = new Values("Unknown", offset, 0x18, Values.Types.UInt32, false, file); values[7] = new Values("Unknown", offset, 0x1C, Values.Types.UInt32, false, file); FileSize0x00 = (UInt32) values[0].value; DataBlockSize0x04 = (UInt32) values[1].value; RelocationTableCount0x08 = (UInt32) values[2].value; RootCount0x0C = (UInt32) values[3].value; RootCount0x10 = (UInt32) values[4].value; Unknown0x14 = (UInt32) values[5].value; Unknown0x18 = (UInt32) values[6].value; Unknown0x1C = (UInt32) values[7].value; }
private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) { Values value = (Values)dataGridView1.CurrentRow.Tag; int fileOffset = value.fileLocation + value.offset; byte[] newData; switch (value.type) { case Values.Types.UInt32: UInt32 oldValue32 = (UInt32)value.value; UInt32 newValue32; try { newValue32 = UInt32.Parse(dataGridView1.CurrentCell.Value.ToString(), NumberStyles.HexNumber); } catch (Exception f) { if (f is FormatException || f is OverflowException) { MessageBox.Show("Please enter a 32-bit hexadecimal number!"); dataGridView1.CurrentCell.Value = oldValue32.ToString("x8"); return; } else { throw; } } if (oldValue32 == newValue32) { return; } value.value = newValue32; newData = BitConverter.GetBytes(newValue32); break; case Values.Types.UInt16: UInt16 oldValue16 = (UInt16)value.value; UInt16 newValue16; try { newValue16 = UInt16.Parse(dataGridView1.CurrentCell.Value.ToString(), NumberStyles.HexNumber); } catch (Exception f) { if (f is FormatException || f is OverflowException) { MessageBox.Show("Please enter a 16-bit hexadecimal number!"); dataGridView1.CurrentCell.Value = oldValue16.ToString("x4"); return; } else { throw; } } if (oldValue16 == newValue16) { return; } value.value = newValue16; newData = BitConverter.GetBytes(newValue16); break; case Values.Types.Float: float oldValueFloat = (float)value.value; float newValueFloat; try { newValueFloat = float.Parse(dataGridView1.CurrentCell.Value.ToString()); } catch (FormatException f) { MessageBox.Show("Please enter a decimal number!"); dataGridView1.CurrentCell.Value = oldValueFloat; return; } if (oldValueFloat == newValueFloat) { return; } value.value = newValueFloat; newData = BitConverter.GetBytes(newValueFloat); break; default: return; } if (BitConverter.IsLittleEndian) { Array.Reverse(newData); } DatFile.UpdateValue(newData, fileOffset); }
public JointNode(byte[] file, UInt32 offset) : base(file, offset) { values = new Values[16]; values[0] = new Values("Unknown", offset, 0x00, Values.Types.UInt32, true, file); values[1] = new Values("Flags", offset, 0x04, Values.Types.UInt32, true, file); values[2] = new Values("Child Offset", offset, 0x08, Values.Types.UInt32, false, file); values[3] = new Values("Next Offset", offset, 0x0C, Values.Types.UInt32, false, file); values[4] = new Values("Joint Data Node Offset", offset, 0x10, Values.Types.UInt32, false, file); values[5] = new Values("Rotation X", offset, 0x14, Values.Types.Float, true, file); values[6] = new Values("Rotation Y", offset, 0x18, Values.Types.Float, true, file); values[7] = new Values("Rotation Z", offset, 0x1C, Values.Types.Float, true, file); values[8] = new Values("Scale X", offset, 0x20, Values.Types.Float, true, file); values[9] = new Values("Scale Y", offset, 0x24, Values.Types.Float, true, file); values[10] = new Values("Scale Z", offset, 0x28, Values.Types.Float, true, file); values[11] = new Values("Translation X", offset, 0x2C, Values.Types.Float, true, file); values[12] = new Values("Translation Y", offset, 0x30, Values.Types.Float, true, file); values[13] = new Values("Translation Z", offset, 0x34, Values.Types.Float, true, file); values[14] = new Values("Transform Offset", offset, 0x38, Values.Types.UInt32, false, file); values[15] = new Values("Unknown", offset, 0x3C, Values.Types.UInt32, true, file); unknown0x00 = (UInt32) values[0].value; flags0x04 = (UInt32) values[1].value; childOffset0x08 = (UInt32) values[2].value; nextOffset0x0C = (UInt32) values[3].value; jointDataNodeOffset0x10 = (UInt32) values[4].value; rotationX0x14 = (float) values[5].value; rotationY0x18 = (float) values[6].value; rotationZ0x1C = (float) values[7].value; scaleX0x20 = (float) values[8].value; scaleY0x24 = (float) values[9].value; scaleZ0x28 = (float) values[10].value; translationX0x2C = (float) values[11].value; translationY0x30 = (float) values[12].value; translationZ0x34 = (float) values[13].value; transformOffset0x38 = (UInt32) values[14].value; unknown0x3C = (UInt32) values[15].value; }
public UInt32 unknownOffset0x5C; // 0x40 - JOBJ_DATA public FighterDataNode(byte[] file, UInt32 offset) : base(file, offset) { values = new Values[24]; values[0] = new Values("Unknown", offset, 0x00, Values.Types.UInt32, false, file); values[1] = new Values("Unknown", offset, 0x04, Values.Types.UInt32, false, file); values[2] = new Values("Unknown", offset, 0x08, Values.Types.UInt32, false, file); values[3] = new Values("Unknown", offset, 0x0C, Values.Types.UInt32, false, file); values[4] = new Values("Unknown", offset, 0x10, Values.Types.UInt32, false, file); values[5] = new Values("Unknown", offset, 0x14, Values.Types.UInt32, false, file); values[6] = new Values("Unknown", offset, 0x18, Values.Types.UInt32, false, file); values[7] = new Values("Unknown", offset, 0x1C, Values.Types.UInt32, false, file); values[8] = new Values("Unknown", offset, 0x20, Values.Types.UInt32, false, file); values[9] = new Values("Unknown", offset, 0x24, Values.Types.UInt32, false, file); values[10] = new Values("Unknown", offset, 0x28, Values.Types.UInt32, false, file); values[11] = new Values("Unknown", offset, 0x2C, Values.Types.UInt32, false, file); values[12] = new Values("Unknown", offset, 0x30, Values.Types.UInt32, false, file); values[13] = new Values("Unknown", offset, 0x34, Values.Types.UInt32, false, file); values[14] = new Values("Unknown", offset, 0x38, Values.Types.UInt32, false, file); values[15] = new Values("Unknown", offset, 0x3C, Values.Types.UInt32, false, file); values[16] = new Values("Unknown", offset, 0x40, Values.Types.UInt32, false, file); values[17] = new Values("Unknown", offset, 0x44, Values.Types.UInt32, false, file); values[18] = new Values("Unknown", offset, 0x48, Values.Types.UInt32, false, file); values[19] = new Values("Unknown", offset, 0x4C, Values.Types.UInt32, false, file); values[20] = new Values("Unknown", offset, 0x50, Values.Types.UInt32, false, file); values[21] = new Values("Unknown", offset, 0x54, Values.Types.UInt32, false, file); values[22] = new Values("Unknown", offset, 0x58, Values.Types.UInt32, false, file); values[23] = new Values("Unknown", offset, 0x5C, Values.Types.UInt32, false, file); unknownOffset0x00 = (UInt32) values[0].value; unknownOffset0x04 = (UInt32) values[1].value; unknownOffset0x08 = (UInt32) values[2].value; unknownOffset0x0C = (UInt32) values[3].value; unknownOffset0x10 = (UInt32) values[4].value; unknownOffset0x14 = (UInt32) values[5].value; unknownOffset0x18 = (UInt32) values[6].value; unknownOffset0x1C = (UInt32) values[7].value; unknownOffset0x20 = (UInt32) values[8].value; unknownOffset0x24 = (UInt32) values[9].value; unknownOffset0x28 = (UInt32) values[10].value; unknownOffset0x2C = (UInt32) values[11].value; unknownOffset0x30 = (UInt32) values[12].value; unknownOffset0x34 = (UInt32) values[13].value; unknownOffset0x38 = (UInt32) values[14].value; unknownOffset0x3C = (UInt32) values[15].value; unknownOffset0x40 = (UInt32) values[16].value; unknownOffset0x44 = (UInt32) values[17].value; unknownOffset0x48 = (UInt32) values[18].value; unknownOffset0x4C = (UInt32) values[19].value; unknownOffset0x50 = (UInt32) values[20].value; unknownOffset0x54 = (UInt32) values[21].value; unknownOffset0x58 = (UInt32) values[22].value; unknownOffset0x5C = (UInt32) values[23].value; }
public PaletteHeader(byte[] file, UInt32 offset) : base(file, offset) { values = new Values[5]; values[0] = new Values("Palette Offset", offset, 0x00, Values.Types.UInt32, false, file); values[1] = new Values("Palette Format", offset, 0x04, Values.Types.UInt32, false, file); values[2] = new Values("Unknown", offset, 0x08, Values.Types.UInt32, false, file); values[3] = new Values("Color Count", offset, 0x0C, Values.Types.UInt16, false, file); values[4] = new Values("Unknown", offset, 0x0E, Values.Types.UInt16, false, file); paletteOffset0x0 = (UInt32) values[0].value; paletteFormat0x4 = (UInt32) values[1].value; unknown0x08 = (UInt32) values[2].value; colorCount0xC = (UInt16) values[3].value; unknown0xE = (UInt16)values[4].value; switch (paletteFormat0x4) { case 0: paletteFormatString = "IA8"; break; case 1: paletteFormatString = "RGB565"; break; case 2: paletteFormatString = "RGB5A3"; break; default: paletteFormatString = "Unknown"; break; } }
public ImageHeader(byte[] file, UInt32 offset) : base(file, offset) { values = new Values[4]; values[0] = new Values("Image Offset", offset, 0x0, Values.Types.UInt32, false, file); values[1] = new Values("Width", offset, 0x4, Values.Types.UInt16, false, file); values[2] = new Values("Height", offset, 0x6, Values.Types.UInt16, false, file); values[3] = new Values("Image Format", offset, 0x8, Values.Types.UInt32, false, file); imageOffset0x0 = (UInt32) values[0].value; width0x4 = (UInt16) values[1].value; height0x6 = (UInt16) values[2].value; imageFormat0x8 = (UInt32) values[3].value; switch (imageFormat0x8) { case 0: imageFormatString = "I4"; break; case 1: imageFormatString = "I8"; break; case 2: imageFormatString = "IA4"; break; case 3: imageFormatString = "IA8"; break; case 4: imageFormatString = "RGB565"; break; case 5: imageFormatString = "RGB5A3"; break; case 6: imageFormatString = "RGBA8"; break; case 8: imageFormatString = "CI4"; break; case 9: imageFormatString = "CI8"; break; case 0xa: imageFormatString = "CI14X2"; break; case 0xe: imageFormatString = "CMPR"; break; default: imageFormatString = "Unknown"; break; } }
public TextureNode(byte[] file, UInt32 offset) : base(file, offset) { values = new Values[5]; values[0] = new Values("Unknown", offset, 0x00, Values.Types.UInt32, false, file); values[1] = new Values("Image Header Offset", offset, 0x4C, Values.Types.UInt32, false, file); values[2] = new Values("Palette Header Offset", offset, 0x50, Values.Types.UInt32, false, file); values[3] = new Values("Unknown", offset, 0x54, Values.Types.UInt32, false, file); values[4] = new Values("Unknown Offset", offset, 0x58, Values.Types.UInt32, false, file); unknown0x00 = (UInt32) values[0].value; imageHeaderOffset0x4C = (UInt32) values[1].value; paletteHeaderOffset0x50 = (UInt32) values[2].value; unknown0x54 = (UInt32) values[3].value; unknownOffset0x58 = (UInt32)values[4].value; }
public MaterialColorNode(byte[] file, UInt32 offset) : base(file, offset) { values = new Values[5]; values[0] = new Values("Unknown Color", offset, 0x00, Values.Types.UInt32, true, file); values[1] = new Values("Unknown Color", offset, 0x04, Values.Types.UInt32, true, file); values[2] = new Values("Unknown Color", offset, 0x08, Values.Types.UInt32, true, file); values[3] = new Values("Unknown", offset, 0x0C, Values.Types.UInt32, true, file); values[4] = new Values("Unknown", offset, 0x10, Values.Types.UInt32, true, file); unknownColor0x00 = (UInt32) values[0].value; unknownColor0x04 = (UInt32) values[1].value; unknownColor0x08 = (UInt32) values[2].value; unknown0x0C = (UInt32) values[3].value; unknown0x10 = (UInt32)values[4].value; }
public MaterialNode(byte[] file, UInt32 offset) : base(file, offset) { values = new Values[6]; values[0] = new Values("Unknown", offset, 0x00, Values.Types.UInt32, false, file); values[1] = new Values("Unknown Flags", offset, 0x04, Values.Types.UInt32, false, file); values[2] = new Values("Texture Node Offset", offset, 0x08, Values.Types.UInt32, false, file); values[3] = new Values("Material Color Node Offset", offset, 0x0C, Values.Types.UInt32, false, file); values[4] = new Values("Unknown", offset, 0x10, Values.Types.UInt32, false, file); values[5] = new Values("Unknown", offset, 0x14, Values.Types.UInt32, false, file); unknown0x00 = (UInt32) values[0].value; unknownFlags0x04 = (UInt32) values[1].value; TextureNodeOffset0x08 = (UInt32) values[2].value; MaterialColorNodeOffset0x0C = (UInt32) values[3].value; unknown0x10 = (UInt32) values[4].value; unknown0x14 = (UInt32) values[5].value; }
public JointDataNode(byte[] file, UInt32 offset) : base(file, offset) { values = new Values[4]; values[0] = new Values("Unknown", offset, 0x00, Values.Types.UInt32, true, file); values[1] = new Values("Next Offset", offset, 0x04, Values.Types.UInt32, false, file); values[2] = new Values("Material Node Offset", offset, 0x08, Values.Types.UInt32, false, file); values[3] = new Values("Mesh Node Offset", offset, 0x0C, Values.Types.UInt32, false, file); unknown0x0 = (UInt32) values[0].value; nextOffset0x4 = (UInt32) values[1].value; materialNodeOffset0x8 = (UInt32) values[2].value; meshNodeOffset0xC = (UInt32)values[3].value; }