public void save() { SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.InitialDirectory = "c:\\"; saveFileDialog.Filter = "HyperViper Call List (*.hvcl)|*.hvcl|All files (*.*)|*.*"; saveFileDialog.FilterIndex = 0; saveFileDialog.RestoreDirectory = true; if (saveFileDialog.ShowDialog() == DialogResult.OK) { uint callnr = UInt32.Parse(txtCallnr.Text); uint count = UInt32.Parse(txtCount.Text); uint start = UInt32.Parse(txtStart.Text); uint outSize = UInt32.Parse(txtOutSize.Text); ulong inputInt = (ulong)HypercallConversions.hypercallInput(callnr, optFast.Checked, count, start); byte[] inputBuffer = new byte[hexBoxIn.ByteProvider.Length]; for (int x = 0; x < inputBuffer.Length; x++) { inputBuffer[x] = hexBoxIn.ByteProvider.ReadByte(x); } HVCL.save(saveFileDialog.FileName, inputInt, inputBuffer); } }
private void btnSend_Click(object sender, EventArgs e) { try { uint callnr = UInt32.Parse(txtCallnr.Text); uint count = UInt32.Parse(txtCount.Text); uint start = UInt32.Parse(txtStart.Text); uint outSize = UInt32.Parse(txtOutSize.Text); long inputInt = HypercallConversions.hypercallInput(callnr, optFast.Checked, count, start); long output; byte[] outputBuffer = new byte[outSize]; byte[] inputBuffer = new byte[hexBoxIn.ByteProvider.Length]; for (int x = 0; x < inputBuffer.Length; x++) { inputBuffer[x] = hexBoxIn.ByteProvider.ReadByte(x); } if (optFast.Checked && inputBuffer.Length != 0x10) { MessageBox.Show("Fast hypercall input has to be 16 bytes (two 8 byte registers"); return; } if (DriverIO.hypercall(inputInt, inputBuffer, (uint)inputBuffer.Length, out output, out outputBuffer, outSize)) { txtResultStatus.Text = (output & 0xFFFF).ToString(); if ((output & 0xFFFF) > 0 || optFast.Checked) { hexBoxOut.ByteProvider = new DynamicByteProvider(new byte[0]); hexBoxOut.Visible = false; } else { hexBoxOut.ByteProvider = new DynamicByteProvider(outputBuffer); hexBoxOut.Visible = true; } } else { hexBoxOut.ByteProvider = new DynamicByteProvider(new byte[0]); hexBoxOut.Visible = false; txtResultStatus.Text = ""; MessageBox.Show("Making hypercall failed!"); } } catch (Exception exc) { MessageBox.Show(exc.Message); } }
private void button1_Click(object sender, EventArgs e) { uint callnr = UInt32.Parse(txtCallnr.Text); uint count = UInt32.Parse(txtCount.Text); uint start = UInt32.Parse(txtStart.Text); long inputInt = HypercallConversions.hypercallInput(callnr, optFast.Checked, count, start); byte[] inputBuffer = new byte[hexBoxIn.ByteProvider.Length]; for (int x = 0; x < inputBuffer.Length; x++) { inputBuffer[x] = hexBoxIn.ByteProvider.ReadByte(x); } HV_MUTATION_CONF conf; conf.target = 0; conf.dbgMsg = (byte)(chkFuzzDbg.Checked ? 1 : 0); conf.type = getFuzzType(); conf.seed = UInt32.Parse(txtFuzzSeed.Text); conf.minChanges = UInt32.Parse(txtFuzzMin.Text); conf.maxChanges = UInt32.Parse(txtFuzzMax.Text); conf.maxLength = (uint)inputBuffer.Length; conf.count = getFuzzCount((uint)inputBuffer.Length); if (optFast.Checked && inputBuffer.Length != 0x10) { MessageBox.Show("Fast hypercall input has to be 16 bytes (two 8 byte registers"); return; } if (DriverIO.hypercallFuzz(inputInt, inputBuffer, (uint)inputBuffer.Length, conf)) { MessageBox.Show("DONE"); } else { MessageBox.Show("FAILED"); } }