Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Globalization;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Timers;
- namespace BobJenkinsBrute
- {
- class Program
- {
- static uint CreateHash(string Native)
- {
- tries++;
- uint num = 0;
- byte[] bytes = Encoding.UTF8.GetBytes(Native);
- for (int i = 0; i < bytes.Length; i++)
- {
- num += bytes[i];
- num += num << 10;
- num ^= num >> 6;
- }
- num += num << 3;
- num ^= num >> 11;
- return (num + (num << 15));
- }
- static string hash = "";
- static int min = 0;
- static int max = 0;
- static long tries = 0;
- static int time = 0;
- static void Main(string[] args)
- {
- Console.Title = "GTA V Native Hash Cracker by xSonoro & XeClutch";
- Logger.WriteLogo();
- if(args.Length != 3)
- {
- hash = Logger.LogQuestion("Enter Hash: ").Replace("0x", "");
- min = int.Parse(Logger.LogQuestion("Enter minimum numbers of characters for native: "));
- max = int.Parse(Logger.LogQuestion("Enter maximum numbers of characters for native: "));
- }
- else
- {
- hash = args[0];
- min = int.Parse(args[1]);
- max = int.Parse(args[2]);
- }
- Bruteforce bf = new Bruteforce();
- bf.min = min;
- bf.max = max;
- Logger.LogAction("Started cracking the hash: 0x" + hash);
- time = Environment.TickCount;
- foreach(string combo in bf)
- {
- uint CrackMe = uint.Parse(hash.Replace("0x", ""), NumberStyles.HexNumber);
- if (CreateHash(combo) == CrackMe)
- {
- Logger.LogSubAction("Cracked: " + combo);
- Logger.LogSubSubAction("The process took " + tries + " tries.");
- Logger.LogSubSubAction("The process took " + ((Environment.TickCount - time) / 1000) + " seconds.");
- tries = 0;
- time = 0;
- }
- }
- Console.Read();
- }
- }
- public static class Logger
- {
- public static void WriteLogo()
- {
- Console.ForegroundColor = ConsoleColor.Green;
- Console.WriteLine(@" _________ _____ __ ");
- Console.WriteLine(@" \_ ___ \_______ / | | ____ | | __ ___________ ");
- Console.WriteLine(@" / \ \/\_ __ \/ | |__/ ___\| |/ // __ \_ __ \");
- Console.WriteLine(@" \ \____| | \/ ^ /\ \___| <\ ___/| | \/");
- Console.WriteLine(@" \______ /|__| \____ | \___ >__|_ \\___ >__| ");
- Console.WriteLine(@" \/ |__| \/ \/ \/ ");
- Console.WriteLine();
- Console.ForegroundColor = ConsoleColor.White;
- }
- public static void LogError(string err)
- {
- Console.Write("[");
- Console.ForegroundColor = ConsoleColor.Red;
- Console.Write("!");
- Console.ForegroundColor = ConsoleColor.White;
- Console.Write("] " + err + "\n");
- Console.Read();
- }
- public static void LogAction(string act)
- {
- Console.Write("[");
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("*");
- Console.ForegroundColor = ConsoleColor.White;
- Console.Write("] " + act + "\n");
- }
- public static void LogSubAction(string subact)
- {
- Console.Write("-> [");
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("*");
- Console.ForegroundColor = ConsoleColor.White;
- Console.Write("] " + subact);
- Console.Write("\n");
- }
- public static void LogSubSubAction(string subsubact)
- {
- Console.Write("-> [");
- Console.ForegroundColor = ConsoleColor.Green;
- Console.Write("*");
- Console.ForegroundColor = ConsoleColor.White;
- Console.Write("] " + subsubact);
- Console.Write("\n");
- }
- public static string LogQuestion(string q)
- {
- Console.Write("[");
- Console.ForegroundColor = ConsoleColor.Cyan;
- Console.Write("?");
- Console.ForegroundColor = ConsoleColor.White;
- Console.Write("] " + q);
- return Console.ReadLine();
- }
- }
- public class Bruteforce : IEnumerable
- {
- private StringBuilder sb = new StringBuilder();
- public string charset = "abcdefghijklmnopqrstuvwxyz_";
- private ulong len;
- private int _max;
- public int max { get { return _max; } set { _max = value; } }
- private int _min;
- public int min { get { return _min; } set { _min = value; } }
- public System.Collections.IEnumerator GetEnumerator()
- {
- len = (ulong)this.charset.Length;
- for (double x = min; x <= max; x++)
- {
- ulong total = (ulong)Math.Pow((double)charset.Length, (double)x);
- ulong counter = 0;
- while (counter < total)
- {
- string a = factoradic(counter, x - 1);
- yield return a;
- counter++;
- }
- }
- }
- private string factoradic(ulong l, double power)
- {
- sb.Length = 0;
- while (power >= 0)
- {
- sb = sb.Append(this.charset[(int)(l % len)]);
- l /= len;
- power--;
- }
- return sb.ToString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement