-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First working version of the netcrypt sample.
- Loading branch information
Yvan Janssens
committed
Oct 15, 2013
1 parent
2524b1c
commit 81f6ae1
Showing
28 changed files
with
850 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
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.Diagnostics; | ||
using System.IO; | ||
using Netcrypt; | ||
|
||
namespace SimplePacker | ||
{ | ||
public partial class Form1 : Form | ||
{ | ||
public Form1() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void twitterLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) | ||
{ | ||
Process.Start("http://bit.ly/168dEqY"); | ||
} | ||
|
||
private void sourceCodeLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) | ||
{ | ||
Process.Start("http://bit.ly/1gIe8pZ"); | ||
} | ||
|
||
private void packExecButton_Click(object sender, EventArgs e) | ||
{ | ||
if (inputFileLocationLabel.Text == "(choose)") | ||
{ | ||
MessageBox.Show("Please choose an input file first."); | ||
return; | ||
} | ||
|
||
if (outputFileLocationLabel.Text == "(choose)") | ||
{ | ||
MessageBox.Show("Please choose an output file first."); | ||
return; | ||
} | ||
|
||
try | ||
{ | ||
File.WriteAllBytes(outputFileLocationLabel.Text, Packer.Pack(File.ReadAllBytes(inputFileLocationLabel.Text))); | ||
MessageBox.Show("Packing completed succesfully.\n\nCross your fingers and try to execute the output file..."); | ||
} | ||
catch (Exception ex) | ||
{ | ||
MessageBox.Show("An error has occured while packing the executable.\nPlease note:\n* Only .NET executables will work\n* This is a proof-of-concept packer, designed as a learning aid for .NET developers. It might just not work on your executable.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); | ||
} | ||
} | ||
|
||
private void chooseInputButton_Click(object sender, EventArgs e) | ||
{ | ||
if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) | ||
{ | ||
inputFileLocationLabel.Text = openFileDialog.FileName; | ||
} | ||
} | ||
|
||
private void chooseOutputButton_Click(object sender, EventArgs e) | ||
{ | ||
if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) | ||
{ | ||
outputFileLocationLabel.Text = saveFileDialog.FileName; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.