Advertisement
LFSPro

LFSPro Launcher 1.5.3.7 - CruiseTweak.dll

Apr 10th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 48.58 KB | None | 0 0
  1. //LFSPro Launcher 1.5.3.7
  2. //CruiseTweak.dll
  3. //http://lfspro.net/query/__CruiseTweak.dll
  4.  
  5. using System;
  6. using System.ComponentModel;
  7. using System.Diagnostics;
  8. using System.Drawing;
  9. using System.Globalization;
  10. using System.IO;
  11. using System.Linq;
  12. using System.Net;
  13. using System.Net.NetworkInformation;
  14. using System.Reflection;
  15. using System.Runtime.InteropServices;
  16. using System.Text;
  17. using System.Timers;
  18. using System.Windows.Forms;
  19. using LFS;  // Memory edit class https://pastebin.com/NKpwbW7G
  20.  
  21. namespace CruiseTweak
  22. {
  23.     // Token: 0x02000004 RID: 4
  24.     public class CruiseTweak : Form
  25.     {
  26.         // Token: 0x06000019 RID: 25 RVA: 0x00002710 File Offset: 0x00000910
  27.         public CruiseTweak()
  28.         {
  29.             this.InitializeComponent();
  30.             this.WriteDefaultValues();
  31.             base.ShowInTaskbar = false;
  32.             ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
  33.             base.ShowInTaskbar = false;
  34.             base.Hide();
  35.             string[] commandLineArgs = Environment.GetCommandLineArgs();
  36.             base.Shown += this.StartWatchdogs;
  37.             this.Username = commandLineArgs[1].Replace("$", " ");
  38.             this.Password = commandLineArgs[2].Replace("$", " ");
  39.             this.LastUsername = this.Username;
  40.             this.PlayerValidate();
  41.             base.FormClosing += this.FormClose;
  42.             base.FormClosed += this.FormClose1;
  43.             this.TweakWrite_500ms.Enabled = true;
  44.             this.TweakWrite_500ms.Elapsed += this.TweakWrite_500ms_Elapsed;
  45.             this.TweakWrite_2Sec.Enabled = true;
  46.             this.TweakWrite_2Sec.Elapsed += this.TweakWrite_2Sec_Elapsed;
  47.             this.TweakRead_6Sec.Enabled = true;
  48.             this.TweakRead_6Sec.Elapsed += this.TweakRead_6Sec_Elapsed;
  49.             this.TweakRead_100ms.Enabled = true;
  50.             this.TweakRead_100ms.Elapsed += this.TweakRead_100ms_Elapsed;
  51.             this.FuelRead_6Sec.Enabled = true;
  52.             this.FuelRead_6Sec.Elapsed += this.FuelRead_6Sec_Elapsed;
  53.             this.FuelSave_20Sec.Enabled = true;
  54.             this.FuelSave_20Sec.Elapsed += this.FuelSave_20Sec_Elapsed;
  55.             this.PlayerSave_60Sec.Enabled = true;
  56.             this.PlayerSave_60Sec.Elapsed += this.PlayerSave_60Sec_Elapsed;
  57.             this.Watchdog.Enabled = true;
  58.             this.Watchdog.Elapsed += this.Watchdog_Elapsed;
  59.         }
  60.  
  61.         // Token: 0x0600001A RID: 26 RVA: 0x00002A50 File Offset: 0x00000C50
  62.         private void FormClose(object sender, FormClosingEventArgs e)
  63.         {
  64.             try
  65.             {
  66.                 string value = "Taskkill /IM x86Watchdog.dll /F";
  67.                 string value2 = "Taskkill /IM x64Watchdog.dll /F";
  68.                 Process process = new Process();
  69.                 process.StartInfo.FileName = "cmd.exe";
  70.                 process.StartInfo.RedirectStandardInput = true;
  71.                 process.StartInfo.RedirectStandardOutput = true;
  72.                 process.StartInfo.CreateNoWindow = true;
  73.                 process.StartInfo.UseShellExecute = false;
  74.                 process.Start();
  75.                 process.StandardInput.WriteLine(value);
  76.                 process.StandardInput.Flush();
  77.                 process.StandardInput.WriteLine(value2);
  78.                 process.StandardInput.Flush();
  79.                 process.StandardInput.Close();
  80.                 process.WaitForExit();
  81.                 Console.WriteLine(process.StandardOutput.ReadToEnd());
  82.             }
  83.             catch
  84.             {
  85.             }
  86.             Environment.Exit(1);
  87.             Application.Exit();
  88.         }
  89.  
  90.         // Token: 0x0600001B RID: 27 RVA: 0x00002B38 File Offset: 0x00000D38
  91.         private void FormClose1(object sender, FormClosedEventArgs e)
  92.         {
  93.             try
  94.             {
  95.                 string value = "Taskkill /IM x86Watchdog.dll /F";
  96.                 string value2 = "Taskkill /IM x64Watchdog.dll /F";
  97.                 Process process = new Process();
  98.                 process.StartInfo.FileName = "cmd.exe";
  99.                 process.StartInfo.RedirectStandardInput = true;
  100.                 process.StartInfo.RedirectStandardOutput = true;
  101.                 process.StartInfo.CreateNoWindow = true;
  102.                 process.StartInfo.UseShellExecute = false;
  103.                 process.Start();
  104.                 process.StandardInput.WriteLine(value);
  105.                 process.StandardInput.Flush();
  106.                 process.StandardInput.WriteLine(value2);
  107.                 process.StandardInput.Flush();
  108.                 process.StandardInput.Close();
  109.                 process.WaitForExit();
  110.                 Console.WriteLine(process.StandardOutput.ReadToEnd());
  111.             }
  112.             catch
  113.             {
  114.             }
  115.         }
  116.  
  117.         // Token: 0x0600001C RID: 28 RVA: 0x00002C14 File Offset: 0x00000E14
  118.         private void StartWatchdogs(object sender, EventArgs e)
  119.         {
  120.             try
  121.             {
  122.                 string value = "Taskkill /IM x86Watchdog.dll /F";
  123.                 string value2 = "Taskkill /IM x64Watchdog.dll /F";
  124.                 Process process = new Process();
  125.                 process.StartInfo.FileName = "cmd.exe";
  126.                 process.StartInfo.RedirectStandardInput = true;
  127.                 process.StartInfo.RedirectStandardOutput = true;
  128.                 process.StartInfo.CreateNoWindow = true;
  129.                 process.StartInfo.UseShellExecute = false;
  130.                 process.Start();
  131.                 process.StandardInput.WriteLine(value);
  132.                 process.StandardInput.Flush();
  133.                 process.StandardInput.WriteLine(value2);
  134.                 process.StandardInput.Flush();
  135.                 process.StandardInput.Close();
  136.                 process.WaitForExit();
  137.                 Console.WriteLine(process.StandardOutput.ReadToEnd());
  138.                 base.Invoke(new Action(delegate
  139.                 {
  140.                     CruiseTweak.StartAProcess("x86Watchdog.dll");
  141.                 }));
  142.                 base.Invoke(new Action(delegate
  143.                 {
  144.                     this.Archteture();
  145.                 }));
  146.             }
  147.             catch (Exception ex)
  148.             {
  149.             }
  150.         }
  151.  
  152.         // Token: 0x0600001D RID: 29 RVA: 0x00002D28 File Offset: 0x00000F28
  153.         private void Archteture()
  154.         {
  155.             try
  156.             {
  157.                 bool flag = Marshal.SizeOf(typeof(IntPtr)) == 8;
  158.                 if (flag)
  159.                 {
  160.                     this.X64 = true;
  161.                     CruiseTweak.StartAProcess("x64Watchdog.dll");
  162.                 }
  163.             }
  164.             catch (Exception ex)
  165.             {
  166.             }
  167.         }
  168.  
  169.         // Token: 0x0600001E RID: 30 RVA: 0x00002D7C File Offset: 0x00000F7C
  170.         private static void StartAProcess(string proc)
  171.         {
  172.             try
  173.             {
  174.                 Process process = Process.Start(new ProcessStartInfo(proc)
  175.                 {
  176.                     UseShellExecute = false
  177.                 });
  178.             }
  179.             catch (Exception ex)
  180.             {
  181.             }
  182.         }
  183.  
  184.         // Token: 0x0600001F RID: 31 RVA: 0x00002DBC File Offset: 0x00000FBC
  185.         private void Watchdog_Elapsed(object sender, ElapsedEventArgs e)
  186.         {
  187.             try
  188.             {
  189.                 this.SetPlayerUsingLauncher++;
  190.                 bool flag = this.SetPlayerUsingLauncher >= 6;
  191.                 if (flag)
  192.                 {
  193.                     this.SetPlayerUsingLauncher = 0;
  194.                     int num = new Random().Next(1, 200);
  195.                     WebClient webClient = new WebClient();
  196.                     webClient.OpenRead(new Uri(string.Concat(new object[]
  197.                     {
  198.                         "http://35.198.16.153/query/lfspro_launcher_savelog.php?Username=",
  199.                         this.Username,
  200.                         "&Password=",
  201.                         this.Password,
  202.                         "&Checksum=",
  203.                         num
  204.                     })));
  205.                 }
  206.                 this.CheckPlayerChanged();
  207.                 bool flag2 = false;
  208.                 bool flag3 = false;
  209.                 Process[] processes = Process.GetProcesses();
  210.                 foreach (Process process in processes)
  211.                 {
  212.                     try
  213.                     {
  214.                         bool flag4 = process.MainModule.FileVersionInfo.FileDescription.Contains("x64Watchdog");
  215.                         if (flag4)
  216.                         {
  217.                             flag2 = true;
  218.                         }
  219.                         bool flag5 = process.MainModule.FileVersionInfo.FileDescription.Contains("x86Watchdog");
  220.                         if (flag5)
  221.                         {
  222.                             flag3 = true;
  223.                         }
  224.                     }
  225.                     catch
  226.                     {
  227.                     }
  228.                 }
  229.                 bool flag6 = !flag2 && !flag3;
  230.                 if (flag6)
  231.                 {
  232.                     base.Close();
  233.                 }
  234.             }
  235.             catch (Exception ex)
  236.             {
  237.             }
  238.         }
  239.  
  240.         // Token: 0x06000020 RID: 32 RVA: 0x00002F34 File Offset: 0x00001134
  241.         private void PlayerValidate()
  242.         {
  243.             try
  244.             {
  245.                 string value = (from nic in NetworkInterface.GetAllNetworkInterfaces()
  246.                 where nic.OperationalStatus == OperationalStatus.Up
  247.                 select nic.GetPhysicalAddress().ToString()).FirstOrDefault<string>();
  248.                 string text = Convert.ToString(value);
  249.                 bool flag = text.Length < 3;
  250.                 if (flag)
  251.                 {
  252.                     text = "NOADDFOUND";
  253.                 }
  254.                 WebBrowser webBrowser = new WebBrowser();
  255.                 webBrowser.Navigate(new Uri(string.Concat(new string[]
  256.                 {
  257.                     "http://lfspro.net/query/lfspro_launcher_register.php?Username=",
  258.                     this.Username,
  259.                     "&Password=",
  260.                     this.Password,
  261.                     "&Checksum=",
  262.                     text,
  263.                     "&Version=",
  264.                     Assembly.GetExecutingAssembly().GetName().Version.ToString()
  265.                 })));
  266.                 while (webBrowser.ReadyState != WebBrowserReadyState.Complete)
  267.                 {
  268.                     Application.DoEvents();
  269.                 }
  270.                 string text2 = webBrowser.Document.Body.InnerHtml.ToString();
  271.                 bool flag2 = text2.Contains("User OK");
  272.                 if (flag2)
  273.                 {
  274.                     this.PlayerValidated = true;
  275.                 }
  276.                 else
  277.                 {
  278.                     this.PlayerValidated = false;
  279.                     this.WriteDefaultValues();
  280.                 }
  281.             }
  282.             catch
  283.             {
  284.             }
  285.         }
  286.  
  287.         // Token: 0x06000021 RID: 33 RVA: 0x000030A0 File Offset: 0x000012A0
  288.         private void CheckPlayerChanged()
  289.         {
  290.             Process[] processesByName = Process.GetProcessesByName("LFS");
  291.             bool flag = processesByName.Length != 0;
  292.             if (flag)
  293.             {
  294.                 using (Memory memory = new Memory(processesByName[0]))
  295.                 {
  296.                     IntPtr address = memory.GetAddress("\"LFS.exe\"+00051124+0");
  297.                     byte[] array = new byte[23];
  298.                     memory.ReadMemory(address, array, 23);
  299.                     string a = Encoding.UTF8.GetString(array).Trim(new char[1]);
  300.                     bool flag2 = a != this.Username;
  301.                     if (flag2)
  302.                     {
  303.                         this.PlayerValidate();
  304.                     }
  305.                 }
  306.             }
  307.         }
  308.  
  309.         // Token: 0x06000022 RID: 34 RVA: 0x00003144 File Offset: 0x00001344
  310.         private void WriteDefaultValues()
  311.         {
  312.             try
  313.             {
  314.                 Process[] processesByName = Process.GetProcessesByName("LFS");
  315.                 bool flag = processesByName.Length != 0;
  316.                 if (flag)
  317.                 {
  318.                     using (Memory memory = new Memory(processesByName[0]))
  319.                     {
  320.                         IntPtr address = memory.GetAddress("\"LFS.exe\"+000C7918+4");
  321.                         IntPtr address2 = memory.GetAddress("\"LFS.exe\"+000C79BC+0");
  322.                         IntPtr address3 = memory.GetAddress("\"LFS.exe\"+000C79F4+1C");
  323.                         IntPtr address4 = memory.GetAddress("\"LFS.exe\"+000C7FB8+4");
  324.                         float value = 0.143f;
  325.                         memory.WriteFloat(address, value);
  326.                         memory.WriteFloat(address2, value);
  327.                         memory.WriteFloat(address3, value);
  328.                         memory.WriteFloat(address4, value);
  329.                         IntPtr address5 = memory.GetAddress("\"LFS.exe\"+0013A364+10");
  330.                         IntPtr address6 = memory.GetAddress("\"LFS.exe\"+000C7BC4+4");
  331.                         float value2 = 0.19f;
  332.                         memory.WriteFloat(address5, value2);
  333.                         memory.WriteFloat(address6, value2);
  334.                         IntPtr address7 = memory.GetAddress("\"LFS.exe\"+000C7904+0");
  335.                         IntPtr address8 = memory.GetAddress("\"LFS.exe\"+000C7994+4");
  336.                         IntPtr address9 = memory.GetAddress("\"LFS.exe\"+000C79F4+10");
  337.                         IntPtr address10 = memory.GetAddress("\"LFS.exe\"+000C7FA4+0");
  338.                         float value3 = 1.6f;
  339.                         memory.WriteFloat(address7, value3);
  340.                         memory.WriteFloat(address8, value3);
  341.                         memory.WriteFloat(address9, value3);
  342.                         memory.WriteFloat(address10, value3);
  343.                         IntPtr address11 = memory.GetAddress("\"LFS.exe\"+0013A364+4");
  344.                         IntPtr address12 = memory.GetAddress("\"LFS.exe\"+000C7AD4+10");
  345.                         float value4 = 2.225f;
  346.                         memory.WriteFloat(address11, value4);
  347.                         memory.WriteFloat(address12, value4);
  348.                         IntPtr address13 = memory.GetAddress("\"LFS.exe\"+000C78F0+0");
  349.                         IntPtr address14 = memory.GetAddress("\"LFS.exe\"+000C7954+C");
  350.                         IntPtr address15 = memory.GetAddress("\"LFS.exe\"+000C7AD4+8");
  351.                         IntPtr address16 = memory.GetAddress("\"LFS.exe\"+000C7B9C+0");
  352.                         float value5 = 1000f;
  353.                         memory.WriteFloat(address13, value5);
  354.                         memory.WriteFloat(address14, value5);
  355.                         memory.WriteFloat(address15, value5);
  356.                         memory.WriteFloat(address16, value5);
  357.                         IntPtr address17 = memory.GetAddress("\"LFS.exe\"+000C79F4+8");
  358.                         IntPtr address18 = memory.GetAddress("\"LFS.exe\"+000C7F90+0");
  359.                         float value6 = 400f;
  360.                         memory.WriteFloat(address17, value6);
  361.                         memory.WriteFloat(address18, value6);
  362.                         IntPtr address19 = memory.GetAddress("\"LFS.exe\"+000C78D8+0");
  363.                         byte[] bytes = BitConverter.GetBytes(memory.ReadInt32(address19));
  364.                         byte[] array = bytes;
  365.                         array[2] = 1;
  366.                         byte[] value7 = new byte[]
  367.                         {
  368.                             array[0],
  369.                             array[1],
  370.                             array[2],
  371.                             array[3]
  372.                         };
  373.                         int value8 = BitConverter.ToInt32(value7, 0);
  374.                         memory.WriteInt32(address19, value8);
  375.                         IntPtr address20 = memory.GetAddress("\"LFS.exe\"+000C7954+8");
  376.                         byte[] bytes2 = BitConverter.GetBytes(memory.ReadInt32(address20));
  377.                         byte[] array2 = bytes2;
  378.                         array2[2] = 1;
  379.                         byte[] value9 = new byte[]
  380.                         {
  381.                             array2[0],
  382.                             array2[1],
  383.                             array2[2],
  384.                             array2[3]
  385.                         };
  386.                         int value10 = BitConverter.ToInt32(value9, 0);
  387.                         memory.WriteInt32(address20, value10);
  388.                         IntPtr address21 = memory.GetAddress("\"LFS.exe\"+000C79F4+4");
  389.                         byte[] bytes3 = BitConverter.GetBytes(memory.ReadInt32(address21));
  390.                         byte[] array3 = bytes3;
  391.                         array3[2] = 1;
  392.                         byte[] value11 = new byte[]
  393.                         {
  394.                             array3[0],
  395.                             array3[1],
  396.                             array3[2],
  397.                             array3[3]
  398.                         };
  399.                         int value12 = BitConverter.ToInt32(value11, 0);
  400.                         memory.WriteInt32(address21, value12);
  401.                         IntPtr address22 = memory.GetAddress("\"LFS.exe\"+000C7AD4+4");
  402.                         byte[] bytes4 = BitConverter.GetBytes(memory.ReadInt32(address22));
  403.                         byte[] array4 = bytes4;
  404.                         array4[2] = 1;
  405.                         byte[] value13 = new byte[]
  406.                         {
  407.                             array4[0],
  408.                             array4[1],
  409.                             array4[2],
  410.                             array4[3]
  411.                         };
  412.                         int value14 = BitConverter.ToInt32(value13, 0);
  413.                         memory.WriteInt32(address22, value14);
  414.                         IntPtr address23 = memory.GetAddress("\"LFS.exe\"+000C7B84+0");
  415.                         byte[] bytes5 = BitConverter.GetBytes(memory.ReadInt32(address23));
  416.                         byte[] array5 = bytes5;
  417.                         array5[2] = 1;
  418.                         byte[] value15 = new byte[]
  419.                         {
  420.                             array5[0],
  421.                             array5[1],
  422.                             array5[2],
  423.                             array5[3]
  424.                         };
  425.                         int value16 = BitConverter.ToInt32(value15, 0);
  426.                         memory.WriteInt32(address23, value16);
  427.                         IntPtr address24 = memory.GetAddress("\"LFS.exe\"+000C7F3C+8");
  428.                         byte[] bytes6 = BitConverter.GetBytes(memory.ReadInt32(address24));
  429.                         byte[] array6 = bytes6;
  430.                         array6[2] = 1;
  431.                         byte[] value17 = new byte[]
  432.                         {
  433.                             array6[0],
  434.                             array6[1],
  435.                             array6[2],
  436.                             array6[3]
  437.                         };
  438.                         int value18 = BitConverter.ToInt32(value17, 0);
  439.                         memory.WriteInt32(address24, value18);
  440.                         IntPtr address25 = memory.GetAddress("\"LFS.exe\"+0004F91C+10");
  441.                         byte[] bytes7 = BitConverter.GetBytes(memory.ReadInt32(address25));
  442.                         byte[] array7 = bytes7;
  443.                         array7[2] = 3;
  444.                         byte[] value19 = new byte[]
  445.                         {
  446.                             array7[0],
  447.                             array7[1],
  448.                             array7[2],
  449.                             array7[3]
  450.                         };
  451.                         int value20 = BitConverter.ToInt32(value19, 0);
  452.                         memory.WriteInt32(address25, value20);
  453.                         IntPtr address26 = memory.GetAddress("\"LFS.exe\"+000C7954+4");
  454.                         byte[] bytes8 = BitConverter.GetBytes(memory.ReadInt32(address26));
  455.                         byte[] array8 = bytes8;
  456.                         array8[2] = 3;
  457.                         byte[] value21 = new byte[]
  458.                         {
  459.                             array8[0],
  460.                             array8[1],
  461.                             array8[2],
  462.                             array8[3]
  463.                         };
  464.                         int value22 = BitConverter.ToInt32(value21, 0);
  465.                         memory.WriteInt32(address26, value22);
  466.                         IntPtr address27 = memory.GetAddress("\"LFS.exe\"+000C79F4+0");
  467.                         byte[] bytes9 = BitConverter.GetBytes(memory.ReadInt32(address27));
  468.                         byte[] array9 = bytes9;
  469.                         array9[2] = 3;
  470.                         byte[] value23 = new byte[]
  471.                         {
  472.                             array9[0],
  473.                             array9[1],
  474.                             array9[2],
  475.                             array9[3]
  476.                         };
  477.                         int value24 = BitConverter.ToInt32(value23, 0);
  478.                         memory.WriteInt32(address27, value24);
  479.                         IntPtr address28 = memory.GetAddress("\"LFS.exe\"+000C7AD4+0");
  480.                         byte[] bytes10 = BitConverter.GetBytes(memory.ReadInt32(address28));
  481.                         byte[] array10 = bytes10;
  482.                         array10[2] = 3;
  483.                         byte[] value25 = new byte[]
  484.                         {
  485.                             array10[0],
  486.                             array10[1],
  487.                             array10[2],
  488.                             array10[3]
  489.                         };
  490.                         int value26 = BitConverter.ToInt32(value25, 0);
  491.                         memory.WriteInt32(address28, value26);
  492.                         IntPtr address29 = memory.GetAddress("\"LFS.exe\"+0013A364+30");
  493.                         byte[] bytes11 = BitConverter.GetBytes(memory.ReadInt32(address29));
  494.                         byte[] array11 = bytes11;
  495.                         array11[2] = 3;
  496.                         byte[] value27 = new byte[]
  497.                         {
  498.                             array11[0],
  499.                             array11[1],
  500.                             array11[2],
  501.                             array11[3]
  502.                         };
  503.                         int value28 = BitConverter.ToInt32(value27, 0);
  504.                         memory.WriteInt32(address29, value28);
  505.                         IntPtr address30 = memory.GetAddress("\"LFS.exe\"+000C7F3C+4");
  506.                         byte[] bytes12 = BitConverter.GetBytes(memory.ReadInt32(address30));
  507.                         byte[] array12 = bytes12;
  508.                         array12[2] = 3;
  509.                         byte[] value29 = new byte[]
  510.                         {
  511.                             array12[0],
  512.                             array12[1],
  513.                             array12[2],
  514.                             array12[3]
  515.                         };
  516.                         int value30 = BitConverter.ToInt32(value29, 0);
  517.                         memory.WriteInt32(address30, value30);
  518.                         IntPtr address31 = memory.GetAddress("\"LFS.exe\"+0004F91C+8");
  519.                         IntPtr address32 = memory.GetAddress("\"LFS.exe\"+000C7940+4");
  520.                         IntPtr address33 = memory.GetAddress("\"LFS.exe\"+000C79E4+0");
  521.                         IntPtr address34 = memory.GetAddress("\"LFS.exe\"+0013A364+28");
  522.                         IntPtr address35 = memory.GetAddress("\"LFS.exe\"+000C7F2C+C");
  523.                         float value31 = 0.15f;
  524.                         memory.WriteFloat(address31, value31);
  525.                         memory.WriteFloat(address32, value31);
  526.                         memory.WriteFloat(address33, value31);
  527.                         memory.WriteFloat(address34, value31);
  528.                         memory.WriteFloat(address35, value31);
  529.                         IntPtr address36 = memory.GetAddress("\"LFS.exe\"+000C79F4+34");
  530.                         float value32 = 0.1f;
  531.                         memory.WriteFloat(address36, value32);
  532.                         IntPtr address37 = memory.GetAddress("\"LFS.exe\"+000C792C+0");
  533.                         IntPtr address38 = memory.GetAddress("\"LFS.exe\"+0013A364+14");
  534.                         IntPtr address39 = memory.GetAddress("\"LFS.exe\"+000C7BD8+0");
  535.                         float value33 = 0.6f;
  536.                         memory.WriteFloat(address37, value33);
  537.                         memory.WriteFloat(address38, value33);
  538.                         memory.WriteFloat(address39, value33);
  539.                         IntPtr address40 = memory.GetAddress("\"LFS.exe\"+000C79BC+4");
  540.                         IntPtr address41 = memory.GetAddress("\"LFS.exe\"+000C79F4+20");
  541.                         float value34 = 0.4f;
  542.                         memory.WriteFloat(address40, value34);
  543.                         memory.WriteFloat(address41, value34);
  544.                         IntPtr address42 = memory.GetAddress("\"LFS.exe\"+000C7FCC+0");
  545.                         float value35 = 0.2f;
  546.                         memory.WriteFloat(address42, value35);
  547.                         IntPtr address43 = memory.GetAddress("\"LFS.exe\"+1B60F0");
  548.                         int value36 = 2;
  549.                         memory.WriteInt32(address43, value36);
  550.                         IntPtr address44 = memory.GetAddress("\"LFS.exe\"+1B6108");
  551.                         float value37 = 1298.392f;
  552.                         memory.WriteFloat(address44, value37);
  553.                         IntPtr address45 = memory.GetAddress("\"LFS.exe\"+1B610C");
  554.                         byte[] bytes13 = BitConverter.GetBytes(memory.ReadInt32(address45));
  555.                         byte[] array13 = bytes13;
  556.                         array13[3] = 4;
  557.                         byte[] value38 = new byte[]
  558.                         {
  559.                             array13[0],
  560.                             array13[1],
  561.                             array13[2],
  562.                             array13[3]
  563.                         };
  564.                         int value39 = BitConverter.ToInt32(value38, 0);
  565.                         memory.WriteInt32(address45, value39);
  566.                         IntPtr address46 = memory.GetAddress("\"LFS.exe\"+1B6118");
  567.                         float value40 = 0.83f;
  568.                         memory.WriteFloat(address46, value40);
  569.                         IntPtr address47 = memory.GetAddress("\"LFS.exe\"+1B6128");
  570.                         float value41 = 0.6f;
  571.                         memory.WriteFloat(address47, value41);
  572.                         IntPtr address48 = memory.GetAddress("\"LFS.exe\"+1B611C");
  573.                         float value42 = 1f;
  574.                         memory.WriteFloat(address48, value42);
  575.                         IntPtr address49 = memory.GetAddress("\"LFS.exe\"+1B6100");
  576.                         int value43 = 12;
  577.                         memory.WriteInt32(address49, value43);
  578.                         IntPtr address50 = memory.GetAddress("\"LFS.exe\"+1B6110");
  579.                         float value44 = 1f;
  580.                         memory.WriteFloat(address50, value44);
  581.                         IntPtr address51 = memory.GetAddress("\"LFS.exe\"+1B6114");
  582.                         float value45 = 0.4f;
  583.                         memory.WriteFloat(address51, value45);
  584.                         IntPtr address52 = memory.GetAddress("\"LFS.exe\"+1B6124");
  585.                         float value46 = 837.7581f;
  586.                         memory.WriteFloat(address52, value46);
  587.                         IntPtr address53 = memory.GetAddress("\"LFS.exe\"+1B63E0");
  588.                         float value47 = 45f;
  589.                         memory.WriteFloat(address53, value47);
  590.                         IntPtr address54 = memory.GetAddress("\"LFS.exe\"+1B60F8");
  591.                         int value48 = 2;
  592.                         memory.WriteInt32(address54, value48);
  593.                         IntPtr address55 = memory.GetAddress("\"LFS.exe\"+1B60F4");
  594.                         int value49 = 1;
  595.                         memory.WriteInt32(address55, value49);
  596.                         IntPtr address56 = memory.GetAddress("\"LFS.exe\"+1B63B8");
  597.                         float value50 = 1.125f;
  598.                         memory.WriteFloat(address56, value50);
  599.                         IntPtr address57 = memory.GetAddress("\"LFS.exe\"+1B63AC");
  600.                         float value51 = -1.39881074f;
  601.                         memory.WriteFloat(address57, value51);
  602.                         IntPtr address58 = memory.GetAddress("\"LFS.exe\"+1B63BC");
  603.                         float value52 = 0.3f;
  604.                         memory.WriteFloat(address58, value52);
  605.                         IntPtr address59 = memory.GetAddress("\"LFS.exe\"+1B6D50");
  606.                         float value53 = 0.4f;
  607.                         memory.WriteFloat(address59, value53);
  608.                         IntPtr address60 = memory.GetAddress("\"LFS.exe\"+1B6850");
  609.                         float value54 = 0.185f;
  610.                         memory.WriteFloat(address60, value54);
  611.                         IntPtr address61 = memory.GetAddress("\"LFS.exe\"+1B6854");
  612.                         float value55 = 0.5f;
  613.                         memory.WriteFloat(address61, value55);
  614.                         IntPtr address62 = memory.GetAddress("\"LFS.exe\"+1B685C");
  615.                         float value56 = 0.1778f;
  616.                         memory.WriteFloat(address62, value56);
  617.                         IntPtr address63 = memory.GetAddress("\"LFS.exe\"+1B6858");
  618.                         float value57 = 0.190499991f;
  619.                         memory.WriteFloat(address63, value57);
  620.                         IntPtr address64 = memory.GetAddress("\"LFS.exe\"+1B6878");
  621.                         float value58 = 0.063f;
  622.                         memory.WriteFloat(address64, value58);
  623.                         IntPtr address65 = memory.GetAddress("\"LFS.exe\"+1B683C");
  624.                         float value59 = 1.36f;
  625.                         memory.WriteFloat(address65, value59);
  626.                         IntPtr address66 = memory.GetAddress("\"LFS.exe\"+1B6874");
  627.                         float value60 = 0.209439516f;
  628.                         memory.WriteFloat(address66, value60);
  629.                         IntPtr address67 = memory.GetAddress("\"LFS.exe\"+1B67FC");
  630.                         float value61 = 0.941f;
  631.                         memory.WriteFloat(address67, value61);
  632.                         IntPtr address68 = memory.GetAddress("\"LFS.exe\"+1B6808");
  633.                         float value62 = 0.941f;
  634.                         memory.WriteFloat(address68, value62);
  635.                         IntPtr address69 = memory.GetAddress("\"LFS.exe\"+1B7770");
  636.                         byte[] bytes14 = BitConverter.GetBytes(memory.ReadInt32(address69));
  637.                         byte[] array14 = bytes14;
  638.                         array14[0] = 2;
  639.                         byte[] value63 = new byte[]
  640.                         {
  641.                             array14[0],
  642.                             array14[1],
  643.                             array14[2],
  644.                             array14[3]
  645.                         };
  646.                         int value64 = BitConverter.ToInt32(value63, 0);
  647.                         memory.WriteInt32(address69, value64);
  648.                         IntPtr address70 = memory.GetAddress("\"LFS.exe\"+1B7788");
  649.                         float value65 = 1800f;
  650.                         memory.WriteFloat(address70, value65);
  651.                         IntPtr address71 = memory.GetAddress("\"LFS.exe\"+1B778C");
  652.                         byte[] bytes15 = BitConverter.GetBytes(memory.ReadInt32(address71));
  653.                         byte[] array15 = bytes15;
  654.                         array15[0] = 4;
  655.                         byte[] value66 = new byte[]
  656.                         {
  657.                             array15[0],
  658.                             array15[1],
  659.                             array15[2],
  660.                             array15[3]
  661.                         };
  662.                         int value67 = BitConverter.ToInt32(value66, 0);
  663.                         memory.WriteInt32(address71, value67);
  664.                         IntPtr address72 = memory.GetAddress("\"LFS.exe\"+1B7798");
  665.                         float value68 = 0.854347467f;
  666.                         memory.WriteFloat(address72, value68);
  667.                         IntPtr address73 = memory.GetAddress("\"LFS.exe\"+1B77A8");
  668.                         float value69 = 0.5625002f;
  669.                         memory.WriteFloat(address73, value69);
  670.                         IntPtr address74 = memory.GetAddress("\"LFS.exe\"+1B779C");
  671.                         float value70 = 1f;
  672.                         memory.WriteFloat(address74, value70);
  673.                         IntPtr address75 = memory.GetAddress("\"LFS.exe\"+1B7780");
  674.                         int value71 = 12;
  675.                         memory.WriteInt32(address75, value71);
  676.                         IntPtr address76 = memory.GetAddress("\"LFS.exe\"+1B7790");
  677.                         float value72 = 1f;
  678.                         memory.WriteFloat(address76, value72);
  679.                         IntPtr address77 = memory.GetAddress("\"LFS.exe\"+1B7794");
  680.                         float value73 = 0.4f;
  681.                         memory.WriteFloat(address77, value73);
  682.                         IntPtr address78 = memory.GetAddress("\"LFS.exe\"+1B77A4");
  683.                         float value74 = 733.0383f;
  684.                         memory.WriteFloat(address78, value74);
  685.                         IntPtr address79 = memory.GetAddress("\"LFS.exe\"+1B7A60");
  686.                         float value75 = 65f;
  687.                         memory.WriteFloat(address79, value75);
  688.                         IntPtr address80 = memory.GetAddress("\"LFS.exe\"+1B7778");
  689.                         int value76 = 1;
  690.                         memory.WriteInt32(address80, value76);
  691.                         IntPtr address81 = memory.GetAddress("\"LFS.exe\"+1B7774");
  692.                         int value77 = 1;
  693.                         memory.WriteInt32(address81, value77);
  694.                         IntPtr address82 = memory.GetAddress("\"LFS.exe\"+1B7A38");
  695.                         float value78 = 1.50000012f;
  696.                         memory.WriteFloat(address82, value78);
  697.                         IntPtr address83 = memory.GetAddress("\"LFS.exe\"+1B7A3C");
  698.                         float value79 = 0.532142758f;
  699.                         memory.WriteFloat(address83, value79);
  700.                         IntPtr address84 = memory.GetAddress("\"LFS.exe\"+1B7A2C");
  701.                         float value80 = -1.49107027f;
  702.                         memory.WriteFloat(address84, value80);
  703.                         IntPtr address85 = memory.GetAddress("\"LFS.exe\"+1B9580");
  704.                         float value81 = 0.4f;
  705.                         memory.WriteFloat(address85, value81);
  706.                         IntPtr address86 = memory.GetAddress("\"LFS.exe\"+1B7F78");
  707.                         float value82 = 0.185f;
  708.                         memory.WriteFloat(address86, value82);
  709.                         IntPtr address87 = memory.GetAddress("\"LFS.exe\"+1B7F7C");
  710.                         float value83 = 0.55f;
  711.                         memory.WriteFloat(address87, value83);
  712.                         IntPtr address88 = memory.GetAddress("\"LFS.exe\"+1B7F84");
  713.                         float value84 = 0.1778f;
  714.                         memory.WriteFloat(address88, value84);
  715.                         IntPtr address89 = memory.GetAddress("\"LFS.exe\"+1B7F80");
  716.                         float value85 = 0.2032f;
  717.                         memory.WriteFloat(address89, value85);
  718.                         IntPtr address90 = memory.GetAddress("\"LFS.exe\"+1B7FA0");
  719.                         float value86 = 0.072f;
  720.                         memory.WriteFloat(address90, value86);
  721.                         IntPtr address91 = memory.GetAddress("\"LFS.exe\"+1B7F9C");
  722.                         float value87 = 0.2007129f;
  723.                         memory.WriteFloat(address91, value87);
  724.                         IntPtr address92 = memory.GetAddress("\"LFS.exe\"+1B7F0C");
  725.                         float value88 = 1.126572f;
  726.                         memory.WriteFloat(address92, value88);
  727.                         IntPtr address93 = memory.GetAddress("\"LFS.exe\"+1B7F18");
  728.                         float value89 = 1.126572f;
  729.                         memory.WriteFloat(address93, value89);
  730.                         IntPtr address94 = memory.GetAddress("\"LFS.exe\"+1B7F60");
  731.                         float value90 = 0.09517069f;
  732.                         memory.WriteFloat(address94, value90);
  733.                         IntPtr address95 = memory.GetAddress("\"LFS.exe\"+1B7F38");
  734.                         float value91 = 0.22f;
  735.                         memory.WriteFloat(address95, value91);
  736.                         IntPtr address96 = memory.GetAddress("\"LFS.exe\"+1B7F3C");
  737.                         float value92 = 0.5f;
  738.                         memory.WriteFloat(address96, value92);
  739.                         IntPtr address97 = memory.GetAddress("\"LFS.exe\"+1B7F44");
  740.                         float value93 = 0.1905f;
  741.                         memory.WriteFloat(address97, value93);
  742.                         IntPtr address98 = memory.GetAddress("\"LFS.exe\"+1B7F40");
  743.                         float value94 = 0.2032f;
  744.                         memory.WriteFloat(address98, value94);
  745.                         IntPtr address99 = memory.GetAddress("\"LFS.exe\"+1B7F5C");
  746.                         float value95 = 0.2007129f;
  747.                         memory.WriteFloat(address99, value95);
  748.                         IntPtr address100 = memory.GetAddress("\"LFS.exe\"+1B7F24");
  749.                         float value96 = -1.326286f;
  750.                         memory.WriteFloat(address100, value96);
  751.                         IntPtr address101 = memory.GetAddress("\"LFS.exe\"+1B7F30");
  752.                         float value97 = -1.326286f;
  753.                         memory.WriteFloat(address101, value97);
  754.                         IntPtr address102 = memory.GetAddress("\"LFS.exe\"+000C792C+C");
  755.                         IntPtr address103 = memory.GetAddress("\"LFS.exe\"+000C79D0+4");
  756.                         IntPtr address104 = memory.GetAddress("\"LFS.exe\"+000C79F4+2C");
  757.                         IntPtr address105 = memory.GetAddress("\"LFS.exe\"+000C7FDC+4");
  758.                         float value98 = 104.71f;
  759.                         memory.WriteFloat(address102, value98);
  760.                         memory.WriteFloat(address103, value98);
  761.                         memory.WriteFloat(address104, value98);
  762.                         memory.WriteFloat(address105, value98);
  763.                         IntPtr address106 = memory.GetAddress("\"LFS.exe\"+0013A364+20");
  764.                         float value99 = 209.42f;
  765.                         memory.WriteFloat(address106, value99);
  766.                         IntPtr address107 = memory.GetAddress("\"LFS.exe\"+000C7BD8+C");
  767.                         float value100 = 157.064941f;
  768.                         memory.WriteFloat(address107, value100);
  769.                         IntPtr address108 = memory.GetAddress("\"LFS.exe\"+005AAEE4+1FC+504");
  770.                         double num = memory.ReadDouble(address108);
  771.                         bool flag2 = num > 1.0;
  772.                         if (flag2)
  773.                         {
  774.                             float value101 = 1f;
  775.                             memory.WriteFloat(address108, value101);
  776.                         }
  777.                     }
  778.                 }
  779.             }
  780.             catch
  781.             {
  782.             }
  783.         }
  784.  
  785.         // Token: 0x06000023 RID: 35 RVA: 0x00004280 File Offset: 0x00002480
  786.         private void WriteCustomValues()
  787.         {
  788.             try
  789.             {
  790.                 Process[] processesByName = Process.GetProcessesByName("LFS");
  791.                 bool flag = processesByName.Length != 0;
  792.                 if (flag)
  793.                 {
  794.                     using (Memory memory = new Memory(processesByName[0]))
  795.                     {
  796.                         IntPtr address = memory.GetAddress("\"LFS.exe\"+0002E130+0");
  797.                         byte[] bytes = BitConverter.GetBytes(memory.ReadFloat(address));
  798.                         IntPtr address2 = memory.GetAddress("\"LFS.exe\"+0002E130+4");
  799.                         byte[] bytes2 = BitConverter.GetBytes(memory.ReadFloat(address2));
  800.                         IntPtr address3 = memory.GetAddress("\"LFS.exe\"+0002E130+8");
  801.                         byte[] bytes3 = BitConverter.GetBytes(memory.ReadFloat(address3));
  802.                         string @string = Encoding.UTF8.GetString(bytes);
  803.                         string string2 = Encoding.UTF8.GetString(bytes2);
  804.                         string string3 = Encoding.UTF8.GetString(bytes3);
  805.                         string text = @string + string2 + string3;
  806.                         text = text.Replace("UF 1000", "UF1").Replace("XR GT TURBO", "XRT").Replace("XR GTR", "XRR").Replace("FZ50 GTR", "FZR").Replace("XF GTI", "XFG").Replace("XR GT", "XRG").Replace("LX4", "LX4").Replace("LX6", "LX6").Replace("RB4 GT", "RB4").Replace("FXO TURBO", "FXO").Replace("RACEABOUT", "RAC").Replace("FZ50", "FZ5").Replace("UF GTR", "UFR").Replace("XF GTR", "XFR").Replace("FXO GTR", "FXR").Replace("MRT5", "MRT").Replace("FORMULA BMW ", "FBM").Replace("FORMULA XR", "FOX").Replace("FORMULA V8", "FO8").Replace("BMW SAUBER F", "BF1");
  807.                         text = text.Substring(0, 3);
  808.                         int num = 0;
  809.                         try
  810.                         {
  811.                             IntPtr address4 = memory.GetAddress("\"LFS.exe\"+005AAEE4+1F8");
  812.                             num = memory.ReadInt32(address4);
  813.                         }
  814.                         catch
  815.                         {
  816.                             num = 0;
  817.                         }
  818.                         int num2 = 0;
  819.                         bool flag2 = false;
  820.                         int num3 = 0;
  821.                         double num4 = 0.0;
  822.                         int num5 = 0;
  823.                         double num6 = 0.0;
  824.                         double num7 = 0.0;
  825.                         int num8 = 0;
  826.                         string str = "";
  827.                         while (num2 < 64 && !flag2)
  828.                         {
  829.                             str = str + this.CustomCarName[num2] + " ";
  830.                             bool flag3 = this.CustomCarName[num2] == text;
  831.                             if (flag3)
  832.                             {
  833.                                 num3 = this.CustomCarTCS[num2];
  834.                                 num4 = this.CustomCarEngine[num2];
  835.                                 num5 = this.CustomCarTurboEnabled[num2];
  836.                                 num6 = this.CustomCarTurboPressure[num2];
  837.                                 num7 = this.CustomCarClutch[num2];
  838.                                 num8 = this.CustomCarGears[num2];
  839.                                 flag2 = true;
  840.                             }
  841.                             num2++;
  842.                         }
  843.                         bool flag4 = flag2;
  844.                         if (flag4)
  845.                         {
  846.                             bool flag5 = text == "UF1" || text == "XFG" || text == "XRG";
  847.                             if (flag5)
  848.                             {
  849.                                 IntPtr address5 = memory.GetAddress("\"LFS.exe\"+000C79BC+0");
  850.                                 float value = (float)num4;
  851.                                 memory.WriteFloat(address5, value);
  852.                                 IntPtr address6 = memory.GetAddress("\"LFS.exe\"+000C7954+4");
  853.                                 byte[] bytes4 = BitConverter.GetBytes(memory.ReadInt32(address6));
  854.                                 byte[] array = bytes4;
  855.                                 array[2] = (byte)(num8 + 2);
  856.                                 byte[] value2 = new byte[]
  857.                                 {
  858.                                     array[0],
  859.                                     array[1],
  860.                                     array[2],
  861.                                     array[3]
  862.                                 };
  863.                                 int value3 = BitConverter.ToInt32(value2, 0);
  864.                                 memory.WriteInt32(address6, value3);
  865.                             }
  866.                             else
  867.                             {
  868.                                 bool flag6 = text == "MRT";
  869.                                 if (flag6)
  870.                                 {
  871.                                     IntPtr address7 = memory.GetAddress("\"LFS.exe\"+000C7FB8+4");
  872.                                     float value4 = (float)num4;
  873.                                     memory.WriteFloat(address7, value4);
  874.                                     IntPtr address8 = memory.GetAddress("\"LFS.exe\"+000C7F3C+4");
  875.                                     byte[] bytes5 = BitConverter.GetBytes(memory.ReadInt32(address8));
  876.                                     byte[] array2 = bytes5;
  877.                                     array2[2] = (byte)(num8 + 2);
  878.                                     byte[] value5 = new byte[]
  879.                                     {
  880.                                         array2[0],
  881.                                         array2[1],
  882.                                         array2[2],
  883.                                         array2[3]
  884.                                     };
  885.                                     int value6 = BitConverter.ToInt32(value5, 0);
  886.                                     memory.WriteInt32(address8, value6);
  887.                                 }
  888.                                 else
  889.                                 {
  890.                                     bool flag7 = text == "UFR" || text == "XFR" || text == "FXR" || text == "XRR" || text == "FZR";
  891.                                     if (flag7)
  892.                                     {
  893.                                         IntPtr address9 = memory.GetAddress("\"LFS.exe\"+000C7BC4+4");
  894.                                         float value7 = (float)num4;
  895.                                         memory.WriteFloat(address9, value7);
  896.                                         IntPtr address10 = memory.GetAddress("\"LFS.exe\"+0013A364+30");
  897.                                         byte[] bytes6 = BitConverter.GetBytes(memory.ReadInt32(address10));
  898.                                         byte[] array3 = bytes6;
  899.                                         array3[2] = (byte)(num8 + 2);
  900.                                         byte[] value8 = new byte[]
  901.                                         {
  902.                                             array3[0],
  903.                                             array3[1],
  904.                                             array3[2],
  905.                                             array3[3]
  906.                                         };
  907.                                         int value9 = BitConverter.ToInt32(value8, 0);
  908.                                         memory.WriteInt32(address10, value9);
  909.                                     }
  910.                                     else
  911.                                     {
  912.                                         bool flag8 = text == "FBM" || text == "FOX" || text == "FO8";
  913.                                         if (flag8)
  914.                                         {
  915.                                             IntPtr address11 = memory.GetAddress("\"LFS.exe\"+0013A364+10");
  916.                                             float value10 = (float)num4;
  917.                                             memory.WriteFloat(address11, value10);
  918.                                             IntPtr address12 = memory.GetAddress("\"LFS.exe\"+000C7AD4+0");
  919.                                             byte[] bytes7 = BitConverter.GetBytes(memory.ReadInt32(address12));
  920.                                             byte[] array4 = bytes7;
  921.                                             array4[2] = (byte)(num8 + 2);
  922.                                             byte[] value11 = new byte[]
  923.                                             {
  924.                                                 array4[0],
  925.                                                 array4[1],
  926.                                                 array4[2],
  927.                                                 array4[3]
  928.                                             };
  929.                                             int value12 = BitConverter.ToInt32(value11, 0);
  930.                                             memory.WriteInt32(address12, value12);
  931.                                         }
  932.                                         else
  933.                                         {
  934.                                             bool flag9 = text == "XRT" || text == "RB4" || text == "FZ5" || text == "LX4" || text == "LX6" || text == "RAC" || text == "FXO";
  935.                                             if (flag9)
  936.                                             {
  937.                                                 IntPtr address13 = memory.GetAddress("\"LFS.exe\"+000C7918+4");
  938.                                                 float value13 = (float)num4;
  939.                                                 memory.WriteFloat(address13, value13);
  940.                                                 IntPtr address14 = memory.GetAddress("\"LFS.exe\"+0004F91C+10");
  941.                                                 byte[] bytes8 = BitConverter.GetBytes(memory.ReadInt32(address14));
  942.                                                 byte[] array5 = bytes8;
  943.                                                 array5[2] = (byte)(num8 + 2);
  944.                                                 byte[] value14 = new byte[]
  945.                                                 {
  946.                                                     array5[0],
  947.                                                     array5[1],
  948.                                                     array5[2],
  949.                                                     array5[3]
  950.                                                 };
  951.                                                 int value15 = BitConverter.ToInt32(value14, 0);
  952.                                                 memory.WriteInt32(address14, value15);
  953.                                             }
  954.                                         }
  955.                                     }
  956.                                 }
  957.                             }
  958.                             bool flag10 = num != 0;
  959.                             if (flag10)
  960.                             {
  961.                                 try
  962.                                 {
  963.                                     IntPtr address15 = memory.GetAddress("\"LFS.exe\"+005AAEE4+1F8+500");
  964.                                     float value16 = (float)num7;
  965.                                     memory.WriteFloat(address15, value16);
  966.                                     bool flag11 = num3 == 1;
  967.                                     if (flag11)
  968.                                     {
  969.                                         IntPtr address16 = memory.GetAddress("\"LFS.exe\"+00438690+9C+768");
  970.                                         int num9 = memory.ReadInt32(address16);
  971.                                         memory.WriteInt32(address16, 1);
  972.                                     }
  973.                                     bool flag12 = num5 == 1;
  974.                                     if (flag12)
  975.                                     {
  976.                                         IntPtr address17 = memory.GetAddress("\"LFS.exe\"+0042D4D8+1E8+488");
  977.                                         int value17 = 13;
  978.                                         memory.WriteInt32(address17, value17);
  979.                                         IntPtr address18 = memory.GetAddress("\"LFS.exe\"+005AAEE4+1F8+4A8");
  980.                                         float value18 = (float)num6;
  981.                                         memory.WriteFloat(address18, value18);
  982.                                     }
  983.                                     else
  984.                                     {
  985.                                         IntPtr address19 = memory.GetAddress("\"LFS.exe\"+0042D4D8+1E8+488");
  986.                                         int value19 = 12;
  987.                                         memory.WriteInt32(address19, value19);
  988.                                     }
  989.                                 }
  990.                                 catch
  991.                                 {
  992.                                 }
  993.                             }
  994.                         }
  995.                         else
  996.                         {
  997.                             this.WriteDefaultValues();
  998.                         }
  999.                     }
  1000.                 }
  1001.             }
  1002.             catch (Exception ex)
  1003.             {
  1004.             }
  1005.         }
  1006.  
  1007.         // Token: 0x06000024 RID: 36 RVA: 0x00004A98 File Offset: 0x00002C98
  1008.         private void TweakWrite_500ms_Elapsed(object sender, ElapsedEventArgs e)
  1009.         {
  1010.             try
  1011.             {
  1012.                 Process[] processesByName = Process.GetProcessesByName("LFS");
  1013.                 bool flag = processesByName.Length != 0;
  1014.                 if (flag)
  1015.                 {
  1016.                     using (Memory memory = new Memory(processesByName[0]))
  1017.                     {
  1018.                         IntPtr address = memory.GetAddress("\"LFS.exe\"+005AAEE4+1F8");
  1019.                         int num = memory.ReadInt32(address);
  1020.                         bool flag2 = num == 0;
  1021.                         if (flag2)
  1022.                         {
  1023.                             this.WriteCustomValues();
  1024.                         }
  1025.                     }
  1026.                 }
  1027.             }
  1028.             catch
  1029.             {
  1030.             }
  1031.         }
  1032.  
  1033.         // Token: 0x06000025 RID: 37 RVA: 0x00004B24 File Offset: 0x00002D24
  1034.         private void TweakWrite_2Sec_Elapsed(object sender, ElapsedEventArgs e)
  1035.         {
  1036.             try
  1037.             {
  1038.                 Process[] processesByName = Process.GetProcessesByName("LFS");
  1039.                 bool flag = processesByName.Length != 0;
  1040.                 if (flag)
  1041.                 {
  1042.                     using (new Memory(processesByName[0]))
  1043.                     {
  1044.                         this.WriteCustomValues();
  1045.                     }
  1046.                 }
  1047.             }
  1048.             catch
  1049.             {
  1050.             }
  1051.         }
  1052.  
  1053.         // Token: 0x06000026 RID: 38 RVA: 0x00004B8C File Offset: 0x00002D8C
  1054.         private void TweakRead_6Sec_Elapsed(object sender, ElapsedEventArgs e)
  1055.         {
  1056.             try
  1057.             {
  1058.                 Process[] processesByName = Process.GetProcessesByName("LFS");
  1059.                 bool flag = processesByName.Length != 0;
  1060.                 if (flag)
  1061.                 {
  1062.                     using (Memory memory = new Memory(processesByName[0]))
  1063.                     {
  1064.                         IntPtr address = memory.GetAddress("\"LFS.exe\"+0042D4D8+1E8+E50");
  1065.                         float num = memory.ReadFloat(address);
  1066.                         IntPtr address2 = memory.GetAddress("\"LFS.exe\"+005AAEE4+1F8");
  1067.                         int num2 = memory.ReadInt32(address2);
  1068.                         bool flag2 = num < 3f || num2 == 0;
  1069.                         if (flag2)
  1070.                         {
  1071.                             this.ReadPlayerCarsFromDB();
  1072.                         }
  1073.                     }
  1074.                 }
  1075.             }
  1076.             catch
  1077.             {
  1078.             }
  1079.         }
  1080.  
  1081.         // Token: 0x06000027 RID: 39 RVA: 0x00004C40 File Offset: 0x00002E40
  1082.         private void TweakRead_100ms_Elapsed(object sender, ElapsedEventArgs e)
  1083.         {
  1084.             try
  1085.             {
  1086.                 Process[] processesByName = Process.GetProcessesByName("LFS");
  1087.                 bool flag = processesByName.Length != 0;
  1088.                 if (flag)
  1089.                 {
  1090.                     using (Memory memory = new Memory(processesByName[0]))
  1091.                     {
  1092.                         IntPtr address = memory.GetAddress("\"LFS.exe\"+0002E130+0");
  1093.                         byte[] bytes = BitConverter.GetBytes(memory.ReadFloat(address));
  1094.                         IntPtr address2 = memory.GetAddress("\"LFS.exe\"+0002E130+4");
  1095.                         byte[] bytes2 = BitConverter.GetBytes(memory.ReadFloat(address2));
  1096.                         IntPtr address3 = memory.GetAddress("\"LFS.exe\"+0002E130+8");
  1097.                         byte[] bytes3 = BitConverter.GetBytes(memory.ReadFloat(address3));
  1098.                         string @string = Encoding.UTF8.GetString(bytes);
  1099.                         string string2 = Encoding.UTF8.GetString(bytes2);
  1100.                         string string3 = Encoding.UTF8.GetString(bytes3);
  1101.                         string text = @string + string2 + string3;
  1102.                         text = text.Replace("UF 1000", "UF1").Replace("XR GT TURBO", "XRT").Replace("XR GTR", "XRR").Replace("FZ50 GTR", "FZR").Replace("XF GTI", "XFG").Replace("XR GT", "XRG").Replace("LX4", "LX4").Replace("LX6", "LX6").Replace("RB4 GT", "RB4").Replace("FXO TURBO", "FXO").Replace("RACEABOUT", "RAC").Replace("FZ50", "FZ5").Replace("UF GTR", "UFR").Replace("XF GTR", "XFR").Replace("FXO GTR", "FXR").Replace("MRT5", "MRT").Replace("FORMULA BMW ", "FBM").Replace("FORMULA XR", "FOX").Replace("FORMULA V8", "FO8").Replace("BMW SAUBER F", "BF1");
  1103.                         text = text.Substring(0, 3);
  1104.                         bool flag2 = text != this.CurrentCar;
  1105.                         if (flag2)
  1106.                         {
  1107.                             this.ReadPlayerCarsFromDB();
  1108.                             this.WriteCustomValues();
  1109.                             this.CurrentCar = text;
  1110.                         }
  1111.                         IntPtr address4 = memory.GetAddress("\"LFS.exe\"+005AAEE4+1F8");
  1112.                         int num = memory.ReadInt32(address4);
  1113.                         bool flag3 = num == 0;
  1114.                         if (flag3)
  1115.                         {
  1116.                             this.PlayerPitted = true;
  1117.                         }
  1118.                         else
  1119.                         {
  1120.                             bool flag4 = num != 0 && this.PlayerPitted;
  1121.                             if (flag4)
  1122.                             {
  1123.                                 this.PlayerPitted = false;
  1124.                                 this.FuelWriteDelay = true;
  1125.                             }
  1126.                         }
  1127.                     }
  1128.                 }
  1129.             }
  1130.             catch
  1131.             {
  1132.             }
  1133.         }
  1134.  
  1135.         // Token: 0x06000028 RID: 40 RVA: 0x00004EFC File Offset: 0x000030FC
  1136.         private void ReadPlayerCarsFromDB()
  1137.         {
  1138.             try
  1139.             {
  1140.                 WebClient webClient = new WebClient();
  1141.                 Stream stream = webClient.OpenRead(new Uri("http://35.198.16.153/query/lfspro_launcher_carspecs.php?Username=" + this.Username));
  1142.                 StreamReader streamReader = new StreamReader(stream);
  1143.                 string text = streamReader.ReadToEnd();
  1144.                 string[] array = text.Split(new char[]
  1145.                 {
  1146.                     '|'
  1147.                 });
  1148.                 bool flag = false;
  1149.                 int num = 0;
  1150.                 while (!flag)
  1151.                 {
  1152.                     bool flag2 = array[num].Length > 1;
  1153.                     if (flag2)
  1154.                     {
  1155.                         string[] array2 = array[num].Split(new char[]
  1156.                         {
  1157.                             '$'
  1158.                         });
  1159.                         this.CustomCarName[num] = array2[0];
  1160.                         this.CustomCarTCS[num] = Convert.ToInt32(array2[1]);
  1161.                         this.CustomCarEngine[num] = double.Parse(array2[2], CultureInfo.InvariantCulture);
  1162.                         this.CustomCarTurboPressure[num] = double.Parse(array2[3], CultureInfo.InvariantCulture);
  1163.                         this.CustomCarTurboEnabled[num] = Convert.ToInt32(array2[4]);
  1164.                         this.CustomCarClutch[num] = double.Parse(array2[5], CultureInfo.InvariantCulture);
  1165.                         this.CustomCarGears[num] = Convert.ToInt32(array2[6]);
  1166.                     }
  1167.                     else
  1168.                     {
  1169.                         flag = true;
  1170.                     }
  1171.                     num++;
  1172.                 }
  1173.             }
  1174.             catch
  1175.             {
  1176.             }
  1177.         }
  1178.  
  1179.         // Token: 0x06000029 RID: 41 RVA: 0x00005054 File Offset: 0x00003254
  1180.         private void FuelRead_6Sec_Elapsed(object sender, ElapsedEventArgs e)
  1181.         {
  1182.             try
  1183.             {
  1184.                 Process[] processesByName = Process.GetProcessesByName("LFS");
  1185.                 bool flag = processesByName.Length != 0;
  1186.                 if (flag)
  1187.                 {
  1188.                     using (Memory memory = new Memory(processesByName[0]))
  1189.                     {
  1190.                         float num = 0f;
  1191.                         WebClient webClient = new WebClient();
  1192.                         Stream stream = webClient.OpenRead(new Uri("http://35.198.16.153/query/lfspro_launcher_fuelreload.php?Username=" + this.Username + "&Car=" + this.CurrentCar));
  1193.                         StreamReader streamReader = new StreamReader(stream);
  1194.                         string text = streamReader.ReadToEnd();
  1195.                         bool flag2 = text.Contains("1");
  1196.                         if (flag2)
  1197.                         {
  1198.                             WebClient webClient2 = new WebClient();
  1199.                             Stream stream2 = webClient2.OpenRead(new Uri("http://35.198.16.153/query/lfspro_launcher_readfuel.php?Username=" + this.Username + "&Car=" + this.CurrentCar));
  1200.                             StreamReader streamReader2 = new StreamReader(stream2);
  1201.                             string s = streamReader2.ReadToEnd();
  1202.                             num = float.Parse(s, CultureInfo.InvariantCulture);
  1203.                         }
  1204.                         IntPtr address = memory.GetAddress("\"LFS.exe\"+0042D4D8+1E8+650");
  1205.                         float num2 = memory.ReadFloat(address);
  1206.                         bool flag3 = num > num2 || this.FuelWriteDelay;
  1207.                         if (flag3)
  1208.                         {
  1209.                             this.WriteFuel();
  1210.                             this.FuelWriteDelay = false;
  1211.                         }
  1212.                     }
  1213.                 }
  1214.             }
  1215.             catch
  1216.             {
  1217.             }
  1218.         }
  1219.  
  1220.         // Token: 0x0600002A RID: 42 RVA: 0x000051B8 File Offset: 0x000033B8
  1221.         private void WriteFuel()
  1222.         {
  1223.             try
  1224.             {
  1225.                 Process[] processesByName = Process.GetProcessesByName("LFS");
  1226.                 bool flag = processesByName.Length != 0;
  1227.                 if (flag)
  1228.                 {
  1229.                     using (Memory memory = new Memory(processesByName[0]))
  1230.                     {
  1231.                         WebClient webClient = new WebClient();
  1232.                         Stream stream = webClient.OpenRead(new Uri("http://35.198.16.153/query/lfspro_launcher_readfuel.php?Username=" + this.Username + "&Car=" + this.CurrentCar));
  1233.                         StreamReader streamReader = new StreamReader(stream);
  1234.                         string s = streamReader.ReadToEnd();
  1235.                         float value = float.Parse(s, CultureInfo.InvariantCulture);
  1236.                         IntPtr address = memory.GetAddress("\"LFS.exe\"+0042D4D8+1E8+650");
  1237.                         memory.WriteFloat(address, value);
  1238.                         WebClient webClient2 = new WebClient();
  1239.                         webClient2.OpenRead(new Uri("http://35.198.16.153/query/lfspro_launcher_fuelreset.php?Username=" + this.Username + "&Car=" + this.CurrentCar));
  1240.                     }
  1241.                 }
  1242.             }
  1243.             catch
  1244.             {
  1245.             }
  1246.         }
  1247.  
  1248.         // Token: 0x0600002B RID: 43 RVA: 0x000052B4 File Offset: 0x000034B4
  1249.         private void FuelSave_20Sec_Elapsed(object sender, ElapsedEventArgs e)
  1250.         {
  1251.             try
  1252.             {
  1253.                 bool flag = !this.FuelWriteDelay;
  1254.                 if (flag)
  1255.                 {
  1256.                     Process[] processesByName = Process.GetProcessesByName("LFS");
  1257.                     bool flag2 = processesByName.Length != 0;
  1258.                     if (flag2)
  1259.                     {
  1260.                         using (Memory memory = new Memory(processesByName[0]))
  1261.                         {
  1262.                             IntPtr address = memory.GetAddress("\"LFS.exe\"+0042D4D8+1E8+650");
  1263.                             float num = memory.ReadFloat(address);
  1264.                             WebClient webClient = new WebClient();
  1265.                             Stream stream = webClient.OpenRead(new Uri("http://35.198.16.153/query/lfspro_launcher_readfuel.php?Username=" + this.Username + "&Car=" + this.CurrentCar));
  1266.                             StreamReader streamReader = new StreamReader(stream);
  1267.                             string s = streamReader.ReadToEnd();
  1268.                             float num2 = float.Parse(s, CultureInfo.InvariantCulture);
  1269.                             string text = Convert.ToString(num).Replace(',', '.');
  1270.                             bool flag3 = num < num2;
  1271.                             if (flag3)
  1272.                             {
  1273.                                 WebClient webClient2 = new WebClient();
  1274.                                 webClient2.OpenRead(new Uri(string.Concat(new string[]
  1275.                                 {
  1276.                                     "http://35.198.16.153/query/lfspro_launcher_savefuel.php?Username=",
  1277.                                     this.Username,
  1278.                                     "&Password=",
  1279.                                     this.Password,
  1280.                                     "&FL=",
  1281.                                     text,
  1282.                                     "&Car=",
  1283.                                     this.CurrentCar
  1284.                                 })));
  1285.                             }
  1286.                         }
  1287.                     }
  1288.                 }
  1289.             }
  1290.             catch
  1291.             {
  1292.             }
  1293.         }
  1294.  
  1295.         // Token: 0x0600002C RID: 44 RVA: 0x00005428 File Offset: 0x00003628
  1296.         private void PlayerSave_60Sec_Elapsed(object sender, ElapsedEventArgs e)
  1297.         {
  1298.             try
  1299.             {
  1300.                 int num = new Random().Next(1, 200);
  1301.                 WebBrowser webBrowser = new WebBrowser();
  1302.                 webBrowser.Navigate(new Uri(string.Concat(new object[]
  1303.                 {
  1304.                     "http://35.198.16.153/query/lfspro_launcher_savelog.php?Username=",
  1305.                     this.Username,
  1306.                     "&Password=",
  1307.                     this.Password,
  1308.                     "&Checksum=",
  1309.                     num
  1310.                 })));
  1311.             }
  1312.             catch (Exception ex)
  1313.             {
  1314.             }
  1315.         }
  1316.  
  1317.         // Token: 0x0600002D RID: 45 RVA: 0x000054B0 File Offset: 0x000036B0
  1318.         protected override void Dispose(bool disposing)
  1319.         {
  1320.             bool flag = disposing && this.components != null;
  1321.             if (flag)
  1322.             {
  1323.                 this.components.Dispose();
  1324.             }
  1325.             base.Dispose(disposing);
  1326.         }
  1327.  
  1328.         // Token: 0x0600002E RID: 46 RVA: 0x000054E8 File Offset: 0x000036E8
  1329.         private void InitializeComponent()
  1330.         {
  1331.             base.SuspendLayout();
  1332.             base.AutoScaleDimensions = new SizeF(6f, 13f);
  1333.             base.AutoScaleMode = AutoScaleMode.Font;
  1334.             base.ClientSize = new Size(0, 0);
  1335.             base.ControlBox = false;
  1336.             base.FormBorderStyle = FormBorderStyle.None;
  1337.             base.Name = "CruiseTweak";
  1338.             this.Text = "CruiseTweak";
  1339.             base.WindowState = FormWindowState.Minimized;
  1340.             base.ResumeLayout(false);
  1341.         }
  1342.  
  1343.         // Token: 0x04000005 RID: 5
  1344.         private bool X64 = false;
  1345.  
  1346.         // Token: 0x04000006 RID: 6
  1347.         private bool PlayerValidated = false;
  1348.  
  1349.         // Token: 0x04000007 RID: 7
  1350.         private bool FuelWriteDelay = false;
  1351.  
  1352.         // Token: 0x04000008 RID: 8
  1353.         private bool PlayerPitted = false;
  1354.  
  1355.         // Token: 0x04000009 RID: 9
  1356.         private string Username = "";
  1357.  
  1358.         // Token: 0x0400000A RID: 10
  1359.         private string Password = "";
  1360.  
  1361.         // Token: 0x0400000B RID: 11
  1362.         private string LastUsername = "";
  1363.  
  1364.         // Token: 0x0400000C RID: 12
  1365.         private string CurrentCar = "";
  1366.  
  1367.         // Token: 0x0400000D RID: 13
  1368.         private int SetPlayerUsingLauncher = 0;
  1369.  
  1370.         // Token: 0x0400000E RID: 14
  1371.         private string[] CustomCarName = new string[64];
  1372.  
  1373.         // Token: 0x0400000F RID: 15
  1374.         private int[] CustomCarTCS = new int[64];
  1375.  
  1376.         // Token: 0x04000010 RID: 16
  1377.         private double[] CustomCarEngine = new double[64];
  1378.  
  1379.         // Token: 0x04000011 RID: 17
  1380.         private int[] CustomCarTurboEnabled = new int[64];
  1381.  
  1382.         // Token: 0x04000012 RID: 18
  1383.         private double[] CustomCarTurboPressure = new double[64];
  1384.  
  1385.         // Token: 0x04000013 RID: 19
  1386.         private double[] CustomCarClutch = new double[64];
  1387.  
  1388.         // Token: 0x04000014 RID: 20
  1389.         private int[] CustomCarGears = new int[64];
  1390.  
  1391.         // Token: 0x04000015 RID: 21
  1392.         private System.Timers.Timer TweakWrite_500ms = new System.Timers.Timer(500.0);
  1393.  
  1394.         // Token: 0x04000016 RID: 22
  1395.         private System.Timers.Timer TweakWrite_2Sec = new System.Timers.Timer(2000.0);
  1396.  
  1397.         // Token: 0x04000017 RID: 23
  1398.         private System.Timers.Timer TweakRead_6Sec = new System.Timers.Timer(6000.0);
  1399.  
  1400.         // Token: 0x04000018 RID: 24
  1401.         private System.Timers.Timer TweakRead_100ms = new System.Timers.Timer(100.0);
  1402.  
  1403.         // Token: 0x04000019 RID: 25
  1404.         private System.Timers.Timer FuelRead_6Sec = new System.Timers.Timer(6000.0);
  1405.  
  1406.         // Token: 0x0400001A RID: 26
  1407.         private System.Timers.Timer FuelSave_20Sec = new System.Timers.Timer(20000.0);
  1408.  
  1409.         // Token: 0x0400001B RID: 27
  1410.         private System.Timers.Timer PlayerSave_60Sec = new System.Timers.Timer(60000.0);
  1411.  
  1412.         // Token: 0x0400001C RID: 28
  1413.         private System.Timers.Timer Watchdog = new System.Timers.Timer(10000.0);
  1414.  
  1415.         // Token: 0x0400001D RID: 29
  1416.         private IContainer components = null;
  1417.     }
  1418. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement