top of page

Reverse Engineering and Cracking a Software Registration System

  • Hacking By Doing
  • Aug 20, 2024
  • 3 min read

In this post, I'll be demonstrating the process of reverse engineering and cracking a CrackMe challenge software. The goal is to bypass the software's authentication mechanism, which requires a correct username and registration code to proceed.



Initial Exploration

Let's start by analyzing the challenge. The software presents two input fields for a username and a registration code.



As you can see, when a random input is provided in both fields, the software responds with an error message. This behavior indicates that the program is validating the provided credentials against a hidden key or algorithm. If the input matches the correct key, the software will grant access; if not, it will display an error, as shown above.


Since we don't possess the correct registration code, our task is to reverse engineer the software to either retrieve the correct key or manipulate the program to bypass the check altogether.



Loading the Software into a Debugger

We'll begin by loading the software into x64dbg, a powerful debugger for Windows. Our objective here is to modify the program so that it grants access regardless of the input we provide.



The first step is to identify the error message displayed when an incorrect registration code is entered. In this case, the string we're looking for is: "Nope, that's not it! Try again."



Finding the Validation Logic

To locate this string in x64dbg, we navigate to Search for → All modules → String references.


Upon finding the string, we can follow it in the disassembler to examine the associated assembly code.



The disassembled code reveals that the software is comparing two memory locations, likely containing the correct registration code and the user-provided code. The comparison is performed using the lstrcmpA function from the Windows API, which compares two strings.



If the strings match, the program jumps to an instruction that grants access. Otherwise, it jumps to a different instruction that triggers the error message.



Modifying the Control Flow

To bypass this check, we'll modify the conditional jump instruction (JNE, or "Jump if Not Equal") to an unconditional jump (JMP) that directly points to the instruction granting access, regardless of the comparison result.

Specifically, we'll change the jump target to 0x004012BE, which is the address that allows us to proceed.



Patching the Software

After making this modification, we save the patched executable as a new, cracked version of the software.

Now, when we input the same credentials as before, the software successfully bypasses the registration check, confirming that our crack was successful.



Creating a Keygen

With the cracked version complete, let's take it a step further and create a keygen that will generate valid registration codes for any username.


Returning to the debugger, we know that the correct registration code is stored in memory at a specific location—either 0x406549 or 0x406949. We'll start by examining the first address.



By modifying the code that triggers the error message, we can redirect it to print the correct registration code from memory instead.



Finalizing the Keygen

We save this patched version as keygen.exe and test it.



As you can see, our keygen successfully generates the correct registration code for any username provided, completing our task.



Conclusion

In this challenge, we've accomplished two key objectives: creating a cracked version of the software and developing a keygen to generate valid registration codes. This exercise demonstrates fundamental reverse engineering techniques and provides a hands-on introduction to software cracking.

I hope you found this challenge as enjoyable and informative as I did. Thanks for reading!

Subscribe to get exclusive updates

Thanks for submitting!

  • Twitter
  • Instagram
  • Facebook

© 2022 Hacking By Doing

bottom of page