V1.0.5 - Faster RWD cypher, checksum update, OBD2

This commit is contained in:
Bouletmarc 2022-04-21 01:32:03 -04:00 committed by GitHub
parent b5de0fe437
commit c1f4243029
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 11441 additions and 126 deletions

22
ClassDecryptString.cs Normal file
View File

@ -0,0 +1,22 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Token: 0x020001FD RID: 509
internal class ClassDecryptString
{
// Token: 0x0600163F RID: 5695 RVA: 0x0016A828 File Offset: 0x00168A28
internal static uint DecryptThisString(string string_0)
{
uint num = 0;
if (string_0 != null)
{
num = 2166136261U;
for (int i = 0; i < string_0.Length; i++)
{
num = ((uint)string_0[i] ^ num) * 16777619U;
}
}
return num;
}
}

20
ClassListView.cs Normal file
View File

@ -0,0 +1,20 @@
using System;
using System.Windows.Forms;
internal class ClassListView : ListView
{
public ClassListView()
{
base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
base.SetStyle(ControlStyles.EnableNotifyMessage, true);
}
protected virtual void OnNotifyMessage(Message m)
{
if (m.Msg != 20)
{
base.OnNotifyMessage(m);
}
}
}

View File

@ -22,6 +22,7 @@ static class Class_RWD
private static byte[] DecodersBytes = new byte[] { }; //Used to decode rwd to bin
private static byte[] EncodersBytes = new byte[] { }; //Used to encode bin to rwd
private static byte[] RWD_encrypted_StartFile = new byte[] { }; //Used to encode bin to rwd
public static byte BootloaderSum = 0;
private static GForm_Main GForm_Main_0;
@ -54,7 +55,7 @@ static class Class_RWD
return k1;
}
private static UInt16 checksum_by_sum(byte[] fw, uint start, uint end)
public static UInt16 checksum_by_sum(byte[] fw, uint start, uint end)
{
int s = 0;
uint valuescount = (end - start) / 2;
@ -105,6 +106,8 @@ static class Class_RWD
//Fix Checksums
//TODO HERE #######################################
//UInt16 thisnn = Class_RWD.checksum_by_sum(dataEncrypted, (uint)RWD_encrypted_StartFile.Length, (uint)dataEncrypted.Length);
//Console.WriteLine(thisnn.ToString("X4"));
//Save Encrypted rwd firmware
string ThisPath = Path.GetDirectoryName(f_name) + @"\" + Path.GetFileNameWithoutExtension(f_name) + ".rwd";
@ -213,6 +216,7 @@ static class Class_RWD
EmptyCount++;
}
}
//Remove Empty chars
byte[] bufRedo = new byte[16 - EmptyCount];
for (int i2 = 0; i2 < bufRedo.Length; i2++) bufRedo[i2] = buf[i2];
@ -228,12 +232,17 @@ static class Class_RWD
}
//Get CanAddress Infos
CanAddress = "18DA" + headers2[0].ToString("X") + "F1";
CanAddress = "18DA" + headers2[0].ToString("X2") + "F1";
string AdditionnalCanInfos = "";
if (headers2[0] == 0x0e) AdditionnalCanInfos = " (CVT Transmission (maybe?))";
if (headers2[0] == 0x10) AdditionnalCanInfos = " (Manual Transmission)";
if (headers2[0] == 0x11) AdditionnalCanInfos = " (Automatics Transmission)";
if (headers2[0] == 0x30) AdditionnalCanInfos = " (Electric Power Sterring)";
//Print/Log Informations
GForm_Main_0.method_1("Firmware Start: 0x" + start.ToString("X"));
GForm_Main_0.method_1("Firmware Size: 0x" + size.ToString("X"));
GForm_Main_0.method_1("CanAddress: 0x" + CanAddress);
GForm_Main_0.method_1("CanAddress: 0x" + CanAddress + AdditionnalCanInfos);
GForm_Main_0.method_1("Software Keys: 0x" + SoftwareKey);
GForm_Main_0.method_1("Supported Versions (and keys): ");
for (int i = 0; i < SuppportedVersions.Length; i++) GForm_Main_0.method_1(SuppportedVersions[i] + " (0x" + SuppportedFWKeys[i] + ")");
@ -284,6 +293,29 @@ static class Class_RWD
//###################################################################
//###################################################################
foreach (byte[] fc in firmware_candidates)
{
//Checksum location for SH7058 1mb rom file are located at 0x8400, it's a 1byte sum calculated from negative sum of the full binary
//Since we are missing the bootloader section of the full binary we have to remove the section 0x0000 to 0x8000(Start_Address)
//we can calculate what was the 'sum' of the bootloader by subtracting the 'sum' of the decrypted firmware!
if (start == 0x8000) //Only SH7058 1mb file
{
byte num = GetBootloaderSum(fc);
byte num2 = GetNegativeChecksumFWBin(fc);
byte ThisSum = num;
ThisSum -= num2;
byte chk = fc[0x400];
if (chk == ThisSum)
{
GForm_Main_0.method_1("checksums good!");
BootloaderSum = num;
GForm_Main_0.method_1("Bootloader Sum are 0x" + BootloaderSum.ToString("X"));
}
}
}
//###############################################
/*List<byte[]> firmware_good = new List<byte[]>();
idx = 0;
@ -357,6 +389,33 @@ static class Class_RWD
}
}
public static byte GetBootloaderSum(byte[] FWFileBytes)
{
//###############################
//Get Checksum (sum)
byte[] BufferBytes = FWFileBytes;
byte num = BufferBytes[0x400];
byte num2 = GetNegativeChecksumFWBin(BufferBytes);
byte BTSum = num;
BTSum += num2;
return BTSum;
//BootloaderSum = BTSum;
//GForm_Main_0.method_1("Bootloader Sum are 0x" + BootloaderSum.ToString("X"));
}
public static byte GetNegativeChecksumFWBin(byte[] byte_1)
{
byte b = 0;
for (int i = 0; i < byte_1.Length; i++)
{
if (i != 0x400)
{
b -= byte_1[i];
}
}
return b;
}
public static byte[] Push(byte[] bArray, byte[] newBytes)
{
byte[] newArray = new byte[bArray.Length + newBytes.Length];
@ -594,12 +653,10 @@ static class Class_RWD
{
search_value_padded += ThisChar + ".";
}
GForm_Main_0.method_1("Searching:");
//GForm_Main_0.method_1(search_value);
//GForm_Main_0.method_1(search_value_padded);
string search_exact = search_value.ToUpper();
string search_padded = search_value_padded.ToUpper();
GForm_Main_0.method_1("Searching:");
GForm_Main_0.method_1(search_exact);
GForm_Main_0.method_1(search_padded);
@ -614,29 +671,36 @@ static class Class_RWD
"fn:%", //MOD
};
List<string> keys = new List<string> { };
if (_keys.Length != 3)
{
GForm_Main_0.method_1("excatly three keys currently required, cannot perform decryption!");
return new List<byte[]> { };
}
//#####################################################################################################
//This code is for trying all Keys and cypher methods to find the correct decrypting cypher
/*List<string> keys = new List<string> { };
for (int i = 0; i < _keys.Length; i++) {
string k = _keys[i].ToString("x2");
keys.Add(String.Format("val:" + k + ",sym:" + "k{0}", i));
}
if (keys.Count != 3)
{
GForm_Main_0.method_1("excatly three keys currently required, cannot perform decryption!");
return new List<byte[]> { };
//return null;
}
List<byte[]> firmware_candidates_0 = new List<byte[]> { };
string[] key_perms = prnPermut(keys.ToArray());
string[] op_perms = prnPermutALL(operators);
//Console.WriteLine(key_perms.Length);
//Console.WriteLine(op_perms.Length);
string[] op_perms = prnPermutALL(operators);*/
//#####################################################################################################
//BUT the cypher seem to always be: (((i ^ k2) + k1) - k0) & 0xFF so use this code instead for 1000x faster decryption
string KeyPermStr = "";
for (int i = _keys.Length - 1; i >= 0; i--)
{
string k = _keys[i].ToString("x2");
KeyPermStr += String.Format("val:" + k + ",sym:" + "k{0}", i) + "|";
}
string OPPermStr = "fn:^,o1|fn:+,o2|fn:-,o3|";
string[] key_perms = new string[] { KeyPermStr };
string[] op_perms = new string[] { OPPermStr };
//#####################################################################################################
List<string> display_ciphers = new List<string> { };
List<byte[]> firmware_candidates_0 = new List<byte[]> { };
List<byte[]> attempted_decoders = new List<byte[]> { };
int CurrentDone = 0;

