Merge pull request #1 from codemonkey85/master

Added report feature
neato, thanks!
This commit is contained in:
Kaphotics 2014-07-21 22:58:47 -07:00
commit 3b205c427d
6 changed files with 632 additions and 12 deletions

View file

@ -95,6 +95,12 @@
<Compile Include="f3-MemoryAmie.Designer.cs">
<DependentUpon>f3-MemoryAmie.cs</DependentUpon>
</Compile>
<Compile Include="frmReport.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmReport.Designer.cs">
<DependentUpon>frmReport.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
@ -175,6 +181,9 @@
<EmbeddedResource Include="f3-MemoryAmie.resx">
<DependentUpon>f3-MemoryAmie.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmReport.resx">
<DependentUpon>frmReport.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>

35
f1-Main.Designer.cs generated
View file

@ -214,6 +214,8 @@
this.Menu_OpenBoxUI = new System.Windows.Forms.ToolStripMenuItem();
this.Menu_ImportGen5 = new System.Windows.Forms.ToolStripMenuItem();
this.Menu_BoxIO = new System.Windows.Forms.ToolStripMenuItem();
this.codeGeneratorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.reportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.Menu_Options = new System.Windows.Forms.ToolStripMenuItem();
this.Menu_Language = new System.Windows.Forms.ToolStripMenuItem();
this.CB_MainLanguage = new System.Windows.Forms.ToolStripComboBox();
@ -320,7 +322,6 @@
this.B_OpenPokedex = new System.Windows.Forms.Button();
this.GB_SAVtools = new System.Windows.Forms.GroupBox();
this.L_SAVINDEX = new System.Windows.Forms.Label();
this.codeGeneratorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabMain.SuspendLayout();
this.Tab_Main.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Label_IsShiny)).BeginInit();
@ -2044,7 +2045,7 @@
this.CHK_Star.AutoSize = true;
this.CHK_Star.Location = new System.Drawing.Point(182, 213);
this.CHK_Star.Name = "CHK_Star";
this.CHK_Star.Size = new System.Drawing.Size(38, 17);
this.CHK_Star.Size = new System.Drawing.Size(35, 17);
this.CHK_Star.TabIndex = 13;
this.CHK_Star.Text = "★";
this.CHK_Star.UseVisualStyleBackColor = true;
@ -2066,7 +2067,7 @@
this.CHK_Square.AutoSize = true;
this.CHK_Square.Location = new System.Drawing.Point(6, 227);
this.CHK_Square.Name = "CHK_Square";
this.CHK_Square.Size = new System.Drawing.Size(38, 17);
this.CHK_Square.Size = new System.Drawing.Size(35, 17);
this.CHK_Square.TabIndex = 11;
this.CHK_Square.Text = "■";
this.CHK_Square.UseVisualStyleBackColor = true;
@ -2133,7 +2134,7 @@
this.CHK_Triangle.AutoSize = true;
this.CHK_Triangle.Location = new System.Drawing.Point(6, 213);
this.CHK_Triangle.Name = "CHK_Triangle";
this.CHK_Triangle.Size = new System.Drawing.Size(38, 17);
this.CHK_Triangle.Size = new System.Drawing.Size(35, 17);
this.CHK_Triangle.TabIndex = 10;
this.CHK_Triangle.Text = "▲";
this.CHK_Triangle.UseVisualStyleBackColor = true;
@ -2541,7 +2542,8 @@
this.Menu_OpenBoxUI,
this.Menu_ImportGen5,
this.Menu_BoxIO,
this.codeGeneratorToolStripMenuItem});
this.codeGeneratorToolStripMenuItem,
this.reportToolStripMenuItem});
this.Menu_Tools.Name = "Menu_Tools";
this.Menu_Tools.Size = new System.Drawing.Size(48, 20);
this.Menu_Tools.Text = "Tools";
@ -2569,6 +2571,21 @@
this.Menu_BoxIO.Text = "Load/Dump Boxes";
this.Menu_BoxIO.Click += new System.EventHandler(this.Menu_DumpLoadBoxes_Click);
//
// codeGeneratorToolStripMenuItem
//
this.codeGeneratorToolStripMenuItem.Name = "codeGeneratorToolStripMenuItem";
this.codeGeneratorToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.codeGeneratorToolStripMenuItem.Text = "Code Generator";
this.codeGeneratorToolStripMenuItem.Click += new System.EventHandler(this.codeGeneratorToolStripMenuItem_Click);
//
// reportToolStripMenuItem
//
this.reportToolStripMenuItem.Enabled = false;
this.reportToolStripMenuItem.Name = "reportToolStripMenuItem";
this.reportToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.reportToolStripMenuItem.Text = "Report";
this.reportToolStripMenuItem.Click += new System.EventHandler(this.reportToolStripMenuItem_Click);
//
// Menu_Options
//
this.Menu_Options.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -3783,13 +3800,6 @@
this.L_SAVINDEX.TabIndex = 16;
this.L_SAVINDEX.Text = "0";
//
// codeGeneratorToolStripMenuItem
//
this.codeGeneratorToolStripMenuItem.Name = "codeGeneratorToolStripMenuItem";
this.codeGeneratorToolStripMenuItem.Size = new System.Drawing.Size(174, 22);
this.codeGeneratorToolStripMenuItem.Text = "Code Generator";
this.codeGeneratorToolStripMenuItem.Click += new System.EventHandler(this.codeGeneratorToolStripMenuItem_Click);
//
// Form1
//
this.AllowDrop = true;
@ -4208,6 +4218,7 @@
private System.Windows.Forms.TextBox TB_PP2;
private System.Windows.Forms.TextBox TB_PP1;
private System.Windows.Forms.ToolStripMenuItem codeGeneratorToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem reportToolStripMenuItem;
}
}

