mirror of
https://github.com/suloku/G6_pl_tool.git
synced 2026-03-21 17:34:08 -05:00
version 0.1 commit
This commit is contained in:
parent
a8377ff475
commit
25ff27bc92
17
.gitattributes
vendored
Normal file
17
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
226
.gitignore
vendored
Normal file
226
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,226 @@
|
|||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
build/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
|
||||
# Windows Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Windows Store app package directory
|
||||
AppPackages/
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
[Ss]tyle[Cc]op.*
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
orleans.codegen.cs
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
18
XYORAS Pokemon Link Tool.sln
Normal file
18
XYORAS Pokemon Link Tool.sln
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
# SharpDevelop 5.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XYORAS Pokemon Link Tool", "XYORAS Pokemon Link Tool\XYORAS Pokemon Link Tool.csproj", "{8E067B09-FD68-4FD1-AC34-D0A1F77BFEBD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8E067B09-FD68-4FD1-AC34-D0A1F77BFEBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8E067B09-FD68-4FD1-AC34-D0A1F77BFEBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8E067B09-FD68-4FD1-AC34-D0A1F77BFEBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8E067B09-FD68-4FD1-AC34-D0A1F77BFEBD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
117
XYORAS Pokemon Link Tool/MainForm.Designer.cs
generated
Normal file
117
XYORAS Pokemon Link Tool/MainForm.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* Created by SharpDevelop.
|
||||
* User: suloku
|
||||
* Date: 18/10/2015
|
||||
* Time: 9:17
|
||||
*
|
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
*/
|
||||
namespace XYORAS_Pokemon_Link_Tool
|
||||
{
|
||||
partial class MainForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Designer variable used to keep track of non-visual components.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
private System.Windows.Forms.Button loadsave;
|
||||
private System.Windows.Forms.TextBox savegamename;
|
||||
private System.Windows.Forms.Button dump_but;
|
||||
private System.Windows.Forms.Button inject_but;
|
||||
private System.Windows.Forms.TextBox currgame;
|
||||
|
||||
/// <summary>
|
||||
/// Disposes resources used by the form.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing) {
|
||||
if (components != null) {
|
||||
components.Dispose();
|
||||
}
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is required for Windows Forms designer support.
|
||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
||||
/// not be able to load this method if it was changed manually.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.loadsave = new System.Windows.Forms.Button();
|
||||
this.savegamename = new System.Windows.Forms.TextBox();
|
||||
this.dump_but = new System.Windows.Forms.Button();
|
||||
this.inject_but = new System.Windows.Forms.Button();
|
||||
this.currgame = new System.Windows.Forms.TextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// loadsave
|
||||
//
|
||||
this.loadsave.Location = new System.Drawing.Point(12, 12);
|
||||
this.loadsave.Name = "loadsave";
|
||||
this.loadsave.Size = new System.Drawing.Size(162, 23);
|
||||
this.loadsave.TabIndex = 0;
|
||||
this.loadsave.Text = "Load XY/ORAS Savegame";
|
||||
this.loadsave.UseVisualStyleBackColor = true;
|
||||
this.loadsave.Click += new System.EventHandler(this.Button1Click);
|
||||
//
|
||||
// savegamename
|
||||
//
|
||||
this.savegamename.Location = new System.Drawing.Point(12, 41);
|
||||
this.savegamename.Name = "savegamename";
|
||||
this.savegamename.Size = new System.Drawing.Size(330, 20);
|
||||
this.savegamename.TabIndex = 1;
|
||||
this.savegamename.TextChanged += new System.EventHandler(this.SavegamenameTextChanged);
|
||||
//
|
||||
// dump_but
|
||||
//
|
||||
this.dump_but.Enabled = false;
|
||||
this.dump_but.Location = new System.Drawing.Point(12, 67);
|
||||
this.dump_but.Name = "dump_but";
|
||||
this.dump_but.Size = new System.Drawing.Size(162, 23);
|
||||
this.dump_but.TabIndex = 2;
|
||||
this.dump_but.Text = "Dump Pokémon Link Data";
|
||||
this.dump_but.UseVisualStyleBackColor = true;
|
||||
this.dump_but.Click += new System.EventHandler(this.Dump_butClick);
|
||||
//
|
||||
// inject_but
|
||||
//
|
||||
this.inject_but.Enabled = false;
|
||||
this.inject_but.Location = new System.Drawing.Point(180, 67);
|
||||
this.inject_but.Name = "inject_but";
|
||||
this.inject_but.Size = new System.Drawing.Size(162, 23);
|
||||
this.inject_but.TabIndex = 4;
|
||||
this.inject_but.Text = "Inject Pokémon Link Data";
|
||||
this.inject_but.UseVisualStyleBackColor = true;
|
||||
this.inject_but.Click += new System.EventHandler(this.Inject_butClick);
|
||||
//
|
||||
// currgame
|
||||
//
|
||||
this.currgame.Location = new System.Drawing.Point(180, 14);
|
||||
this.currgame.Name = "currgame";
|
||||
this.currgame.ReadOnly = true;
|
||||
this.currgame.Size = new System.Drawing.Size(73, 20);
|
||||
this.currgame.TabIndex = 5;
|
||||
this.currgame.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(354, 95);
|
||||
this.Controls.Add(this.currgame);
|
||||
this.Controls.Add(this.savegamename);
|
||||
this.Controls.Add(this.dump_but);
|
||||
this.Controls.Add(this.loadsave);
|
||||
this.Controls.Add(this.inject_but);
|
||||
this.Name = "MainForm";
|
||||
this.Text = "XYORAS Pokemon Link Tool 0.1 by suloku";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
244
XYORAS Pokemon Link Tool/MainForm.cs
Normal file
244
XYORAS Pokemon Link Tool/MainForm.cs
Normal file
|
|
@ -0,0 +1,244 @@
|
|||
/*
|
||||
* Created by SharpDevelop.
|
||||
* User: suloku
|
||||
* Date: 18/10/2015
|
||||
* Time: 9:17
|
||||
*
|
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
namespace XYORAS_Pokemon_Link_Tool
|
||||
{
|
||||
/// <summary>
|
||||
/// Description of MainForm.
|
||||
/// </summary>
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
public MainForm()
|
||||
{
|
||||
//
|
||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
//
|
||||
// TODO: Add constructor code after the InitializeComponent() call.
|
||||
//
|
||||
}
|
||||
int game = 0; //1 XY, 2 ORAS
|
||||
string linkfile;
|
||||
byte[] savebuffer_XY = new byte[0x65600];
|
||||
byte[] savebuffer_ORAS = new byte[0x76000];
|
||||
byte[] linkbuffer = new byte[2631];
|
||||
|
||||
//adapted from Gocario's PHBank (www.github.com/gocario/phbank)
|
||||
byte[] ccitt16(byte[] data)
|
||||
// --------------------------------------------------
|
||||
{
|
||||
int len = data.Length;
|
||||
UInt16 crc = 0xFFFF;
|
||||
|
||||
for (UInt32 i = 0; i < len; i++)
|
||||
{
|
||||
crc ^= ((UInt16)((data[i] << 8)&0x0000FFFF));
|
||||
|
||||
for (UInt32 j = 0; j < 0x8; j++)
|
||||
{
|
||||
if ((crc & 0x8000) > 0)
|
||||
crc = (UInt16)(((UInt16)((crc << 1)&0x0000FFFF ) ^ 0x1021) &0x0000FFFF);
|
||||
else
|
||||
crc <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return BitConverter.GetBytes(crc);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads data into a complete array, throwing an EndOfStreamException
|
||||
/// if the stream runs out of data first, or if an IOException
|
||||
/// naturally occurs.
|
||||
/// </summary>
|
||||
/// <param name="stream">The stream to read data from</param>
|
||||
/// <param name="data">The array to read bytes into. The array
|
||||
/// will be completely filled from the stream, so an appropriate
|
||||
/// size must be given.</param>
|
||||
public static void ReadWholeArray (Stream stream, byte[] data)
|
||||
{
|
||||
int offset=0;
|
||||
int remaining = data.Length;
|
||||
while (remaining > 0)
|
||||
{
|
||||
int read = stream.Read(data, offset, remaining);
|
||||
if (read <= 0)
|
||||
throw new EndOfStreamException
|
||||
(String.Format("End of stream reached with {0} bytes left to read", remaining));
|
||||
remaining -= read;
|
||||
offset += read;
|
||||
}
|
||||
}
|
||||
private void PDR_read_data()
|
||||
{
|
||||
System.IO.FileStream saveFile;
|
||||
saveFile = new FileStream(savegamename.Text, FileMode.Open);
|
||||
if (saveFile.Length != 0x65600 && saveFile.Length != 0x76000 ){
|
||||
savegamename.Text = "";
|
||||
MessageBox.Show("Invalid file length", "Error");
|
||||
return;
|
||||
}
|
||||
if (saveFile.Length == 0x65600){
|
||||
game = 1;
|
||||
currgame.Text = "X/Y";
|
||||
ReadWholeArray(saveFile, savebuffer_XY);
|
||||
saveFile.Close();
|
||||
}else if (saveFile.Length == 0x76000){
|
||||
game = 2;
|
||||
currgame.Text = "OR/AS";
|
||||
ReadWholeArray(saveFile, savebuffer_ORAS);
|
||||
saveFile.Close();
|
||||
}
|
||||
}
|
||||
private void PDR_get_data()
|
||||
{
|
||||
OpenFileDialog openFD = new OpenFileDialog();
|
||||
//openFD.InitialDirectory = "c:\\";
|
||||
openFD.Filter = "VI gen save data|main|All Files (*.*)|*.*";
|
||||
if (openFD.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
#region filename
|
||||
savegamename.Text = openFD.FileName;
|
||||
#endregion
|
||||
PDR_read_data();
|
||||
}
|
||||
|
||||
}
|
||||
private void PDR_save_data()
|
||||
{ if (savegamename.Text.Length < 1) return;
|
||||
SaveFileDialog saveFD = new SaveFileDialog();
|
||||
//saveFD.InitialDirectory = "c:\\";
|
||||
saveFD.Filter = "VI gen save data|main|All Files (*.*)|*.*";
|
||||
if (saveFD.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
System.IO.FileStream saveFile;
|
||||
saveFile = new FileStream(saveFD.FileName, FileMode.Create);
|
||||
//Write file
|
||||
if (game == 1){
|
||||
saveFile.Write(savebuffer_XY, 0, savebuffer_XY.Length);
|
||||
}else if (game == 2){
|
||||
saveFile.Write(savebuffer_ORAS, 0, savebuffer_ORAS.Length);
|
||||
}
|
||||
saveFile.Close();
|
||||
MessageBox.Show("File Saved.", "Save file");
|
||||
}
|
||||
}
|
||||
private void PDR_dump_forest_data()
|
||||
{ if (savegamename.Text.Length < 1) return;
|
||||
SaveFileDialog saveFD = new SaveFileDialog();
|
||||
//saveFD.InitialDirectory = "c:\\";
|
||||
saveFD.Filter = "Pokémon Link Data|*.bin|All Files (*.*)|*.*";
|
||||
if (saveFD.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
System.IO.FileStream saveFile;
|
||||
saveFile = new FileStream(saveFD.FileName, FileMode.Create);
|
||||
//Write file
|
||||
if (game == 1){
|
||||
saveFile.Write(savebuffer_XY, 0x1FFFF, 0xA47);
|
||||
}else if (game == 2) {
|
||||
saveFile.Write(savebuffer_ORAS, 0x20FFF, 0xA47);
|
||||
}
|
||||
|
||||
saveFile.Close();
|
||||
MessageBox.Show("Pokémon Link data dumped to:\r"+saveFD.FileName+".", "Dump Entralink Forest Data");
|
||||
}
|
||||
}
|
||||
private void PDR_read_forest_data()
|
||||
{
|
||||
System.IO.FileStream saveFile;
|
||||
saveFile = new FileStream(linkfile, FileMode.Open);
|
||||
if (saveFile.Length != 0xA47){
|
||||
//linkfile = "";
|
||||
MessageBox.Show("Invalid file length", "Error");
|
||||
return;
|
||||
}
|
||||
ReadWholeArray(saveFile, linkbuffer);
|
||||
saveFile.Close();
|
||||
PDR_injectNsave();
|
||||
}
|
||||
private void PDR_get_forest_data()
|
||||
{
|
||||
OpenFileDialog openFD = new OpenFileDialog();
|
||||
//openFD.InitialDirectory = "c:\\";
|
||||
openFD.Filter = "Pokémon Link Data|*.bin|All Files (*.*)|*.*";
|
||||
if (openFD.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
#region filename
|
||||
linkfile = openFD.FileName;
|
||||
#endregion
|
||||
PDR_read_forest_data();
|
||||
}
|
||||
|
||||
}
|
||||
private void PDR_injectNsave()
|
||||
{
|
||||
|
||||
if (game == 1){
|
||||
//Put link data in save
|
||||
Array.Copy(linkbuffer, 0, savebuffer_XY, 0x1FFFF, 0xA47);
|
||||
//Get full block for checksum calculation
|
||||
byte[] giftblockbuffer = new byte[0xC48];
|
||||
Array.Copy(savebuffer_XY, 0x1FE00, giftblockbuffer, 0, 0xC48);
|
||||
byte[] tablecrcsum = new byte[2];
|
||||
tablecrcsum = ccitt16(giftblockbuffer);
|
||||
//Put new checksum in savefile
|
||||
Array.Copy(tablecrcsum, 0, savebuffer_XY, 0x6559A, 2);
|
||||
}
|
||||
else if (game == 2){
|
||||
//Put link data in save
|
||||
Array.Copy(linkbuffer, 0, savebuffer_ORAS, 0x20FFF, 0xA47);
|
||||
//Get full block for checksum calculation
|
||||
byte[] giftblockbuffer = new byte[0xC48];
|
||||
Array.Copy(savebuffer_ORAS, 0x20E00, giftblockbuffer, 0, 0xC48);
|
||||
byte[] tablecrcsum = new byte[2];
|
||||
tablecrcsum = ccitt16(giftblockbuffer);
|
||||
//Put new checksum in savefile
|
||||
Array.Copy(tablecrcsum, 0, savebuffer_ORAS, 0x75F9A, 2);
|
||||
}
|
||||
//Write Data
|
||||
PDR_save_data();
|
||||
}
|
||||
void Button1Click(object sender, EventArgs e)
|
||||
{
|
||||
PDR_get_data();
|
||||
}
|
||||
void Dump_butClick(object sender, EventArgs e)
|
||||
{
|
||||
if (savegamename.Text.Length < 1) return;
|
||||
PDR_dump_forest_data();
|
||||
}
|
||||
void SavegamenameTextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (savegamename.Text.Length > 0){
|
||||
dump_but.Enabled = true;
|
||||
inject_but.Enabled = true;
|
||||
}else{
|
||||
dump_but.Enabled = false;
|
||||
inject_but.Enabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
void Inject_butClick(object sender, EventArgs e)
|
||||
{
|
||||
PDR_get_forest_data();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
120
XYORAS Pokemon Link Tool/MainForm.resx
Normal file
120
XYORAS Pokemon Link Tool/MainForm.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
31
XYORAS Pokemon Link Tool/Program.cs
Normal file
31
XYORAS Pokemon Link Tool/Program.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Created by SharpDevelop.
|
||||
* User: suloku
|
||||
* Date: 18/10/2015
|
||||
* Time: 9:17
|
||||
*
|
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
||||
*/
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace XYORAS_Pokemon_Link_Tool
|
||||
{
|
||||
/// <summary>
|
||||
/// Class with program entry point.
|
||||
/// </summary>
|
||||
internal sealed class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Program entry point.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainForm());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
31
XYORAS Pokemon Link Tool/Properties/AssemblyInfo.cs
Normal file
31
XYORAS Pokemon Link Tool/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#region Using directives
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
#endregion
|
||||
|
||||
// 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("XYORAS Pokemon Link Tool")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("XYORAS Pokemon Link Tool")]
|
||||
[assembly: AssemblyCopyright("Copyright 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all the values or you can use the default the Revision and
|
||||
// Build Numbers by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
69
XYORAS Pokemon Link Tool/XYORAS Pokemon Link Tool.csproj
Normal file
69
XYORAS Pokemon Link Tool/XYORAS Pokemon Link Tool.csproj
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{8E067B09-FD68-4FD1-AC34-D0A1F77BFEBD}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>XYORAS_Pokemon_Link_Tool</RootNamespace>
|
||||
<AssemblyName>XYORAS Pokemon Link Tool</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>Full</DebugType>
|
||||
<Optimize>False</Optimize>
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<DebugType>None</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainForm.cs" />
|
||||
<Compile Include="MainForm.Designer.cs">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<DependentUpon>MainForm.Designer.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
6
XYORAS Pokemon Link Tool/app.config
Normal file
6
XYORAS Pokemon Link Tool/app.config
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
|
||||
</startup>
|
||||
</configuration>
|
||||
Loading…
Reference in New Issue
Block a user