View File

@ -38,6 +38,9 @@
<PropertyGroup>
<ApplicationIcon>hnet.com-image.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="DarkUI">
<HintPath>.\DarkUI.dll</HintPath>
@ -58,10 +61,24 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ClassDecryptString.cs" />
<Compile Include="ClassListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Class_ODB.cs" />
<Compile Include="Class_ECUS.cs" />
<Compile Include="Class_Cypher.cs" />
<Compile Include="Class_RWD.cs" />
<Compile Include="frmOBD2Scan.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GClass3.cs" />
<Compile Include="GClass4.cs" />
<Compile Include="GEnum0.cs" />
<Compile Include="GEnum1.cs" />
<Compile Include="GForm_FWChkSum.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GForm_ConvertBIN.cs">
<SubType>Form</SubType>
</Compile>
@ -75,7 +92,17 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="Class_Startup.cs" />
<Compile Include="LineG.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PerfChart.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmOBD2Scan.resx" />
<EmbeddedResource Include="GForm_FWChkSum.resx">
<DependentUpon>GForm_FWChkSum.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GForm_ConvertBIN.resx">
<DependentUpon>GForm_ConvertBIN.cs</DependentUpon>
</EmbeddedResource>
@ -98,6 +125,7 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -116,6 +144,9 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="hnet.com-image.ico" />
<Content Include="OBD2.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

139
GClass3.cs Normal file
View File

@ -0,0 +1,139 @@
using System;
using System.ComponentModel;
using System.Drawing;
[TypeConverter(typeof(ExpandableObjectConverter))]
public class GClass3
{
private GClass4 gclass4_0 = new GClass4();
private GClass4 gclass4_1 = new GClass4();
private GClass4 gclass4_2 = new GClass4();
private GClass4 gclass4_3 = new GClass4();
private Color color_0 = Color.DarkGreen;
private Color color_1 = Color.DarkGreen;
private bool bool_0 = true;
private bool bool_1 = true;
private bool bool_2 = true;
private bool bool_3 = true;
public bool Boolean_0
{
get
{
return this.bool_0;
}
set
{
this.bool_0 = value;
}
}
public bool Boolean_1
{
get
{
return this.bool_1;
}
set
{
this.bool_1 = value;
}
}
public bool Boolean_2
{
get
{
return this.bool_2;
}
set
{
this.bool_2 = value;
}
}
public GClass4 GClass4_0
{
get
{
return this.gclass4_0;
}
set
{
this.gclass4_0 = value;
}
}
public GClass4 GClass4_1
{
get
{
return this.gclass4_1;
}
set
{
this.gclass4_1 = value;
}
}
public GClass4 GClass4_2
{
get
{
return this.gclass4_2;
}
set
{
this.gclass4_2 = value;
}
}
public GClass4 GClass4_3
{
get
{
return this.gclass4_3;
}
set
{
this.gclass4_3 = value;
}
}
public bool Boolean_3
{
get
{
return this.bool_3;
}
set
{
this.bool_3 = value;
}
}
public Color Color_0
{
get
{
return this.color_0;
}
set
{
this.color_0 = value;
}
}
public Color Color_1
{
get
{
return this.color_1;
}
set
{
this.color_1 = value;
}
}
}

56
GClass4.cs Normal file
View File

@ -0,0 +1,56 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
[TypeConverter(typeof(ExpandableObjectConverter))]
public class GClass4
{
private Pen pen_0 = new Pen(Color.Black);
public Color Color_0
{
get
{
return this.pen_0.Color;
}
set
{
this.pen_0.Color = value;
}
}
public DashStyle DashStyle_0
{
get
{
return this.pen_0.DashStyle;
}
set
{
this.pen_0.DashStyle = value;
}
}
public float Single_0
{
get
{
return this.pen_0.Width;
}
set
{
this.pen_0.Width = value;
}
}
[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
public Pen Pen_0
{
get
{
return this.pen_0;
}
}
}

8
GEnum0.cs Normal file
View File

@ -0,0 +1,8 @@
using System;
public enum GEnum0
{
Absolute,
Relative
}

10
GEnum1.cs Normal file
View File

@ -0,0 +1,10 @@
using System;
public enum GEnum1
{
Disabled,
Simple,
SynchronizedAverage,
SynchronizedSum
}

195
GForm_FWChkSum.cs Normal file
View File

@ -0,0 +1,195 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
using DarkUI.Controls;
using DarkUI.Forms;
public class GForm_FWChkSum : DarkForm
{
public GForm_FWChkSum()
{
this.InitializeComponent();
}
public string FileBIN { get; set; }
public string FileRWD { get; set; }
private void method_0(object sender, EventArgs e)
{
this.FileBIN = this.textBox_bin.Text;
this.FileRWD = this.textBox_rwd.Text;
base.Close();
}
private void method_1(object sender, EventArgs e)
{
if (this.FileBIN != "") this.textBox_bin.Text = this.FileBIN;
}
private void method_2(object sender, EventArgs e)
{
base.DialogResult = DialogResult.Abort;
base.Close();
}
protected virtual void Dispose(bool disposing)
{
if (disposing && this.icontainer_0 != null)
{
this.icontainer_0.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.darkButton_0 = new DarkUI.Controls.DarkButton();
this.darkButton_1 = new DarkUI.Controls.DarkButton();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBox_bin = new System.Windows.Forms.TextBox();
this.textBox_rwd = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.SuspendLayout();
//
// darkButton_0
//
this.darkButton_0.Checked = false;
this.darkButton_0.DialogResult = System.Windows.Forms.DialogResult.OK;
this.darkButton_0.Location = new System.Drawing.Point(257, 154);
this.darkButton_0.Name = "darkButton_0";
this.darkButton_0.Size = new System.Drawing.Size(75, 23);
this.darkButton_0.TabIndex = 4;
this.darkButton_0.Text = "Accept";
this.darkButton_0.Click += new System.EventHandler(this.method_0);
//
// darkButton_1
//
this.darkButton_1.Checked = false;
this.darkButton_1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.darkButton_1.Location = new System.Drawing.Point(12, 154);
this.darkButton_1.Name = "darkButton_1";
this.darkButton_1.Size = new System.Drawing.Size(75, 23);
this.darkButton_1.TabIndex = 5;
this.darkButton_1.Text = "Cancel";
this.darkButton_1.Click += new System.EventHandler(this.method_2);
//
// label1
//
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.SystemColors.ControlLight;
this.label1.Location = new System.Drawing.Point(12, 61);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(267, 13);
this.label1.TabIndex = 6;
this.label1.Text = "Select decrypted firmware .bin file (file to fix checksum):";
//
// label2
//
this.label2.AutoSize = true;
this.label2.ForeColor = System.Drawing.SystemColors.ControlLight;
this.label2.Location = new System.Drawing.Point(12, 106);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(171, 13);
this.label2.TabIndex = 7;
this.label2.Text = "Select encrypted firmware .rwd file:";
//
// textBox_bin
//
this.textBox_bin.Location = new System.Drawing.Point(12, 79);
this.textBox_bin.Name = "textBox_bin";
this.textBox_bin.Size = new System.Drawing.Size(320, 20);
this.textBox_bin.TabIndex = 8;
this.textBox_bin.DoubleClick += new System.EventHandler(this.textBox_bin_DoubleClick);
//
// textBox_rwd
//
this.textBox_rwd.Location = new System.Drawing.Point(12, 124);
this.textBox_rwd.Name = "textBox_rwd";
this.textBox_rwd.Size = new System.Drawing.Size(320, 20);
this.textBox_rwd.TabIndex = 9;
this.textBox_rwd.DoubleClick += new System.EventHandler(this.textBox_rwd_DoubleClick);
//
// label3
//
this.label3.AutoSize = true;
this.label3.ForeColor = System.Drawing.SystemColors.ControlLight;
this.label3.Location = new System.Drawing.Point(30, 10);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(285, 39);
this.label3.TabIndex = 10;
this.label3.Text = "To fix a firmware decrypted .bin checksum, you must select\r\nthe .rwd firmware fro" +
"m which it has been decrypted from in\r\norder to apply the correct checksum value" +
"";
this.label3.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// openFileDialog1
//
this.openFileDialog1.Title = "Select File";
//
// GForm_FWChkSum
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(344, 187);
this.ControlBox = false;
this.Controls.Add(this.label3);
this.Controls.Add(this.textBox_rwd);
this.Controls.Add(this.textBox_bin);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.darkButton_1);
this.Controls.Add(this.darkButton_0);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "GForm_FWChkSum";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Fix decrypted firmware .bin checksum";
this.Load += new System.EventHandler(this.method_1);
this.ResumeLayout(false);
this.PerformLayout();
}
[CompilerGenerated]
private IContainer icontainer_0;
private DarkButton darkButton_0;
private Label label1;
private Label label2;
private TextBox textBox_bin;
private TextBox textBox_rwd;
private Label label3;
private OpenFileDialog openFileDialog1;
private DarkButton darkButton_1;
private void textBox_bin_DoubleClick(object sender, EventArgs e)
{
this.openFileDialog1.Filter = "Honda decompressed firmware binary|*.bin";
this.openFileDialog1.DefaultExt = "*.bin";
DialogResult result = this.openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
this.textBox_bin.Text = this.openFileDialog1.FileName;
}
}
private void textBox_rwd_DoubleClick(object sender, EventArgs e)
{
this.openFileDialog1.Filter = "Honda compressed firmware file|*.rwd;*.gz";
this.openFileDialog1.DefaultExt = "*.gz";
DialogResult result = this.openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
this.textBox_rwd.Text = this.openFileDialog1.FileName;
}
}
}

123
GForm_FWChkSum.resx Normal file
View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -24,6 +24,9 @@ public class GForm_Main : DarkForm
bool WritingBinaryMode = true; //if false we are in writing firmware mode
private DarkButton darkButton_FlashFW;
GForm_Main GForm_Main_0;
private DarkGroupBox DarkgroupBox1;
private DarkButton darkButton4;
private DarkButton darkButton5;
private DarkButton darkButton3;
public GForm_Main()
@ -68,6 +71,7 @@ public class GForm_Main : DarkForm
public void method_1(string string_3)
{
//With newline automaticly added
Console.WriteLine(string_3);
GForm_Main.Class5 @class = new GForm_Main.Class5();
@class.gform0_0 = this;
@ -81,9 +85,9 @@ public class GForm_Main : DarkForm
APIInfo[] apilist = APIFactory.GetAPIList();
APIInfo apiinfo = apilist[0];
DarkTextBox darkTextBox = this.darkTextBox_0;
Console.Write(apiinfo.Name + Environment.NewLine);
Console.Write("Filename:" + apiinfo.Filename + Environment.NewLine);
Console.Write(apiinfo.Details + Environment.NewLine);
Console.WriteLine(apiinfo.Name);
Console.WriteLine("Filename:" + apiinfo.Filename);
Console.WriteLine(apiinfo.Details);
darkTextBox.Text = darkTextBox.Text + apiinfo.Name + Environment.NewLine;
darkTextBox.Text = darkTextBox.Text + "Filename:" + apiinfo.Filename + Environment.NewLine;
darkTextBox.Text = darkTextBox.Text + apiinfo.Details + Environment.NewLine;
@ -100,9 +104,7 @@ public class GForm_Main : DarkForm
darkButton1.Enabled = true;
darkButton_4.Enabled = true;
darkButton_0.Enabled = true;
return;
}
this.darkTextBox_0.Text = "Couldn't open device selection form";
}
@ -174,7 +176,7 @@ public class GForm_Main : DarkForm
byte[] bytes = new byte[0x10];
Array.Copy(Received, 8, bytes, 0, 0x10);
this.darkTextBox_1.Text = Encoding.ASCII.GetString(bytes); //Display VIN number
this.method_1("VIN:" + Encoding.ASCII.GetString(bytes) + Environment.NewLine);
this.method_1("VIN:" + Encoding.ASCII.GetString(bytes));
num2 = 1;
}
//#############################################################
@ -192,14 +194,14 @@ public class GForm_Main : DarkForm
byte[] bytes = new byte[0x10];
Array.Copy(Received, 7, bytes, 0, 0x10);
this.darkTextBox_2.Text = Encoding.ASCII.GetString(bytes); //Display CAL_ID Number
this.method_1("ID:" + Encoding.ASCII.GetString(bytes) + Environment.NewLine);
this.method_1("Vehicle is Online" + Environment.NewLine);
this.method_1("ID:" + Encoding.ASCII.GetString(bytes));
this.method_1("Vehicle is Online");
num2 = 2;
}
//#############################################################
if (num2 == 1)
{
this.method_1("Vehicle is in recovery mode?" + Environment.NewLine);
this.method_1("Vehicle is in recovery mode?");
DarkMessageBox.Show(this, "Failed to retrieve vin number, assuming recovery mode, read disabled", "RECOVERY MODE", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
else if (num2 != 2)
@ -277,6 +279,7 @@ public class GForm_Main : DarkForm
return;
}
File.WriteAllBytes(saveFileDialog.FileName, byte_12);
this.method_1("File saved: " + saveFileDialog.FileName);
DarkMessageBox.Show(this, "Successfully Saved File!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
this.darkButton_DownloadROM.Enabled = false;
this.darkButton_Unlock41.Enabled = false;
@ -386,7 +389,7 @@ public class GForm_Main : DarkForm
byte[] Received = SendJ2534Message(channel, arraySend1);
if (Received != null)
{
this.method_1("Diag Mode Set" + Environment.NewLine);
this.method_1("Diag Mode Set");
}
//################################################################
arraySend1 = new byte[]
@ -396,7 +399,7 @@ public class GForm_Main : DarkForm
};
byte SeedSendByte = this.Unlocking_Mode;
arraySend1[1] = SeedSendByte;
this.method_1("Requesting Seed" + Environment.NewLine);
this.method_1("Requesting Seed");
Received = SendJ2534Message(channel, arraySend1);
byte[] byte_ = new byte[]
@ -430,8 +433,8 @@ public class GForm_Main : DarkForm
Array.Reverse(array6);
}
this.method_1("Security Request - Seed Bytes:" + GForm_Main.smethod_1(array6) + Environment.NewLine);
if (!TwoBytesMode) this.method_1("Security Request - Algorithm:" + b.ToString("X2") + Environment.NewLine);
this.method_1("Security Request - Seed Bytes:" + GForm_Main.smethod_1(array6));
if (!TwoBytesMode) this.method_1("Security Request - Algorithm:" + b.ToString("X2"));
break;
}
array6[index] = Received[(index + num) + 2];
@ -447,7 +450,7 @@ public class GForm_Main : DarkForm
else value = Class_Cypher.GetKey01(array6, darkTextBox_2.Text);
byte[] bytes = BitConverter.GetBytes(value);
this.method_1("Security Request - Key to Send:" + GForm_Main.smethod_1(bytes) + Environment.NewLine);
this.method_1("Security Request - Key to Send:" + GForm_Main.smethod_1(bytes));
arraySend1 = new byte[]
{
@ -480,7 +483,7 @@ public class GForm_Main : DarkForm
int num = GForm_Main.smethod_2(Received, byte_2, 0); //looking for 0x67, 0x42
if (num > 0)
{
this.method_1("Security Authorized: ECU Unlocked" + Environment.NewLine);
this.method_1("Security Authorized: ECU Unlocked");
ECU_Unlocked = true;
if (!TwoBytesMode)
{
@ -497,7 +500,7 @@ public class GForm_Main : DarkForm
}
else
{
this.method_1("Recv:" + GForm_Main.smethod_1(Received) + Environment.NewLine);
this.method_1("Recv:" + GForm_Main.smethod_1(Received));
ECU_Unlocked = false;
this.darkButton_DownloadROM.Enabled = false;
this.darkButton_FlashRom.Enabled = false;
@ -508,7 +511,7 @@ public class GForm_Main : DarkForm
}
else
{
this.method_1("Result NOT OK!!" + Environment.NewLine);
this.method_1("Result NOT OK!!");
}
}
}
@ -542,13 +545,13 @@ public class GForm_Main : DarkForm
//Send message
SAE.J2534.Message messageCommands = new SAE.J2534.Message(arrayCommand, TxFlag.CAN_29BIT_ID | TxFlag.ISO15765_FRAME_PAD);
channel.SendMessage(messageCommands);
this.method_1("Send:" + GForm_Main.smethod_1(messageCommands.Data) + Environment.NewLine);
this.method_1("Send:" + GForm_Main.smethod_1(messageCommands.Data));
//Receive message
GetMessageResults messagesReceived = channel.GetMessages(3, 1000);
if (messagesReceived.Result.IsOK())
{
//this.method_1("Programming Mode Set!" + Environment.NewLine);
//this.method_1("Programming Mode Set!");
int IndexReceived = 1;
foreach (SAE.J2534.Message message3 in messagesReceived.Messages)
{
@ -563,11 +566,11 @@ public class GForm_Main : DarkForm
Class_ODB.Mode mode = (Class_ODB.Mode)this.byte_6[0];
string str2 = mode.ToString();
Class_ODB.NegativeResponse negativeResponse = (Class_ODB.NegativeResponse)this.byte_6[1];
this.method_1("BAD Response: " + str2 + "|" + negativeResponse.ToString() + Environment.NewLine);
this.method_1("BAD Response: " + str2 + "|" + negativeResponse.ToString());
}
if (IndexReceived >= 3)
{
this.method_1("Recv:" + GForm_Main.smethod_1(message3.Data) + Environment.NewLine);
this.method_1("Recv:" + GForm_Main.smethod_1(message3.Data));
return message3.Data; //after 3messages received, return the last messages bytes
}
IndexReceived++;
@ -575,7 +578,7 @@ public class GForm_Main : DarkForm
}
else
{
this.method_1("Result NOT OK!!" + Environment.NewLine);
this.method_1("Result NOT OK!!");
}
return null;
}
@ -961,30 +964,113 @@ public class GForm_Main : DarkForm
}
}
public int Check_Checksum(byte[] byte_1)
public byte GetNegativeChecksumFullBin(byte[] byte_1)
{
byte b = 0;
for (int i = 0; i < byte_1.Length; i++)
{
if (i != 33792) //0x8400
if (i != 0x8400)
{
b -= byte_1[i];
}
}
return (int)b;
return b;
}
public int GetChecksum(byte[] byte_1)
public byte GetNegativeChecksumArea(byte[] byte_1, int Start, int ChecksumLocation)
{
byte b = 0;
for (int i = 0; i < byte_1.Length; i++)
for (int i = Start; i < byte_1.Length; i++)
{
if (i != 33792) //0x8400
if (i != ChecksumLocation)
{
b -= byte_1[i];
}
}
return (int)b;
return b;
}
public byte[] VerifyChecksumFullBin(byte[] BinFileBytes)
{
//###############################
//Get Checksum and Fix it for 0x8400
byte[] BufferBytes = BinFileBytes;
int CheckLocation = 0x8400;
byte num = BufferBytes[CheckLocation];
byte num2 = GetNegativeChecksumArea(BufferBytes, 0, CheckLocation);
//byte num2 = this.GetNegativeChecksumFullBin(BufferBytes);
if (num != num2)
{
this.method_1("Checksum miss match.");
BufferBytes[0x8400] = num2;
this.method_1("Checksum fixed at 0x" + CheckLocation.ToString("X") + " | Checksum: 0x" + num2.ToString("X2"));
}
else
{
this.method_1("Checksum are good at 0x" + CheckLocation.ToString("X") + " | Checksum: 0x" + num2.ToString("X2"));
}
//########################################################
//########################################################
//Verify for 0x10400
CheckLocation = 0x10400;
num = BufferBytes[CheckLocation];
num2 = GetNegativeChecksumArea(BufferBytes, 0x8000, CheckLocation);
if (num != num2)
{
this.method_1("Checksum miss match.");
BufferBytes[CheckLocation] = num2;
this.method_1("Checksum fixed at 0x" + CheckLocation.ToString("X") + " | Checksum: 0x" + num2.ToString("X2"));
}
else
{
this.method_1("Checksum are good at 0x" + CheckLocation.ToString("X") + " | Checksum: 0x" + num2.ToString("X2"));
}
//########################################################
//########################################################
return BufferBytes;
}
public byte[] VerifyChecksumFWBin(byte[] FWFileBytes)
{
//###############################
//Get Checksum and Fix it at 0x400 (0x8400 in full bin)
byte[] BufferBytes = FWFileBytes;
byte num = Class_RWD.BootloaderSum;
byte num2 = Class_RWD.GetNegativeChecksumFWBin(BufferBytes);
byte ThisSum = num;
ThisSum -= num2;
int CheckLocation = 0x400;
byte chk = BufferBytes[CheckLocation];
if (chk != ThisSum)
{
this.method_1("Checksum miss match.");
BufferBytes[0x400] = ThisSum;
this.method_1("Checksum fixed at 0x" + CheckLocation.ToString("X") + " | Checksum: 0x" + num2.ToString("X2"));
}
else
{
GForm_Main_0.method_1("checksum good at 0x" + CheckLocation.ToString("X") + " | Checksum: 0x" + num2.ToString("X2"));
}
//########################################################
//########################################################
//Verify for 0x8400 (0x10400 in full bin)
CheckLocation = 0x8400;
num = BufferBytes[CheckLocation];
num2 = GetNegativeChecksumArea(BufferBytes, 0, CheckLocation);
if (num != num2)
{
this.method_1("Checksum miss match.");
BufferBytes[CheckLocation] = num2;
this.method_1("Checksum fixed at 0x" + CheckLocation.ToString("X") + " | Checksum: 0x" + num2.ToString("X2"));
}
else
{
this.method_1("Checksum are good at 0x" + CheckLocation.ToString("X") + " | Checksum: 0x" + num2.ToString("X2"));
}
//########################################################
//########################################################
return BufferBytes;
}
@ -1002,18 +1088,8 @@ public class GForm_Main : DarkForm
WritingBinaryMode = true;
//###############################
//Get Checksum and Fix it
int num = (int) byte_ToWrite[33792];
int num2 = this.GetChecksum(byte_ToWrite);
if (num != num2)
{
DialogResult dialogResult = MessageBox.Show("Checksum miss match." + Environment.NewLine + "Do you want to correct it?", "Checksum Error.", MessageBoxButtons.YesNo, MessageBoxIcon.Hand);
if (dialogResult == DialogResult.Yes)
{
byte_ToWrite[33792] = (byte)num2;
}
}
//###############################
//Get/Fix Checksums
byte_ToWrite = VerifyChecksumFullBin(byte_ToWrite);
if (MessageBox.Show("Are you sure you want to write this file to ECU?", "Flash Tool", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
@ -1173,7 +1249,7 @@ public class GForm_Main : DarkForm
byte[] Received = SendJ2534Message(channel, arraySend1);
if (Received != null)
{
this.method_1("Programming Mode Set!" + Environment.NewLine);
this.method_1("Programming Mode Set!");
}
//###################
//Erase Memory
@ -1189,7 +1265,7 @@ public class GForm_Main : DarkForm
Received = SendJ2534Message(channel, arraySend1);
if (Received != null)
{
this.method_1("Memory Erased!" + Environment.NewLine);
this.method_1("Memory Erased!");
}
//###################
//Set WRITE_DATA_BY_IDENTIFIER
@ -1206,7 +1282,7 @@ public class GForm_Main : DarkForm
Received = SendJ2534Message(channel, arraySend1);
if (Received != null)
{
this.method_1("WRITE_DATA_BY_IDENTIFIER Set!" + Environment.NewLine);
this.method_1("WRITE_DATA_BY_IDENTIFIER Set!");
}
//###################
//Request Download
@ -1246,7 +1322,7 @@ public class GForm_Main : DarkForm
Received = SendJ2534Message(channel, arraySend1);
if (Received != null)
{
this.method_1("Request download started" + Environment.NewLine);
this.method_1("Request download started");
stopwatch.Start();
var block_size = (Received[Received.Length - 2] + Received[Received.Length - 1]); //Get the two last bytes
@ -1288,7 +1364,7 @@ public class GForm_Main : DarkForm
this.method_5(Percent);
/*if (Received != null)
{
this.method_1("WRITE CHUNK CORRECT!" + Environment.NewLine);
this.method_1("WRITE CHUNK CORRECT!");
}*/
}
stopwatch.Stop();
@ -1365,7 +1441,7 @@ public class GForm_Main : DarkForm
int num3 = GForm_Main.smethod_2(Received, buffer2, 0);
if (num3 > 0)
{
this.method_1("Transfer Exited" + Environment.NewLine);
this.method_1("Transfer Exited");
}
arraySend1 = new byte[]
@ -1378,7 +1454,7 @@ public class GForm_Main : DarkForm
Received = SendJ2534Message(channel_0, arraySend1);
if (Received != null)
{
this.method_1("Routine control check dependencies" + Environment.NewLine);
this.method_1("Routine control check dependencies");
}
}
}
@ -1485,16 +1561,16 @@ public class GForm_Main : DarkForm
this.darkButton_DownloadROM = new DarkUI.Controls.DarkButton();
this.darkButton_0 = new DarkUI.Controls.DarkButton();
this.darkGroupBox_0 = new DarkUI.Controls.DarkGroupBox();
this.darkButton3 = new DarkUI.Controls.DarkButton();
this.darkButton_FlashFW = new DarkUI.Controls.DarkButton();
this.darkButton2 = new DarkUI.Controls.DarkButton();
this.darkButton_Unlock01 = new DarkUI.Controls.DarkButton();
this.darkTextBox_4 = new DarkUI.Controls.DarkTextBox();
this.darkButton_Unlock41 = new DarkUI.Controls.DarkButton();
this.darkTextBox_3 = new DarkUI.Controls.DarkTextBox();
this.darkButton1 = new DarkUI.Controls.DarkButton();
this.darkButton_6 = new DarkUI.Controls.DarkButton();
this.darkButton_FlashRom = new DarkUI.Controls.DarkButton();
this.darkButton3 = new DarkUI.Controls.DarkButton();
this.darkButton2 = new DarkUI.Controls.DarkButton();
this.darkTextBox_4 = new DarkUI.Controls.DarkTextBox();
this.darkTextBox_3 = new DarkUI.Controls.DarkTextBox();
this.darkLabel_3 = new DarkUI.Controls.DarkLabel();
this.darkButton_4 = new DarkUI.Controls.DarkButton();
this.darkLabel_2 = new DarkUI.Controls.DarkLabel();
@ -1508,7 +1584,11 @@ public class GForm_Main : DarkForm
this.darkLabel_7 = new DarkUI.Controls.DarkLabel();
this.darkLabel_8 = new DarkUI.Controls.DarkLabel();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.DarkgroupBox1 = new DarkUI.Controls.DarkGroupBox();
this.darkButton4 = new DarkUI.Controls.DarkButton();
this.darkButton5 = new DarkUI.Controls.DarkButton();
this.darkGroupBox_0.SuspendLayout();
this.DarkgroupBox1.SuspendLayout();
this.SuspendLayout();
//
// darkTextBox_0
@ -1556,7 +1636,7 @@ public class GForm_Main : DarkForm
//
this.darkButton_0.Checked = false;
this.darkButton_0.Enabled = false;
this.darkButton_0.Location = new System.Drawing.Point(6, 338);
this.darkButton_0.Location = new System.Drawing.Point(695, 24);
this.darkButton_0.Name = "darkButton_0";
this.darkButton_0.Size = new System.Drawing.Size(192, 23);
this.darkButton_0.TabIndex = 50;
@ -1567,40 +1647,23 @@ public class GForm_Main : DarkForm
// darkGroupBox_0
//
this.darkGroupBox_0.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
this.darkGroupBox_0.Controls.Add(this.darkButton3);
this.darkGroupBox_0.Controls.Add(this.darkButton5);
this.darkGroupBox_0.Controls.Add(this.darkButton_FlashFW);
this.darkGroupBox_0.Controls.Add(this.darkButton2);
this.darkGroupBox_0.Controls.Add(this.darkButton_Unlock01);
this.darkGroupBox_0.Controls.Add(this.darkTextBox_4);
this.darkGroupBox_0.Controls.Add(this.darkButton_Unlock41);
this.darkGroupBox_0.Controls.Add(this.darkTextBox_3);
this.darkGroupBox_0.Controls.Add(this.darkButton1);
this.darkGroupBox_0.Controls.Add(this.darkButton_6);
this.darkGroupBox_0.Controls.Add(this.darkButton_FlashRom);
this.darkGroupBox_0.Controls.Add(this.darkLabel_3);
this.darkGroupBox_0.Controls.Add(this.darkButton_4);
this.darkGroupBox_0.Controls.Add(this.darkButton_0);
this.darkGroupBox_0.Controls.Add(this.darkButton_3);
this.darkGroupBox_0.Controls.Add(this.darkLabel_2);
this.darkGroupBox_0.Controls.Add(this.darkButton_DownloadROM);
this.darkGroupBox_0.Controls.Add(this.darkButton_2);
this.darkGroupBox_0.Location = new System.Drawing.Point(7, 6);
this.darkGroupBox_0.Name = "darkGroupBox_0";
this.darkGroupBox_0.Size = new System.Drawing.Size(204, 500);
this.darkGroupBox_0.Size = new System.Drawing.Size(204, 314);
this.darkGroupBox_0.TabIndex = 56;
this.darkGroupBox_0.TabStop = false;
this.darkGroupBox_0.Text = "J2534 Controls";
//
// darkButton3
//
this.darkButton3.Checked = false;
this.darkButton3.Location = new System.Drawing.Point(6, 309);
this.darkButton3.Name = "darkButton3";
this.darkButton3.Size = new System.Drawing.Size(192, 23);
this.darkButton3.TabIndex = 67;
this.darkButton3.Text = "Convert Firmware .bin to .rwd";
this.darkButton3.Click += new System.EventHandler(this.darkButton3_Click_1);
//
// darkButton_FlashFW
//
this.darkButton_FlashFW.Checked = false;
@ -1612,16 +1675,6 @@ public class GForm_Main : DarkForm
this.darkButton_FlashFW.Text = "Flash Firmware (.rwd)";
this.darkButton_FlashFW.Click += new System.EventHandler(this.darkButton3_Click);
//
// darkButton2
//
this.darkButton2.Checked = false;
this.darkButton2.Location = new System.Drawing.Point(6, 280);
this.darkButton2.Name = "darkButton2";
this.darkButton2.Size = new System.Drawing.Size(192, 23);
this.darkButton2.TabIndex = 59;
this.darkButton2.Text = "Convert Firmware .rwd to .bin";
this.darkButton2.Click += new System.EventHandler(this.darkButton2_Click_1);
//
// darkButton_Unlock01
//
this.darkButton_Unlock01.Checked = false;
@ -1633,14 +1686,6 @@ public class GForm_Main : DarkForm
this.darkButton_Unlock01.Text = "UNLOCK ECU (0x27,0x01)";
this.darkButton_Unlock01.Click += new System.EventHandler(this.darkButton_Unlock01_Click);
//
// darkTextBox_4
//
this.darkTextBox_4.Location = new System.Drawing.Point(85, 474);
this.darkTextBox_4.Name = "darkTextBox_4";
this.darkTextBox_4.Size = new System.Drawing.Size(113, 20);
this.darkTextBox_4.TabIndex = 66;
this.darkTextBox_4.Visible = false;
//
// darkButton_Unlock41
//
this.darkButton_Unlock41.Checked = false;
@ -1652,14 +1697,6 @@ public class GForm_Main : DarkForm
this.darkButton_Unlock41.Text = "UNLOCK ECU (0x27,0x41)";
this.darkButton_Unlock41.Click += new System.EventHandler(this.darkButton2_Click);
//
// darkTextBox_3
//
this.darkTextBox_3.Location = new System.Drawing.Point(85, 450);
this.darkTextBox_3.Name = "darkTextBox_3";
this.darkTextBox_3.Size = new System.Drawing.Size(113, 20);
this.darkTextBox_3.TabIndex = 65;
this.darkTextBox_3.Visible = false;
//
// darkButton1
//
this.darkButton1.Checked = false;
@ -1692,11 +1729,47 @@ public class GForm_Main : DarkForm
this.darkButton_FlashRom.Text = "Flash Rom (.bin)";
this.darkButton_FlashRom.Click += new System.EventHandler(this.method_17);
//
// darkButton3
//
this.darkButton3.Checked = false;
this.darkButton3.Location = new System.Drawing.Point(6, 48);
this.darkButton3.Name = "darkButton3";
this.darkButton3.Size = new System.Drawing.Size(192, 23);
this.darkButton3.TabIndex = 67;
this.darkButton3.Text = "Convert Firmware .bin to .rwd";
this.darkButton3.Click += new System.EventHandler(this.darkButton3_Click_1);
//
// darkButton2
//
this.darkButton2.Checked = false;
this.darkButton2.Location = new System.Drawing.Point(6, 19);
this.darkButton2.Name = "darkButton2";
this.darkButton2.Size = new System.Drawing.Size(192, 23);
this.darkButton2.TabIndex = 59;
this.darkButton2.Text = "Convert Firmware .rwd to .bin";
this.darkButton2.Click += new System.EventHandler(this.darkButton2_Click_1);
//
// darkTextBox_4
//
this.darkTextBox_4.Location = new System.Drawing.Point(774, 104);
this.darkTextBox_4.Name = "darkTextBox_4";
this.darkTextBox_4.Size = new System.Drawing.Size(113, 20);
this.darkTextBox_4.TabIndex = 66;
this.darkTextBox_4.Visible = false;
//
// darkTextBox_3
//
this.darkTextBox_3.Location = new System.Drawing.Point(774, 80);
this.darkTextBox_3.Name = "darkTextBox_3";
this.darkTextBox_3.Size = new System.Drawing.Size(113, 20);
this.darkTextBox_3.TabIndex = 65;
this.darkTextBox_3.Visible = false;
//
// darkLabel_3
//
this.darkLabel_3.AutoSize = true;
this.darkLabel_3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.darkLabel_3.Location = new System.Drawing.Point(24, 476);
this.darkLabel_3.Location = new System.Drawing.Point(713, 106);
this.darkLabel_3.Name = "darkLabel_3";
this.darkLabel_3.Size = new System.Drawing.Size(56, 13);
this.darkLabel_3.TabIndex = 60;
@ -1707,7 +1780,7 @@ public class GForm_Main : DarkForm
//
this.darkButton_4.Checked = false;
this.darkButton_4.Enabled = false;
this.darkButton_4.Location = new System.Drawing.Point(6, 367);
this.darkButton_4.Location = new System.Drawing.Point(695, 53);
this.darkButton_4.Name = "darkButton_4";
this.darkButton_4.Size = new System.Drawing.Size(192, 23);
this.darkButton_4.TabIndex = 51;
@ -1719,7 +1792,7 @@ public class GForm_Main : DarkForm
//
this.darkLabel_2.AutoSize = true;
this.darkLabel_2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220)))));
this.darkLabel_2.Location = new System.Drawing.Point(7, 453);
this.darkLabel_2.Location = new System.Drawing.Point(696, 83);
this.darkLabel_2.Name = "darkLabel_2";
this.darkLabel_2.Size = new System.Drawing.Size(73, 13);
this.darkLabel_2.TabIndex = 59;
@ -1813,31 +1886,71 @@ public class GForm_Main : DarkForm
//
this.openFileDialog1.DefaultExt = "*.gz";
this.openFileDialog1.Filter = "Honda Compressed RWD Firmware|*.gz;*.rwd";
this.openFileDialog1.Title = "Open Honda RWD Firmware File";
this.openFileDialog1.Title = "Open Honda/Acura File";
//
// DarkgroupBox1
//
this.DarkgroupBox1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
this.DarkgroupBox1.Controls.Add(this.darkButton4);
this.DarkgroupBox1.Controls.Add(this.darkButton3);
this.DarkgroupBox1.Controls.Add(this.darkButton2);
this.DarkgroupBox1.Location = new System.Drawing.Point(7, 326);
this.DarkgroupBox1.Name = "DarkgroupBox1";
this.DarkgroupBox1.Size = new System.Drawing.Size(204, 180);
this.DarkgroupBox1.TabIndex = 70;
this.DarkgroupBox1.TabStop = false;
this.DarkgroupBox1.Text = "File Controls";
//
// darkButton4
//
this.darkButton4.Checked = false;
this.darkButton4.Location = new System.Drawing.Point(6, 77);
this.darkButton4.Name = "darkButton4";
this.darkButton4.Size = new System.Drawing.Size(192, 23);
this.darkButton4.TabIndex = 68;
this.darkButton4.Text = "Fix Checksums";
this.darkButton4.Click += new System.EventHandler(this.darkButton4_Click);
//
// darkButton5
//
this.darkButton5.Checked = false;
this.darkButton5.Location = new System.Drawing.Point(6, 280);
this.darkButton5.Name = "darkButton5";
this.darkButton5.Size = new System.Drawing.Size(192, 23);
this.darkButton5.TabIndex = 69;
this.darkButton5.Text = "Open OBD2 Scan Tools";
this.darkButton5.Click += new System.EventHandler(this.darkButton5_Click);
//
// GForm_Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(694, 571);
this.Controls.Add(this.DarkgroupBox1);
this.Controls.Add(this.darkLabel_8);
this.Controls.Add(this.darkLabel_7);
this.Controls.Add(this.darkProgressBar_0);
this.Controls.Add(this.darkTextBox_2);
this.Controls.Add(this.darkTextBox_4);
this.Controls.Add(this.darkTextBox_1);
this.Controls.Add(this.darkLabel_5);
this.Controls.Add(this.darkTextBox_3);
this.Controls.Add(this.darkLabel_4);
this.Controls.Add(this.darkLabel_1);
this.Controls.Add(this.darkLabel_0);
this.Controls.Add(this.darkGroupBox_0);
this.Controls.Add(this.darkLabel_3);
this.Controls.Add(this.darkTextBox_0);
this.Controls.Add(this.darkButton_4);
this.Controls.Add(this.darkLabel_2);
this.Controls.Add(this.darkButton_0);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(710, 573);
this.Name = "GForm_Main";
this.Text = "Honda CANBUS Tools";
this.Load += new System.EventHandler(this.GForm_Main_Load);
this.darkGroupBox_0.ResumeLayout(false);
this.darkGroupBox_0.PerformLayout();
this.DarkgroupBox1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@ -2152,6 +2265,8 @@ public class GForm_Main : DarkForm
private void darkButton2_Click_1(object sender, EventArgs e)
{
this.openFileDialog1.Filter = "Honda Compressed RWD Firmware|*.gz;*.rwd";
this.openFileDialog1.DefaultExt = "*.gz";
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
@ -2172,9 +2287,72 @@ public class GForm_Main : DarkForm
string ThisB = gform.FileBIN;
string ThisR = gform.FileRWD;
gform.Dispose();
Class_RWD.LoadBIN(ThisB, ThisR);
return;
}
this.darkTextBox_0.Text = "Couldn't open file selection form";
}
private void darkButton4_Click(object sender, EventArgs e)
{
//this.openFileDialog1.Filter = "Honda Compressed RWD Firmware|*.gz;*.rwd";
this.openFileDialog1.Filter = "Honda full binary rom file|*.bin|Honda decompressed firmware binary|*.bin";
this.openFileDialog1.DefaultExt = "*.bin";
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK)
{
if (openFileDialog1.FilterIndex == 1)
{
byte[] FilesBytes = File.ReadAllBytes(openFileDialog1.FileName);
if (FilesBytes.Length == 0xFFFFF)
{
byte[] NewFilesBytes = VerifyChecksumFullBin(FilesBytes);
if (NewFilesBytes != FilesBytes)
{
string NewPath = Path.GetDirectoryName(openFileDialog1.FileName) + @"\" + Path.GetFileNameWithoutExtension(openFileDialog1.FileName) + "_FixedChkSum.bin";
File.Create(NewPath).Dispose();
File.WriteAllBytes(NewPath, NewFilesBytes);
this.method_1("File saved: " + NewPath);
}
}
else
{
this.method_1("This file is not compatible!");
}
}
if (openFileDialog1.FilterIndex == 2)
{
GForm_FWChkSum gform = new GForm_FWChkSum();
gform.FileBIN = openFileDialog1.FileName;
if (gform.ShowDialog() == DialogResult.OK)
{
string ThisB = gform.FileBIN;
string ThisR = gform.FileRWD;
gform.Dispose();
byte[] FilesBytes = File.ReadAllBytes(ThisB);
if (FilesBytes.Length == 0xF7FFF)
{
Class_RWD.LoadRWD(ThisR, true, false);
byte[] NewFilesBytes = VerifyChecksumFWBin(FilesBytes);
if (NewFilesBytes != FilesBytes)
{
string NewPath = Path.GetDirectoryName(ThisB) + @"\" + Path.GetFileNameWithoutExtension(ThisB) + "_FixedChkSum.bin";
File.Create(NewPath).Dispose();
File.WriteAllBytes(NewPath, NewFilesBytes);
this.method_1("File saved: " + NewPath);
}
}
else
{
this.method_1("This file is not compatible!");
}
}
}
}
}
private void darkButton5_Click(object sender, EventArgs e)
{
frmOBD2Scan frmOBD2Scan_0 = new frmOBD2Scan();
frmOBD2Scan_0.Show();
}
}

151
LineG.cs Normal file
View File

@ -0,0 +1,151 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
public class LineG : Form
{
private IContainer icontainer_0;
private PerfChart perfChart1;
private Label sensorname;
private Timer timer_0;
public LineG()
{
this.InitializeComponent();
}
private void InitializeComponent()
{
this.icontainer_0 = new Container();
GClass4 class2 = new GClass4();
GClass4 class3 = new GClass4();
GClass4 class4 = new GClass4();
GClass4 class5 = new GClass4();
this.sensorname = new Label();
this.timer_0 = new Timer(this.icontainer_0);
this.perfChart1 = new PerfChart();
base.SuspendLayout();
this.sensorname.AutoSize = true;
this.sensorname.BackColor = Color.Green;
this.sensorname.Font = new Font("Microsoft Sans Serif", 16.875f, FontStyle.Bold);
this.sensorname.ForeColor = Color.White;
this.sensorname.Location = new Point(0x1a, 0x187);
this.sensorname.Name = "sensorname";
this.sensorname.Size = new Size(0x143, 0x34);
this.sensorname.TabIndex = 1;
this.sensorname.Text = "Sensor Name:";
this.timer_0.Interval = 50;
this.timer_0.Tick += new EventHandler(this.timer_0_Tick);
this.perfChart1.Border3DStyle_0 = Border3DStyle.Flat;
this.perfChart1.Font = new Font("Segoe UI", 72f, FontStyle.Regular, GraphicsUnit.Point, 0);
this.perfChart1.Location = new Point(0x10, 0x11);
this.perfChart1.Margin = new Padding(7, 8, 7, 8);
this.perfChart1.Name = "perfChart1";
this.perfChart1.GClass3_0.Boolean_3 = true;
class2.Color_0 = Color.Black;
class2.DashStyle_0 = DashStyle.Solid;
class2.Single_0 = 1f;
this.perfChart1.GClass3_0.GClass4_2 = class2;
this.perfChart1.GClass3_0.Color_1 = Color.Green;
this.perfChart1.GClass3_0.Color_0 = Color.YellowGreen;
class3.Color_0 = Color.White;
class3.DashStyle_0 = DashStyle.Solid;
class3.Single_0 = 15f;
this.perfChart1.GClass3_0.GClass4_3 = class3;
class4.Color_0 = Color.Black;
class4.DashStyle_0 = DashStyle.Solid;
class4.Single_0 = 1f;
this.perfChart1.GClass3_0.GClass4_1 = class4;
this.perfChart1.GClass3_0.Boolean_2 = false;
this.perfChart1.GClass3_0.Boolean_1 = true;
this.perfChart1.GClass3_0.Boolean_0 = true;
class5.Color_0 = Color.Black;
class5.DashStyle_0 = DashStyle.Solid;
class5.Single_0 = 1f;
this.perfChart1.GClass3_0.GClass4_0 = class5;
this.perfChart1.GEnum0_0 = GEnum0.Relative;
this.perfChart1.Size = new Size(0x218, 0x16e);
this.perfChart1.TabIndex = 0;
this.perfChart1.Int32_0 = 100;
this.perfChart1.GEnum1_0 = GEnum1.Disabled;
this.perfChart1.Click += new EventHandler(this.perfChart1_Click);
this.perfChart1.DoubleClick += new EventHandler(this.perfChart1_DoubleClick);
this.perfChart1.KeyDown += new KeyEventHandler(this.perfChart1_KeyDown);
base.AutoScaleDimensions = new SizeF(12f, 25f);
base.AutoScaleMode = AutoScaleMode.Font;
base.ClientSize = new Size(800, 450);
base.Controls.Add(this.sensorname);
base.Controls.Add(this.perfChart1);
base.FormBorderStyle = FormBorderStyle.None;
base.MaximizeBox = false;
base.MinimizeBox = false;
base.Name = "LineG";
this.Text = "Form1";
base.Load += new EventHandler(this.LineG_Load);
base.ResumeLayout(false);
base.PerformLayout();
}
private void LineG_Load(object sender, EventArgs e)
{
base.FormBorderStyle = FormBorderStyle.None;
base.WindowState = FormWindowState.Maximized;
this.perfChart1.Top = 0;
this.perfChart1.Left = 0;
this.sensorname.Left = 10;
this.sensorname.Top = base.Height - 50;
this.perfChart1.Size = new Size(base.Width, base.Height);
this.sensorname.Text = "Sensor: " + frmOBD2Scan.string_20;
this.timer_0.Enabled = true;
this.perfChart1.GClass3_0.Color_1 = frmOBD2Scan.color_0;
this.perfChart1.GClass3_0.Color_0 = frmOBD2Scan.color_0;
this.perfChart1.GClass3_0.GClass4_3.Color_0 = frmOBD2Scan.color_2;
}
private void perfChart1_Click(object sender, EventArgs e)
{
if (this.timer_0.Enabled)
{
this.timer_0.Enabled = false;
}
else
{
this.timer_0.Enabled = true;
}
}
private void perfChart1_DoubleClick(object sender, EventArgs e)
{
this.timer_0.Enabled = false;
frmOBD2Scan.int_186 = 0;
base.Close();
}
private void perfChart1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
e.SuppressKeyPress = true;
this.timer_0.Enabled = false;
frmOBD2Scan.int_186 = 0;
base.Close();
}
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.icontainer_0 != null))
{
this.icontainer_0.Dispose();
}
base.Dispose(disposing);
}
private void timer_0_Tick(object sender, EventArgs e)
{
this.perfChart1.method_1((decimal) frmOBD2Scan.int_185);
}
}

