Add VXAce Support.

This commit is contained in:
SilicaAndPina 2019-12-15 19:47:58 +13:00
parent 2ac917cebd
commit 34cc013c5e
15 changed files with 133 additions and 37027 deletions

BIN
.vs/RMDEC/v15/.suo Normal file

Binary file not shown.

View File

@ -540,7 +540,7 @@ namespace RMDEC
makeMV.Enabled = true;
unmakeMV.Enabled = true;
Process.Start(mvProject.FilePath);
Process.Start(mvProject.FilePath+"\\");
}
private void makeMV_Click(object sender, EventArgs e)
{

View File

@ -32,9 +32,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="DotNetZip, Version=1.13.4.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
<HintPath>..\packages\DotNetZip.1.13.4\lib\net40\DotNetZip.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
</Reference>

View File

@ -1,10 +1,9 @@
using Ionic.Zlib;

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RMDEC
{
@ -13,11 +12,10 @@ namespace RMDEC
public VXAProject() { }
//Private Variables
private static int[] supportedVersions = { 0x3 };
private int currentVersion = 0;
private byte[] encryptionKey = new byte[0x4];
private string gameTitle;
private string exeName;
private string filePath;
private Stream rgss3aStream;
@ -43,6 +41,15 @@ namespace RMDEC
}
}
public String ExeName
{
get
{
return exeName;
}
}
public String FilePath
{
get
@ -126,18 +133,21 @@ namespace RMDEC
private byte[] decryptFileData(byte[] input, byte[] keydata)
{
byte[] output = new byte[input.Length];
long size = input.LongLength;
byte[] output = new byte[size];
uint keyInt = BitConverter.ToUInt32(keydata, 0x00);
for (int i = 0; i < input.Length; i++)
for (int i = 0; i < size; i++)
{
if (i != 0 && i % 4 == 0)
{
// Derive new key
keyInt *= 7;
keyInt += 3;
keydata = BitConverter.GetBytes(keyInt);
keyInt = ((keyInt * 7) + 3);
byte[] derivedKeyBytes = BitConverter.GetBytes(keyInt);
Array.Copy(derivedKeyBytes, keydata, 0x4); // have to do this in order to make the arguments update..
}
output[i] = (byte)(input[i] ^ keydata[i % keydata.Length]);
@ -162,31 +172,23 @@ namespace RMDEC
throw new InvalidDataException("Not a valid rgss3a!");
}
string workDir = Path.GetDirectoryName(file);
string gameExeName = Path.GetFileNameWithoutExtension(file);
string iniFilePath = Path.Combine(workDir, gameExeName + ".ini");
vxp.exeName = Path.GetFileNameWithoutExtension(file);
string iniFilePath = Path.Combine(workDir, vxp.exeName + ".ini");
vxp.rgss3aStream = rgss3a;
try
{
vxp.gameTitle = read_ini_value(iniFilePath, "Game", "Title", gameExeName);
vxp.gameTitle = read_ini_value(iniFilePath, "Game", "Title", vxp.exeName);
}
catch (Exception)
{
vxp.gameTitle = gameExeName;
vxp.gameTitle = vxp.exeName;
}
vxp.filePath = workDir;
rgss3a.Seek(0x1, SeekOrigin.Current);
int version = rgss3a.ReadByte();
if(!supportedVersions.Contains(version))
{
throw new InvalidDataException("Unsupported version!");
}
vxp.currentVersion = version;
rgss3a.Seek(0x2, SeekOrigin.Current);
vxp.encryptionKey = BitConverter.GetBytes((((vxp.readUInt32()) * 9) + 3));
@ -196,31 +198,29 @@ namespace RMDEC
public void DecryptFile(int fileIndex, Stream outStream)
{
outStream.SetLength(0);
ArchiveFile fileData = archiveFileList[fileIndex];
byte[] keyData = fileData.Key;
rgss3aStream.Seek(fileData.Offset, SeekOrigin.Begin);
uint size = fileData.Size;
for(int i = 0; i < size; i += 0x40000000)
for(int i = 0; i < size; i += 0x20000000)
{
if (size >= 0x40000000) //1GB
if (size > 0x20000000) //512MB
{
byte[] gameData = new byte[0x40000000];
rgss3aStream.Read(gameData, 0x00, 0x40000000);
byte[] gameData = new byte[0x20000000];
rgss3aStream.Read(gameData, 0x00, 0x20000000);
gameData = decryptFileData(gameData, keyData);
//gameData = ZlibStream.UncompressBuffer(gameData);
outStream.Write(gameData, 0x00, (int)size);
outStream.Write(gameData, 0x00, gameData.Length);
}
else
{
byte[] gameData = new byte[size];
rgss3aStream.Read(gameData, 0x00, (int)size);
rgss3aStream.Read(gameData, 0x00, gameData.Length);
gameData = decryptFileData(gameData, keyData);
//gameData = ZlibStream.UncompressBuffer(gameData);
outStream.Write(gameData, 0x00, (int)size);
outStream.Write(gameData, 0x00, gameData.Length);
}
}

View File

@ -31,15 +31,11 @@
this.encryptedFileList = new System.Windows.Forms.ListBox();
this.decryptSelected = new System.Windows.Forms.Button();
this.decryptedFileList = new System.Windows.Forms.ListBox();
this.encryptSelected = new System.Windows.Forms.Button();
this.processingBar = new System.Windows.Forms.ProgressBar();
this.processingText = new System.Windows.Forms.Label();
this.makeMV = new System.Windows.Forms.Button();
this.unmakeMV = new System.Windows.Forms.Button();
this.makeVXA = new System.Windows.Forms.Button();
this.layout1 = new System.Windows.Forms.TableLayoutPanel();
this.layout2 = new System.Windows.Forms.TableLayoutPanel();
this.layout1.SuspendLayout();
this.layout2.SuspendLayout();
this.SuspendLayout();
//
// encryptedFileList
@ -51,9 +47,8 @@
this.encryptedFileList.HorizontalScrollbar = true;
this.encryptedFileList.Location = new System.Drawing.Point(3, 3);
this.encryptedFileList.Name = "encryptedFileList";
this.layout1.SetRowSpan(this.encryptedFileList, 4);
this.encryptedFileList.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
this.encryptedFileList.Size = new System.Drawing.Size(334, 357);
this.encryptedFileList.Size = new System.Drawing.Size(820, 141);
this.encryptedFileList.TabIndex = 3;
//
// decryptSelected
@ -63,11 +58,11 @@
this.decryptSelected.Enabled = false;
this.decryptSelected.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.decryptSelected.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.decryptSelected.Location = new System.Drawing.Point(387, 98);
this.decryptSelected.Location = new System.Drawing.Point(389, 156);
this.decryptSelected.Name = "decryptSelected";
this.decryptSelected.Size = new System.Drawing.Size(48, 48);
this.decryptSelected.TabIndex = 4;
this.decryptSelected.Text = "-->";
this.decryptSelected.Text = "|\r\nV";
this.decryptSelected.UseVisualStyleBackColor = false;
this.decryptSelected.Click += new System.EventHandler(this.decryptSelected_Click);
//
@ -78,31 +73,15 @@
this.decryptedFileList.Dock = System.Windows.Forms.DockStyle.Fill;
this.decryptedFileList.FormattingEnabled = true;
this.decryptedFileList.HorizontalScrollbar = true;
this.decryptedFileList.Location = new System.Drawing.Point(486, 3);
this.decryptedFileList.Location = new System.Drawing.Point(3, 217);
this.decryptedFileList.Name = "decryptedFileList";
this.layout1.SetRowSpan(this.decryptedFileList, 4);
this.decryptedFileList.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
this.decryptedFileList.Size = new System.Drawing.Size(337, 357);
this.decryptedFileList.Size = new System.Drawing.Size(820, 143);
this.decryptedFileList.TabIndex = 5;
//
// encryptSelected
//
this.encryptSelected.Anchor = System.Windows.Forms.AnchorStyles.None;
this.encryptSelected.BackColor = System.Drawing.SystemColors.InactiveCaption;
this.encryptSelected.Enabled = false;
this.encryptSelected.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.encryptSelected.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
this.encryptSelected.Location = new System.Drawing.Point(387, 208);
this.encryptSelected.Name = "encryptSelected";
this.encryptSelected.Size = new System.Drawing.Size(48, 48);
this.encryptSelected.TabIndex = 6;
this.encryptSelected.Text = "<--";
this.encryptSelected.UseVisualStyleBackColor = false;
this.encryptSelected.Click += new System.EventHandler(this.encryptSelected_Click);
//
// processingBar
//
this.processingBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
this.processingBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.processingBar.BackColor = System.Drawing.SystemColors.InactiveCaption;
this.processingBar.Location = new System.Drawing.Point(154, 415);
@ -123,93 +102,56 @@
this.processingText.Text = "Waiting";
this.processingText.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// makeMV
// makeVXA
//
this.makeMV.BackColor = System.Drawing.SystemColors.InactiveCaption;
this.makeMV.Dock = System.Windows.Forms.DockStyle.Fill;
this.makeMV.Enabled = false;
this.makeMV.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.makeMV.Location = new System.Drawing.Point(417, 3);
this.makeMV.Name = "makeMV";
this.makeMV.Size = new System.Drawing.Size(409, 24);
this.makeMV.TabIndex = 9;
this.makeMV.Text = "Un-Deploy MV Project";
this.makeMV.UseVisualStyleBackColor = false;
this.makeMV.Click += new System.EventHandler(this.makeMV_Click);
//
// unmakeMV
//
this.unmakeMV.BackColor = System.Drawing.SystemColors.InactiveCaption;
this.unmakeMV.Dock = System.Windows.Forms.DockStyle.Fill;
this.unmakeMV.Enabled = false;
this.unmakeMV.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.unmakeMV.ForeColor = System.Drawing.SystemColors.InactiveCaptionText;
this.unmakeMV.Location = new System.Drawing.Point(3, 3);
this.unmakeMV.Name = "unmakeMV";
this.unmakeMV.Size = new System.Drawing.Size(408, 24);
this.unmakeMV.TabIndex = 10;
this.unmakeMV.Text = "Deploy MV Project";
this.unmakeMV.UseVisualStyleBackColor = false;
this.unmakeMV.Click += new System.EventHandler(this.unmakeMV_Click);
this.makeVXA.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.makeVXA.BackColor = System.Drawing.SystemColors.InactiveCaption;
this.makeVXA.Enabled = false;
this.makeVXA.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.makeVXA.ForeColor = System.Drawing.SystemColors.InactiveCaptionText;
this.makeVXA.Location = new System.Drawing.Point(18, 385);
this.makeVXA.Name = "makeVXA";
this.makeVXA.Size = new System.Drawing.Size(820, 24);
this.makeVXA.TabIndex = 10;
this.makeVXA.Text = "Decrypt and Uncompress to VX Ace Project";
this.makeVXA.UseVisualStyleBackColor = false;
this.makeVXA.Click += new System.EventHandler(this.makeVXA_Click);
//
// layout1
//
this.layout1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
this.layout1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.layout1.ColumnCount = 5;
this.layout1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 44.17065F));
this.layout1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.829354F));
this.layout1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 55F));
this.layout1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.829354F));
this.layout1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 44.17064F));
this.layout1.Controls.Add(this.encryptSelected, 2, 2);
this.layout1.ColumnCount = 1;
this.layout1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.layout1.Controls.Add(this.encryptedFileList, 0, 0);
this.layout1.Controls.Add(this.decryptedFileList, 4, 0);
this.layout1.Controls.Add(this.decryptedFileList, 0, 2);
this.layout1.Controls.Add(this.decryptSelected, 2, 1);
this.layout1.Location = new System.Drawing.Point(15, 12);
this.layout1.Name = "layout1";
this.layout1.RowCount = 4;
this.layout1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 22.89562F));
this.layout1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 39.05724F));
this.layout1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 38.04714F));
this.layout1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 74F));
this.layout1.RowCount = 3;
this.layout1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40.76087F));
this.layout1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 18.47826F));
this.layout1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40.76087F));
this.layout1.Size = new System.Drawing.Size(826, 363);
this.layout1.TabIndex = 7;
//
// layout2
//
this.layout2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.layout2.ColumnCount = 2;
this.layout2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.layout2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.layout2.Controls.Add(this.unmakeMV, 0, 0);
this.layout2.Controls.Add(this.makeMV, 1, 0);
this.layout2.Location = new System.Drawing.Point(12, 380);
this.layout2.Name = "layout2";
this.layout2.RowCount = 1;
this.layout2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.layout2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.layout2.Size = new System.Drawing.Size(829, 30);
this.layout2.TabIndex = 11;
//
// VXAProjectToolset
// vxaProjectToolset
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.ClientSize = new System.Drawing.Size(853, 442);
this.Controls.Add(this.makeVXA);
this.Controls.Add(this.processingText);
this.Controls.Add(this.processingBar);
this.Controls.Add(this.layout1);
this.Controls.Add(this.layout2);
this.MinimumSize = new System.Drawing.Size(869, 481);
this.Name = "VXAProjectToolset";
this.Name = "vxaProjectToolset";
this.Text = "RMDec - RPG Maker VX ACE";
this.Load += new System.EventHandler(this.VXAProjectToolset_Load);
this.layout1.ResumeLayout(false);
this.layout2.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -218,12 +160,9 @@
private System.Windows.Forms.ListBox encryptedFileList;
private System.Windows.Forms.Button decryptSelected;
private System.Windows.Forms.ListBox decryptedFileList;
private System.Windows.Forms.Button encryptSelected;
private System.Windows.Forms.ProgressBar processingBar;
private System.Windows.Forms.Label processingText;
private System.Windows.Forms.Button makeMV;
private System.Windows.Forms.Button unmakeMV;
private System.Windows.Forms.Button makeVXA;
private System.Windows.Forms.TableLayoutPanel layout1;
private System.Windows.Forms.TableLayoutPanel layout2;
}
}

View File

@ -19,32 +19,21 @@ namespace RMDEC
vxProject = proj;
InitializeComponent();
}
private List<string> decFileList = new List<string>();
private bool encryptedIndexingComplete = false;
private bool unencryptedIndexingComplete = false;
private void onIndexThreadComplete()
{
if(encryptedIndexingComplete && unencryptedIndexingComplete)
{
processingText.Text = "Waiting";
processingText.BackColor = Color.Red;
processingText.Text = "Waiting";
processingText.BackColor = Color.Red;
decryptSelected.Enabled = true;
encryptSelected.Enabled = true;
decryptSelected.Enabled = true;
makeMV.Enabled = true;
unmakeMV.Enabled = true;
makeVXA.Enabled = true;
makeVXA.Enabled = true;
processingBar.Style = ProgressBarStyle.Continuous;
processingBar.Style = ProgressBarStyle.Continuous;
this.Cursor = Cursors.Arrow;
}
this.Cursor = Cursors.Arrow;
}
private void indexFiles()
{
@ -54,112 +43,39 @@ namespace RMDEC
this.Cursor = Cursors.WaitCursor;
//Index Encrypted Files
Thread indexEncryptedFilesThread = new Thread(() =>
Thread indexFiles = new Thread(() =>
{
vxProject.PopulateFileList();
foreach (string file in vxProject.FileList)
{
string fileExtension = Path.GetExtension(file);
string realPath = Path.Combine(vxProject.FilePath, file);
Invoke((Action)delegate
{
encryptedFileList.Items.Add("[" + fileExtension.ToUpper().TrimStart('.') + "] " + file);
});
if (File.Exists(realPath))
{
Invoke((Action)delegate
{
decryptedFileList.Items.Add("[" + fileExtension.ToUpper().TrimStart('.') + "] " + file);
});
}
}
Invoke((Action)delegate
{
encryptedIndexingComplete = true;
unencryptedIndexingComplete = true;
onIndexThreadComplete();
});
});
indexEncryptedFilesThread.Start();
/*Index Unencrypted Files
Thread indexUnencryptedFilesThread = new Thread(() =>
{
List<string> pngList = new List<string>();
List<string> oggList = new List<string>();
List<string> m4aList = new List<string>();
foreach (string file in Directory.EnumerateFiles(vxProject.FilePath, "*", SearchOption.AllDirectories))
{
string relativeName = file.Remove(0, vxProject.FilePath.Length + 1);
string fileExtension = Path.GetExtension(file).ToLower();
if(blacklistedFiles.Contains(relativeName))
{
continue;
}
switch (fileExtension)
{
case ".png":
pngList.Add(file);
break;
case ".ogg":
oggList.Add(file);
break;
case ".m4a":
m4aList.Add(file);
break;
}
}
//add PNG
foreach (string png in pngList)
{
string relativeName = png.Remove(0, vxProject.FilePath.Length+1);
Invoke((Action)delegate
{
decryptedFileList.Items.Add("[PNG] " + relativeName);
});
decFileList.Add(png);
}
//add OGG
foreach (string ogg in oggList)
{
string relativeName = ogg.Remove(0, vxProject.FilePath.Length+1);
Invoke((Action)delegate
{
decryptedFileList.Items.Add("[OGG] " + relativeName);
});
decFileList.Add(ogg);
}
//add M4A
foreach (string m4a in m4aList)
{
string relativeName = m4a.Remove(0, vxProject.FilePath.Length+1);
Invoke((Action)delegate
{
decryptedFileList.Items.Add("[M4A] " + relativeName);
});
decFileList.Add(m4a);
}
Invoke((Action)delegate
{
unencryptedImageCount = pngList.Count;
unencryptedMusicCount = oggList.Count + m4aList.Count;
unencryptedIndexingComplete = true;
onIndexThreadComplete();
});
});
indexUnencryptedFilesThread.Start();
*/
indexFiles.Start();
}
private void VXAProjectToolset_Load(object sender, EventArgs e)
{
@ -172,87 +88,7 @@ namespace RMDEC
this.Text = "RMDec - [RMVXA] " + vxProject.GameTitle + " - " + vxProject.FilePath;
}
private void encryptSelected_Click(object sender, EventArgs e)
{
/* SelectedIndexCollection itemList = decryptedFileList.SelectedIndices;
int itemCount = itemList.Count;
if (itemCount < 1)
{
return;
}
int item = 0;
processingBar.Style = ProgressBarStyle.Continuous;
processingBar.Maximum = itemCount;
processingText.BackColor = Color.Yellow;
encryptSelected.Enabled = false;
decryptSelected.Enabled = false;
Thread decryptFilesThread = new Thread(() =>
{
int i = 1;
int total = itemCount;
do
{
Invoke((Action)delegate
{
itemCount = itemList.Count;
item = itemList[0];
processingText.Text = "Encrypting " + i.ToString() + "/" + total.ToString();
});
string decryptedFile = decFileList[item];
string newExtension = encodeFileExtension(decryptedFile);
string encryptedFile = Path.ChangeExtension(decryptedFile, newExtension);
FileStream Decrypted = File.OpenRead(decryptedFile);
FileStream Encrypted = File.OpenWrite(encryptedFile);
vxProject.EncryptFile(Decrypted, Encrypted);
Encrypted.Close();
Decrypted.Close();
File.Delete(decryptedFile);
Invoke((Action)delegate
{
string entry = decryptedFileList.Items[item].ToString();
string encryptedEntry = Path.ChangeExtension(entry, newExtension);
encryptedFileList.Items.Add(encryptedEntry);
encFileList.Add(encryptedFile);
decryptedFileList.Items.RemoveAt(item);
decFileList.RemoveAt(item);
processingBar.Value = i;
});
i++;
} while (itemCount > 1);
Invoke((Action)delegate
{
encryptSelected.Enabled = true;
decryptSelected.Enabled = true;
processingText.BackColor = Color.Green;
processingText.Text = "Encrypted " + total.ToString() + " files!";
});
});
decryptFilesThread.Start();
*/
}
private void decryptSelected_Click(object sender, EventArgs e)
@ -271,27 +107,20 @@ namespace RMDEC
processingBar.Maximum = itemCount;
processingText.BackColor = Color.Yellow;
encryptSelected.Enabled = false;
decryptSelected.Enabled = false;
makeMV.Enabled = false;
unmakeMV.Enabled = false;
makeVXA.Enabled = false;
Thread decryptFilesThread = new Thread(() =>
{
int i = 1;
int total = itemCount;
do
{
for(int i = 0; i < itemCount; i++)
{
Invoke((Action)delegate
{
itemCount = itemList.Count;
item = itemList[0];
processingText.Text = "Decrypting " + i.ToString() + "/" + total.ToString();
{
item = itemList[i];
processingText.Text = "Decrypting " + i.ToString() + "/" + itemCount.ToString();
});
@ -308,50 +137,50 @@ namespace RMDEC
Invoke((Action)delegate
{
string entry = encryptedFileList.Items[item].ToString();
string decryptedEntry = entry;
decryptedFileList.Items.Add(decryptedEntry);
encryptedFileList.Items.RemoveAt(item);
vxProject.FileList.RemoveAt(item);
string encEntry = encryptedFileList.Items[i].ToString();
if (!decryptedFileList.Items.Contains(encEntry))
{
decryptedFileList.Items.Add(encEntry);
}
processingBar.Value = i;
});
i++;
} while (itemCount > 1);
}
Invoke((Action)delegate
{
encryptSelected.Enabled = true;
decryptSelected.Enabled = true;
makeMV.Enabled = true;
unmakeMV.Enabled = true;
makeVXA.Enabled = true;
processingText.BackColor = Color.Green;
processingText.Text = "Decrypted " + total.ToString() + " files!";
processingText.Text = "Decrypted " + itemCount.ToString() + " files!";
});
});
decryptFilesThread.Start();
}
private void onMakeMvComplete()
private void onMakeVxaComplete()
{
string rpgProject = Path.Combine(vxProject.FilePath, "Game.rvproj2");
string rpgProject = Path.Combine(vxProject.FilePath, vxProject.ExeName+".rvproj2");
string rpgEncryptedArchive = Path.Combine(vxProject.FilePath, vxProject.ExeName + ".rgss3a");
File.WriteAllText(rpgProject, "RPGVXAce 1.00");
if(File.Exists(rpgEncryptedArchive))
{
vxProject.Close();
File.Move(rpgEncryptedArchive, rpgEncryptedArchive+".delete-me");
}
processingText.BackColor = Color.Green;
processingText.Text = "Game Un-Deployed!";
processingText.Text = "Game Decrypted!";
encryptSelected.Enabled = true;
decryptSelected.Enabled = true;
makeMV.Enabled = true;
unmakeMV.Enabled = true;
makeVXA.Enabled = true;
Process.Start(vxProject.FilePath);
Process.Start(vxProject.FilePath+"\\");
}
private void makeMV_Click(object sender, EventArgs e)
private void makeVXA_Click(object sender, EventArgs e)
{
int itemCount = vxProject.FileList.Count;
@ -362,12 +191,11 @@ namespace RMDEC
processingBar.Maximum = itemCount;
processingText.BackColor = Color.Yellow;
encryptSelected.Enabled = false;
decryptSelected.Enabled = false;
makeMV.Enabled = false;
unmakeMV.Enabled = false;
makeVXA.Enabled = false;
makeVXA.Enabled = false;
Thread decryptFilesThread = new Thread(() =>
{
@ -380,26 +208,22 @@ namespace RMDEC
});
string fileName = (Path.Combine(vxProject.FilePath, vxProject.FileList[0]));
string fileName = (Path.Combine(vxProject.FilePath, vxProject.FileList[i]));
Directory.CreateDirectory(Path.GetDirectoryName(fileName));
FileStream Decrypted = File.OpenWrite(fileName);
vxProject.DecryptFile(0, Decrypted);
vxProject.DecryptFile(i, Decrypted);
Decrypted.Close();
Invoke((Action)delegate
{
string entry = encryptedFileList.Items[0].ToString();
string decryptedEntry = entry;
decryptedFileList.Items.Add(decryptedEntry);
decFileList.Add(fileName);
encryptedFileList.Items.RemoveAt(0);
vxProject.FileList.RemoveAt(0);
string encEntry = encryptedFileList.Items[0].ToString();
if (!decryptedFileList.Items.Contains(encEntry))
{
decryptedFileList.Items.Add(encEntry);
}
encryptedFileList.Items.Remove(encEntry);
processingBar.Value = i;
});
}
@ -408,7 +232,7 @@ namespace RMDEC
Invoke((Action)delegate
{
onMakeMvComplete();
onMakeVxaComplete();
});
@ -418,103 +242,10 @@ namespace RMDEC
}
else
{
onMakeMvComplete();
onMakeVxaComplete();
}
}
private void onUnMakeMvComplete()
{
string rpgProject = Path.Combine(vxProject.FilePath, "Game.rpgproject");
if(File.Exists(rpgProject))
{
File.Delete(rpgProject);
}
processingText.BackColor = Color.Green;
processingText.Text = "Game Deployed!";
encryptSelected.Enabled = true;
decryptSelected.Enabled = true;
makeMV.Enabled = true;
unmakeMV.Enabled = true;
}
private void unmakeMV_Click(object sender, EventArgs e)
{
/* int itemCount = decFileList.Count;
//Encrypt Everything
if (itemCount > 0)
{
processingBar.Style = ProgressBarStyle.Continuous;
processingBar.Maximum = itemCount;
processingText.BackColor = Color.Yellow;
encryptSelected.Enabled = false;
decryptSelected.Enabled = false;
makeMV.Enabled = false;
unmakeMV.Enabled = false;
Thread encryptFilesThread = new Thread(() =>
{
for (int i = 0; i < itemCount; i++)
{
Invoke((Action)delegate
{
processingText.Text = "Encrypting " + i.ToString() + "/" + itemCount.ToString();
});
string decryptedFile = decFileList[0];
string newExtension = encodeFileExtension(decryptedFile);
string encryptedFile = Path.ChangeExtension(decryptedFile, newExtension);
FileStream Encrypted = File.OpenWrite(encryptedFile);
FileStream Decrypted = File.OpenRead(decryptedFile);
vxProject.EncryptFile(Decrypted,Encrypted);
Encrypted.Close();
Decrypted.Close();
File.Delete(decryptedFile);
Invoke((Action)delegate
{
string entry = decryptedFileList.Items[0].ToString();
string encryptedEntry = Path.ChangeExtension(entry, newExtension);
encryptedFileList.Items.Add(encryptedEntry);
encFileList.Add(encryptedFile);
decryptedFileList.Items.RemoveAt(0);
decFileList.RemoveAt(0);
processingBar.Value = i;
});
}
Invoke((Action)delegate
{
onUnMakeMvComplete();
});
});
encryptFilesThread.Start();
}
else
{
onUnMakeMvComplete();
}
*/
}
}
}

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DotNetZip" version="1.13.4" targetFramework="net452" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net452" />
<package id="WindowsAPICodePack-Core" version="1.1.2" targetFramework="net452" />
<package id="WindowsAPICodePack-Shell" version="1.1.1" targetFramework="net452" />

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff