Example #1
0
        public void SalvarItemListBinEncode()
        {
            try
            {
                using (SaveFileDialog save = new SaveFileDialog())
                {
                    save.Filter = "*.bin|*.bin";
                    save.Title  = "Selecione onde deseja salvar sua ItemList.bin";
                    save.ShowDialog();

                    if (save.FileName != "")
                    {
                        byte[] toSave   = Pak.ToByteArray(this.List);
                        byte[] pKeyList = File.ReadAllBytes("./Keys.bin");
                        Array.Resize(ref pKeyList, pKeyList.Length + 1);


                        for (int i = 0; i < toSave.Length; i++)
                        {
                            toSave[i] ^= (pKeyList[i & 63]);
                        }

                        File.Create(save.FileName).Close();
                        File.WriteAllBytes(save.FileName, toSave);

                        MessageBox.Show($"Arquivo {save.FileName} salvo no modo Encode com sucesso!");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #2
0
        public void SalvarItemListBin()
        {
            try
            {
                using (SaveFileDialog save = new SaveFileDialog())
                {
                    save.Filter = "*.bin|*.bin";
                    save.Title  = "Selecione onde deseja salvar sua ItemList.bin";
                    save.ShowDialog();

                    if (save.FileName != "")
                    {
                        byte[] toSave = Pak.ToByteArray(this.List);

                        for (int i = 0; i < toSave.Length; i++)
                        {
                            toSave[i] ^= 0x5A;
                        }

                        File.Create(save.FileName).Close();
                        File.WriteAllBytes(save.FileName, toSave);

                        MessageBox.Show($"Arquivo {save.FileName} salvo com sucesso!");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #3
0
        public void SalvaritemNameBin()
        {
            try
            {
                using (SaveFileDialog save = new SaveFileDialog())
                {
                    save.Filter = "*.bin|*.bin";
                    save.Title  = "Selecione onde deseja salvar sua ItemName.bin";
                    save.ShowDialog();

                    if (save.FileName != "")
                    {
                        for (int i = 0; i < 6500; i++)
                        {
                            if (string.IsNullOrEmpty(this.List.Item[i].Name))
                            {
                                continue;
                            }

                            this.ItemName.Item[i].Id   = i;
                            this.ItemName.Item[i].Name = this.List.Item[i].Name;
                        }


                        byte[] toSave = Pak.ToByteArray(this.ItemName);


                        for (int i = 0; i < toSave.Length; i += 68)
                        {
                            for (int j = i + 4, k = 0; j < i + 68; j++, k++)
                            {
                                toSave[j] += (byte)(k);
                            }
                        }

                        File.Create(save.FileName).Close();
                        File.WriteAllBytes(save.FileName, toSave);

                        MessageBox.Show($"Arquivo {save.FileName} salvo com sucesso!");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }