Advertisement
Guest User

Untitled

a guest
Dec 29th, 2017
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 9.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Diagnostics;
  10. using System.IO;
  11.  
  12. namespace WindowsFormsApplication1
  13. {
  14.     // Token: 0x02000004 RID: 4
  15.     public partial class Form1 : Form
  16.     {
  17.         // Token: 0x0600000C RID: 12 RVA: 0x000030A0 File Offset: 0x000012A0
  18.         public Form1()
  19.         {
  20.             InitializeComponent();
  21.         }
  22.  
  23.         // Token: 0x0600000E RID: 14 RVA: 0x000030CE File Offset: 0x000012CE
  24.         private void button2_Click(object sender, EventArgs e)
  25.         {
  26.             File.WriteAllBytes(this.string_0, new Form1.GClass1(this.byte_0).Decrypt(File.ReadAllBytes(this.string_0)));
  27.             MessageBox.Show("Decrypt");
  28.         }
  29.  
  30.         // Token: 0x0600000F RID: 15 RVA: 0x00003101 File Offset: 0x00001301
  31.         private void button3_Click(object sender, EventArgs e)
  32.         {
  33.             File.WriteAllBytes(this.string_0, new Form1.GClass1(this.byte_0).Encrypt(File.ReadAllBytes(this.string_0)));
  34.             MessageBox.Show("Encrypt");
  35.         }
  36.  
  37.         // Token: 0x0600000D RID: 13 RVA: 0x00003554 File Offset: 0x00001754
  38.         private void button1_Click(object sender, EventArgs e)
  39.         {
  40.             OpenFileDialog openFileDialog = new OpenFileDialog
  41.             {
  42.                 Title = "Select Resident Evil Revelations 2 Save"
  43.             };
  44.             OpenFileDialog openFileDialog2 = openFileDialog;
  45.             try
  46.             {
  47.                 if (((openFileDialog2.ShowDialog() == (DialogResult)1) ? 1 : 0) != 0)
  48.                 {
  49.                     this.string_0 = openFileDialog2.FileName;
  50.                     this.textBox1.Text = this.string_0;
  51.                     this.button2.Enabled = (1 != 0);
  52.                     this.button3.Enabled = (1 != 0);
  53.                 }
  54.             }
  55.             finally
  56.             {
  57.                 if (openFileDialog2 != null)
  58.                 {
  59.                     ((IDisposable)openFileDialog2).Dispose();
  60.                 }
  61.             }
  62.         }
  63.  
  64.         // Token: 0x06000010 RID: 16 RVA: 0x00003134 File Offset: 0x00001334
  65.         private void label1_Click(object sender, EventArgs e)
  66.         {
  67.             Process.Start("https://www.youtube.com/user/TheDarkNachoXD");
  68.         }
  69.  
  70.         // Token: 0x04000005 RID: 5
  71.         public byte[] byte_0 = Encoding.ASCII.GetBytes("zW$2eWaHNdT~6j86T_&j");
  72.  
  73.         // Token: 0x04000006 RID: 6
  74.         private IContainer icontainer_0 = null;
  75.  
  76.         // Token: 0x04000004 RID: 4
  77.         public string string_0;
  78.  
  79.         // Token: 0x02000005 RID: 5
  80.         public class GClass1
  81.         {
  82.             // Token: 0x06000013 RID: 19 RVA: 0x00003A50 File Offset: 0x00001C50
  83.             public GClass1(byte[] KEY)
  84.             {
  85.                 //Las dos llamadas a la función de class4 quedan pendientes hasta saber que valores se les mete como parametro
  86.                 uint[] expr_10 = new uint[18];
  87.                 //Class4.c6dd15eaeef3c4180278360442316aea0(expr_10, 440);
  88.                 this.int_0 = (int[])(object)expr_10;
  89.                 uint[,] expr_3F = new uint[4, 256];
  90.                 //Class4.c6dd15eaeef3c4180278360442316aea0(expr_3F, 521);
  91.                 this.int_1 = (int[,])(object)expr_3F;
  92.                 this.byte_0 = Encoding.ASCII.GetBytes("zW$2eWaHNdT~6j86T_&j");
  93.                 base..ctor();
  94.                 int i = 0;
  95.                 int num = 0;
  96.                 int num2 = 0;
  97.                 while (i < 18)
  98.                 {
  99.                     int j = 0;
  100.                     while (j < 4)
  101.                     {
  102.                         int arg_BE_0 = num << 8;
  103.                         int expr_B0 = num2;
  104.                         num2 = expr_B0 + 1;
  105.                         num = (arg_BE_0 | (int)KEY[expr_B0]);
  106.                         j += 1;
  107.                         num2 %= (int)KEY.Length;
  108.                     }
  109.                     this.int_0[i] ^= num;
  110.                     i += 1;
  111.                     num = 0;
  112.                 }
  113.                 int num3 = 0;
  114.                 int num4 = 0;
  115.                 i = 0;
  116.                 while (i < 18)
  117.                 {
  118.                     this.c0c1ef294051644e1e4a229a2e6a0ee04(ref num3, ref num4);
  119.                     int[] arg_16E_0 = this.int_0;
  120.                     int expr_15F = i;
  121.                     i = expr_15F + 1;
  122.                     arg_16E_0[expr_15F] = num3;
  123.                     int[] arg_185_0 = this.int_0;
  124.                     int expr_176 = i;
  125.                     i = expr_176 + 1;
  126.                     arg_185_0[expr_176] = num4;
  127.                 }
  128.                 for (i = 0; i < 4; i += 1)
  129.                 {
  130.                     int j = 0;
  131.                     while (j < 256)
  132.                     {
  133.                         this.c0c1ef294051644e1e4a229a2e6a0ee04(ref num3, ref num4);
  134.                         int[,] arg_1D0_0 = this.int_1;
  135.                         int arg_1D0_1 = i;
  136.                         int expr_1C1 = j;
  137.                         j = expr_1C1 + 1;
  138.                         arg_1D0_0[arg_1D0_1, expr_1C1] = num3;
  139.                         int[,] arg_1EC_0 = this.int_1;
  140.                         int arg_1EC_1 = i;
  141.                         int expr_1DD = j;
  142.                         j = expr_1DD + 1;
  143.                         arg_1EC_0[arg_1EC_1, expr_1DD] = num4;
  144.                     }
  145.                 }
  146.             }
  147.  
  148.             // Token: 0x06000016 RID: 22 RVA: 0x00003F0C File Offset: 0x0000210C
  149.             private void c0c1ef294051644e1e4a229a2e6a0ee04(ref int int_2, ref int int_3)
  150.             {
  151.                 int num = 0;
  152.                 for (int i = 0; i < 16; i += 1)
  153.                 {
  154.                     num = (this.int_0[i] ^ int_2);
  155.                     int_2 = ((this.int_1[0, (int)((byte)(num >> 24))] + this.int_1[1, (int)((byte)(num >> 16))] ^ this.int_1[2, (int)((byte)(num >> 8))]) + this.int_1[3, (int)((byte)num)] ^ int_3);
  156.                     int_3 = num;
  157.                 }
  158.                 int_3 = (this.int_0[16] ^ int_2);
  159.                 int_2 = (this.int_0[17] ^ num);
  160.             }
  161.  
  162.             // Token: 0x06000017 RID: 23 RVA: 0x00004014 File Offset: 0x00002214
  163.             private void ccfae92404b1d8caf890158f763ac579b(ref int int_2, ref int int_3)
  164.             {
  165.                 int num = 0;
  166.                 for (int i = 0; i < 16; i += 1)
  167.                 {
  168.                     num = (this.int_0[17 - i] ^ int_2);
  169.                     int_2 = ((this.int_1[0, (int)((byte)(num >> 24))] + this.int_1[1, (int)((byte)(num >> 16))] ^ this.int_1[2, (int)((byte)(num >> 8))]) + this.int_1[3, (int)((byte)num)] ^ int_3);
  170.                     int_3 = num;
  171.                 }
  172.                 int_3 = (this.int_0[1] ^ int_2);
  173.                 int_2 = (this.int_0[0] ^ num);
  174.             }
  175.  
  176.             public unsafe static void MemReverse(void* src, int size)
  177.             {
  178.                 byte* ptr = (byte*)src;
  179.                 byte* ptr2 = ptr + size - 1;
  180.                 while (ptr < ptr2)
  181.                 {
  182.                     byte b = *ptr;
  183.                     *ptr = *ptr2;
  184.                     *ptr2 = b;
  185.                     ptr += 1;
  186.                     ptr2 -= 1;
  187.                 }
  188.             }
  189.  
  190.             public unsafe static int ReverseDWORD(int int_0)
  191.             {
  192.                 MemReverse((void*)(&int_0), 4);
  193.                 return int_0;
  194.             }
  195.  
  196.             // Token: 0x06000015 RID: 21 RVA: 0x00003DC4 File Offset: 0x00001FC4
  197.             public unsafe byte[] Decrypt(byte[] eData)
  198.             {
  199.                 byte[] array = new byte[(int)eData.Length];
  200.                 if (eData != null && (int)eData.Length != 0)
  201.                 {
  202.                     fixed (byte* ptr = &eData[0])
  203.                     {
  204.                     }
  205.                 }
  206.                 else
  207.                 {
  208.                     fixed (byte* ptr = (byte[]) null)
  209.                     {
  210.                     }
  211.                 }
  212.                 byte[] array2;
  213.                 if ((array2 = array) != null && (int)array2.Length != 0)
  214.                 {
  215.                     fixed (byte* ptr2 = &array2[0])
  216.                     {
  217.                     }
  218.                 }
  219.                 else
  220.                 {
  221.                     fixed (byte* ptr2 = (byte[])null)
  222.                     {
  223.                     }
  224.                 }
  225.                 byte* ptr;
  226.                 int* ptr3 = (int*)ptr;
  227.                 byte* ptr2;
  228.                 int* ptr4 = (int*)ptr2;
  229.                 for (int i = 0; i < (int)eData.Length >> 3; i += 1)
  230.                 {
  231.                     int* expr_82 = ptr3;
  232.                     ptr3 = expr_82 + 4 / 4;
  233.                     int num = ReverseDWORD(*expr_82);
  234.                     int* expr_9B = ptr3;
  235.                     ptr3 = expr_9B + 4 / 4;
  236.                     int num2 = ReverseDWORD(*expr_9B);
  237.                     this.ccfae92404b1d8caf890158f763ac579b(ref num, ref num2);
  238.                     int* expr_BE = ptr4;
  239.                     ptr4 = expr_BE + 4 / 4;
  240.                     num = (*expr_BE = ReverseDWORD(num));
  241.                     int* expr_DA = ptr4;
  242.                     ptr4 = expr_DA + 4 / 4;
  243.                     num2 = (*expr_DA = ReverseDWORD(num2));
  244.                 }
  245.                 fixed (byte* ptr = (byte[])null)
  246.                 {
  247.                     fixed (byte* ptr2 = (byte[])null)
  248.                     {
  249.                         return array;
  250.                     }
  251.                 }
  252.             }
  253.  
  254.             // Token: 0x06000014 RID: 20 RVA: 0x00003C7C File Offset: 0x00001E7C
  255.             public unsafe byte[] Encrypt(byte[] uData)
  256.             {
  257.                 byte[] array = new byte[(int)uData.Length];
  258.                 if (uData != null && (int)uData.Length != 0)
  259.                 {
  260.                     fixed (byte* ptr = &uData[0])
  261.                     {
  262.                     }
  263.                 }
  264.                 else
  265.                 {
  266.                     fixed (byte* ptr = null)
  267.                     {
  268.                     }
  269.                 }
  270.                 byte[] array2;
  271.                 if ((array2 = array) != null && (int)array2.Length != 0)
  272.                 {
  273.                     fixed (byte* ptr2 = &array2[0])
  274.                     {
  275.                     }
  276.                 }
  277.                 else
  278.                 {
  279.                     fixed (byte* ptr2 = (byte[])null)
  280.                     {
  281.                     }
  282.                 }
  283.                 byte* ptr2;
  284.                 int* ptr3 = (int*)ptr2;
  285.                 byte* ptr;
  286.                 int* ptr4 = (int*)ptr;
  287.                 for (int i = 0; i < (int)uData.Length >> 3; i += 1)
  288.                 {
  289.                     int* expr_82 = ptr4;
  290.                     ptr4 = expr_82 + 4 / 4;
  291.                     int num = ReverseDWORD(*expr_82);
  292.                     int* expr_9B = ptr4;
  293.                     ptr4 = expr_9B + 4 / 4;
  294.                     int num2 = ReverseDWORD(*expr_9B);
  295.                     this.c0c1ef294051644e1e4a229a2e6a0ee04(ref num, ref num2);
  296.                     int* expr_BE = ptr3;
  297.                     ptr3 = expr_BE + 4 / 4;
  298.                     num = (*expr_BE = ReverseDWORD(num));
  299.                     int* expr_DA = ptr3;
  300.                     ptr3 = expr_DA + 4 / 4;
  301.                     num2 = (*expr_DA = ReverseDWORD(num2));
  302.                 }
  303.                 fixed (byte* ptr = null)
  304.                 {
  305.                     fixed (byte* ptr2 = null)
  306.                     {
  307.                         return array;
  308.                     }
  309.                 }
  310.             }
  311.  
  312.             // Token: 0x06000018 RID: 24 RVA: 0x00004128 File Offset: 0x00002328
  313.             public byte[] refEncryptor(byte[] data, bool encrypt)
  314.             {
  315.                 byte[] result = byte_1;
  316.                 Form1.GClass1 gClass = new Form1.GClass1(this.byte_0);
  317.                 if ((encrypt ? 1 : 0) != 0)
  318.                 {
  319.                     result = gClass.Encrypt(data);
  320.                 }
  321.                 else
  322.                 {
  323.                     result = gClass.Decrypt(data);
  324.                 }
  325.                 return result;
  326.             }
  327.  
  328.             // Token: 0x0400000E RID: 14
  329.             public byte[] byte_0;
  330.             static byte[] byte_1;
  331.  
  332.             // Token: 0x0400000C RID: 12
  333.             private int[] int_0;
  334.  
  335.             // Token: 0x0400000D RID: 13
  336.             private int[,] int_1;
  337.         }
  338.     }
  339. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement