private void btn_Inject_Click(object sender, EventArgs e) { if (tb_FileInjection.Text == "") { MessageBox.Show("Please select a file!", "WonderInjection", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } byte[] pkmEncrypted = System.IO.File.ReadAllBytes(tb_FileInjection.Text); byte[] cloneshort = PKHeX.encryptArray(pkmEncrypted.Take(232).ToArray()); uint boxIndex = Decimal.ToUInt32((nud_BoxInjection.Value - 1) * 30 + nud_SlotInjection.Value - 1); uint count = Decimal.ToUInt32(nud_CountInjection.Value); if (boxIndex + count > 32 * 30) { uint newCount = 32 * 30 - boxIndex; count = newCount; } byte[] dataToWrite = new byte[count * 232]; for (int i = 0; i < count; i++) { cloneshort.CopyTo(dataToWrite, i * 232); } uint offset = boxOff + boxIndex * 232; Program.scriptHelper.write(offset, dataToWrite, pid); MessageBox.Show("Injection Successful!"); }
static void Main() { ntrClient = new NTR(); scriptHelper = new ScriptHelper(); helper = new RemoteControl(); pkhex = new PKHeX(); PKTable = new LookupTable(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); f1 = new MainForm(); Application.Run(f1); }
private void handlePokeRead(object args_obj) { DataReadyWaiting args = (DataReadyWaiting)args_obj; validator.Data = PKHeX.decryptArray(args.data); }