Exemple #1
0
        private void Compile_Click(object sender, EventArgs e)
        {
            if (getVersion() == 3.0)
            {
            }

            else
            {
                compilar_onde = new TibiaFolder("What folder the sprites are?");
                if (compilar_onde.success == true)
                {
                    compilar_para_onde = new TibiaFolder("Choose where you want the file be saved?");
                    if (compilar_para_onde.success == true)
                    {
                        #region compilando as versões entre 7.0 até 9.54
                        if (getVersion() == 7.0)
                        {
                            sprite_compiler70 = new Thread(compileTo70);
                            sprite_compiler70.Start();
                        }
                        #endregion
                        #region compilando da versão 9.6 para cima
                        else if (getVersion() == 9.6)
                        {
                            sprite_compiler96 = new Thread(compileTo96);
                            sprite_compiler96.Start();
                        }
                        #endregion
                    }
                }
            }
        }
Exemple #2
0
        public void fromFile(TibiaFolder folder)
        {
            BinaryReader signa = new BinaryReader(File.OpenRead(folder.getPath() + "\\signature.dat"));

            this.signature[0] = signa.ReadByte();
            this.signature[1] = signa.ReadByte();
            this.signature[2] = signa.ReadByte();
            this.signature[3] = signa.ReadByte();
        }
Exemple #3
0
        public void save(TibiaFolder folder, string newFolderName)
        {
            FileStream   dat    = new FileStream(folder.getPath() + "\\" + newFolderName + "\\signature.dat", FileMode.Create);
            BinaryWriter writer = new BinaryWriter(dat);

            writer.Write(signature[0]);
            writer.Write(signature[1]);
            writer.Write(signature[2]);
            writer.Write(signature[3]);
            writer.Flush();
            writer.Close();
        }
Exemple #4
0
        private void Extract_Click(object sender, EventArgs e)
        {
            if (getVersion() == 3.0)
            {
                #region lendo para a versão 3.0 até 6.5
                setLog("Can't work with this version.");
                #endregion
            }

            else
            {
                extrair_quem = new TibiaFile("Which file you want to decompile?");
                if (extrair_quem.success == true)
                {
                    extrair_para_onde = new TibiaFolder("Where do you want the folder be created?");
                    if (extrair_para_onde.success == true)
                    {
                        #region lendo para a versão 7.0 até 9.54
                        if (getVersion() == 7.0)
                        {
                            setLog("Reading sprite file.");
                            try
                            {
                                sd70 = new SprDecompiler70(extrair_quem);
                                setLog("Exporting...");
                                setLog("The logs blinking while extracting means that my program is the best...");
                                sprites_to_export = sd70.getSprites();
                                assinatura.set(sd70.getSignature());
                            }

                            catch
                            {
                                try
                                {
                                    setLog("Can't read the file...");
                                    selectversion.SelectedIndex = 1;
                                    setLog("Trying to decompile under the pattern from version 9.6");
                                    setLog("Reading sprite file.");
                                    sd96 = new SprDecompiler96(extrair_quem);
                                    setLog("Exporting...");
                                    sprites_to_export = sd96.getSprites();
                                    assinatura.set(sd96.getSignature());
                                }

                                catch
                                {
                                    setLog("Can't read the file... Operation aborted");
                                }
                            }
                        }
                        #endregion
                        #region lendo para versão 9.6
                        else if (getVersion() == 9.6)
                        {
                            setLog("Reading sprite file.");
                            //try
                            // {
                            sd96 = new SprDecompiler96(extrair_quem);
                            setLog("Exporting...");
                            sprites_to_export = sd96.getSprites();
                            assinatura.set(sd96.getSignature());

                            /*}
                             *
                             * catch
                             * {
                             *  try
                             *  {
                             *      setLog("Can't read the file...");
                             *      selectversion.SelectedIndex = 0;
                             *      setLog("Trying to decompile under the pattern from version 7.2 to 9.54");
                             *      setLog("Reading sprite file.");
                             *      sd70 = new SprDecompiler70(extrair_quem);
                             *      assinatura.set(sd70.getSignature());
                             *      setLog("Exporting...");
                             *      sprites_to_export = sd70.getSprites();
                             *  }
                             *
                             *  catch
                             *  {
                             *      setLog("Can't read the file... Operation aborted");
                             *  }
                             */
                        }
                        #endregion
                        #region criando a pasta onde as sprites serão armazenadas e depois iniciando o thread
                        if (sprites_to_export != null)
                        {
                            string nova_pasta = "Sprites";
                            int    k          = 2;

                            while (Directory.Exists(extrair_para_onde.getPath() + "\\" + nova_pasta))
                            {
                                nova_pasta = "Sprites " + k.ToString(); k++;
                            }
                            export_folder_name = extrair_para_onde.getPath() + "\\" + nova_pasta;
                            Directory.CreateDirectory(export_folder_name);
                            assinatura.save(extrair_para_onde, nova_pasta);
                        }

                        this.sprites_exporter = new Thread(new ThreadStart(this.saveSprites));
                        this.sprites_exporter.Start();
                        #endregion
                    } //seleção da pasta onde as imagens vão ficar
                }     //seleção do arquivo a ser extraido
            }
        }