View file

@ -6046,6 +6046,7 @@ namespace PKHeX
{
B_ExportSAV.Enabled = false;
B_SwitchSAV.Enabled = false;
reportToolStripMenuItem.Enabled = false;
B_OUTPasserby.Enabled = B_OUTHallofFame.Enabled = B_JPEG.Enabled = false;
if ((BitConverter.ToUInt32(input, 0x100) != 0x41534944) && (BitConverter.ToUInt32(input, 0x5234) != 0x6E69616D))
{
@ -6092,6 +6093,7 @@ namespace PKHeX
{
B_ExportSAV.Enabled = true;
B_SwitchSAV.Enabled = true;
reportToolStripMenuItem.Enabled = true;
savindex = detectSAVIndex(input);
opensave(input, path, ext);
}
@ -8061,6 +8063,7 @@ namespace PKHeX
{
getPKXBoxes();
}
private void getTSV(object sender, EventArgs e)
{
uint TID = ToUInt32(TB_TID.Text);
@ -8528,6 +8531,13 @@ namespace PKHeX
CodeGenerator CodeGen = new PKHeX.CodeGenerator(this);
CodeGen.Show();
}
private void reportToolStripMenuItem_Click(object sender, EventArgs e)
{
frmReport ReportForm = new frmReport();
ReportForm.PopulateData(savefile);
ReportForm.ShowDialog();
}
}
#region Structs & Classes
public class cbItem

67
frmReport.Designer.cs generated Normal file
View file

@ -0,0 +1,67 @@
namespace PKHeX
{
partial class frmReport
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.dgData = new System.Windows.Forms.DataGridView();
((System.ComponentModel.ISupportInitialize)(this.dgData)).BeginInit();
this.SuspendLayout();
//
// dgData
//
this.dgData.AllowUserToAddRows = false;
this.dgData.AllowUserToDeleteRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.dgData.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgData.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgData.Location = new System.Drawing.Point(0, 0);
this.dgData.Name = "dgData";
this.dgData.RowHeadersVisible = false;
this.dgData.Size = new System.Drawing.Size(559, 568);
this.dgData.TabIndex = 0;
//
// frmReport
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(559, 568);
this.Controls.Add(this.dgData);
this.Name = "frmReport";
this.Text = "Report";
((System.ComponentModel.ISupportInitialize)(this.dgData)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgData;
}
}

403
frmReport.cs Normal file
View file

@ -0,0 +1,403 @@
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.Security.Cryptography;
namespace PKHeX
{
public partial class frmReport : Form
{
private byte[] SaveData;
private const int PIDOFFSET = 0x18;
private const int TIDOFFSET = 0x0C;
private const int SIDOFFSET = 0x0E;
public frmReport()
{
InitializeComponent();
}
private static uint LCRNG(uint seed)
{
uint a = 0x41C64E6D;
uint c = 0x00006073;
seed = (seed * a + c) & 0xFFFFFFFF;
return seed;
}
public byte[] shuffleArray(byte[] pkx, uint sv)
{
byte[] ekx = new Byte[260];
Array.Copy(pkx, ekx, 8);
// Now to shuffle the blocks
// Define Shuffle Order Structure
var aloc = new byte[] { 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3 };
var bloc = new byte[] { 1, 1, 2, 3, 2, 3, 0, 0, 0, 0, 0, 0, 2, 3, 1, 1, 3, 2, 2, 3, 1, 1, 3, 2 };
var cloc = new byte[] { 2, 3, 1, 1, 3, 2, 2, 3, 1, 1, 3, 2, 0, 0, 0, 0, 0, 0, 3, 2, 3, 2, 1, 1 };
var dloc = new byte[] { 3, 2, 3, 2, 1, 1, 3, 2, 3, 2, 1, 1, 3, 2, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0 };
// Get Shuffle Order
var shlog = new byte[] { aloc[sv], bloc[sv], cloc[sv], dloc[sv] };
// UnShuffle Away!
for (int b = 0; b < 4; b++)
{
Array.Copy(pkx, 8 + 56 * shlog[b], ekx, 8 + 56 * b, 56);
}
// Fill the Battle Stats back
if (pkx.Length > 232)
{
Array.Copy(pkx, 232, ekx, 232, 28);
}
return ekx;
}
public byte[] decryptArray(byte[] ekx)
{
byte[] pkx = ekx;
uint pv = BitConverter.ToUInt32(pkx, 0);
uint sv = (((pv & 0x3E000) >> 0xD) % 24);
uint seed = pv;
// Decrypt Blocks with RNG Seed
for (int i = 8; i < 232; i += 2)
{
int pre = pkx[i] + ((pkx[i + 1]) << 8);
seed = LCRNG(seed);
int seedxor = (int)((seed) >> 16);
int post = (pre ^ seedxor);
pkx[i] = (byte)((post) & 0xFF);
pkx[i + 1] = (byte)(((post) >> 8) & 0xFF);
}
// Deshuffle
pkx = shuffleArray(pkx, sv);
// Decrypt the Party Stats
seed = pv;
for (int i = 232; i < 260; i += 2)
{
int pre = pkx[i] + ((pkx[i + 1]) << 8);
seed = LCRNG(seed);
int seedxor = (int)((seed) >> 16);
int post = (pre ^ seedxor);
pkx[i] = (byte)((post) & 0xFF);
pkx[i + 1] = (byte)(((post) >> 8) & 0xFF);
}
return pkx;
}
private UInt16 getTSV(UInt32 PID, UInt16 TID, UInt16 SID)
{
UInt16 tsv = Convert.ToUInt16((TID ^ SID) >> 4);
return Convert.ToUInt16(((PID >> 16) ^ (PID & 0xFFFF)) >> 4);
}
private int detectSAVIndex(byte[] data)
{
int savindex = 0;
SHA256 mySHA256 = SHA256Managed.Create();
{
byte[] difihash1 = new Byte[0x12C];
byte[] difihash2 = new Byte[0x12C];
Array.Copy(data, 0x330, difihash1, 0, 0x12C);
Array.Copy(data, 0x200, difihash2, 0, 0x12C);
byte[] hashValue1 = mySHA256.ComputeHash(difihash1);
byte[] hashValue2 = mySHA256.ComputeHash(difihash2);
byte[] actualhash = new Byte[0x20];
Array.Copy(data, 0x16C, actualhash, 0, 0x20);
if (hashValue1.SequenceEqual(actualhash))
{
savindex = 0;
}
else if (hashValue2.SequenceEqual(actualhash))
{
savindex = 1;
}
else
{
savindex = 2;
}
}
if ((data[0x168] ^ 1) != savindex && savindex != 2)
{
savindex = 2;
}
return savindex;
}
public void PopulateData(byte[] InputData)
{
//IList<PKX> PL = new List<PKX>();
SaveData = new byte[InputData.Length];
Array.Copy(InputData, SaveData, InputData.Length);
PokemonList PL = new PokemonList();
SaveGames.SaveStruct SaveGame = new SaveGames.SaveStruct("XY");
int savindex = detectSAVIndex(SaveData);
for (int BoxNum = 0; BoxNum < 31; BoxNum++)
{
int boxoffset = 0x27A00 + 0x7F000 * savindex + BoxNum * (0xE8 * 30);
for (int SlotNum = 0; SlotNum < 30; SlotNum++)
{
int offset = boxoffset + 0xE8 * SlotNum;
byte[] slotdata = new Byte[0xE8];
Array.Copy(SaveData, offset, slotdata, 0, 0xE8);
byte[] dslotdata = decryptArray(slotdata);
PKX pkm = new PKX(dslotdata);
PL.Add(pkm);
}
}
dgData.DataSource = PL;
dgData.AutoGenerateColumns = true;
}
public static string TrimFromZero(string input)
{
int index = input.IndexOf('\0');
if (index < 0)
return input;
return input.Substring(0, index);
}
public class PKX
{
private uint mEC, mPID, mIV32,
mexp,
mHP_EV, mATK_EV, mDEF_EV, mSPA_EV, mSPD_EV, mSPE_EV,
mHP_IV, mATK_IV, mDEF_IV, mSPE_IV, mSPA_IV, mSPD_IV,
mcnt_cool, mcnt_beauty, mcnt_cute, mcnt_smart, mcnt_tough, mcnt_sheen,
mmarkings, mhptype;
private string
mnicknamestr, mnotOT, mot, mgenderstring;
private int
mability, mabilitynum, mnature, mfeflag, mgenderflag, maltforms, mPKRS_Strain, mPKRS_Duration,
mmetlevel, motgender;
private bool
misegg, misnick, misshiny;
private ushort
mspecies, mhelditem, mTID, mSID, mTSV, mESV,
mmove1, mmove2, mmove3, mmove4,
mmove1_pp, mmove2_pp, mmove3_pp, mmove4_pp,
mmove1_ppu, mmove2_ppu, mmove3_ppu, mmove4_ppu,
meggmove1, meggmove2, meggmove3, meggmove4,
mchk,
mOTfriendship, mOTaffection,
megg_year, megg_month, megg_day,
mmet_year, mmet_month, mmet_day,
meggloc, mmetloc,
mball, mencountertype,
mgamevers, mcountryID, mregionID, mdsregID, motlang;
public uint EC { get { return mEC; } }
public uint PID { get { return mPID; } }
public uint IVs { get { return mIV32; } }
public uint EXP { get { return mexp; } }
public uint HP_EV { get { return mHP_EV; } }
public uint ATK_EV { get { return mATK_EV; } }
public uint DEF_EV { get { return mDEF_EV; } }
public uint SPA_EV { get { return mSPA_EV; } }
public uint SPD_EV { get { return mSPD_EV; } }
public uint SPE_EV { get { return mSPE_EV; } }
public uint HP_IV { get { return mHP_IV; } }
public uint ATK_IV { get { return mATK_IV; } }
public uint DEF_IV { get { return mDEF_IV; } }
public uint SPA_IV { get { return mSPA_IV; } }
public uint SPD_IV { get { return mSPD_IV; } }
public uint SPE_IV { get { return mSPE_IV; } }
public uint Cool { get { return mcnt_cool; } }
public uint Beauty { get { return mcnt_beauty; } }
public uint Cute { get { return mcnt_cute; } }
public uint Smart { get { return mcnt_smart; } }
public uint Tough { get { return mcnt_tough; } }
public uint Sheen { get { return mcnt_sheen; } }
public uint Markings { get { return mmarkings; } }
public uint HP_Type { get { return mhptype; } }
public string Nickname { get { return mnicknamestr; } }
public string NotOT { get { return mnotOT; } }
public string OT { get { return mot; } }
public string Gender { get { return mgenderstring; } }
public int Ability { get { return mability; } }
public int AbilityNum { get { return mabilitynum; } }
public int Nature { get { return mnature; } }
public int FatefulFlag { get { return mfeflag; } }
public int GenderFlag { get { return mgenderflag; } }
public int AltForms { get { return maltforms; } }
public int PKRS_Strain { get { return mPKRS_Strain; } }
public int PKRS_Days { get { return mPKRS_Duration; } }
public int MetLevel { get { return mmetlevel; } }
public int OT_Gender { get { return motgender; } }
public bool IsEgg { get { return misegg; } }
public bool IsNicknamed { get { return misnick; } }
public bool IsShiny { get { return misshiny; } }
public ushort Species { get { return mspecies; } }
public ushort HeldItem { get { return mhelditem; } }
public ushort TID { get { return mTID; } }
public ushort SID { get { return mSID; } }
public ushort TSV { get { return mTSV; } }
public ushort ESV { get { return mESV; } }
public ushort Move1 { get { return mmove1; } }
public ushort Move2 { get { return mmove2; } }
public ushort Move3 { get { return mmove3; } }
public ushort Move4 { get { return mmove4; } }
public ushort Move1_PP { get { return mmove1_pp; } }
public ushort Move2_PP { get { return mmove2_pp; } }
public ushort Move3_PP { get { return mmove3_pp; } }
public ushort Move4_PP { get { return mmove4_pp; } }
public ushort Move1_PPUp { get { return mmove1_ppu; } }
public ushort Move2_PPUp { get { return mmove2_ppu; } }
public ushort Move3_PPUp { get { return mmove3_ppu; } }
public ushort Move4_PPUp { get { return mmove4_ppu; } }
public ushort EggMove1 { get { return meggmove1; } }
public ushort EggMove2 { get { return meggmove2; } }
public ushort EggMove3 { get { return meggmove3; } }
public ushort EggMove4 { get { return meggmove4; } }
public ushort Checksum { get { return mchk; } }
public ushort Friendship { get { return mOTfriendship; } }
public ushort OT_Affection { get { return mOTaffection; } }
public ushort Egg_Year { get { return megg_year; } }
public ushort Egg_Day { get { return megg_month; } }
public ushort Egg_Month { get { return megg_day; } }
public ushort Met_Year { get { return mmet_year; } }
public ushort Met_Day { get { return mmet_month; } }
public ushort Met_Month { get { return mmet_day; } }
public ushort Egg_Location { get { return meggloc; } }
public ushort Met_Location { get { return mmetloc; } }
public ushort Ball { get { return mball; } }
public ushort Encounter { get { return mencountertype; } }
public ushort GameVersion { get { return mgamevers; } }
public ushort CountryID { get { return mcountryID; } }
public ushort RegionID { get { return mregionID; } }
public ushort DSRegionID { get { return mdsregID; } }
public ushort OTLang { get { return motlang; } }
public PKX(byte[] pkx)
{
mnicknamestr = "";
mnotOT = "";
mot = "";
mEC = BitConverter.ToUInt32(pkx, 0);
mchk = BitConverter.ToUInt16(pkx, 6);
mspecies = BitConverter.ToUInt16(pkx, 0x08);
mhelditem = BitConverter.ToUInt16(pkx, 0x0A);
mTID = BitConverter.ToUInt16(pkx, 0x0C);
mSID = BitConverter.ToUInt16(pkx, 0x0E);
mexp = BitConverter.ToUInt32(pkx, 0x10);
mability = pkx[0x14];
mabilitynum = pkx[0x15];
// 0x16, 0x17 - unknown
mPID = BitConverter.ToUInt32(pkx, 0x18);
mnature = pkx[0x1C];
mfeflag = pkx[0x1D] % 2;
mgenderflag = (pkx[0x1D] >> 1) & 0x3;
maltforms = (pkx[0x1D] >> 3);
mHP_EV = pkx[0x1E];
mATK_EV = pkx[0x1F];
mDEF_EV = pkx[0x20];
mSPA_EV = pkx[0x22];
mSPD_EV = pkx[0x23];
mSPE_EV = pkx[0x21];
mcnt_cool = pkx[0x24];
mcnt_beauty = pkx[0x25];
mcnt_cute = pkx[0x26];
mcnt_smart = pkx[0x27];
mcnt_tough = pkx[0x28];
mcnt_sheen = pkx[0x29];
mmarkings = pkx[0x2A];
mPKRS_Strain = pkx[0x2B] >> 4;
mPKRS_Duration = pkx[0x2B] % 0x10;
// Block B
mnicknamestr = TrimFromZero(Encoding.Unicode.GetString(pkx, 0x40, 24));
// 0x58, 0x59 - unused
mmove1 = BitConverter.ToUInt16(pkx, 0x5A);
mmove2 = BitConverter.ToUInt16(pkx, 0x5C);
mmove3 = BitConverter.ToUInt16(pkx, 0x5E);
mmove4 = BitConverter.ToUInt16(pkx, 0x60);
mmove1_pp = pkx[0x62];
mmove2_pp = pkx[0x63];
mmove3_pp = pkx[0x64];
mmove4_pp = pkx[0x65];
mmove1_ppu = pkx[0x66];
mmove2_ppu = pkx[0x67];
mmove3_ppu = pkx[0x68];
mmove4_ppu = pkx[0x69];
meggmove1 = BitConverter.ToUInt16(pkx, 0x6A);
meggmove2 = BitConverter.ToUInt16(pkx, 0x6C);
meggmove3 = BitConverter.ToUInt16(pkx, 0x6E);
meggmove4 = BitConverter.ToUInt16(pkx, 0x70);
// 0x72 - Super Training Flag - Passed with pkx to new form
// 0x73 - unused/unknown
mIV32 = BitConverter.ToUInt32(pkx, 0x74);
mHP_IV = mIV32 & 0x1F;
mATK_IV = (mIV32 >> 5) & 0x1F;
mDEF_IV = (mIV32 >> 10) & 0x1F;
mSPE_IV = (mIV32 >> 15) & 0x1F;
mSPA_IV = (mIV32 >> 20) & 0x1F;
mSPD_IV = (mIV32 >> 25) & 0x1F;
misegg = Convert.ToBoolean((mIV32 >> 30) & 1);
misnick = Convert.ToBoolean((mIV32 >> 31));
// Block C
mnotOT = TrimFromZero(Encoding.Unicode.GetString(pkx, 0x78, 24));
bool notOTG = Convert.ToBoolean(pkx[0x92]);
// Memory Editor edits everything else with pkx in a new form
// Block D
mot = TrimFromZero(Encoding.Unicode.GetString(pkx, 0xB0, 24));
// 0xC8, 0xC9 - unused
mOTfriendship = pkx[0xCA];
mOTaffection = pkx[0xCB]; // Handled by Memory Editor
// 0xCC, 0xCD, 0xCE, 0xCF, 0xD0
megg_year = pkx[0xD1];
megg_month = pkx[0xD2];
megg_day = pkx[0xD3];
mmet_year = pkx[0xD4];
mmet_month = pkx[0xD5];
mmet_day = pkx[0xD6];
// 0xD7 - unused
meggloc = BitConverter.ToUInt16(pkx, 0xD8);
mmetloc = BitConverter.ToUInt16(pkx, 0xDA);
mball = pkx[0xDC];
mmetlevel = pkx[0xDD] & 0x7F;
motgender = (pkx[0xDD]) >> 7;
mencountertype = pkx[0xDE];
mgamevers = pkx[0xDF];
mcountryID = pkx[0xE0];
mregionID = pkx[0xE1];
mdsregID = pkx[0xE2];
motlang = pkx[0xE3];
if (mgenderflag == 0)
{
mgenderstring = "♂";
}
else if (mgenderflag == 1)
{
mgenderstring = "♀";
}
else mgenderstring = "-";
mhptype = (15 * ((mHP_IV & 1) + 2 * (mATK_IV & 1) + 4 * (mDEF_IV & 1) + 8 * (mSPE_IV & 1) + 16 * (mSPA_IV & 1) + 32 * (mSPD_IV & 1))) / 63 + 1;
mTSV = (ushort)((mTID ^ mSID) >> 4);
mESV = (ushort)(((mPID >> 16) ^ (mPID & 0xFFFF)) >> 4);
misshiny = (mTSV == mESV);
}
}
public class PokemonList : System.Collections.ObjectModel.ObservableCollection<PKX> { }
}
}

120
frmReport.resx Normal file
View 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>