XenocodeRCE

Sneazzy C# KeygenME

Sep 18th, 2014
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.24 KB | None | 0 0
  1. using System;
  2. using System.Diagnostics;
  3.  
  4.  
  5. namespace ConsoleApplication1
  6. {
  7.     class Program
  8.     {
  9.         static void Main()
  10.         {
  11.             var cipherBuffer = "";
  12.             sbyte i;
  13.  
  14.             Console.Write("YOUR ID :");
  15.             var buffer = Console.ReadLine();
  16.  
  17.             Debug.Assert(buffer != null, "buffer != null");
  18.             for (i = 0; i < buffer.Length; i++)
  19.             {
  20.                 cipherBuffer = StringFunctions.ChangeCharacter(cipherBuffer, i, (char)((buffer[i] + 1 & 0x1337)));
  21.             }
  22.            
  23.             Console.Write("Your Key : " + cipherBuffer);
  24.  
  25.             Console.ReadLine();
  26.         }
  27.     }
  28.  
  29.     internal static class DefineConstants
  30.     {
  31.         public const int BuffSize = 20;
  32.     }
  33.  
  34.     internal static class StringFunctions
  35.     {
  36.  
  37.         internal static string ChangeCharacter(string sourcestring, int charindex, char changechar)
  38.         {
  39.             return (charindex > 0 ? sourcestring.Substring(0, charindex) : "")
  40.                    + changechar +
  41.                    (charindex < sourcestring.Length - 1 ? sourcestring.Substring(charindex + 1) : "");
  42.         }
  43.  
  44.         internal static bool IsXDigit(char character)
  45.         {
  46.             if (char.IsDigit(character))
  47.                 return true;
  48.             return "ABCDEFabcdef".IndexOf(character) > -1;
  49.         }
  50.  
  51.         internal static string StrChr(string stringtosearch, char chartofind)
  52.         {
  53.             var index = stringtosearch.IndexOf(chartofind);
  54.             return index > -1 ? stringtosearch.Substring(index) : null;
  55.         }
  56.  
  57.         internal static string StrRChr(string stringtosearch, char chartofind)
  58.         {
  59.             var index = stringtosearch.LastIndexOf(chartofind);
  60.             return index > -1 ? stringtosearch.Substring(index) : null;
  61.         }
  62.  
  63.         internal static string StrStr(string stringtosearch, string stringtofind)
  64.         {
  65.             var index = stringtosearch.IndexOf(stringtofind, StringComparison.Ordinal);
  66.             return index > -1 ? stringtosearch.Substring(index) : null;
  67.         }
  68.  
  69.         private static string _activestring;
  70.         private static int _activeposition;
  71.  
  72.         internal static string StrTok(string stringtotokenize, string delimiters)
  73.         {
  74.             if (stringtotokenize != null)
  75.             {
  76.                 _activestring = stringtotokenize;
  77.                 _activeposition = -1;
  78.             }
  79.  
  80.             if (_activestring == null)
  81.                 return null;
  82.  
  83.             if (_activeposition == _activestring.Length)
  84.                 return null;
  85.  
  86.             _activeposition++;
  87.             while (_activeposition < _activestring.Length && delimiters.IndexOf(_activestring[_activeposition]) > -1)
  88.             {
  89.                 _activeposition++;
  90.             }
  91.  
  92.             if (_activeposition == _activestring.Length)
  93.                 return null;
  94.  
  95.             int startingposition = _activeposition;
  96.  
  97.             do
  98.             {
  99.                 _activeposition++;
  100.             } while (_activeposition < _activestring.Length && delimiters.IndexOf(_activestring[_activeposition]) == -1);
  101.  
  102.             return _activestring.Substring(startingposition, _activeposition - startingposition);
  103.         }
  104.     }
  105. }
Advertisement
Add Comment
Please, Sign In to add comment