Esempio n. 1
0
        public void OpenFile_Click(object sender, EventArgs e)
        {
            string path = "";

            path = AndiFileDialog.OpenDialog(path, _LastPath, "WildEncounter EX Gen IV - File Open", "Any Files|*.*|Narc Files|*.*");

            if (path != "")
            {
                Program.GlobalPath = Path.GetDirectoryName(path);
                _LastPath          = Path.GetDirectoryName(path);

                flepath = new FileInfo(path);
                Program.mForm.fname.Text = flepath.Name;
                Program.mForm.fsize.Text = flepath.Length + "";

                if (CheckMagicHeaderID.get(path) != "NARC")
                {
                    MessageBox.Show("This Not NARC File, File Extension Signature is " + CheckMagicHeaderID.get(path) + ", and is not NARC File!", "Error!");
                    return;
                }

                narc.OpenData(path);
                EventsAfterOpenFile();
            }
        }
Esempio n. 2
0
        public void OpenFile_Click(object sender, EventArgs e)
        {
            string path = "", path2 = "";

            path = AndiFileDialog.OpenDialog(path, Path.GetDirectoryName(_LastPath), "Evolution Narc File - File Open", "Any Files|*.*|Narc Files|*.*");

            if (path != "")
            {
                flepath = new FileInfo(path);
                Program.mForm.fname.Text = flepath.Name;
                Program.mForm.fsize.Text = flepath.Length + "";

                path2 = AndiFileDialog.OpenDialog(path2, Path.GetDirectoryName(_LastPath), "BabyEvolution Narc File - File Open", "Any Files|*.*|Narc Files|*.*");
            }

            if (path2 != "")
            {
                if (CheckMagicHeaderID.get(path2) != "NARC")
                {
                    MessageBox.Show(
                        "This Not NARC File, File Extension Signature is " + CheckMagicHeaderID.get(path2) + ", and is not NARC File!", "Error!");
                    isBabyEvoOpened            = false;
                    andiImageComboBox4.Enabled = false;
                }
                else
                {
                    andiImageComboBox4.Enabled = true;
                    Narc[1] = new AndiNarcReader();
                    Narc[1].OpenData(path2);
                    isBabyEvoOpened = true;
                }
            }
            else
            {
                isBabyEvoOpened            = false;
                andiImageComboBox4.Enabled = false;
            }

            if (path != "")
            {
                Program.GlobalPath = Path.GetDirectoryName(path);
                _LastPath          = path;

                if (CheckMagicHeaderID.get(path) != "NARC")
                {
                    MessageBox.Show("This Not NARC File, File Extension Signature is " + CheckMagicHeaderID.get(path) + ", and is not NARC File!", "Error!");
                    return;
                }

                andiCustomTabControl1.Enabled = true;
                Narc[0] = new AndiNarcReader();
                Narc[0].OpenData(path);
                EventsAfterOpenFile();
            }
        }
Esempio n. 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            string path = "";

            path = AndiFileDialog.OpenDialog(path, _LastPath, "OVA9 Table - File Open", "Any Files|*.*|Bin Files|*.bin");

            if (path != "")
            {
                a = new FileStream(path, FileMode.Open);
                int b = (int)(a.Length / 32);
                object[,] datatemp = new object[b, 9];

                for (int i = 0; i < b; i++)
                {
                    byte[] buffernew = new byte[4];
                    a.Position = 0 + i * 32;
                    a.Read(buffernew, 0, 4);
                    datatemp[i, 0] = BitConverter.ToUInt32(buffernew, 0);
                    a.Position     = 4 + i * 32;
                    a.Read(buffernew, 0, 4);
                    datatemp[i, 1] = BitConverter.ToUInt32(buffernew, 0).ToString("x8");
                    a.Position     = 8 + i * 32;
                    a.Read(buffernew, 0, 4);
                    datatemp[i, 2] = BitConverter.ToUInt32(buffernew, 0);
                    a.Position     = 12 + i * 32;
                    a.Read(buffernew, 0, 4);
                    datatemp[i, 3] = BitConverter.ToUInt32(buffernew, 0);
                    a.Position     = 16 + i * 32;
                    a.Read(buffernew, 0, 4);
                    datatemp[i, 4] = BitConverter.ToUInt32(buffernew, 0).ToString("x8");
                    a.Position     = 20 + i * 32;
                    a.Read(buffernew, 0, 4);
                    datatemp[i, 5] = BitConverter.ToUInt32(buffernew, 0).ToString("x8");
                    a.Position     = 24 + i * 32;
                    a.Read(buffernew, 0, 4);
                    datatemp[i, 6] = BitConverter.ToUInt32(buffernew, 0);
                    a.Position     = 28 + i * 32;
                    buffernew      = new byte[3];
                    a.Read(buffernew, 0, 3);
                    datatemp[i, 7] = BitConverter.ToUInt16(buffernew, 0).ToString("x8");

                    a.Position = 31 + i * 32;
                    buffernew  = new byte[1];
                    a.Read(buffernew, 0, 1);
                    datatemp[i, 8] = (int)buffernew[0];
                }

                FillGrid.Build(grid1, b, 9, "OVA#", "RAM Addr", "RAM Size", "BSS Size", "Static InitStart", "Static InitEnd", "File ID#", "RESERVED", "Compressed Flag");
                Fill(grid1, datatemp);
            }
        }
Esempio n. 4
0
        public void OpenFile_Click(object sender, EventArgs e)
        {
            try
            {
                string path = "";

                path = AndiFileDialog.OpenDialog(path, _LastPath, "InGameTrade - File Open", "Any Files|*.*|Narc Files|*.*");

                if (path != "")
                {
                    Program.GlobalPath = Path.GetDirectoryName(path);
                    _LastPath          = Path.GetDirectoryName(path);
                    _LastPath2         = path;
                    FileStream a = new FileStream(path, FileMode.Open);
                    Program.mForm.fname.Text = a.Name;
                    Program.mForm.fsize.Text = a.Length + "";
                    byte[] bytee = new byte[4];

                    a.Position = 0;

                    a.Read(bytee, 0, 4);

                    string check = System.Text.Encoding.ASCII.GetString(bytee);
                    a.Close();

                    if (check != "NARC")
                    {
                        MessageBox.Show("This Not NARC File, File Extension Signature is " + check + ", and is not NARC File!", "Error!");
                        return;
                    }

                    narc.OpenData(path);

                    if (narc.FileCount != 20)
                    {
                        MessageBox.Show("Invalid File.", "Error!");
                        return;
                    }

                    EventsAfterOpenFile();
                }
            }
            catch (Exception ex)
            {
#if DEBUG
                Database.InsertReader.InsertLogs("error", "Yello", ex);
#endif
            }
        }
Esempio n. 5
0
        public void OpenFile_Click(object sender, EventArgs e)
        {
            try
            {
                string path = "";

                path = AndiFileDialog.OpenDialog(path, _LastPath, "Hidden Grotto - File Open", "Any Files|*.*|Narc Files|*.*");

                if (path != "")
                {
                    Program.GlobalPath = Path.GetDirectoryName(path);
                    _LastPath          = Path.GetDirectoryName(path);

                    flepath = new FileInfo(path);
                    Program.mForm.fname.Text = flepath.Name;
                    Program.mForm.fsize.Text = flepath.Length + "";

                    if (CheckMagicHeaderID.get(path) != "NARC")
                    {
                        MessageBox.Show("This Not NARC File, File Extension Signature is " + CheckMagicHeaderID.get(path) + ", and is not NARC File!", "Error!");
                        return;
                    }

                    narc.OpenData(path);

                    if (narc.FileCount != 20)
                    {
                        MessageBox.Show("Invalid File.", "Error!");
                        return;
                    }

                    EventsAfterOpenFile();
                }
            }
            catch (Exception ex)
            {
#if DEBUG
                Database.InsertReader.InsertLogs("error", "Yello", ex);
#endif
            }
        }