Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Diagnostics;
- using System.IO;
- namespace WindowsFormsApplication1
- {
- // Token: 0x02000004 RID: 4
- public partial class Form1 : Form
- {
- // Token: 0x0600000C RID: 12 RVA: 0x000030A0 File Offset: 0x000012A0
- public Form1()
- {
- InitializeComponent();
- }
- // Token: 0x0600000E RID: 14 RVA: 0x000030CE File Offset: 0x000012CE
- private void button2_Click(object sender, EventArgs e)
- {
- File.WriteAllBytes(this.string_0, new Form1.GClass1(this.byte_0).Decrypt(File.ReadAllBytes(this.string_0)));
- MessageBox.Show("Decrypt");
- }
- // Token: 0x0600000F RID: 15 RVA: 0x00003101 File Offset: 0x00001301
- private void button3_Click(object sender, EventArgs e)
- {
- File.WriteAllBytes(this.string_0, new Form1.GClass1(this.byte_0).Encrypt(File.ReadAllBytes(this.string_0)));
- MessageBox.Show("Encrypt");
- }
- // Token: 0x0600000D RID: 13 RVA: 0x00003554 File Offset: 0x00001754
- private void button1_Click(object sender, EventArgs e)
- {
- OpenFileDialog openFileDialog = new OpenFileDialog
- {
- Title = "Select Resident Evil Revelations 2 Save"
- };
- OpenFileDialog openFileDialog2 = openFileDialog;
- try
- {
- if (((openFileDialog2.ShowDialog() == (DialogResult)1) ? 1 : 0) != 0)
- {
- this.string_0 = openFileDialog2.FileName;
- this.textBox1.Text = this.string_0;
- this.button2.Enabled = (1 != 0);
- this.button3.Enabled = (1 != 0);
- }
- }
- finally
- {
- if (openFileDialog2 != null)
- {
- ((IDisposable)openFileDialog2).Dispose();
- }
- }
- }
- // Token: 0x06000010 RID: 16 RVA: 0x00003134 File Offset: 0x00001334
- private void label1_Click(object sender, EventArgs e)
- {
- Process.Start("https://www.youtube.com/user/TheDarkNachoXD");
- }
- // Token: 0x04000005 RID: 5
- public byte[] byte_0 = Encoding.ASCII.GetBytes("zW$2eWaHNdT~6j86T_&j");
- // Token: 0x04000006 RID: 6
- private IContainer icontainer_0 = null;
- // Token: 0x04000004 RID: 4
- public string string_0;
- // Token: 0x02000005 RID: 5
- public class GClass1
- {
- // Token: 0x06000013 RID: 19 RVA: 0x00003A50 File Offset: 0x00001C50
- public GClass1(byte[] KEY)
- {
- //Las dos llamadas a la función de class4 quedan pendientes hasta saber que valores se les mete como parametro
- uint[] expr_10 = new uint[18];
- //Class4.c6dd15eaeef3c4180278360442316aea0(expr_10, 440);
- this.int_0 = (int[])(object)expr_10;
- uint[,] expr_3F = new uint[4, 256];
- //Class4.c6dd15eaeef3c4180278360442316aea0(expr_3F, 521);
- this.int_1 = (int[,])(object)expr_3F;
- this.byte_0 = Encoding.ASCII.GetBytes("zW$2eWaHNdT~6j86T_&j");
- base..ctor();
- int i = 0;
- int num = 0;
- int num2 = 0;
- while (i < 18)
- {
- int j = 0;
- while (j < 4)
- {
- int arg_BE_0 = num << 8;
- int expr_B0 = num2;
- num2 = expr_B0 + 1;
- num = (arg_BE_0 | (int)KEY[expr_B0]);
- j += 1;
- num2 %= (int)KEY.Length;
- }
- this.int_0[i] ^= num;
- i += 1;
- num = 0;
- }
- int num3 = 0;
- int num4 = 0;
- i = 0;
- while (i < 18)
- {
- this.c0c1ef294051644e1e4a229a2e6a0ee04(ref num3, ref num4);
- int[] arg_16E_0 = this.int_0;
- int expr_15F = i;
- i = expr_15F + 1;
- arg_16E_0[expr_15F] = num3;
- int[] arg_185_0 = this.int_0;
- int expr_176 = i;
- i = expr_176 + 1;
- arg_185_0[expr_176] = num4;
- }
- for (i = 0; i < 4; i += 1)
- {
- int j = 0;
- while (j < 256)
- {
- this.c0c1ef294051644e1e4a229a2e6a0ee04(ref num3, ref num4);
- int[,] arg_1D0_0 = this.int_1;
- int arg_1D0_1 = i;
- int expr_1C1 = j;
- j = expr_1C1 + 1;
- arg_1D0_0[arg_1D0_1, expr_1C1] = num3;
- int[,] arg_1EC_0 = this.int_1;
- int arg_1EC_1 = i;
- int expr_1DD = j;
- j = expr_1DD + 1;
- arg_1EC_0[arg_1EC_1, expr_1DD] = num4;
- }
- }
- }
- // Token: 0x06000016 RID: 22 RVA: 0x00003F0C File Offset: 0x0000210C
- private void c0c1ef294051644e1e4a229a2e6a0ee04(ref int int_2, ref int int_3)
- {
- int num = 0;
- for (int i = 0; i < 16; i += 1)
- {
- num = (this.int_0[i] ^ int_2);
- 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);
- int_3 = num;
- }
- int_3 = (this.int_0[16] ^ int_2);
- int_2 = (this.int_0[17] ^ num);
- }
- // Token: 0x06000017 RID: 23 RVA: 0x00004014 File Offset: 0x00002214
- private void ccfae92404b1d8caf890158f763ac579b(ref int int_2, ref int int_3)
- {
- int num = 0;
- for (int i = 0; i < 16; i += 1)
- {
- num = (this.int_0[17 - i] ^ int_2);
- 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);
- int_3 = num;
- }
- int_3 = (this.int_0[1] ^ int_2);
- int_2 = (this.int_0[0] ^ num);
- }
- public unsafe static void MemReverse(void* src, int size)
- {
- byte* ptr = (byte*)src;
- byte* ptr2 = ptr + size - 1;
- while (ptr < ptr2)
- {
- byte b = *ptr;
- *ptr = *ptr2;
- *ptr2 = b;
- ptr += 1;
- ptr2 -= 1;
- }
- }
- public unsafe static int ReverseDWORD(int int_0)
- {
- MemReverse((void*)(&int_0), 4);
- return int_0;
- }
- // Token: 0x06000015 RID: 21 RVA: 0x00003DC4 File Offset: 0x00001FC4
- public unsafe byte[] Decrypt(byte[] eData)
- {
- byte[] array = new byte[(int)eData.Length];
- if (eData != null && (int)eData.Length != 0)
- {
- fixed (byte* ptr = &eData[0])
- {
- }
- }
- else
- {
- fixed (byte* ptr = (byte[]) null)
- {
- }
- }
- byte[] array2;
- if ((array2 = array) != null && (int)array2.Length != 0)
- {
- fixed (byte* ptr2 = &array2[0])
- {
- }
- }
- else
- {
- fixed (byte* ptr2 = (byte[])null)
- {
- }
- }
- byte* ptr;
- int* ptr3 = (int*)ptr;
- byte* ptr2;
- int* ptr4 = (int*)ptr2;
- for (int i = 0; i < (int)eData.Length >> 3; i += 1)
- {
- int* expr_82 = ptr3;
- ptr3 = expr_82 + 4 / 4;
- int num = ReverseDWORD(*expr_82);
- int* expr_9B = ptr3;
- ptr3 = expr_9B + 4 / 4;
- int num2 = ReverseDWORD(*expr_9B);
- this.ccfae92404b1d8caf890158f763ac579b(ref num, ref num2);
- int* expr_BE = ptr4;
- ptr4 = expr_BE + 4 / 4;
- num = (*expr_BE = ReverseDWORD(num));
- int* expr_DA = ptr4;
- ptr4 = expr_DA + 4 / 4;
- num2 = (*expr_DA = ReverseDWORD(num2));
- }
- fixed (byte* ptr = (byte[])null)
- {
- fixed (byte* ptr2 = (byte[])null)
- {
- return array;
- }
- }
- }
- // Token: 0x06000014 RID: 20 RVA: 0x00003C7C File Offset: 0x00001E7C
- public unsafe byte[] Encrypt(byte[] uData)
- {
- byte[] array = new byte[(int)uData.Length];
- if (uData != null && (int)uData.Length != 0)
- {
- fixed (byte* ptr = &uData[0])
- {
- }
- }
- else
- {
- fixed (byte* ptr = null)
- {
- }
- }
- byte[] array2;
- if ((array2 = array) != null && (int)array2.Length != 0)
- {
- fixed (byte* ptr2 = &array2[0])
- {
- }
- }
- else
- {
- fixed (byte* ptr2 = (byte[])null)
- {
- }
- }
- byte* ptr2;
- int* ptr3 = (int*)ptr2;
- byte* ptr;
- int* ptr4 = (int*)ptr;
- for (int i = 0; i < (int)uData.Length >> 3; i += 1)
- {
- int* expr_82 = ptr4;
- ptr4 = expr_82 + 4 / 4;
- int num = ReverseDWORD(*expr_82);
- int* expr_9B = ptr4;
- ptr4 = expr_9B + 4 / 4;
- int num2 = ReverseDWORD(*expr_9B);
- this.c0c1ef294051644e1e4a229a2e6a0ee04(ref num, ref num2);
- int* expr_BE = ptr3;
- ptr3 = expr_BE + 4 / 4;
- num = (*expr_BE = ReverseDWORD(num));
- int* expr_DA = ptr3;
- ptr3 = expr_DA + 4 / 4;
- num2 = (*expr_DA = ReverseDWORD(num2));
- }
- fixed (byte* ptr = null)
- {
- fixed (byte* ptr2 = null)
- {
- return array;
- }
- }
- }
- // Token: 0x06000018 RID: 24 RVA: 0x00004128 File Offset: 0x00002328
- public byte[] refEncryptor(byte[] data, bool encrypt)
- {
- byte[] result = byte_1;
- Form1.GClass1 gClass = new Form1.GClass1(this.byte_0);
- if ((encrypt ? 1 : 0) != 0)
- {
- result = gClass.Encrypt(data);
- }
- else
- {
- result = gClass.Decrypt(data);
- }
- return result;
- }
- // Token: 0x0400000E RID: 14
- public byte[] byte_0;
- static byte[] byte_1;
- // Token: 0x0400000C RID: 12
- private int[] int_0;
- // Token: 0x0400000D RID: 13
- private int[,] int_1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement