Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decompiled with JetBrains decompiler
- // Type: Level2.Program
- // Assembly: Level2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
- // MVID: 8E42502F-4AC8-4897-84C5-FB18B897711E
- // Assembly location: D:\Games\Torrents\8d.exe
- using System;
- using System.IO;
- using System.Reflection;
- using System.Runtime.InteropServices;
- namespace Level2
- {
- internal class Program
- {
- public static void Main(string[] args)
- {
- if (Program.Authorize())
- {
- Console.WriteLine("Security check complete. Starting application...");
- string tempFileName = Path.GetTempFileName();
- Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Level2.level3.dll");
- using (FileStream fileStream = new FileStream(tempFileName, FileMode.Create, FileAccess.Write))
- {
- while (manifestResourceStream.Position < manifestResourceStream.Length)
- fileStream.WriteByte(Program.Deobfuscate((byte) manifestResourceStream.ReadByte()));
- }
- IntPtr hModule = Win32.LoadLibrary(tempFileName);
- ((Action) Marshal.GetDelegateForFunctionPointer(Win32.GetProcAddress(hModule, "check"), typeof (Action)))();
- Win32.FreeLibrary(hModule);
- File.Delete(tempFileName);
- }
- else
- Console.WriteLine("Security check failed. Exiting...");
- }
- private static bool Authorize()
- {
- Console.WriteLine("Please, complete security check to run this application.");
- Console.Write("Enter PIN: ");
- long result;
- if (long.TryParse(Console.ReadLine(), out result))
- return result == 15663090876965025L;
- return false;
- }
- private static byte Deobfuscate(byte obfuscated)
- {
- return (byte) ((uint) byte.MaxValue - (uint) obfuscated);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement