Initial split to pk3DS and pk3DS.Core
@@ -2,7 +2,7 @@
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
public class AesCtr
|
||||
{
|
||||
@@ -3,13 +3,13 @@
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using pk3DS.Properties; // For other projects, replace this line with the namespace that contains your ETC1Lib.dll resource.
|
||||
using pk3DS.Core.Properties; // For other projects, replace this line with the namespace that contains your ETC1Lib.dll resource.
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
public static class BCLIM
|
||||
{
|
||||
internal static void openFile(string path, bool autosave = false, bool crop = true, char format = 'X')
|
||||
public static void openFile(string path, bool autosave = false, bool crop = true, char format = 'X')
|
||||
{
|
||||
// Handle file
|
||||
if (!File.Exists(path)) throw new Exception("Can only accept files, not folders");
|
||||
@@ -20,7 +20,7 @@ internal static void openFile(string path, bool autosave = false, bool crop = tr
|
||||
makeBMP(path, autosave, crop);
|
||||
}
|
||||
|
||||
internal static byte[] IMGToBCLIM(Image img, char fc)
|
||||
public static byte[] IMGToBCLIM(Image img, char fc)
|
||||
{
|
||||
Bitmap mBitmap = new Bitmap(img);
|
||||
MemoryStream ms = new MemoryStream();
|
||||
@@ -61,7 +61,7 @@ internal static byte[] IMGToBCLIM(Image img, char fc)
|
||||
}
|
||||
return ms.ToArray();
|
||||
}
|
||||
internal static byte[] getBCLIM(string path, char fc)
|
||||
public static byte[] getBCLIM(string path, char fc)
|
||||
{
|
||||
byte[] byteArray = File.ReadAllBytes(path);
|
||||
using (Stream BitmapStream = new MemoryStream(byteArray)) // Open the file, even if it is in use.
|
||||
@@ -70,7 +70,7 @@ internal static byte[] getBCLIM(string path, char fc)
|
||||
return IMGToBCLIM(img, fc);
|
||||
}
|
||||
}
|
||||
internal static Image makeBCLIM(string path, char fc)
|
||||
public static Image makeBCLIM(string path, char fc)
|
||||
{
|
||||
byte[] bclim = getBCLIM(path, fc);
|
||||
string fp = Path.GetFileNameWithoutExtension(path);
|
||||
@@ -81,7 +81,7 @@ internal static Image makeBCLIM(string path, char fc)
|
||||
|
||||
return makeBMP(newPath);
|
||||
}
|
||||
internal static Image makeBMP(string path, bool autosave = false, bool crop = true)
|
||||
public static Image makeBMP(string path, bool autosave = false, bool crop = true)
|
||||
{
|
||||
CLIM bclim = analyze(path);
|
||||
if (bclim.Magic != 0x4D494C43)
|
||||
@@ -129,7 +129,7 @@ internal static Image makeBMP(string path, bool autosave = false, bool crop = tr
|
||||
return !crop ? img : CropBMP;
|
||||
}
|
||||
// Bitmap Data Writing
|
||||
internal static Bitmap getIMG(int width, int height, byte[] bytes, int f)
|
||||
public static Bitmap getIMG(int width, int height, byte[] bytes, int f)
|
||||
{
|
||||
Bitmap img = new Bitmap(width, height);
|
||||
int area = img.Width * img.Height;
|
||||
@@ -185,7 +185,7 @@ internal static Bitmap getIMG(int width, int height, byte[] bytes, int f)
|
||||
}
|
||||
return img;
|
||||
}
|
||||
internal static Bitmap getIMG(CLIM bclim)
|
||||
public static Bitmap getIMG(CLIM bclim)
|
||||
{
|
||||
if (bclim.FileFormat == 7 && BitConverter.ToUInt16(bclim.Data, 0) == 2) // XY7
|
||||
return getIMG_XY7(bclim);
|
||||
@@ -204,7 +204,7 @@ internal static Bitmap getIMG(CLIM bclim)
|
||||
// Build Image
|
||||
return getIMG(w, h, bclim.Data, f);
|
||||
}
|
||||
internal static Bitmap getIMG_XY7(CLIM bclim)
|
||||
public static Bitmap getIMG_XY7(CLIM bclim)
|
||||
{
|
||||
Bitmap img = new Bitmap(bclim.BaseSize, bclim.BaseSize);
|
||||
using (Stream BitmapStream = new MemoryStream(bclim.Data))
|
||||
@@ -251,7 +251,7 @@ internal static Bitmap getIMG_XY7(CLIM bclim)
|
||||
}
|
||||
return img;
|
||||
}
|
||||
internal static Bitmap getIMG_ETC(CLIM bclim)
|
||||
public static Bitmap getIMG_ETC(CLIM bclim)
|
||||
{
|
||||
Bitmap img = new Bitmap(Math.Max(nlpo2(bclim.Width), 16), Math.Max(nlpo2(bclim.Height), 16));
|
||||
string dllpath = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\ETC1Lib.dll";
|
||||
@@ -349,7 +349,7 @@ internal static Bitmap getIMG_ETC(CLIM bclim)
|
||||
}
|
||||
|
||||
// BCLIM Data Writing
|
||||
internal static int write16BitColorPalette(Bitmap img, ref MemoryStream ms)
|
||||
public static int write16BitColorPalette(Bitmap img, ref MemoryStream ms)
|
||||
{
|
||||
using (Stream pixelcolors = new MemoryStream())
|
||||
using (BinaryWriter bz = new BinaryWriter(pixelcolors))
|
||||
@@ -436,14 +436,14 @@ internal static int write16BitColorPalette(Bitmap img, ref MemoryStream ms)
|
||||
}
|
||||
return 7;
|
||||
}
|
||||
internal static void writeGeneric(int format, Bitmap img, ref MemoryStream ms, bool rectangle = true)
|
||||
public static void writeGeneric(int format, Bitmap img, ref MemoryStream ms, bool rectangle = true)
|
||||
{
|
||||
BinaryWriter bz = new BinaryWriter(ms);
|
||||
bz.Write(getPixelData(img, format, rectangle));
|
||||
bz.Flush();
|
||||
}
|
||||
|
||||
internal static byte[] getPixelData(Bitmap img, int format, bool rectangle = true)
|
||||
public static byte[] getPixelData(Bitmap img, int format, bool rectangle = true)
|
||||
{
|
||||
int w = img.Width;
|
||||
int h = img.Height;
|
||||
@@ -529,7 +529,7 @@ internal static byte[] getPixelData(Bitmap img, int format, bool rectangle = tru
|
||||
return mz.ToArray();
|
||||
}
|
||||
}
|
||||
internal static int getColorCount(Bitmap img)
|
||||
public static int getColorCount(Bitmap img)
|
||||
{
|
||||
Color[] colors = new Color[img.Width * img.Height];
|
||||
int colorct = 1;
|
||||
@@ -24,7 +24,7 @@
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
public class BLZCoder
|
||||
{
|
||||
@@ -5,9 +5,9 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
internal class CRO
|
||||
public class CRO
|
||||
{
|
||||
// Utility
|
||||
internal static void updateTB(RichTextBox RTB, string progress)
|
||||
@@ -105,7 +105,7 @@ internal static string[] verifyCRR(string PATH_CRR, string PATH_CRO)
|
||||
}
|
||||
return results;
|
||||
}
|
||||
internal static bool rehashCRR(string PATH_CRR, string PATH_CRO, bool saveCRO = true, bool saveCRR = true, RichTextBox TB_Progress = null, ProgressBar PB_Show = null)
|
||||
public static bool rehashCRR(string PATH_CRR, string PATH_CRO, bool saveCRO = true, bool saveCRR = true, RichTextBox TB_Progress = null, ProgressBar PB_Show = null)
|
||||
{
|
||||
// Get CRO files
|
||||
string[] CROFiles = Directory.GetFiles(PATH_CRO);
|
||||
@@ -5,16 +5,16 @@
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using pk3DS.Properties;
|
||||
using pk3DS.Core.Properties;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
public class CTR
|
||||
public class CTRUtil
|
||||
{
|
||||
internal const uint MEDIA_UNIT_SIZE = 0x200;
|
||||
|
||||
// Main wrapper that assembles the ROM based on the following specifications:
|
||||
internal static bool buildROM(bool Card2, string LOGO_NAME,
|
||||
public static bool buildROM(bool Card2, string LOGO_NAME,
|
||||
string EXEFS_PATH, string ROMFS_PATH, string EXHEADER_PATH,
|
||||
string SERIAL_TEXT, string SAVE_PATH,
|
||||
ProgressBar PB_Show = null, RichTextBox TB_Progress = null)
|
||||
@@ -4,7 +4,7 @@
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
public class DARC
|
||||
{
|
||||
@@ -94,7 +94,7 @@ public NameTableEntry(uint offset, string fileName)
|
||||
}
|
||||
|
||||
// DARC r/w
|
||||
internal static byte[] setDARC(DARC darc)
|
||||
public static byte[] setDARC(DARC darc)
|
||||
{
|
||||
// Package DARC into a writable array.
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
@@ -129,7 +129,7 @@ internal static byte[] setDARC(DARC darc)
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
internal static DARC getDARC(string folderName)
|
||||
public static DARC getDARC(string folderName)
|
||||
{
|
||||
// Package Folder into a DARC.
|
||||
List<FileTableEntry> EntryList = new List<FileTableEntry>();
|
||||
@@ -219,12 +219,12 @@ internal static DARC getDARC(string folderName)
|
||||
return darc;
|
||||
}
|
||||
|
||||
internal static bool darc2files(string path, string folderName)
|
||||
public static bool darc2files(string path, string folderName)
|
||||
{
|
||||
try { return darc2files(File.ReadAllBytes(path), folderName); }
|
||||
catch (Exception) { return false; }
|
||||
}
|
||||
internal static bool darc2files(byte[] darc, string folderName)
|
||||
public static bool darc2files(byte[] darc, string folderName)
|
||||
{
|
||||
// Save all contents of a DARC to a folder, assuming there's only 1 layer of folders.
|
||||
try
|
||||
@@ -266,7 +266,7 @@ internal static bool darc2files(byte[] darc, string folderName)
|
||||
}
|
||||
catch (Exception) { return false; }
|
||||
}
|
||||
internal static bool files2darc(string folderName, bool delete = false, string originalDARC = null, string outFile = null)
|
||||
public static bool files2darc(string folderName, bool delete = false, string originalDARC = null, string outFile = null)
|
||||
{
|
||||
// Save all contents of a folder to a darc.
|
||||
try
|
||||
@@ -304,21 +304,21 @@ internal static bool files2darc(string folderName, bool delete = false, string o
|
||||
return true;
|
||||
} catch (Exception) { return false; }
|
||||
}
|
||||
|
||||
|
||||
// DARC Utility
|
||||
internal static int getDARCposition(byte[] data)
|
||||
public static int getDARCposition(byte[] data)
|
||||
{
|
||||
int pos = 0;
|
||||
while (BitConverter.ToUInt32(data, pos) != 0x63726164)
|
||||
{ pos += 4; if (pos >= data.Length) return -1; }
|
||||
return pos;
|
||||
}
|
||||
internal static bool insertFile(ref DARC orig, int index, string path)
|
||||
public static bool insertFile(ref DARC orig, int index, string path)
|
||||
{
|
||||
try { return insertFile(ref orig, index, File.ReadAllBytes(path)); }
|
||||
catch (Exception) { return false; }
|
||||
}
|
||||
internal static bool insertFile(ref DARC orig, int index, byte[] data)
|
||||
public static bool insertFile(ref DARC orig, int index, byte[] data)
|
||||
{
|
||||
if (index < 0) return false;
|
||||
|
||||
@@ -344,7 +344,7 @@ internal static bool insertFile(ref DARC orig, int index, byte[] data)
|
||||
}
|
||||
catch (Exception) { return false; }
|
||||
}
|
||||
internal static DARC insertFiles(DARC orig, string folderName)
|
||||
public static DARC insertFiles(DARC orig, string folderName)
|
||||
{
|
||||
string[] fileNames = new string[orig.Entries.Length];
|
||||
for (int i = 0; i < fileNames.Length; i++)
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
internal static class ETC1
|
||||
{
|
||||
@@ -4,7 +4,7 @@
|
||||
using System.Text;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
public class ExeFS
|
||||
{
|
||||
@@ -33,7 +33,7 @@ public void getSuperBlockHash()
|
||||
}
|
||||
|
||||
// Overall R/W files (wrapped)
|
||||
internal static bool get(string inFile, string outPath)
|
||||
public static bool get(string inFile, string outPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -55,7 +55,7 @@ internal static bool get(string inFile, string outPath)
|
||||
}
|
||||
catch { return false; }
|
||||
}
|
||||
internal static bool set(string[] files, string outFile)
|
||||
public static bool set(string[] files, string outFile)
|
||||
{
|
||||
if (files.Length > 10) { Console.WriteLine("Cannot package more than 10 files to exefs."); return false; }
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using pk3DS.Properties;
|
||||
using pk3DS.Core.Properties;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
public class Exheader
|
||||
{
|
||||
@@ -4,35 +4,35 @@
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
internal static class FileFormat
|
||||
public static class FileFormat
|
||||
{
|
||||
internal const string defaultExtension = "bin";
|
||||
internal static readonly string[] validEXT = {"BCH",};
|
||||
|
||||
internal static string Guess(string path)
|
||||
public static string Guess(string path)
|
||||
{
|
||||
string ext;
|
||||
using (BinaryReader br = new BinaryReader(File.OpenRead(path)))
|
||||
ext = Guess(br);
|
||||
return ext;
|
||||
}
|
||||
internal static string Guess(byte[] data)
|
||||
public static string Guess(byte[] data)
|
||||
{
|
||||
string ext;
|
||||
using (BinaryReader br = new BinaryReader(new MemoryStream(data)))
|
||||
ext = Guess(br);
|
||||
return ext;
|
||||
}
|
||||
internal static string Guess(MemoryStream ms, bool start = true)
|
||||
public static string Guess(MemoryStream ms, bool start = true)
|
||||
{
|
||||
string ext;
|
||||
using (BinaryReader br = new BinaryReader(ms))
|
||||
ext = Guess(br, start);
|
||||
return ext;
|
||||
}
|
||||
internal static string Guess(BinaryReader br, bool start = true)
|
||||
public static string Guess(BinaryReader br, bool start = true)
|
||||
{
|
||||
long position = br.BaseStream.Position; // Store current position to reset after.
|
||||
|
||||
@@ -60,7 +60,7 @@ internal static string Guess(BinaryReader br, bool start = true)
|
||||
return "." + ext;
|
||||
}
|
||||
|
||||
internal static bool GuessMini(BinaryReader br, out string ext)
|
||||
public static bool GuessMini(BinaryReader br, out string ext)
|
||||
{
|
||||
long position = br.BaseStream.Position; // Store current position to reset after.
|
||||
ext = ""; // Reset extension
|
||||
@@ -82,7 +82,7 @@ internal static bool GuessMini(BinaryReader br, out string ext)
|
||||
|
||||
return ext.Length > 0;
|
||||
}
|
||||
internal static bool GuessHeaderedDARC(BinaryReader br, out string ext)
|
||||
public static bool GuessHeaderedDARC(BinaryReader br, out string ext)
|
||||
{
|
||||
long position = br.BaseStream.Position; // Store current position to reset after.
|
||||
ext = ""; // Reset extension
|
||||
@@ -104,7 +104,7 @@ internal static bool GuessHeaderedDARC(BinaryReader br, out string ext)
|
||||
|
||||
return ext.Length > 0;
|
||||
}
|
||||
internal static bool GuessBCLIM(BinaryReader br, out string ext)
|
||||
public static bool GuessBCLIM(BinaryReader br, out string ext)
|
||||
{
|
||||
long position = br.BaseStream.Position; // Store current position to reset after.
|
||||
ext = ""; // Reset extension
|
||||
@@ -124,7 +124,7 @@ internal static bool GuessBCLIM(BinaryReader br, out string ext)
|
||||
|
||||
return ext.Length > 0;
|
||||
}
|
||||
internal static bool GuessLZ11(BinaryReader br, out string ext)
|
||||
public static bool GuessLZ11(BinaryReader br, out string ext)
|
||||
{
|
||||
long position = br.BaseStream.Position; // Store current position to reset after.
|
||||
ext = ""; // Reset extension
|
||||
@@ -144,7 +144,7 @@ internal static bool GuessLZ11(BinaryReader br, out string ext)
|
||||
br.BaseStream.Position = position;
|
||||
return ext.Length > 0;
|
||||
}
|
||||
internal static bool Guess4CHAR(BinaryReader br, out string ext)
|
||||
public static bool Guess4CHAR(BinaryReader br, out string ext)
|
||||
{
|
||||
long position = br.BaseStream.Position; // Store current position to reset after.
|
||||
ext = ""; // Reset extension
|
||||
@@ -163,7 +163,7 @@ internal static bool Guess4CHAR(BinaryReader br, out string ext)
|
||||
br.BaseStream.Position = position;
|
||||
return false;
|
||||
}
|
||||
internal static bool Guess3CHAR(BinaryReader br, out string ext)
|
||||
public static bool Guess3CHAR(BinaryReader br, out string ext)
|
||||
{
|
||||
long position = br.BaseStream.Position; // Store current position to reset after.
|
||||
ext = ""; // Reset extension
|
||||
@@ -5,7 +5,7 @@
|
||||
using System.Windows.Forms;
|
||||
using pk3DS;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
#region GARC Class & Struct
|
||||
public static class GARC
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
// LZSS (de)compression, heavily taken from dsdecmp
|
||||
public static class LZSS
|
||||
{
|
||||
internal static long Decompress(string infile, string outfile)
|
||||
public static long Decompress(string infile, string outfile)
|
||||
{
|
||||
// make sure the output directory exists
|
||||
string outDirectory = Path.GetDirectoryName(outfile);
|
||||
@@ -34,7 +34,7 @@ internal static long Decompress(string infile, string outfile)
|
||||
/// <returns>The length of the output data.</returns>
|
||||
/// <exception cref="NotEnoughDataException">When the given length of the input data
|
||||
/// is not enough to properly decompress the input.</exception>
|
||||
internal static long Decompress(Stream instream, long inLength, Stream outstream)
|
||||
public static long Decompress(Stream instream, long inLength, Stream outstream)
|
||||
{
|
||||
#region Format definition in NDSTEK style
|
||||
/* Data header (32bit)
|
||||
@@ -243,7 +243,7 @@ Flag data (8bit)
|
||||
return decompressedSize;
|
||||
}
|
||||
|
||||
internal static int Compress(string infile, string outfile)
|
||||
public static int Compress(string infile, string outfile)
|
||||
{
|
||||
// make sure the output directory exists
|
||||
string outDirectory = Path.GetDirectoryName(outfile);
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
public class NCCH
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
public class NCSD
|
||||
{
|
||||
@@ -5,7 +5,7 @@
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
public class RomFS
|
||||
{
|
||||
@@ -63,7 +63,7 @@ internal static void updateTB(RichTextBox RTB, string progress)
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
internal static void BuildRomFS(string infile, string outfile, RichTextBox TB_Progress = null, ProgressBar PB_Show = null)
|
||||
public static void BuildRomFS(string infile, string outfile, RichTextBox TB_Progress = null, ProgressBar PB_Show = null)
|
||||
{
|
||||
OutFile = outfile;
|
||||
ROOT_DIR = infile;
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
// System Menu Data Header
|
||||
public class SMDH
|
||||
@@ -2,12 +2,12 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace CTR
|
||||
namespace pk3DS.Core.CTR
|
||||
{
|
||||
// Mini Packing Util
|
||||
internal static class mini
|
||||
public static class mini
|
||||
{
|
||||
internal static byte[] adjustMiniHeader(byte[] data, int headerLength)
|
||||
public static byte[] adjustMiniHeader(byte[] data, int headerLength)
|
||||
{
|
||||
// Adjust the header size of the mini file.
|
||||
int count = BitConverter.ToUInt16(data, 2);
|
||||
@@ -28,7 +28,7 @@ internal static byte[] adjustMiniHeader(byte[] data, int headerLength)
|
||||
|
||||
return newData;
|
||||
}
|
||||
internal static void packMini(string path, string ident, string fileName, string outExt = null, string outFolder = null, bool delete = true)
|
||||
public static void packMini(string path, string ident, string fileName, string outExt = null, string outFolder = null, bool delete = true)
|
||||
{
|
||||
if (outFolder == null)
|
||||
{
|
||||
@@ -84,7 +84,7 @@ internal static void packMini(string path, string ident, string fileName, string
|
||||
if (delete)
|
||||
Directory.Delete(path, true);
|
||||
}
|
||||
internal static byte[] packMini(byte[][] fileData, string ident)
|
||||
public static byte[] packMini(byte[][] fileData, string ident)
|
||||
{
|
||||
// Create new Binary with the relevant header bytes
|
||||
byte[] data = new byte[4];
|
||||
@@ -129,7 +129,7 @@ internal static byte[] packMini(byte[][] fileData, string ident)
|
||||
}
|
||||
}
|
||||
}
|
||||
internal static bool packMini2(string path, string ident, string fileName)
|
||||
public static bool packMini2(string path, string ident, string fileName)
|
||||
{
|
||||
if (!Directory.Exists(path)) return false;
|
||||
try
|
||||
@@ -143,7 +143,7 @@ internal static bool packMini2(string path, string ident, string fileName)
|
||||
}
|
||||
catch { return false; }
|
||||
}
|
||||
internal static void unpackMini(string path, string ident, string outFolder = null, bool delete = true)
|
||||
public static void unpackMini(string path, string ident, string outFolder = null, bool delete = true)
|
||||
{
|
||||
if (outFolder == null) outFolder = Path.GetDirectoryName(path);
|
||||
if (!Directory.Exists(outFolder)) Directory.CreateDirectory(outFolder);
|
||||
@@ -207,7 +207,7 @@ public static byte[][] unpackMini(byte[] fileData, string identifier)
|
||||
}
|
||||
return returnData;
|
||||
}
|
||||
internal static string getIsMini(string path)
|
||||
public static string getIsMini(string path)
|
||||
{
|
||||
byte[] data = File.ReadAllBytes(path);
|
||||
var fi = new FileInfo(path);
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using CTR;
|
||||
using pk3DS.Core.CTR;
|
||||
|
||||
namespace pk3DS
|
||||
namespace pk3DS.Core
|
||||
{
|
||||
public class GARCFile
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace pk3DS
|
||||
namespace pk3DS.Core
|
||||
{
|
||||
public class GARCReference
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace pk3DS
|
||||
namespace pk3DS.Core
|
||||
{
|
||||
public static class GameBackup
|
||||
{
|
||||
@@ -1,11 +1,18 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using CTR;
|
||||
using pk3DS.Core.CTR;
|
||||
using pk3DS.Core.Structures.PersonalInfo;
|
||||
using pk3DS.Core.Structures;
|
||||
using pk3DS.Core.Structures.Gen6;
|
||||
|
||||
namespace pk3DS
|
||||
namespace pk3DS.Core
|
||||
{
|
||||
public class GameConfig
|
||||
{
|
||||
// This static instance variable is a shim to continue using a static instance without breaking direct references to Main
|
||||
// To-Do: Remove Instance in favor of something else
|
||||
public static GameConfig Instance { get; set; }
|
||||
|
||||
private const int FILECOUNT_XY = 271;
|
||||
private const int FILECOUNT_ORASDEMO = 301;
|
||||
private const int FILECOUNT_ORAS = 299;
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace pk3DS
|
||||
namespace pk3DS.Core
|
||||
{
|
||||
public abstract class LCRNG32
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace pk3DS
|
||||
namespace pk3DS.Core
|
||||
{
|
||||
public enum GameVersion
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace pk3DS
|
||||
namespace pk3DS.Core
|
||||
{
|
||||
public enum TextName
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace pk3DS
|
||||
namespace pk3DS.Core
|
||||
{
|
||||
public class TextVariableCode
|
||||
{
|
||||
36
pk3DS.Core/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("pk3DS.Core")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("pk3DS.Core")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("bc4d176c-9471-432a-82eb-abf9af1d6dfd")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
16206
pk3DS.Core/Properties/Resources.Designer.cs
generated
Normal file
4960
pk3DS.Core/Properties/Resources.resx
Normal file
|
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 160 B |
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 151 B |
|
Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 407 B |
|
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 308 B |
|
Before Width: | Height: | Size: 327 B After Width: | Height: | Size: 327 B |
|
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 434 B |
|
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 503 B |
|
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 474 B |
|
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 402 B |
|
Before Width: | Height: | Size: 490 B After Width: | Height: | Size: 490 B |
|
Before Width: | Height: | Size: 448 B After Width: | Height: | Size: 448 B |
|
Before Width: | Height: | Size: 424 B After Width: | Height: | Size: 424 B |
|
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 406 B |
|
Before Width: | Height: | Size: 430 B After Width: | Height: | Size: 430 B |
|
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 537 B |
|
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 278 B |
|
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 606 B |
|
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
|
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 510 B |
|
Before Width: | Height: | Size: 412 B After Width: | Height: | Size: 412 B |
|
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 409 B |
|
Before Width: | Height: | Size: 530 B After Width: | Height: | Size: 530 B |
|
Before Width: | Height: | Size: 456 B After Width: | Height: | Size: 456 B |
|
Before Width: | Height: | Size: 369 B After Width: | Height: | Size: 369 B |
|
Before Width: | Height: | Size: 444 B After Width: | Height: | Size: 444 B |
|
Before Width: | Height: | Size: 458 B After Width: | Height: | Size: 458 B |
|
Before Width: | Height: | Size: 470 B After Width: | Height: | Size: 470 B |
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
|
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
|
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 417 B |
|
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 426 B |
|
Before Width: | Height: | Size: 425 B After Width: | Height: | Size: 425 B |
|
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 436 B |
|
Before Width: | Height: | Size: 476 B After Width: | Height: | Size: 476 B |
|
Before Width: | Height: | Size: 664 B After Width: | Height: | Size: 664 B |
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
|
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 462 B |
|
Before Width: | Height: | Size: 500 B After Width: | Height: | Size: 500 B |
|
Before Width: | Height: | Size: 348 B After Width: | Height: | Size: 348 B |
|
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 673 B |
|
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 621 B |
|
Before Width: | Height: | Size: 471 B After Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 296 B |
|
Before Width: | Height: | Size: 394 B After Width: | Height: | Size: 394 B |
|
Before Width: | Height: | Size: 496 B After Width: | Height: | Size: 496 B |
|
Before Width: | Height: | Size: 441 B After Width: | Height: | Size: 441 B |
|
Before Width: | Height: | Size: 453 B After Width: | Height: | Size: 453 B |
|
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 370 B After Width: | Height: | Size: 370 B |
|
Before Width: | Height: | Size: 423 B After Width: | Height: | Size: 423 B |
|
Before Width: | Height: | Size: 321 B After Width: | Height: | Size: 321 B |
|
Before Width: | Height: | Size: 326 B After Width: | Height: | Size: 326 B |
|
Before Width: | Height: | Size: 394 B After Width: | Height: | Size: 394 B |
|
Before Width: | Height: | Size: 563 B After Width: | Height: | Size: 563 B |
|
Before Width: | Height: | Size: 477 B After Width: | Height: | Size: 477 B |
|
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 499 B |
|
Before Width: | Height: | Size: 441 B After Width: | Height: | Size: 441 B |
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 466 B |
|
Before Width: | Height: | Size: 477 B After Width: | Height: | Size: 477 B |
|
Before Width: | Height: | Size: 376 B After Width: | Height: | Size: 376 B |
|
Before Width: | Height: | Size: 451 B After Width: | Height: | Size: 451 B |
|
Before Width: | Height: | Size: 500 B After Width: | Height: | Size: 500 B |
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 552 B |
|
Before Width: | Height: | Size: 470 B After Width: | Height: | Size: 470 B |
|
Before Width: | Height: | Size: 518 B After Width: | Height: | Size: 518 B |