1445
OBD2.txt Normal file

File diff suppressed because it is too large Load Diff

371
PerfChart.cs Normal file
View File

@ -0,0 +1,371 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
public class PerfChart : UserControl
{
private const int int_0 = 0x200;
private const int int_1 = 8;
private int int_2;
private int int_3 = 4;
private decimal decimal_0;
private decimal decimal_1;
private int int_4;
private decimal decimal_2;
private Border3DStyle border3DStyle_0 = Border3DStyle.Flat;
private GEnum0 genum0_0;
private GEnum1 genum1_0;
private List<decimal> list_0 = new List<decimal>(0x200);
private Queue<decimal> queue_0 = new Queue<decimal>();
private GClass3 gclass3_0;
private IContainer icontainer_0;
private Timer timer_0;
public PerfChart()
{
this.InitializeComponent();
this.gclass3_0 = new GClass3();
base.SetStyle(ControlStyles.UserPaint, true);
base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
base.SetStyle(ControlStyles.ResizeRedraw, true);
this.Font = SystemInformation.MenuFont;
}
private void InitializeComponent()
{
this.icontainer_0 = new Container();
this.timer_0 = new Timer(this.icontainer_0);
base.SuspendLayout();
this.timer_0.Tick += new EventHandler(this.timer_0_Tick);
base.AutoScaleDimensions = new SizeF(6f, 13f);
base.AutoScaleMode = AutoScaleMode.Font;
base.Name = "PerfChart";
base.Size = new Size(0xeb, 0x57);
base.ResumeLayout(false);
}
public void method_0()
{
this.list_0.Clear();
base.Invalidate();
}
public void method_1(decimal decimal_3)
{
if ((this.genum0_0 == GEnum0.Absolute) && (decimal_3 > 100M))
{
throw new Exception($"Values greater then 100 not allowed in ScaleMode: Absolute ({decimal_3})");
}
GEnum1 enum2 = this.genum1_0;
if (enum2 == GEnum1.Disabled)
{
this.method_3(decimal_3);
base.Invalidate();
}
else
{
if ((enum2 - 1) > GEnum1.SynchronizedAverage)
{
throw new Exception($"Unsupported TimerMode: {this.genum1_0}");
}
this.method_2(decimal_3);
}
}
private void method_10(Graphics graphics_0)
{
Rectangle rect = new Rectangle(0, 0, base.Width, base.Height);
using (Brush brush = new LinearGradientBrush(rect, this.gclass3_0.Color_0, this.gclass3_0.Color_1, LinearGradientMode.Vertical))
{
graphics_0.FillRectangle(brush, rect);
}
if (this.gclass3_0.Boolean_0)
{
for (int i = base.Width - this.int_4; i >= 0; i -= 8)
{
graphics_0.DrawLine(this.gclass3_0.GClass4_0.Pen_0, i, 0, i, base.Height);
}
}
if (this.gclass3_0.Boolean_1)
{
for (int i = 0; i < base.Height; i += 8)
{
graphics_0.DrawLine(this.gclass3_0.GClass4_1.Pen_0, 0, i, base.Width, i);
}
}
}
private void method_11(object sender, EventArgs e)
{
base.Invalidate();
}
private void method_2(decimal decimal_3)
{
this.queue_0.Enqueue(decimal_3);
}
private void method_3(decimal decimal_3)
{
this.list_0.Insert(0, Math.Max(decimal_3, 0M));
if (this.list_0.Count > 0x200)
{
this.list_0.RemoveAt(0x200);
}
this.int_4 += this.int_3;
if (this.int_4 > 8)
{
this.int_4 = this.int_4 % 8;
}
}
private void method_4()
{
if (this.queue_0.Count <= 0)
{
this.method_3(0M);
}
else if (this.genum1_0 == GEnum1.Simple)
{
while (this.queue_0.Count > 0)
{
this.method_3(this.queue_0.Dequeue());
}
}
else if ((this.genum1_0 == GEnum1.SynchronizedAverage) || (this.genum1_0 == GEnum1.SynchronizedSum))
{
decimal num = 0M;
int count = this.queue_0.Count;
while (true)
{
if (this.queue_0.Count <= 0)
{
if (this.genum1_0 == GEnum1.SynchronizedAverage)
{
num = (decimal) (num / count);
}
if (num > 88M)
{
num = (decimal) (num - 10M);
}
if (num < 10M)
{
num = (decimal) (num + 10M);
}
this.method_3(num);
break;
}
num = (decimal) (num + this.queue_0.Dequeue());
}
}
base.Invalidate();
}
private int method_5(decimal decimal_3)
{
decimal num = 0M;
if (this.genum0_0 == GEnum0.Absolute)
{
num = (decimal) ((decimal_3 * base.Height) / 100M);
}
else if (this.genum0_0 == GEnum0.Relative)
{
num = (this.decimal_0 > 0M) ? ((decimal) ((decimal_3 * base.Height) / this.decimal_0)) : 0M;
}
return Convert.ToInt32(Math.Round((decimal) ((base.Height - num) + 6M)));
}
private decimal method_6()
{
decimal num = 0M;
for (int i = 0; i < this.int_2; i++)
{
if (this.list_0[i] > num)
{
num = this.list_0[i];
}
}
return num;
}
private decimal method_7()
{
try
{
return this.list_0[0];
}
catch
{
}
try
{
return this.list_0[1];
}
catch
{
return 0M;
}
}
private void method_8(Graphics graphics_0)
{
this.int_2 = Math.Min(base.Width / this.int_3, this.list_0.Count);
if (this.genum0_0 == GEnum0.Relative)
{
this.decimal_0 = this.method_6();
}
this.decimal_1 = this.method_7();
Point point = new Point(base.Width + this.int_3, base.Height);
Point point2 = new Point();
if ((this.int_2 > 0) && this.gclass3_0.Boolean_2)
{
this.decimal_2 = 0M;
this.method_9(graphics_0);
}
for (int i = 0; i < this.int_2; i++)
{
point2.X = point.X - this.int_3;
point2.Y = this.method_5(this.list_0[i]);
graphics_0.DrawLine(this.gclass3_0.GClass4_3.Pen_0, point, point2);
point = point2;
}
if (this.genum0_0 == GEnum0.Relative)
{
SolidBrush brush = new SolidBrush(this.gclass3_0.GClass4_3.Color_0);
string[] textArray1 = new string[] { "Max: ", this.decimal_0.ToString(), Environment.NewLine, "Current: ", this.decimal_1.ToString() };
graphics_0.DrawString(string.Concat(textArray1), this.Font, brush, (float) 4f, (float) 2f);
}
ControlPaint.DrawBorder3D(graphics_0, 0, 0, base.Width, base.Height, this.border3DStyle_0);
}
private void method_9(Graphics graphics_0)
{
for (int i = 0; i < this.int_2; i++)
{
this.decimal_2 = (decimal) (this.decimal_2 + this.list_0[i]);
}
this.decimal_2 = (decimal) (this.decimal_2 / this.int_2);
int num = this.method_5(this.decimal_2);
graphics_0.DrawLine(this.gclass3_0.GClass4_2.Pen_0, 0, num, base.Width, num);
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.icontainer_0 != null))
{
this.icontainer_0.Dispose();
}
base.Dispose(disposing);
}
protected virtual void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
if (this.gclass3_0.Boolean_3)
{
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
}
this.method_10(e.Graphics);
this.method_8(e.Graphics);
}
protected virtual void OnResize(EventArgs e)
{
base.OnResize(e);
base.Invalidate();
}
private void timer_0_Tick(object sender, EventArgs e)
{
if (!base.DesignMode)
{
this.method_4();
}
}
[Description("Appearance and Style"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Category("Appearance")]
public GClass3 GClass3_0
{
get
{
return this.gclass3_0;
}
set
{
this.gclass3_0 = value;
}
}
[Description("BorderStyle"), DefaultValue(typeof(Border3DStyle), "Sunken"), Category("Appearance")]
public Border3DStyle Border3DStyle_0
{
get
{
return this.border3DStyle_0;
}
set
{
this.border3DStyle_0 = value;
base.Invalidate();
}
}
public GEnum0 GEnum0_0
{
get
{
return this.genum0_0;
}
set
{
this.genum0_0 = value;
}
}
public GEnum1 GEnum1_0
{
get
{
return this.genum1_0;
}
set
{
if (value == GEnum1.Disabled)
{
if (this.genum1_0 != GEnum1.Disabled)
{
this.genum1_0 = value;
this.timer_0.Stop();
this.method_4();
return;
}
}
else
{
this.genum1_0 = value;
this.timer_0.Start();
}
}
}
public int Int32_0
{
get
{
return this.timer_0.Interval;
}
set
{
if (value < 15)
{
throw new ArgumentOutOfRangeException("TimerInterval", value, "The Timer interval must be greater then 15");
}
this.timer_0.Interval = value;
}
}
}

77
app.manifest Normal file
View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- Options du manifeste de contrôle de compte d'utilisateur
Si vous souhaitez modifier le niveau du contrôle de compte d'utilisateur Windows, remplacez le
nœud requestedExecutionLevel par l'une des propositions suivantes.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
La spécification de l'élément requestedExecutionLevel désactive la virtualisation de fichiers et du Registre.
Supprimez cet élément si votre application a besoin de la virtualisation pour des
raisons de compatibilité descendante.
-->
<!-- <requestedExecutionLevel level="asInvoker" uiAccess="false" /> -->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Liste des versions de Windows pour lesquelles cette application a été testée,
et sur lesquelles elle doit fonctionner. Décommentez éléments appropriés,
et Windows va automatiquement sélectionner l'environnement le plus compatible. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Indique que l'application prend en charge DPI et qu'elle n'est pas automatiquement mise à l'échelle par Windows à un niveau de
DPI plus élevé. Les applications Windows Presentation Foundation (WPF) prennent automatiquement en charge DPI et n'ont pas besoin
d'opter pour ce choix. Les applications Windows Forms qui ciblent .NET Framework 4.6 et qui optent pour ce paramètre, doivent
également affecter la valeur 'true' au paramètre 'EnableWindowsFormsHighDpiAutoResizing' dans leur fichier app.config. -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
-->
<!-- Activer les thèmes pour les contrôles et boîtes de dialogue communes de Windows (Windows XP et version ultérieure) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>

Binary file not shown.

Binary file not shown.

BIN
bin/Debug/FlashToolTest.zip Normal file

Binary file not shown.

1445
bin/Debug/OBD2.txt Normal file

File diff suppressed because it is too large Load Diff

6830
frmOBD2Scan.cs Normal file

File diff suppressed because it is too large Load Diff

150
frmOBD2Scan.resx Normal file
View File

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip_0.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>603, 17</value>
</metadata>
<metadata name="colorDialog_0.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="timer_2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>143, 17</value>
</metadata>
<metadata name="timer_3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>235, 17</value>
</metadata>
<metadata name="timer_4.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>327, 17</value>
</metadata>
<metadata name="timer_5.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>419, 17</value>
</metadata>
<metadata name="timer_6.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>511, 17</value>
</metadata>
<metadata name="toolTip_0.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>603, 17</value>
</metadata>
<metadata name="timer_1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>705, 17</value>
</metadata>
<metadata name="timer_0.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>797, 17</value>
</metadata>
</root>