From 7d5dff9851b1024acf540258a31e0ecc296d8669 Mon Sep 17 00:00:00 2001 From: Greg Edwards Date: Fri, 9 May 2014 16:35:37 -0400 Subject: [PATCH] Fixed hex view being only 8 bytes wide. --- gts/test/Decode.aspx.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gts/test/Decode.aspx.cs b/gts/test/Decode.aspx.cs index 170a4983..e83c8673 100644 --- a/gts/test/Decode.aspx.cs +++ b/gts/test/Decode.aspx.cs @@ -29,6 +29,8 @@ namespace PkmnFoundations.GTS.debug { data = GtsSession4.DecryptData(txtData.Text); litGeneration.Text = "4"; + // todo: genIV is always valid so genV never gets detected + // need to validate checksum and error there } catch (FormatException) { @@ -56,16 +58,16 @@ namespace PkmnFoundations.GTS.debug private String RenderHex(String hex) { StringBuilder builder = new StringBuilder(); - for (int x = 0; x < hex.Length; x += 8) + for (int x = 0; x < hex.Length; x += 16) { - if (x % 16 == 0) + if (x % 32 == 0) { - builder.Append(x.ToString("x4")); + builder.Append((x >> 1).ToString("x4")); builder.Append(": "); } - builder.Append(hex.Substring(x, Math.Min(8, hex.Length - x))); - builder.Append((x % 16 == 0) ? " " : "
"); + builder.Append(hex.Substring(x, Math.Min(16, hex.Length - x))); + builder.Append((x % 32 == 0) ? " " : "
"); } return builder.ToString(); }