Lukesc1993 Posted November 6, 2014 Posted November 6, 2014 So I just cracked my first CrackMe and found out how the program computes the registration number and now I wanna write a keygen for it. What program should I use to write the keygen and could anyine get me started on the code? The algorithm the CrackMe uses to create the correct keygen is: Get hex value of each letter in username Add each letter in hex together Multiply the value by 539 Output as decimal Thanks to anyone who can help
GIV Posted November 6, 2014 Posted November 6, 2014 VB .NET 2010 Public Class frmKeygen Private name As String = "" Dim character As Long = 0 Private sum As Integer Private Sub txtInput_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtInput.TextChanged name = txtInput.Text Try For i = 0 To name.Length - 1 character = character + Asc(name.Substring(i, 1)) Next character = character * 539 txtOutput.Text = character.ToString Catch ex As Exception MessageBox.Show("The result of multiplication is too high.", "Try less characters for the name.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End Try End Sub End ClassProject.7zKeygen.7z 1
SiSC0 Posted November 6, 2014 Posted November 6, 2014 C# .Net 3.5 - Console App - compile with SharpDevelop/VisualStudio/MonoDevelop/... using System; using System.IO; using System.Linq; using System.Reflection; namespace Keygen { class Program { static void Main( string[] args ) { if( args.Length == 0 ) { string thisExe = Path.GetFileName( Assembly.GetExecutingAssembly().GetName().Name ); Console.WriteLine( "Use {0}.exe USERNAME", thisExe ); return; } // first prog argument string username = args[ 0 ]; // call/invoke Generate-Method decimal key = Generate( username ); // show result, Output as decimal Console.WriteLine( "Key: '{0}'", key ); } // easy to understand Method static decimal Generate( string username ) { decimal result = 0; //Get hex value of each letter in username foreach( char letter in username ) { //Add each letter in hex together result = result + (byte)letter; } //Multiply the value by 539 result = result * 539; return result; } // pro variant static decimal ProGenerate( string username ) { return username.Aggregate<char, decimal>( 0, ( current, letter ) => current + (byte)letter ) * 539; } } }
XorRanger Posted November 6, 2014 Posted November 6, 2014 Howdy.Did Someone Forget other none .NET Languages? Here is one for Delphi 7 (this is just the function that generates the key)function MakeMyKey(UserName: string): string;var intCounter, intHolder: Integer; strFinalKey: string;begin if (Length(UserName) < 1) then begin ShowMessage('Hey Cutie, Don' + 't be ' + 'shy :(' + sLineBreak + 'Please give me a Name'); end else begin intHolder := 0; for intCounter := 1 to (Length(UserName)) do begin intHolder := intHolder + Ord(UserName[intCounter]); end; strFinalKey := IntToStr(intHolder * 539); Form1.edtSerial.Text := strFinalKey; end;end;Attached is the Keygen and its Full Source. Lukesc1993 Keygen.zipLukesc1993 Src.zip 1
GIV Posted November 7, 2014 Posted November 7, 2014 Howdy.Did Someone Forget other none .NET Languages? Did you mean this?#include <iostream>#include <string>using namespace std;int main(){ int suma, lungime; string nume; cout << "Simple translation to C++ by GIV\n"; cout << "Please enter your name: "<<endl; cin >> nume; lungime = nume.length(); suma = 0;for (unsigned int i = 0; i < nume.size(); i++){ suma += nume[i];}cout << "The final calculus is:"<<endl; cout << suma*539 << endl; system("pause"); return 0;}C++.7z 1
Office Jesus Posted November 8, 2014 Posted November 8, 2014 (edited) Did someone forget about the non-high-level languages? Generate proc hWnd:HWND invoke GetDlgItemText, hWnd, IDC_NAME, addr NameBuffer, 17 ; Cap name length to 17 mov edi,offset NameBuffer invoke lstrlen,edi mov esi,eax xor ecx,ecx xor eax,eax cmp esi, 01h ; Jump if no name entered jl BADERROR xor eax, eax xor edx, edx @@: mov dl, byte ptr [NameBuffer + ecx] add eax, edx inc ecx cmp ecx, esi jnz @b mov ecx, 21Bh ; 21Bh = 539d mul ecx invoke wsprintf, addr SerialBuffer, addr FormatControl, eax invoke SetDlgItemText, hWnd, IDC_SERIAL, addr SerialBuffer BADERROR: xor eax, eax ret Generate endp Lukesc1993.zip Edited November 9, 2014 by Office Jesus 4
Levis Posted November 13, 2014 Posted November 13, 2014 (edited) Did someone forget about script language? :worthy: username = raw_input('Name -->') serial = 0 for i in username: serial+=ord(i) serial*=539 print serial keygen.py.tar.gz Edited November 14, 2014 by Levis 2
dstn Posted November 15, 2014 Posted November 15, 2014 Why not AutoIT? lol #include <MsgBoxConstants.au3> Example() Func Example() Local $i, $output Local $Input = InputBox("Input","", "", "") For $i=0 to StringLen($input) $output = $output + Asc(StringMid($input,$i,1)) Next $output = $output * 539 MsgBox($MB_SYSTEMMODAL, "", $output) EndFunc ;==>Example 1
sama Posted November 15, 2014 Posted November 15, 2014 I am to late.No new code from my sideonly a bit shorter ASM code of Office Jesus Generate proc hWnd:HWND invoke GetDlgItemText, hWnd, IDC_NAME, addr NameBuffer, 17 ; Cap name length to 17 .if eax lea edi, NameBuffer xor eax,eax and edx,0 .repeat mov dl,byte ptr [edi] add eax, edx inc edi .until byte ptr[edi] == 0 imul eax,eax,21Bh invoke wsprintf, addr SerialBuffer, addr FormatControl, eax invoke SetDlgItemText, hWnd, IDC_KEY, addr SerialBuffer .endif ret Generate endp of course it can be done shorter.(btw. i was to lazy, so i used OfficeJesus own code snippet.)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now