Video Tutorial How to make a KeyGen - Ziggy's KeyGenMe Tutorial

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

ismaelvazquezjr

Meme Tier VIP
Fleep Tier Donator
Trump Tier Donator
Jan 4, 2020
28
2,268
0
Learn how to reverse engineer a key generation algorithm in Ziggy's KeyGenMe #0. A KeyGenMe is a program that is intentionally made for learning reverse engineering legally. We are not doing anything illegal in this video. KeyGenMes and CrackMes are common learning tools for ethical hackers. Even antivirus companies create CrackMes for ethical reasons.

Ziggy's KeyGenMe #0 is a very simple one that utilizes a simple XOR algorithm, which is very common. You will learn how to reverse engineer it using Ida Pro and then using this information we will show you a simple python script that can generate serials based on the username.


Python Key Generation Script
Python:
#!/usr/bin/env python3

encryption_buffer = 0x4E6AF4BC

username = input("Enter a username: ")
full_serial = "FIT-"
username_length = len(username)
min_username_length = 5

while(username_length < min_username_length):
    print("[-] Username must be 5 characters long... Try again.")
    username = input("Enter a username: ")
    username_length = len(username)

i = 0
xor_val = ''.join([str(hex(ord(c))[2:]) for c in username[i:i+4]][::-1])
username_length -= 4
encryption_buffer ^= int(xor_val, 16)

while(username_length > 0):
    i += 1
    xor_val = ''.join([str(hex(ord(c))[2:]) for c in username[i:i+4]][::-1])
    encryption_buffer ^= int(xor_val, 16)
    username_length -= 1

full_serial += str(encryption_buffer)

print(f"The serial is: {full_serial}")
 
Last edited by a moderator:

KF1337

*copies code from tutorials, then breaks it.*
Dank Tier Donator
Full Member
Nobleman
Jan 30, 2020
143
3,453
0
First of all: love your reverse engineering videos! It can be a pain to start reversing, your videos are kinda kickstarting it.
It is very helpful that you comment every instruction that you analyze.

Is there a specific reason to use Dependency Walker, when you load it into IDA anyways and are able to look at the imports?
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,065
78,998
2,370
Is there a specific reason to use Dependency Walker, when you load it into IDA anyways and are able to look at the imports?
No, this is just an old school method of doing things that is taught in older books and tutorials
 
  • Like
Reactions: KF1337

ismaelvazquezjr

Meme Tier VIP
Fleep Tier Donator
Trump Tier Donator
Jan 4, 2020
28
2,268
0
Ziggy KeyGenMe #1 Tutorial with Python Script


You can download the keygen itself in the attachments
password: guidedhacking
 

Attachments

  • Like
Reactions: Langour

Langour

Full Member
Sep 12, 2019
1
112
0
Gr8 video, keep it up!.
I couldn't find anywhere Ziggy's KeyGenMe#0 executable file to download. Would be someone kind and share it?
I'll leave source code written in c++ for these KeyGens if someone would be interested in.

Edited:
C++:
#include <iostream>
#include <string>
#include <sstream>

int main()
{
    std::string name;
    std::getline(std::cin, name);

    const size_t len = name.length();
    if (len >= 5)
    {
        __int64 serial = 0x4E6AF4BC;
        for (int i = 0; i < len - 3; ++i)
        {
            std::stringstream ss;
            for (int j = 3; j >= 0; --j)
                ss << std::hex << (int)name[j + i];

            __int64 xorValue = 0;
            ss >> xorValue;

            serial ^= xorValue;
        }
        printf("Name: %s\nSerial: FIT-%I64d\n", name.c_str(), serial);
    }
}

C++:
#include <iostream>
#include <string>

int main()
{
    std::string name;
    std::getline(std::cin, name);

    int serial = 0;
    for (const auto& ch : name)
    {
        if (ch != 32) // (space)
            serial += toupper(ch) * 5961 - 1;
    }
    printf("Name: %s\nSerial: SnD-%i", name.c_str(), serial);
}
 
Last edited:
Community Mods