Misses some maps for MDV/TID couples,but everything else seems to work fine.

This commit is contained in:
suloku 2016-10-27 15:52:40 +02:00
commit 04d2880aad
11 changed files with 1843 additions and 0 deletions

17
.gitattributes vendored Normal file
View 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
View 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/

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# XYORAS Safari Mirage Tool
Generation VI simple tool for Friend safari unlocking on XY and mirage spot editing in ORAS.

View 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 Safari Mirage Tool", "XYORAS Safari Mirage Tool\XYORAS Safari Mirage 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

View File

@ -0,0 +1,823 @@
/*
* 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_Safari_Mirage_Tool
{
partial class MainForm
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.Windows.Forms.Button loadsave;
private System.Windows.Forms.TextBox savegamename;
private System.Windows.Forms.TextBox currgame;
private System.Windows.Forms.Label label35;
private System.Windows.Forms.NumericUpDown ev_5;
private System.Windows.Forms.NumericUpDown ev_4;
private System.Windows.Forms.NumericUpDown ev_3;
private System.Windows.Forms.NumericUpDown ev_2;
private System.Windows.Forms.NumericUpDown ev_1;
private System.Windows.Forms.NumericUpDown ev_0;
private System.Windows.Forms.GroupBox groupBox7;
private System.Windows.Forms.Button unlock_safari;
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.GroupBox orasbox;
private System.Windows.Forms.GroupBox mdv_box;
private System.Windows.Forms.Label u32;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label u16;
private System.Windows.Forms.NumericUpDown tid_hi;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.NumericUpDown tid_lo;
private System.Windows.Forms.NumericUpDown mdv3;
private System.Windows.Forms.NumericUpDown mdv0;
private System.Windows.Forms.NumericUpDown mdv2;
private System.Windows.Forms.NumericUpDown mdv1;
private System.Windows.Forms.Button mdv_advanced;
private System.Windows.Forms.Button infobut;
private System.Windows.Forms.Button oras_save;
private System.Windows.Forms.Label spot8;
private System.Windows.Forms.Label spot7;
private System.Windows.Forms.Label spot6;
private System.Windows.Forms.Label spot5;
private System.Windows.Forms.Label spot4;
private System.Windows.Forms.Label spot3;
private System.Windows.Forms.Label spot2;
private System.Windows.Forms.Label spot1;
private System.Windows.Forms.Label spot0;
private System.Windows.Forms.Label spot9;
private System.Windows.Forms.Panel panel_info;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button close_info;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton but8;
private System.Windows.Forms.RadioButton but7;
private System.Windows.Forms.RadioButton but6;
private System.Windows.Forms.RadioButton but5;
private System.Windows.Forms.RadioButton but4;
private System.Windows.Forms.RadioButton but3;
private System.Windows.Forms.RadioButton but2;
private System.Windows.Forms.RadioButton but1;
private System.Windows.Forms.RadioButton but0;
private System.Windows.Forms.RadioButton but9;
/// <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
void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.loadsave = new System.Windows.Forms.Button();
this.savegamename = new System.Windows.Forms.TextBox();
this.currgame = new System.Windows.Forms.TextBox();
this.label35 = new System.Windows.Forms.Label();
this.ev_5 = new System.Windows.Forms.NumericUpDown();
this.ev_4 = new System.Windows.Forms.NumericUpDown();
this.ev_3 = new System.Windows.Forms.NumericUpDown();
this.ev_2 = new System.Windows.Forms.NumericUpDown();
this.ev_1 = new System.Windows.Forms.NumericUpDown();
this.ev_0 = new System.Windows.Forms.NumericUpDown();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.unlock_safari = new System.Windows.Forms.Button();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.orasbox = new System.Windows.Forms.GroupBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.spot9 = new System.Windows.Forms.Label();
this.but9 = new System.Windows.Forms.RadioButton();
this.oras_save = new System.Windows.Forms.Button();
this.mdv_advanced = new System.Windows.Forms.Button();
this.spot8 = new System.Windows.Forms.Label();
this.but8 = new System.Windows.Forms.RadioButton();
this.spot7 = new System.Windows.Forms.Label();
this.but7 = new System.Windows.Forms.RadioButton();
this.spot6 = new System.Windows.Forms.Label();
this.but6 = new System.Windows.Forms.RadioButton();
this.but5 = new System.Windows.Forms.RadioButton();
this.spot5 = new System.Windows.Forms.Label();
this.but4 = new System.Windows.Forms.RadioButton();
this.spot4 = new System.Windows.Forms.Label();
this.but3 = new System.Windows.Forms.RadioButton();
this.spot3 = new System.Windows.Forms.Label();
this.but2 = new System.Windows.Forms.RadioButton();
this.spot2 = new System.Windows.Forms.Label();
this.but1 = new System.Windows.Forms.RadioButton();
this.spot1 = new System.Windows.Forms.Label();
this.but0 = new System.Windows.Forms.RadioButton();
this.spot0 = new System.Windows.Forms.Label();
this.mdv_box = new System.Windows.Forms.GroupBox();
this.infobut = new System.Windows.Forms.Button();
this.u32 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.u16 = new System.Windows.Forms.Label();
this.tid_hi = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.tid_lo = new System.Windows.Forms.NumericUpDown();
this.mdv3 = new System.Windows.Forms.NumericUpDown();
this.mdv0 = new System.Windows.Forms.NumericUpDown();
this.mdv2 = new System.Windows.Forms.NumericUpDown();
this.mdv1 = new System.Windows.Forms.NumericUpDown();
this.panel_info = new System.Windows.Forms.Panel();
this.close_info = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.ev_5)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ev_4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ev_3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ev_2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ev_1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ev_0)).BeginInit();
this.groupBox7.SuspendLayout();
this.orasbox.SuspendLayout();
this.groupBox1.SuspendLayout();
this.mdv_box.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tid_hi)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tid_lo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mdv3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mdv0)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mdv2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.mdv1)).BeginInit();
this.panel_info.SuspendLayout();
this.SuspendLayout();
//
// loadsave
//
this.loadsave.Location = new System.Drawing.Point(20, 26);
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.LoadsaveClick);
//
// savegamename
//
this.savegamename.Location = new System.Drawing.Point(20, 55);
this.savegamename.Name = "savegamename";
this.savegamename.Size = new System.Drawing.Size(330, 20);
this.savegamename.TabIndex = 1;
//
// currgame
//
this.currgame.Location = new System.Drawing.Point(188, 28);
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;
//
// label35
//
this.label35.Location = new System.Drawing.Point(1135, 218);
this.label35.Name = "label35";
this.label35.Size = new System.Drawing.Size(37, 23);
this.label35.TabIndex = 102;
this.label35.Text = "EVs";
this.label35.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// ev_5
//
this.ev_5.Location = new System.Drawing.Point(1135, 351);
this.ev_5.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.ev_5.Name = "ev_5";
this.ev_5.Size = new System.Drawing.Size(37, 20);
this.ev_5.TabIndex = 101;
//
// ev_4
//
this.ev_4.Location = new System.Drawing.Point(1135, 329);
this.ev_4.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.ev_4.Name = "ev_4";
this.ev_4.Size = new System.Drawing.Size(37, 20);
this.ev_4.TabIndex = 100;
//
// ev_3
//
this.ev_3.Location = new System.Drawing.Point(1135, 307);
this.ev_3.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.ev_3.Name = "ev_3";
this.ev_3.Size = new System.Drawing.Size(37, 20);
this.ev_3.TabIndex = 99;
//
// ev_2
//
this.ev_2.Location = new System.Drawing.Point(1135, 285);
this.ev_2.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.ev_2.Name = "ev_2";
this.ev_2.Size = new System.Drawing.Size(37, 20);
this.ev_2.TabIndex = 98;
//
// ev_1
//
this.ev_1.Location = new System.Drawing.Point(1135, 263);
this.ev_1.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.ev_1.Name = "ev_1";
this.ev_1.Size = new System.Drawing.Size(37, 20);
this.ev_1.TabIndex = 97;
//
// ev_0
//
this.ev_0.Location = new System.Drawing.Point(1135, 241);
this.ev_0.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.ev_0.Name = "ev_0";
this.ev_0.Size = new System.Drawing.Size(37, 20);
this.ev_0.TabIndex = 96;
//
// groupBox7
//
this.groupBox7.Controls.Add(this.currgame);
this.groupBox7.Controls.Add(this.savegamename);
this.groupBox7.Controls.Add(this.loadsave);
this.groupBox7.Location = new System.Drawing.Point(18, 12);
this.groupBox7.Name = "groupBox7";
this.groupBox7.Size = new System.Drawing.Size(365, 89);
this.groupBox7.TabIndex = 143;
this.groupBox7.TabStop = false;
this.groupBox7.Text = "Savegame";
//
// unlock_safari
//
this.unlock_safari.Enabled = false;
this.unlock_safari.Location = new System.Drawing.Point(403, 40);
this.unlock_safari.Name = "unlock_safari";
this.unlock_safari.Size = new System.Drawing.Size(103, 36);
this.unlock_safari.TabIndex = 144;
this.unlock_safari.Text = "Unlock all Friend Safari (XY only)";
this.unlock_safari.UseVisualStyleBackColor = true;
this.unlock_safari.Click += new System.EventHandler(this.Unlock_safariClick);
//
// comboBox2
//
this.comboBox2.Font = new System.Drawing.Font("Lucida Sans Typewriter", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.comboBox2.FormattingEnabled = true;
this.comboBox2.Items.AddRange(new object[] {
"00: NONE",
"01: 467 - Crescent Isle - Cresselia",
"02: 184 - East of Mossdeep - Tangela, Sunkern, Glameow, Minccino",
"03: 185 - North of Route 124 - Tangela, Sunkern, Purugly, Vulpix",
"04: 186 - West of Route 114 - Tangela, Sunkern, Purugly, Petilil",
"05: 187 - North of Lilycove - Tangela, Sunkern, Purugly, Cherrim",
"06: 188 - South of Route 132 - Sunkern, Petilil, Audino",
"07: 189 - West of Route 105 - Forretress, Happiny",
"08: 190 - South of Route 109 - Audino, Sunkern",
"09: 191 - North of Route 111 - Kricketune, Larvesta",
"10: 192 - West of Rustboro - Tynamo, Klink, Boldore, Graveler",
"11: 193 - North of Fortree - Klink, Tynamo, Excadrill, Onix",
"12: 194 - South of Pacifidlog - Tynamo, Cofagrigus, Slowpoke",
"13: 195 - South of Route 107 - Unown",
"14: 196 - North of Route 124 - Klink, Cofagrigus, Graveler, Boldore",
"15: 197 - North of Route 132 - Ditto, Excadrill, Tynamo",
"16: 198 - Southeast of Route 129 - Tynamo, Onix, Graveler, Boldore",
"17: 199 - North of Fallarbor - Slowpoke, Tynamo",
"18: 200 - West of Route 104 - Venomoth, Xatu, Zebstrika, Darmanitan",
"19: 201 - South of Route 134 - Venomoth, Xatu, Zebstrika, Maractus",
"20: 202 - North of Route 124 - Venomoth, Xatu, Zebstrika, Persian",
"21: 203 - West of Dewford Town - Venomoth, Xatu, Zebstrika, Tangela",
"22: 204 - South of Pacifidlog - Audino, Xatu",
"23: 205 - South of Route 132 - Munna, Ditto",
"24: 206 - North of Route 113 - Darmanitan, Larvesta",
"25: 207 - East of Shoal Cave - Purugly, Porygon",
"26: 208 - West of Route 104 - Forretress, Donphan, Kricketune, Stantler",
"27: 460 - North of Lilycove - Forretress, Donphan, Kricketune, Rufflet",
"28: 461 - Northeast of Route 125 - Forretress, Donphan, Kricketune, Vullaby",
"29: 462 - West of Route 131 - Donphan, Kricketune, Girafarig",
"30: 463 - North of Mossdeep - Magby, Darmanitan",
"31: 464 - South of Route 129 - Zebstrika, Elekid",
"32: 465 - Southeast of Route 129 - Porygon, Xatu, Munna",
"33: 466 - East of Mossdeep - Audino, Happiny, Tangela"});
this.comboBox2.Location = new System.Drawing.Point(102, 72);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(566, 20);
this.comboBox2.TabIndex = 147;
this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.ComboBox2SelectedIndexChanged);
//
// label2
//
this.label2.Location = new System.Drawing.Point(12, 74);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(88, 19);
this.label2.TabIndex = 148;
this.label2.Text = "Mirage Spot:";
this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// orasbox
//
this.orasbox.Controls.Add(this.groupBox1);
this.orasbox.Controls.Add(this.mdv_box);
this.orasbox.Enabled = false;
this.orasbox.Location = new System.Drawing.Point(18, 116);
this.orasbox.Name = "orasbox";
this.orasbox.Size = new System.Drawing.Size(710, 230);
this.orasbox.TabIndex = 149;
this.orasbox.TabStop = false;
this.orasbox.Text = "OR/AS Mirage Spot";
this.orasbox.Enter += new System.EventHandler(this.GroupBox1Enter);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.spot9);
this.groupBox1.Controls.Add(this.but9);
this.groupBox1.Controls.Add(this.oras_save);
this.groupBox1.Controls.Add(this.mdv_advanced);
this.groupBox1.Controls.Add(this.spot8);
this.groupBox1.Controls.Add(this.but8);
this.groupBox1.Controls.Add(this.spot7);
this.groupBox1.Controls.Add(this.but7);
this.groupBox1.Controls.Add(this.spot6);
this.groupBox1.Controls.Add(this.but6);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.but5);
this.groupBox1.Controls.Add(this.spot5);
this.groupBox1.Controls.Add(this.but4);
this.groupBox1.Controls.Add(this.spot4);
this.groupBox1.Controls.Add(this.but3);
this.groupBox1.Controls.Add(this.spot3);
this.groupBox1.Controls.Add(this.but2);
this.groupBox1.Controls.Add(this.spot2);
this.groupBox1.Controls.Add(this.but1);
this.groupBox1.Controls.Add(this.spot1);
this.groupBox1.Controls.Add(this.but0);
this.groupBox1.Controls.Add(this.spot0);
this.groupBox1.Controls.Add(this.comboBox2);
this.groupBox1.Location = new System.Drawing.Point(8, 15);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(689, 100);
this.groupBox1.TabIndex = 195;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "PSS Mirage Spot";
this.groupBox1.Enter += new System.EventHandler(this.GroupBox1Enter);
//
// spot9
//
this.spot9.Location = new System.Drawing.Point(502, 49);
this.spot9.Name = "spot9";
this.spot9.Size = new System.Drawing.Size(22, 18);
this.spot9.TabIndex = 173;
this.spot9.Text = "01";
//
// but9
//
this.but9.Location = new System.Drawing.Point(494, 24);
this.but9.Name = "but9";
this.but9.Size = new System.Drawing.Size(46, 17);
this.but9.TabIndex = 194;
this.but9.Text = "09";
this.but9.UseVisualStyleBackColor = true;
this.but9.CheckedChanged += new System.EventHandler(this.But9CheckedChanged);
//
// oras_save
//
this.oras_save.Location = new System.Drawing.Point(6, 32);
this.oras_save.Name = "oras_save";
this.oras_save.Size = new System.Drawing.Size(75, 23);
this.oras_save.TabIndex = 163;
this.oras_save.Text = "Save";
this.oras_save.UseVisualStyleBackColor = true;
this.oras_save.Click += new System.EventHandler(this.Oras_saveClick);
//
// mdv_advanced
//
this.mdv_advanced.Location = new System.Drawing.Point(550, 24);
this.mdv_advanced.Name = "mdv_advanced";
this.mdv_advanced.Size = new System.Drawing.Size(118, 39);
this.mdv_advanced.TabIndex = 149;
this.mdv_advanced.Text = "Daily Mirage Spot (advanced)";
this.mdv_advanced.UseVisualStyleBackColor = true;
this.mdv_advanced.Click += new System.EventHandler(this.Mdv_advancedClick);
//
// spot8
//
this.spot8.Location = new System.Drawing.Point(452, 49);
this.spot8.Name = "spot8";
this.spot8.Size = new System.Drawing.Size(22, 18);
this.spot8.TabIndex = 172;
this.spot8.Text = "01";
//
// but8
//
this.but8.Location = new System.Drawing.Point(447, 24);
this.but8.Name = "but8";
this.but8.Size = new System.Drawing.Size(46, 17);
this.but8.TabIndex = 189;
this.but8.Text = "08";
this.but8.UseVisualStyleBackColor = true;
this.but8.CheckedChanged += new System.EventHandler(this.But8CheckedChanged);
//
// spot7
//
this.spot7.Location = new System.Drawing.Point(414, 49);
this.spot7.Name = "spot7";
this.spot7.Size = new System.Drawing.Size(22, 18);
this.spot7.TabIndex = 171;
this.spot7.Text = "01";
//
// but7
//
this.but7.Location = new System.Drawing.Point(409, 24);
this.but7.Name = "but7";
this.but7.Size = new System.Drawing.Size(46, 17);
this.but7.TabIndex = 193;
this.but7.Text = "07";
this.but7.UseVisualStyleBackColor = true;
this.but7.CheckedChanged += new System.EventHandler(this.But7CheckedChanged);
//
// spot6
//
this.spot6.Location = new System.Drawing.Point(373, 49);
this.spot6.Name = "spot6";
this.spot6.Size = new System.Drawing.Size(22, 18);
this.spot6.TabIndex = 170;
this.spot6.Text = "01";
//
// but6
//
this.but6.Location = new System.Drawing.Point(367, 24);
this.but6.Name = "but6";
this.but6.Size = new System.Drawing.Size(46, 17);
this.but6.TabIndex = 188;
this.but6.Text = "06";
this.but6.UseVisualStyleBackColor = true;
this.but6.CheckedChanged += new System.EventHandler(this.But6CheckedChanged);
//
// but5
//
this.but5.Location = new System.Drawing.Point(328, 24);
this.but5.Name = "but5";
this.but5.Size = new System.Drawing.Size(46, 17);
this.but5.TabIndex = 192;
this.but5.Text = "05";
this.but5.UseVisualStyleBackColor = true;
this.but5.CheckedChanged += new System.EventHandler(this.But5CheckedChanged);
//
// spot5
//
this.spot5.Location = new System.Drawing.Point(334, 49);
this.spot5.Name = "spot5";
this.spot5.Size = new System.Drawing.Size(22, 18);
this.spot5.TabIndex = 169;
this.spot5.Text = "01";
//
// but4
//
this.but4.Location = new System.Drawing.Point(283, 24);
this.but4.Name = "but4";
this.but4.Size = new System.Drawing.Size(46, 17);
this.but4.TabIndex = 187;
this.but4.Text = "04";
this.but4.UseVisualStyleBackColor = true;
this.but4.CheckedChanged += new System.EventHandler(this.But4CheckedChanged);
//
// spot4
//
this.spot4.Location = new System.Drawing.Point(288, 49);
this.spot4.Name = "spot4";
this.spot4.Size = new System.Drawing.Size(22, 18);
this.spot4.TabIndex = 168;
this.spot4.Text = "01";
//
// but3
//
this.but3.Location = new System.Drawing.Point(236, 24);
this.but3.Name = "but3";
this.but3.Size = new System.Drawing.Size(46, 17);
this.but3.TabIndex = 191;
this.but3.Text = "03";
this.but3.UseVisualStyleBackColor = true;
this.but3.CheckedChanged += new System.EventHandler(this.But3CheckedChanged);
//
// spot3
//
this.spot3.Location = new System.Drawing.Point(240, 49);
this.spot3.Name = "spot3";
this.spot3.Size = new System.Drawing.Size(22, 18);
this.spot3.TabIndex = 167;
this.spot3.Text = "01";
//
// but2
//
this.but2.Location = new System.Drawing.Point(192, 24);
this.but2.Name = "but2";
this.but2.Size = new System.Drawing.Size(46, 17);
this.but2.TabIndex = 186;
this.but2.Text = "02";
this.but2.UseVisualStyleBackColor = true;
this.but2.CheckedChanged += new System.EventHandler(this.But2CheckedChanged);
//
// spot2
//
this.spot2.Location = new System.Drawing.Point(197, 49);
this.spot2.Name = "spot2";
this.spot2.Size = new System.Drawing.Size(22, 18);
this.spot2.TabIndex = 166;
this.spot2.Text = "01";
//
// but1
//
this.but1.Location = new System.Drawing.Point(148, 24);
this.but1.Name = "but1";
this.but1.Size = new System.Drawing.Size(46, 17);
this.but1.TabIndex = 190;
this.but1.Text = "01";
this.but1.UseVisualStyleBackColor = true;
this.but1.CheckedChanged += new System.EventHandler(this.But1CheckedChanged);
//
// spot1
//
this.spot1.Location = new System.Drawing.Point(159, 49);
this.spot1.Name = "spot1";
this.spot1.Size = new System.Drawing.Size(22, 18);
this.spot1.TabIndex = 165;
this.spot1.Text = "01";
//
// but0
//
this.but0.Checked = true;
this.but0.Location = new System.Drawing.Point(103, 24);
this.but0.Name = "but0";
this.but0.Size = new System.Drawing.Size(46, 17);
this.but0.TabIndex = 185;
this.but0.TabStop = true;
this.but0.Text = "00";
this.but0.UseVisualStyleBackColor = true;
this.but0.CheckedChanged += new System.EventHandler(this.But0CheckedChanged);
//
// spot0
//
this.spot0.Location = new System.Drawing.Point(108, 49);
this.spot0.Name = "spot0";
this.spot0.Size = new System.Drawing.Size(22, 18);
this.spot0.TabIndex = 164;
this.spot0.Text = "01";
//
// mdv_box
//
this.mdv_box.Controls.Add(this.infobut);
this.mdv_box.Controls.Add(this.u32);
this.mdv_box.Controls.Add(this.label3);
this.mdv_box.Controls.Add(this.u16);
this.mdv_box.Controls.Add(this.tid_hi);
this.mdv_box.Controls.Add(this.label4);
this.mdv_box.Controls.Add(this.tid_lo);
this.mdv_box.Controls.Add(this.mdv3);
this.mdv_box.Controls.Add(this.mdv0);
this.mdv_box.Controls.Add(this.mdv2);
this.mdv_box.Controls.Add(this.mdv1);
this.mdv_box.Location = new System.Drawing.Point(64, 121);
this.mdv_box.Name = "mdv_box";
this.mdv_box.Size = new System.Drawing.Size(553, 94);
this.mdv_box.TabIndex = 150;
this.mdv_box.TabStop = false;
this.mdv_box.Text = "Advanced (direct HEX view)";
this.mdv_box.Visible = false;
//
// infobut
//
this.infobut.Location = new System.Drawing.Point(470, 65);
this.infobut.Name = "infobut";
this.infobut.Size = new System.Drawing.Size(75, 23);
this.infobut.TabIndex = 162;
this.infobut.Text = "Info";
this.infobut.UseVisualStyleBackColor = true;
this.infobut.Click += new System.EventHandler(this.InfobutClick);
//
// u32
//
this.u32.Location = new System.Drawing.Point(266, 40);
this.u32.Name = "u32";
this.u32.Size = new System.Drawing.Size(198, 48);
this.u32.TabIndex = 160;
this.u32.Text = "MDV u32";
//
// label3
//
this.label3.Location = new System.Drawing.Point(6, 16);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(45, 19);
this.label3.TabIndex = 151;
this.label3.Text = "TID:";
this.label3.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// u16
//
this.u16.Location = new System.Drawing.Point(57, 40);
this.u16.Name = "u16";
this.u16.Size = new System.Drawing.Size(119, 48);
this.u16.TabIndex = 159;
this.u16.Text = "TID u16";
//
// tid_hi
//
this.tid_hi.Hexadecimal = true;
this.tid_hi.Location = new System.Drawing.Point(108, 14);
this.tid_hi.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.tid_hi.Name = "tid_hi";
this.tid_hi.Size = new System.Drawing.Size(45, 20);
this.tid_hi.TabIndex = 152;
this.tid_hi.ValueChanged += new System.EventHandler(this.Tid_hiValueChanged);
//
// label4
//
this.label4.Location = new System.Drawing.Point(215, 17);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(45, 23);
this.label4.TabIndex = 158;
this.label4.Text = "MDV:";
this.label4.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// tid_lo
//
this.tid_lo.Hexadecimal = true;
this.tid_lo.Location = new System.Drawing.Point(57, 14);
this.tid_lo.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.tid_lo.Name = "tid_lo";
this.tid_lo.Size = new System.Drawing.Size(45, 20);
this.tid_lo.TabIndex = 153;
this.tid_lo.ValueChanged += new System.EventHandler(this.Tid_loValueChanged);
//
// mdv3
//
this.mdv3.Hexadecimal = true;
this.mdv3.Location = new System.Drawing.Point(419, 15);
this.mdv3.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.mdv3.Name = "mdv3";
this.mdv3.Size = new System.Drawing.Size(45, 20);
this.mdv3.TabIndex = 157;
this.mdv3.ValueChanged += new System.EventHandler(this.Mdv3ValueChanged);
//
// mdv0
//
this.mdv0.Hexadecimal = true;
this.mdv0.Location = new System.Drawing.Point(266, 15);
this.mdv0.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.mdv0.Name = "mdv0";
this.mdv0.Size = new System.Drawing.Size(45, 20);
this.mdv0.TabIndex = 154;
this.mdv0.ValueChanged += new System.EventHandler(this.Mdv0ValueChanged);
//
// mdv2
//
this.mdv2.Hexadecimal = true;
this.mdv2.Location = new System.Drawing.Point(368, 15);
this.mdv2.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.mdv2.Name = "mdv2";
this.mdv2.Size = new System.Drawing.Size(45, 20);
this.mdv2.TabIndex = 156;
this.mdv2.ValueChanged += new System.EventHandler(this.Mdv2ValueChanged);
//
// mdv1
//
this.mdv1.Hexadecimal = true;
this.mdv1.Location = new System.Drawing.Point(317, 15);
this.mdv1.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.mdv1.Name = "mdv1";
this.mdv1.Size = new System.Drawing.Size(45, 20);
this.mdv1.TabIndex = 155;
this.mdv1.ValueChanged += new System.EventHandler(this.Mdv1ValueChanged);
//
// panel_info
//
this.panel_info.Controls.Add(this.close_info);
this.panel_info.Controls.Add(this.label5);
this.panel_info.Controls.Add(this.label7);
this.panel_info.Controls.Add(this.label6);
this.panel_info.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel_info.Location = new System.Drawing.Point(0, 0);
this.panel_info.Name = "panel_info";
this.panel_info.Size = new System.Drawing.Size(739, 494);
this.panel_info.TabIndex = 0;
this.panel_info.Visible = false;
//
// close_info
//
this.close_info.Location = new System.Drawing.Point(657, 460);
this.close_info.Name = "close_info";
this.close_info.Size = new System.Drawing.Size(60, 22);
this.close_info.TabIndex = 2;
this.close_info.Text = "Close";
this.close_info.UseVisualStyleBackColor = true;
this.close_info.Click += new System.EventHandler(this.Close_infoClick);
//
// label5
//
this.label5.Font = new System.Drawing.Font("Lucida Sans Typewriter", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label5.Location = new System.Drawing.Point(12, 87);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(679, 398);
this.label5.TabIndex = 0;
this.label5.Text = resources.GetString("label5.Text");
//
// label7
//
this.label7.Location = new System.Drawing.Point(12, 40);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(705, 44);
this.label7.TabIndex = 3;
this.label7.Text = resources.GetString("label7.Text");
//
// label6
//
this.label6.Location = new System.Drawing.Point(12, 9);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(705, 44);
this.label6.TabIndex = 1;
this.label6.Text = resources.GetString("label6.Text");
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(739, 494);
this.Controls.Add(this.panel_info);
this.Controls.Add(this.orasbox);
this.Controls.Add(this.unlock_safari);
this.Controls.Add(this.groupBox7);
this.Controls.Add(this.label35);
this.Controls.Add(this.ev_0);
this.Controls.Add(this.ev_1);
this.Controls.Add(this.ev_2);
this.Controls.Add(this.ev_3);
this.Controls.Add(this.ev_4);
this.Controls.Add(this.ev_5);
this.Name = "MainForm";
this.Text = "XYORAS Safari Mirage Tool 0.1 by suloku";
((System.ComponentModel.ISupportInitialize)(this.ev_5)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ev_4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ev_3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ev_2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ev_1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ev_0)).EndInit();
this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout();
this.orasbox.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.mdv_box.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.tid_hi)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.tid_lo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mdv3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mdv0)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mdv2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.mdv1)).EndInit();
this.panel_info.ResumeLayout(false);
this.ResumeLayout(false);
}
}
}

View File

@ -0,0 +1,459 @@
/*
* 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_Safari_Mirage_Tool
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
this.Size = new Size(755, 270);
//
// 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)
public static 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;
}
}
int[] mirage_slots = new int[10];
int pss_slot;
private void 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();
unlock_safari.Enabled = true;
orasbox.Enabled = false;
}else if (saveFile.Length == 0x76000){
game = 2;
currgame.Text = "OR/AS";
ReadWholeArray(saveFile, savebuffer_ORAS);
//Populate ORAS fields
tid_lo.Value = savebuffer_ORAS[0x14000];
tid_hi.Value = savebuffer_ORAS[0x14000+1];
update_tid();
mdv0.Value = savebuffer_ORAS[0x1600];
mdv1.Value = savebuffer_ORAS[0x1601];
mdv2.Value = savebuffer_ORAS[0x1602];
mdv3.Value = savebuffer_ORAS[0x1603];
update_mdv();
pss_slot = 0;
int i = 0;
for(i=0;i<10;i++)
{
mirage_slots[i]=savebuffer_ORAS[0x307D4+(i*4)];
}
update_mirages();
savebuffer_ORAS.Skip(0x20FFF).Take(0xA47).ToArray().CopyTo(linkbuffer, 0);
saveFile.Close();
unlock_safari.Enabled = false;
orasbox.Enabled = true;
}
}
private void Get_save_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
Read_data();
}
}
private void 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 Dump_link_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+".");
}
}
private void Read_link_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();
InjectNsave();
}
private void Get_link_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
Read_link_data();
}
}
private void InjectNsave()
{
if (game == 1){
//Unlock safaris
int i;
for (i=1;i<101;i++)
{
if( savebuffer_XY[0x1E7FF+(0x15*i)] != 0x00 )
savebuffer_XY[0x1E7FF+(0x15*i)] = 0x3D;
}
//Get full block for checksum calculation
byte[] friendblockbuffer = new byte[0x834];
Array.Copy(savebuffer_XY, 0x1E800, friendblockbuffer, 0, 0x834);
byte[] tablecrcsum = new byte[2];
tablecrcsum = ccitt16(friendblockbuffer);
//Put new checksum in savefile
Array.Copy(tablecrcsum, 0, savebuffer_XY, 0x65582, 2);
}
else if (game == 2){
//Put link data in save
Array.Copy(linkbuffer, 0, savebuffer_ORAS, 0x20FFF, 0xA47);
//Get full block for checksum calculation
savebuffer_ORAS[0x14000] = (byte) tid_lo.Value;
savebuffer_ORAS[0x14000+1] = (byte) tid_hi.Value;
byte[] tidblockbuffer = new byte[0x170];
Array.Copy(savebuffer_ORAS, 0x14000, tidblockbuffer, 0, 0x170);
byte[] tablecrcsum = new byte[2];
tablecrcsum = ccitt16(tidblockbuffer);
//Put new checksum in savefile
Array.Copy(tablecrcsum, 0, savebuffer_ORAS, 0x75EA2, 2);
//MDV
savebuffer_ORAS[0x1600] = (byte) mdv0.Value;
savebuffer_ORAS[0x1600+1] = (byte) mdv1.Value;
savebuffer_ORAS[0x1600+2] = (byte) mdv2.Value;
savebuffer_ORAS[0x1600+3] = (byte) mdv3.Value;
byte[] mdvblockbuffer = new byte[0x4];
Array.Copy(savebuffer_ORAS, 0x1600, mdvblockbuffer, 0, 0x4);
tablecrcsum = ccitt16(mdvblockbuffer);
//Put new checksum in savefile
Array.Copy(tablecrcsum, 0, savebuffer_ORAS, 0x75E42, 2);
//PSS
int i = 0;
for(i=0;i<10;i++)
{
savebuffer_ORAS[0x307D4+(i*4)] = (byte)mirage_slots[i];
}
byte[] pssblockbuffer = new byte[0x78B0];
Array.Copy(savebuffer_ORAS, 0x2B600, pssblockbuffer, 0, 0x78B0);
tablecrcsum = ccitt16(pssblockbuffer);
//Put new checksum in savefile
Array.Copy(tablecrcsum, 0, savebuffer_ORAS, 0x75FD2, 2);
}
//Write Data
Save_data();
}
void LoadsaveClick(object sender, EventArgs e)
{
Get_save_data();
}
void Dump_butClick(object sender, EventArgs e)
{
if (savegamename.Text.Length < 1) return;
Dump_link_data();
}
void SavegamenameTextChanged(object sender, EventArgs e)
{
if (savegamename.Text.Length > 0){
if (game == 1)
unlock_safari.Enabled = true;
}else{
unlock_safari.Enabled = false;
}
}
void Inject_butClick(object sender, EventArgs e)
{
Get_link_data();
}
void Mdv_advancedClick(object sender, EventArgs e)
{
mdv_box.Visible ^= true;
if (mdv_box.Visible != true)
this.Size = new Size(755, 270);
else
this.Size = new Size(755, 394);
}
void GroupBox1Enter(object sender, EventArgs e)
{
}
void InfobutClick(object sender, EventArgs e)
{
panel_info.Visible = true;
this.Size = new Size(755, 532);
}
void Oras_saveClick(object sender, EventArgs e)
{
InjectNsave();
}
void Unlock_safariClick(object sender, EventArgs e)
{
InjectNsave();
}
void update_tid()
{
u16.Text = ((UInt16)((UInt16)tid_lo.Value|((UInt16)tid_hi.Value<<8))).ToString("00000")+" (u16)\n0x"+ ((UInt16)((UInt16)tid_lo.Value|((UInt16)tid_hi.Value<<8))).ToString("X4")+" (hex) ";
}
void Tid_hiValueChanged(object sender, EventArgs e)
{
update_tid();
}
void Tid_loValueChanged(object sender, EventArgs e)
{
update_tid();
}
void update_mdv()
{
u32.Text = ((UInt32)((UInt32)mdv0.Value|((UInt32)mdv1.Value<<8)|((UInt32)mdv2.Value<<16)|((UInt32)mdv3.Value<<24))).ToString("0000000000")+" (u32)\n0x"+ ((UInt32)((UInt32)mdv0.Value|((UInt32)mdv1.Value<<8)|((UInt32)mdv2.Value<<16)|((UInt32)mdv3.Value<<24))).ToString("X8")+" (hex) ";
}
void Mdv0ValueChanged(object sender, EventArgs e)
{
update_mdv();
}
void Mdv1ValueChanged(object sender, EventArgs e)
{
update_mdv();
}
void Mdv2ValueChanged(object sender, EventArgs e)
{
update_mdv();
}
void Mdv3ValueChanged(object sender, EventArgs e)
{
update_mdv();
}
void update_mirages()
{
spot0.Text=mirage_slots[0].ToString("00");
spot1.Text=mirage_slots[1].ToString("00");
spot2.Text=mirage_slots[2].ToString("00");
spot3.Text=mirage_slots[3].ToString("00");
spot4.Text=mirage_slots[4].ToString("00");
spot5.Text=mirage_slots[5].ToString("00");
spot6.Text=mirage_slots[6].ToString("00");
spot7.Text=mirage_slots[7].ToString("00");
spot8.Text=mirage_slots[8].ToString("00");
spot9.Text=mirage_slots[9].ToString("00");
comboBox2.SelectedIndex = mirage_slots[(int)pss_slot];
}
void ComboBox2SelectedIndexChanged(object sender, EventArgs e)
{
mirage_slots[(int)pss_slot]=comboBox2.SelectedIndex;
update_mirages();
}
void Close_infoClick(object sender, EventArgs e)
{
panel_info.Visible = false;
if (mdv_box.Visible != true)
this.Size = new Size(755, 270);
else
this.Size = new Size(755, 394);
}
void update_radio()
{
if(but0.Checked == true)
pss_slot=0;
else if (but1.Checked == true)
pss_slot=1;
else if (but2.Checked == true)
pss_slot=2;
else if (but3.Checked == true)
pss_slot=3;
else if (but4.Checked == true)
pss_slot=4;
else if (but5.Checked == true)
pss_slot=5;
else if (but6.Checked == true)
pss_slot=6;
else if (but7.Checked == true)
pss_slot=7;
else if (but8.Checked == true)
pss_slot=8;
else if (but9.Checked == true)
pss_slot=9;
else
pss_slot=0;
comboBox2.SelectedIndex = mirage_slots[(int)pss_slot];
}
void But0CheckedChanged(object sender, EventArgs e)
{
update_radio();
}
void But1CheckedChanged(object sender, EventArgs e)
{
update_radio();
}
void But2CheckedChanged(object sender, EventArgs e)
{
update_radio();
}
void But3CheckedChanged(object sender, EventArgs e)
{
update_radio();
}
void But4CheckedChanged(object sender, EventArgs e)
{
update_radio();
}
void But5CheckedChanged(object sender, EventArgs e)
{
update_radio();
}
void But6CheckedChanged(object sender, EventArgs e)
{
update_radio();
}
void But7CheckedChanged(object sender, EventArgs e)
{
update_radio();
}
void But8CheckedChanged(object sender, EventArgs e)
{
update_radio();
}
void But9CheckedChanged(object sender, EventArgs e)
{
update_radio();
}
}
}

View File

@ -0,0 +1,161 @@
<?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>
<data name="label5.Text" xml:space="preserve">
<value>FF FF FE FF - 01: 467 - Crescent Isle - Cresselia
FF 7F FF FF - 02: 184 - East of Mossdeep - Tangela, Sunkern, Glameow, Minccino
02 00 00 00 - 03: 185 - North of Route 124 - Tangela, Sunkern, Purugly, Vulpix
?? ?? ?? ?? - 04: 186 - West of Route 114 - Tangela, Sunkern, Purugly, Petilil
7F FF FF FF - 05: 187 - North of Lilycove - Tangela, Sunkern, Purugly, Cherrim
F7 FF FF FF - 06: 188 - South of Route 132 - Sunkern, Petilil, Audino
FF FE FF FF - 07: 189 - West of Route 105 - Forretress, Happiny
04 00 00 00 - 08: 190 - South of Route 109 - Audino, Sunkern
?? ?? ?? ?? - 09: 191 - North of Route 111 - Kricketune, Larvesta
03 00 00 00 - 10: 192 - West of Rustboro - Tynamo, Klink, Boldore, Graveler
?? ?? ?? ?? - 11: 193 - North of Fortree - Klink, Tynamo, Excadrill, Onix
?? ?? ?? ?? - 12: 194 - South of Pacifidlog - Tynamo, Cofagrigus, Slowpoke
EF FF FF FF - 13: 195 - South of Route 107 - Unown
?? ?? ?? ?? - 14: 196 - North of Route 124 - Klink, Cofagrigus, Graveler, Boldore
01 00 00 00 - 15: 197 - North of Route 132 - Ditto, Excadrill, Tynamo
?? ?? ?? ?? - 16: 198 - Southeast of Route 129 - Tynamo, Onix, Graveler, Boldore
?? ?? ?? ?? - 17: 199 - North of Fallarbor - Slowpoke, Tynamo
?? ?? ?? ?? - 18: 200 - West of Route 104 - Venomoth, Xatu, Zebstrika, Darmanitan
FF FB FF FF - 19: 201 - South of Route 134 - Venomoth, Xatu, Zebstrika, Maractus
FF FF FF FB - 20: 202 - North of Route 124 - Venomoth, Xatu, Zebstrika, Persian
FF FF FF DF - 21: 203 - West of Dewford Town - Venomoth, Xatu, Zebstrika, Tangela
05 00 00 00 - 22: 204 - South of Pacifidlog - Audino, Xatu
FF FF 7F FF - 23: 205 - South of Route 132 - Munna, Ditto
?? ?? ?? ?? - 24: 206 - North of Route 113 - Darmanitan, Larvesta
BF FF FF FF - 25: 207 - East of Shoal Cave - Purugly, Porygon
FF FF F7 FF - 26: 208 - West of Route 104 - Forretress, Donphan, Kricketune, Stantler
?? ?? ?? ?? - 27: 460 - North of Lilycove - Forretress, Donphan, Kricketune, Rufflet
FD FF FF FF - 28: 461 - Northeast of Route 125 - Forretress, Donphan, Kricketune, Vullaby
FF DF FF FF - 29: 462 - West of Route 131 - Donphan, Kricketune, Girafarig
06 00 00 00 - 30: 463 - North of Mossdeep - Magby, Darmanitan
FF FF DF FF - 31: 464 - South of Route 129 - Zebstrika, Elekid
00 00 00 00 - 32: 465 - Southeast of Route 129 - Porygon, Xatu, Munna
FE FF FF FF - 33: 466 - East of Mossdeep - Audino, Happiny, Tangela</value>
</data>
<data name="label7.Text" xml:space="preserve">
<value>This spot can be transfered via PSS (online/streetpass) and has hidden items. There are no other differences with received PSS spots, so this method is only recommended to get those hidden items or transfering the spot to other players. If you want to catch pokémon using this method, you'll need to save in the mirage spot, then change your TID again or your pokémon will have TID 00000, so PSS spots are more convenient.</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>Daily Mirage spot is randomly generated each time the game is saved, then via an unknown algorythm it is used with TID to generate the mirage spot for the day. You may set TID to 0x0000 and set MDV to any of the following values so your save produces that certain mirage spot.</value>
</data>
</root>

View 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_Safari_Mirage_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());
}
}
}

View 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 Safari Mirage Tool")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XYORAS Safari Mirage Tool")]
[assembly: AssemblyCopyright("Copyright 2016")]
[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.*")]

View 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 Safari Mirage 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>

View 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>