RaphDev's PleaseCrackMe Walkthrough and KeyGen

Simple explanation and key generator.

14/05/2023

PleaseCrackMe, by RaphDev, is a begginner friendly reverse engineering challenge that generates the solution using two inputs from the user. Therefore, I thought this would be an easy way for me to cut my teeth at writing a key generator for a crackme challenge. To solve this challenge I used ghidra to decompile the binary and examine the code.

I started by opening the binary in Ghidra. After analysing it I navigated to the main function and started renaming variables.

The code prompts the user for 2 inputs: a username (line 18+19) and a number between 1 and 9 (line 20+21). The program then loops (lines 28-34) through the usersname and adds the users number to the number values of the character (line 32). Therefore, if the user entered 'john' as their name and '5' as their number, the program would add 5 to the number value of each character.

john = 106 111 104 110

+5

111 116 109 115

This value is then stored as a string and used as the desired password, so the password for the above example would be: otms

Pretty simple!

I then wrote a keygen that simply takes the usersname name and number, adds them together, and spits out the password they need to enter to get access to the program.

def keygen(username,number):
  password=""
  for c in username:
   password = password+chr(ord(c)+int(number))
  return password

username = input("Enter username: ")
print ("Username is: "+username)
number = input("Enter number: ")
print("Number is: " +number)
print("Password is: "+keygen(username,number))

Overall, a simple but fun challenge to start getting in crackmes with.