encode/decode working
* on most occasions, that is * improved app layout * added some "metrics"
This commit is contained in:
parent
a35afc3aa1
commit
9491e4bb25
|
@ -12,6 +12,21 @@
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
|
<PublishUrl>publish\</PublishUrl>
|
||||||
|
<Install>true</Install>
|
||||||
|
<InstallFrom>Disk</InstallFrom>
|
||||||
|
<UpdateEnabled>false</UpdateEnabled>
|
||||||
|
<UpdateMode>Foreground</UpdateMode>
|
||||||
|
<UpdateInterval>7</UpdateInterval>
|
||||||
|
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||||
|
<UpdatePeriodically>false</UpdatePeriodically>
|
||||||
|
<UpdateRequired>false</UpdateRequired>
|
||||||
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
@ -22,6 +37,8 @@
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
@ -32,6 +49,9 @@
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<StartupObject />
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
@ -79,5 +99,17 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
|
||||||
|
<Install>true</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||||
|
<Install>false</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
|
@ -51,6 +51,8 @@
|
||||||
this.label7 = new System.Windows.Forms.Label();
|
this.label7 = new System.Windows.Forms.Label();
|
||||||
this.textBox6capacity = new System.Windows.Forms.TextBox();
|
this.textBox6capacity = new System.Windows.Forms.TextBox();
|
||||||
this.label8 = new System.Windows.Forms.Label();
|
this.label8 = new System.Windows.Forms.Label();
|
||||||
|
this.textBoxsizemode = new System.Windows.Forms.TextBox();
|
||||||
|
this.label9 = new System.Windows.Forms.Label();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
|
@ -73,7 +75,7 @@
|
||||||
this.textBox1putm.Multiline = true;
|
this.textBox1putm.Multiline = true;
|
||||||
this.textBox1putm.Name = "textBox1putm";
|
this.textBox1putm.Name = "textBox1putm";
|
||||||
this.textBox1putm.Size = new System.Drawing.Size(342, 66);
|
this.textBox1putm.Size = new System.Drawing.Size(342, 66);
|
||||||
this.textBox1putm.TabIndex = 1;
|
this.textBox1putm.TabIndex = 3;
|
||||||
//
|
//
|
||||||
// label2
|
// label2
|
||||||
//
|
//
|
||||||
|
@ -89,15 +91,17 @@
|
||||||
this.textBox2getm.Location = new System.Drawing.Point(22, 226);
|
this.textBox2getm.Location = new System.Drawing.Point(22, 226);
|
||||||
this.textBox2getm.Multiline = true;
|
this.textBox2getm.Multiline = true;
|
||||||
this.textBox2getm.Name = "textBox2getm";
|
this.textBox2getm.Name = "textBox2getm";
|
||||||
|
this.textBox2getm.ReadOnly = true;
|
||||||
this.textBox2getm.Size = new System.Drawing.Size(342, 59);
|
this.textBox2getm.Size = new System.Drawing.Size(342, 59);
|
||||||
this.textBox2getm.TabIndex = 3;
|
this.textBox2getm.TabIndex = 3;
|
||||||
|
this.textBox2getm.TabStop = false;
|
||||||
//
|
//
|
||||||
// button1
|
// button1
|
||||||
//
|
//
|
||||||
this.button1.Location = new System.Drawing.Point(22, 166);
|
this.button1.Location = new System.Drawing.Point(22, 166);
|
||||||
this.button1.Name = "button1";
|
this.button1.Name = "button1";
|
||||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||||
this.button1.TabIndex = 5;
|
this.button1.TabIndex = 4;
|
||||||
this.button1.Text = "put";
|
this.button1.Text = "put";
|
||||||
this.button1.UseVisualStyleBackColor = true;
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
@ -107,7 +111,7 @@
|
||||||
this.button2.Location = new System.Drawing.Point(22, 291);
|
this.button2.Location = new System.Drawing.Point(22, 291);
|
||||||
this.button2.Name = "button2";
|
this.button2.Name = "button2";
|
||||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||||
this.button2.TabIndex = 6;
|
this.button2.TabIndex = 5;
|
||||||
this.button2.Text = "get";
|
this.button2.Text = "get";
|
||||||
this.button2.UseVisualStyleBackColor = true;
|
this.button2.UseVisualStyleBackColor = true;
|
||||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||||
|
@ -152,7 +156,7 @@
|
||||||
this.button3.Location = new System.Drawing.Point(196, 472);
|
this.button3.Location = new System.Drawing.Point(196, 472);
|
||||||
this.button3.Name = "button3";
|
this.button3.Name = "button3";
|
||||||
this.button3.Size = new System.Drawing.Size(75, 23);
|
this.button3.Size = new System.Drawing.Size(75, 23);
|
||||||
this.button3.TabIndex = 12;
|
this.button3.TabIndex = 6;
|
||||||
this.button3.Text = "export";
|
this.button3.Text = "export";
|
||||||
this.button3.UseVisualStyleBackColor = true;
|
this.button3.UseVisualStyleBackColor = true;
|
||||||
this.button3.Click += new System.EventHandler(this.button3_Click);
|
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||||
|
@ -162,7 +166,7 @@
|
||||||
this.button4.Location = new System.Drawing.Point(196, 443);
|
this.button4.Location = new System.Drawing.Point(196, 443);
|
||||||
this.button4.Name = "button4";
|
this.button4.Name = "button4";
|
||||||
this.button4.Size = new System.Drawing.Size(75, 23);
|
this.button4.Size = new System.Drawing.Size(75, 23);
|
||||||
this.button4.TabIndex = 13;
|
this.button4.TabIndex = 1;
|
||||||
this.button4.Text = "import";
|
this.button4.Text = "import";
|
||||||
this.button4.UseVisualStyleBackColor = true;
|
this.button4.UseVisualStyleBackColor = true;
|
||||||
this.button4.Click += new System.EventHandler(this.button4_Click);
|
this.button4.Click += new System.EventHandler(this.button4_Click);
|
||||||
|
@ -172,7 +176,7 @@
|
||||||
this.button5.Location = new System.Drawing.Point(289, 443);
|
this.button5.Location = new System.Drawing.Point(289, 443);
|
||||||
this.button5.Name = "button5";
|
this.button5.Name = "button5";
|
||||||
this.button5.Size = new System.Drawing.Size(75, 23);
|
this.button5.Size = new System.Drawing.Size(75, 23);
|
||||||
this.button5.TabIndex = 14;
|
this.button5.TabIndex = 2;
|
||||||
this.button5.Text = "use default";
|
this.button5.Text = "use default";
|
||||||
this.button5.UseVisualStyleBackColor = true;
|
this.button5.UseVisualStyleBackColor = true;
|
||||||
this.button5.Click += new System.EventHandler(this.button5_Click);
|
this.button5.Click += new System.EventHandler(this.button5_Click);
|
||||||
|
@ -256,11 +260,30 @@
|
||||||
this.label8.TabIndex = 23;
|
this.label8.TabIndex = 23;
|
||||||
this.label8.Text = "bytes";
|
this.label8.Text = "bytes";
|
||||||
//
|
//
|
||||||
|
// textBoxsizemode
|
||||||
|
//
|
||||||
|
this.textBoxsizemode.Location = new System.Drawing.Point(594, 535);
|
||||||
|
this.textBoxsizemode.Name = "textBoxsizemode";
|
||||||
|
this.textBoxsizemode.ReadOnly = true;
|
||||||
|
this.textBoxsizemode.Size = new System.Drawing.Size(76, 20);
|
||||||
|
this.textBoxsizemode.TabIndex = 25;
|
||||||
|
//
|
||||||
|
// label9
|
||||||
|
//
|
||||||
|
this.label9.AutoSize = true;
|
||||||
|
this.label9.Location = new System.Drawing.Point(534, 538);
|
||||||
|
this.label9.Name = "label9";
|
||||||
|
this.label9.Size = new System.Drawing.Size(54, 13);
|
||||||
|
this.label9.TabIndex = 26;
|
||||||
|
this.label9.Text = "size mode";
|
||||||
|
//
|
||||||
// main_form
|
// main_form
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(1041, 584);
|
this.ClientSize = new System.Drawing.Size(1041, 584);
|
||||||
|
this.Controls.Add(this.label9);
|
||||||
|
this.Controls.Add(this.textBoxsizemode);
|
||||||
this.Controls.Add(this.label8);
|
this.Controls.Add(this.label8);
|
||||||
this.Controls.Add(this.textBox6capacity);
|
this.Controls.Add(this.textBox6capacity);
|
||||||
this.Controls.Add(this.label7);
|
this.Controls.Add(this.label7);
|
||||||
|
@ -283,6 +306,7 @@
|
||||||
this.Controls.Add(this.label2);
|
this.Controls.Add(this.label2);
|
||||||
this.Controls.Add(this.textBox1putm);
|
this.Controls.Add(this.textBox1putm);
|
||||||
this.Controls.Add(this.label1);
|
this.Controls.Add(this.label1);
|
||||||
|
this.Cursor = System.Windows.Forms.Cursors.Default;
|
||||||
this.DoubleBuffered = true;
|
this.DoubleBuffered = true;
|
||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||||
this.Name = "main_form";
|
this.Name = "main_form";
|
||||||
|
@ -320,6 +344,8 @@
|
||||||
private System.Windows.Forms.Label label7;
|
private System.Windows.Forms.Label label7;
|
||||||
private System.Windows.Forms.TextBox textBox6capacity;
|
private System.Windows.Forms.TextBox textBox6capacity;
|
||||||
private System.Windows.Forms.Label label8;
|
private System.Windows.Forms.Label label8;
|
||||||
|
private System.Windows.Forms.TextBox textBoxsizemode;
|
||||||
|
private System.Windows.Forms.Label label9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
179
main_form.cs
179
main_form.cs
|
@ -25,18 +25,12 @@ namespace KRY_0x02
|
||||||
public static int cap = 0;
|
public static int cap = 0;
|
||||||
public string path = "";
|
public string path = "";
|
||||||
|
|
||||||
public string getpath(TextBox t)
|
|
||||||
{
|
|
||||||
string path = t.Text;
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int get_capacity(int a, int b)
|
public int get_capacity(int a, int b)
|
||||||
{
|
{
|
||||||
int c = 0;
|
int c = 0;
|
||||||
a = im_h;
|
a = im_h;
|
||||||
b = im_w;
|
b = im_w;
|
||||||
c = ((a * b) / 8) - 8;
|
c = ((a * b) / 8) - 1;
|
||||||
cap = c;
|
cap = c;
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
@ -44,64 +38,143 @@ namespace KRY_0x02
|
||||||
|
|
||||||
class do_a_stego
|
class do_a_stego
|
||||||
{
|
{
|
||||||
Bitmap my_bitmap;// = new Bitmap(getpath(textBox1));
|
protected Bitmap my_bitmap;
|
||||||
Color pixel;
|
Color pixel;
|
||||||
|
private readonly BackgroundWorker _bw = new BackgroundWorker();
|
||||||
|
|
||||||
byte bit_array_to_byte(BitArray bit_array)
|
byte bit_array_to_byte(BitArray bit_array)
|
||||||
{
|
{
|
||||||
byte[] byte_array = new byte[1];
|
byte[] byte_array = new byte[1];
|
||||||
//if (bit_array.Count == cap)
|
bit_array.CopyTo(byte_array, 0);
|
||||||
if (bit_array.Count == 8)
|
return byte_array[0];
|
||||||
|
}
|
||||||
|
public byte[] str_to_rev_binarray(string input)
|
||||||
|
{
|
||||||
|
byte[] bA = Encoding.ASCII.GetBytes(input);
|
||||||
|
byte[] bAA = new byte[bA.Length * 8];
|
||||||
|
BitArray b_a = new BitArray(bA);
|
||||||
|
for (int i = 0; i < b_a.Length; i++)
|
||||||
|
{
|
||||||
|
if (b_a[i] == false)
|
||||||
{
|
{
|
||||||
bit_array.CopyTo(byte_array, 0);
|
bAA[i] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bAA[i] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bAA;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Bitmap encode(Bitmap b, string m)
|
||||||
|
{
|
||||||
|
if ((b.Height * b.Width) < 8)
|
||||||
|
{
|
||||||
|
MessageBox.Show("cannot use a pic of this size bro, sorry");
|
||||||
|
return new Bitmap(1, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
byte_array[0] = 0;
|
my_bitmap = b;
|
||||||
MessageBox.Show($"you should have {bit_array.Count} bits for a byte bro", "error happened");
|
string message = m;
|
||||||
}
|
int counter = 0;
|
||||||
return byte_array[0];
|
int counterzero = 0;
|
||||||
}
|
byte[] letters_to_code = str_to_rev_binarray(m);
|
||||||
|
string zero = "00001100";
|
||||||
|
|
||||||
public string encode(Bitmap b, string m)
|
|
||||||
{
|
|
||||||
/* WIP */
|
|
||||||
my_bitmap = b;
|
|
||||||
string message = m;
|
|
||||||
for (int i = 0; i < my_bitmap.Width - 1; i++)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
for (int i = 0; i < my_bitmap.Height - 1; i++)
|
||||||
|
{
|
||||||
|
if (counterzero > 7)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int j = 0; j < my_bitmap.Width - 1; j++)
|
||||||
|
{
|
||||||
|
string blue_str = "";
|
||||||
|
string blue_str_modded = "";
|
||||||
|
int blue_int_modded = 0;
|
||||||
|
if ((counter < (my_bitmap.Height * my_bitmap.Width) - 8) && counter < letters_to_code.Length)
|
||||||
|
{
|
||||||
|
pixel = my_bitmap.GetPixel(j, i);
|
||||||
|
blue_str = Convert.ToString(pixel.B, 2).PadLeft(8, '0');
|
||||||
|
blue_str_modded = blue_str.Substring(0, 7) + Convert.ToString(letters_to_code[counter]);
|
||||||
|
blue_int_modded = Convert.ToInt32(blue_str_modded, 2);
|
||||||
|
Console.WriteLine($"blueSTRmodded {blue_str_modded}");
|
||||||
|
Console.WriteLine($"blueINTmodded {blue_int_modded}");
|
||||||
|
my_bitmap.SetPixel(j, i, Color.FromArgb(pixel.R, pixel.G, blue_int_modded));
|
||||||
|
Console.WriteLine(my_bitmap.GetPixel(i,j));
|
||||||
|
counter++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pixel = my_bitmap.GetPixel(j, i);
|
||||||
|
blue_str = Convert.ToString(pixel.B, 2).PadLeft(8, '0');
|
||||||
|
blue_str_modded = blue_str.Substring(0, 7) + zero[counterzero];
|
||||||
|
blue_int_modded = Convert.ToInt32(blue_str_modded, 2);
|
||||||
|
Console.WriteLine($"0X00 bytes blueSTRmodded {blue_str_modded}");
|
||||||
|
Console.WriteLine($"0X00 bytes blueINTmodded {blue_int_modded}");
|
||||||
|
my_bitmap.SetPixel(j, i, Color.FromArgb(pixel.R, pixel.G, blue_int_modded));
|
||||||
|
counterzero++;
|
||||||
|
|
||||||
|
if (counterzero > 7)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return my_bitmap;
|
||||||
}
|
}
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string gimme(Bitmap b)
|
public string gimme(Bitmap b)
|
||||||
{
|
{
|
||||||
/* WIP */
|
|
||||||
my_bitmap = b;
|
my_bitmap = b;
|
||||||
bool[] my_bool_array = new bool[8];
|
string output = "";
|
||||||
|
bool[] my_bool_array = new bool[(cap * 8) + 8];
|
||||||
|
|
||||||
int int_value;
|
int int_value;
|
||||||
|
int counter = 0;
|
||||||
|
|
||||||
int ii = my_bool_array.Length - 1;
|
for (int i = 0; i <= b.Height - 1; i++)
|
||||||
|
|
||||||
for (int i = 0; i < my_bitmap.Width - 1; i++)
|
|
||||||
{
|
{
|
||||||
pixel = my_bitmap.GetPixel(i, 0);
|
for (int j = 0; j <= b.Width - 1; j++)
|
||||||
int_value = pixel.B;
|
{
|
||||||
|
pixel = b.GetPixel(j, i);
|
||||||
|
int_value = pixel.B;
|
||||||
|
|
||||||
if ((int_value & 1) == 0)
|
if ((int_value & 1) == 0)
|
||||||
{
|
{
|
||||||
my_bool_array[i] = false;
|
my_bool_array[counter] = false;
|
||||||
}
|
}
|
||||||
else if ((int_value & 1) == 1)
|
else if ((int_value & 1) == 1)
|
||||||
{
|
{
|
||||||
my_bool_array[i] = true;
|
my_bool_array[counter] = true;
|
||||||
|
}
|
||||||
|
counter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BitArray my_bit_array = new BitArray(my_bool_array);
|
for (int i = 0; i < my_bool_array.Length / 8; i++)
|
||||||
char my_char = Convert.ToChar(Convert.ToInt32(bit_array_to_byte(my_bit_array)));
|
{
|
||||||
return Convert.ToString(my_char);
|
BitArray my_bit_array = new BitArray(my_bool_array.Skip(i * 8).Take(8).ToArray());
|
||||||
|
Console.WriteLine(bit_array_to_byte(my_bit_array));
|
||||||
|
char my_char = Convert.ToChar(Convert.ToInt32(bit_array_to_byte(my_bit_array)));
|
||||||
|
Console.WriteLine(my_char);
|
||||||
|
output += Convert.ToString(my_char);
|
||||||
|
}
|
||||||
|
// _bw.DoWork += do_magic;
|
||||||
|
//mm.progressBar1.Maximum = my_bitmap.Height * my_bitmap.Width;
|
||||||
|
//mm.progressBar1.Show();
|
||||||
|
//_bw.RunWorkerAsync();
|
||||||
|
//if (main_output != "")
|
||||||
|
//{
|
||||||
|
// output = main_output;
|
||||||
|
//}
|
||||||
|
return output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +190,8 @@ namespace KRY_0x02
|
||||||
do_a_stego do_A_Stego = new do_a_stego();
|
do_a_stego do_A_Stego = new do_a_stego();
|
||||||
Bitmap b = new Bitmap(pictureBox1.Image);
|
Bitmap b = new Bitmap(pictureBox1.Image);
|
||||||
string m = textBox1putm.Text;
|
string m = textBox1putm.Text;
|
||||||
do_A_Stego.encode(b, m);
|
pictureBox1.Image = do_A_Stego.encode(b, m);
|
||||||
|
MessageBox.Show("success!");
|
||||||
}
|
}
|
||||||
private void button2_Click(object sender, EventArgs e)
|
private void button2_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -143,17 +217,23 @@ namespace KRY_0x02
|
||||||
using (OpenFileDialog dlg = new OpenFileDialog())
|
using (OpenFileDialog dlg = new OpenFileDialog())
|
||||||
{
|
{
|
||||||
dlg.Title = "pick a pic";
|
dlg.Title = "pick a pic";
|
||||||
dlg.Filter = "png (*.png)|*.png|bmp (*.bmp)|*.bmp|tiff (*.tiff)|*.tiff|custom (*.*)|*.*";
|
dlg.Filter = "custom (*.*)|*.*|png (*.png)|*.png|bmp (*.bmp)|*.bmp|tiff (*.tiff)|*.tiff";
|
||||||
|
|
||||||
if (dlg.ShowDialog() == DialogResult.OK)
|
if (dlg.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
label5pathtopic.Text = @"path/to/pic";
|
label5pathtopic.Text = @"path/to/pic";
|
||||||
pictureBox1.Image = new Bitmap(dlg.FileName);
|
pictureBox1.Image = new Bitmap(dlg.FileName);
|
||||||
pictureBox1.SizeMode = PictureBoxSizeMode.Normal;
|
pictureBox1.SizeMode = PictureBoxSizeMode.Normal;
|
||||||
|
textBoxsizemode.Text = "norm";
|
||||||
textBox3.Text = dlg.FileName;
|
textBox3.Text = dlg.FileName;
|
||||||
path = textBox3.Text;
|
path = textBox3.Text;
|
||||||
im_h = pictureBox1.Image.Height;
|
im_h = pictureBox1.Image.Height;
|
||||||
im_w = pictureBox1.Image.Width;
|
im_w = pictureBox1.Image.Width;
|
||||||
|
if (im_h < 100 || im_w < 100)
|
||||||
|
{
|
||||||
|
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
|
||||||
|
textBoxsizemode.Text = "zoom";
|
||||||
|
}
|
||||||
textBox4height.Text = im_h.ToString();
|
textBox4height.Text = im_h.ToString();
|
||||||
textBox5width.Text = im_w.ToString();
|
textBox5width.Text = im_w.ToString();
|
||||||
textBox6capacity.Text = get_capacity(im_h,im_w).ToString();
|
textBox6capacity.Text = get_capacity(im_h,im_w).ToString();
|
||||||
|
@ -166,7 +246,8 @@ namespace KRY_0x02
|
||||||
/*/* use-default-pic button */
|
/*/* use-default-pic button */
|
||||||
string filename = @"C:\Users\citizen\source\repos\KRY-0x02\security.png";
|
string filename = @"C:\Users\citizen\source\repos\KRY-0x02\security.png";
|
||||||
pictureBox1.Image = new Bitmap(filename);
|
pictureBox1.Image = new Bitmap(filename);
|
||||||
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
|
pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
|
||||||
|
textBoxsizemode.Text = "auto";
|
||||||
label5pathtopic.Text = $"Security: Actual actual reality: nobody cares about his secrets."
|
label5pathtopic.Text = $"Security: Actual actual reality: nobody cares about his secrets."
|
||||||
+ " (Also, I would be hard-pressed to find that wrench for $5.)";
|
+ " (Also, I would be hard-pressed to find that wrench for $5.)";
|
||||||
textBox3.Text = filename + "\t\t by randall ... https://xkcd.com/538";
|
textBox3.Text = filename + "\t\t by randall ... https://xkcd.com/538";
|
||||||
|
@ -175,12 +256,12 @@ namespace KRY_0x02
|
||||||
im_w = pictureBox1.Image.Width;
|
im_w = pictureBox1.Image.Width;
|
||||||
textBox4height.Text = im_h.ToString();
|
textBox4height.Text = im_h.ToString();
|
||||||
textBox5width.Text = im_w.ToString();
|
textBox5width.Text = im_w.ToString();
|
||||||
textBox6capacity.Text = Convert.ToString(get_capacity(im_h, im_w));
|
textBox6capacity.Text = get_capacity(im_h, im_w).ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void button6_Click(object sender, EventArgs e)
|
private void button6_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
/* clear pic selection */
|
/*/**//**///* clear pic selection */
|
||||||
label5pathtopic.Text = @"path/to/pic";
|
label5pathtopic.Text = @"path/to/pic";
|
||||||
pictureBox1.Image = null;
|
pictureBox1.Image = null;
|
||||||
textBox3.Text = "";
|
textBox3.Text = "";
|
||||||
|
@ -188,12 +269,15 @@ namespace KRY_0x02
|
||||||
textBox4height.Text = "";
|
textBox4height.Text = "";
|
||||||
textBox5width.Text = "";
|
textBox5width.Text = "";
|
||||||
textBox6capacity.Text = "";
|
textBox6capacity.Text = "";
|
||||||
|
textBoxsizemode.Text = "";
|
||||||
im_h = 0;
|
im_h = 0;
|
||||||
im_w = 0;
|
im_w = 0;
|
||||||
|
cap = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void button3_Click(object sender, EventArgs e)
|
private void button3_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
/* save file */
|
||||||
if (pictureBox1.Image == null)
|
if (pictureBox1.Image == null)
|
||||||
{
|
{
|
||||||
MessageBox.Show("you've nothing to export, boi");
|
MessageBox.Show("you've nothing to export, boi");
|
||||||
|
@ -201,7 +285,7 @@ namespace KRY_0x02
|
||||||
}
|
}
|
||||||
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
|
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
|
||||||
saveFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
|
saveFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
|
||||||
saveFileDialog1.Title = "export your neatly stego-ed pic";
|
saveFileDialog1.Title = "export your neatly stego-ed pic";
|
||||||
saveFileDialog1.CheckFileExists = false;
|
saveFileDialog1.CheckFileExists = false;
|
||||||
saveFileDialog1.CheckPathExists = false;
|
saveFileDialog1.CheckPathExists = false;
|
||||||
saveFileDialog1.DefaultExt = "";
|
saveFileDialog1.DefaultExt = "";
|
||||||
|
@ -210,7 +294,6 @@ namespace KRY_0x02
|
||||||
saveFileDialog1.RestoreDirectory = true;
|
saveFileDialog1.RestoreDirectory = true;
|
||||||
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
|
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
// Get file name.
|
|
||||||
string name = saveFileDialog1.FileName;
|
string name = saveFileDialog1.FileName;
|
||||||
pictureBox1.Image.Save($"{name}",ImageFormat.MemoryBmp);
|
pictureBox1.Image.Save($"{name}",ImageFormat.MemoryBmp);
|
||||||
MessageBox.Show($"saved to {name}","gj, file saved!");
|
MessageBox.Show($"saved to {name}","gj, file saved!");
|
||||||
|
|
Loading…
Reference in New Issue