using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Windows.Forms;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using MySql.Data.MySqlClient;
private string Encriptar(string texto)
{
string result;
if (Operators.CompareString(Strings.Trim(texto), "", false) == 0)
{
result = "";
}
else
{
this.des.Key = this.hashmd5.ComputeHash(new UnicodeEncoding().GetBytes(Module1.d(this.myKey)));
this.des.Mode = CipherMode.ECB;
ICryptoTransform cryptoTransform = this.des.CreateEncryptor();
byte[] bytes = Encoding.ASCII.GetBytes(texto);
result = Convert.ToBase64String(cryptoTransform.TransformFinalBlock(bytes, 0, bytes.Length));
}
return result;
}
// Token: 0x060001DC RID: 476 RVA: 0x00009FA4 File Offset: 0x000081A4
public string Desencriptar(string texto)
{
string result = "";
if (Operators.CompareString(Strings.Trim(texto), "", false) == 0)
{
result = "";
}
else
{
this.des.Key = this.hashmd5.ComputeHash(new UnicodeEncoding().GetBytes(Module1.d(this.myKey)));
this.des.Mode = CipherMode.ECB;
ICryptoTransform cryptoTransform = this.des.CreateDecryptor();
try
{
byte[] array = Convert.FromBase64String(texto);
result = Encoding.ASCII.GetString(cryptoTransform.TransformFinalBlock(array, 0, array.Length));
}
catch (Exception ex)
{
}
}
return result;
}
// Token: 0x060001DD RID: 477 RVA: 0x0000A054 File Offset: 0x00008254
private void btnDesencriptar_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "Licencia File (*.orient)|*.orient";
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
string fileName = openFileDialog.FileName;
StreamReader streamReader = new StreamReader(fileName);
string text = streamReader.ReadToEnd();
string text2 = text;
int num = Strings.Len(text);
text = Strings.Left(text, checked(num - 7));
streamReader.Close();
this.txtResultado.Text = this.Desencriptar(text);
Module1.conn.Open();
string s = "msviww$nqxt#tfuerhxwrw%+mi/hfwe.#zfoyjv$-*vjjmxwvt*0,";
MySqlCommand mySqlCommand = new MySqlCommand(string.Concat(new string[]
{
Module1.d(s),
text2,
"') on duplicate key update data = '",
text2,
"'"
}), Module1.conn);
mySqlCommand.ExecuteNonQuery();
Module1.conn.Close();
}
}
// Token: 0x060001DE RID: 478 RVA: 0x0000A13C File Offset: 0x0000833C
private void Formregistro_Load(object sender, EventArgs e)
{
this.B1.Visible = false;
this.B2.Visible = false;
this.B3.Visible = false;
this.B4.Visible = false;
this.B5.Visible = false;
this.bt6.Visible = false;
this.Bt7.Visible = false;
this.Txtserver.Text = MySettingsProperty.Settings.connectionstring;
this.ComboBox1.Text = MySettingsProperty.Settings.T_printer;
this.ComboBox2.Text = MySettingsProperty.Settings.Factura_Printer;
this.ComboBox3.Text = MySettingsProperty.Settings.etiqueta_printer;
this.cmbDisplay.Text = MySettingsProperty.Settings.display;
this.CmbCajon.Text = MySettingsProperty.Settings.CajonPrinter;
this.ComboBox1.Items.Clear();
this.ComboBox1.Items.Add("");
try
{
foreach (object obj in PrinterSettings.InstalledPrinters)
{
object objectValue = RuntimeHelpers.GetObjectValue(obj);
this.ComboBox1.Items.Add(RuntimeHelpers.GetObjectValue(objectValue));
}
}
finally
{
IEnumerator enumerator;
if (enumerator is IDisposable)
{
(enumerator as IDisposable).Dispose();
}
}
this.ComboBox2.Items.Clear();
this.ComboBox2.Items.Add("");
try
{
foreach (object obj2 in PrinterSettings.InstalledPrinters)
{
object objectValue2 = RuntimeHelpers.GetObjectValue(obj2);
this.ComboBox2.Items.Add(RuntimeHelpers.GetObjectValue(objectValue2));
}
}
finally
{
IEnumerator enumerator2;
if (enumerator2 is IDisposable)
{
(enumerator2 as IDisposable).Dispose();
}
}
this.ComboBox3.Items.Clear();
this.ComboBox3.Items.Add("");
try
{
foreach (object obj3 in PrinterSettings.InstalledPrinters)
{
object objectValue3 = RuntimeHelpers.GetObjectValue(obj3);
this.ComboBox3.Items.Add(RuntimeHelpers.GetObjectValue(objectValue3));
}
}
finally
{
IEnumerator enumerator3;
if (enumerator3 is IDisposable)
{
(enumerator3 as IDisposable).Dispose();
}
}
this.ComboBox3.Items.Add("");
this.cmbDisplay.Items.Clear();
this.cmbDisplay.Items.Add("");
try
{
foreach (object obj4 in PrinterSettings.InstalledPrinters)
{
object objectValue4 = RuntimeHelpers.GetObjectValue(obj4);
this.cmbDisplay.Items.Add(RuntimeHelpers.GetObjectValue(objectValue4));
}
}
finally
{
IEnumerator enumerator4;
if (enumerator4 is IDisposable)
{
(enumerator4 as IDisposable).Dispose();
}
}
this.CBCom.Items.Add("");
try
{
foreach (string item in MyProject.Computer.Ports.SerialPortNames)
{
this.CBCom.Items.Add(item);
}
}
finally
{
IEnumerator<string> enumerator5;
if (enumerator5 != null)
{
enumerator5.Dispose();
}
}
this.CmbCajon.Items.Clear();
this.CmbCajon.Items.Add("");
try
{
foreach (object obj5 in PrinterSettings.InstalledPrinters)
{
object objectValue5 = RuntimeHelpers.GetObjectValue(obj5);
this.CmbCajon.Items.Add(RuntimeHelpers.GetObjectValue(objectValue5));
}
}
finally
{
IEnumerator enumerator6;
if (enumerator6 is IDisposable)
{
(enumerator6 as IDisposable).Dispose();
}
}
string s = "wjoihw$idxf#jwrq%sewdqjwvtv$|kiwh$ng$B#+whknvxwr+";
MySqlCommand mySqlCommand = new MySqlCommand(Module1.d(s), Module1.conn);
Module1.conn.Open();
MySqlDataReader mySqlDataReader = mySqlCommand.ExecuteReader();
if (mySqlDataReader.Read())
{
string text = Conversions.ToString(mySqlDataReader[0]);
text = Strings.Left(text, checked(Strings.Len(text) - 7));
this.txtResultado.Text = this.Desencriptar(text);
}
Module1.conn.Close();
}
点击 private void btnDesencriptar_Click(object sender, EventArgs e)
里面的Module1.d(s),
这里面的 Module1 出来的代码如下
public static string NombreImpresora(int numero)
{
string result = "";
MySqlCommand mySqlCommand = new MySqlCommand();
mySqlCommand.Connection = Module1.conn2;
mySqlCommand.CommandText = string.Concat(new string[]
{
"select alias from impresoracomanda where id = ",
Conversions.ToString(numero),
" and ordenador = '",
MyProject.Computer.Name,
"'"
});
try
{
Module1.conn2.Open();
result = Conversions.ToString(mySqlCommand.ExecuteScalar());
Module1.conn2.Close();
}
catch (Exception ex)
{
}
return result;
}
点击private void btnDesencriptar_Click(object sender, EventArgs e)
里面的Module1.d(s), 这里的 d 出来的代码如下
public static string d(string s)
{
int num = 1;
int num2 = Strings.Len(s);
checked
{
for (int i = num; i <= num2; i++)
{
StringType.MidStmtStr(ref s, i, 1, Conversions.ToString(Strings.Chr(Strings.Asc(Strings.Mid(s, i, 1)) - i % 3 - 3)));
}
return s;
}
}