# (Write-up) Reversing.Kr: Easy Crack # 💻Problem - Topic: You are given an .exe file named Easy_CrackMe.exe. When launching the program, a window will appear and ask for a password. - Objective: Learn and decompile the source code to find the correct password for the application. # ****🤔O****verview *Here I use Linux so there are a few different things.* - When launching the application, a window appears as follows: ![](https://hackmd.io/_uploads/Sy4AoaYk6.png) - Enter a password (Here I enter any string) and press the **??** The following notification window appears: ![](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F79f36589-48fc-4756-ad62-07f0135e84d3%2F40a3fa23-ddf8-4564-b4b6-25edd1bbba28%2FUntitled.png?table=block&id=ff249134-6202-4d8a-b490-7059eaf8022a&cache=v2) => This means maybe the logic of the application is to check if the user inputted data matches a predefined value by the programmer. Otherwise, the "Incorrect Password" message window will return as shown above. => So here we need to find a way to read the password value previously defined by the programmer to overcome this challenge. # 🚩Let’s go First, we need to use a debugger program to view the machine code of this program. Here, I use **IDA Free**. Start **IDA** with **Eazy_CrackMe.exe**, a window will open with Eazy_CrackMe.exe's program startup function: ![](https://hackmd.io/_uploads/HydZhTt16.png) In this Function, it called a other function is DialogFunc ![](https://hackmd.io/_uploads/r11fn6Yka.png) Double click on this function name to view its source code ![](https://hackmd.io/_uploads/SJIG36t16.png) Here, there are many things, but we just need to pay attention to one more called function, sub_401080, continue to look at its source code and can see its structure as shown below: ![](https://hackmd.io/_uploads/Hypf3at1a.png) Here, you can also use the pseudo code generation function to make it easier (Press **F5**), but I will not use it because I can clearly understand the program using machine code and feel more difficult >.< Looking through this function, we can see that this is the function that will check the entered password that we are looking for. ![](https://hackmd.io/_uploads/BkHQnaK16.png) Now, we just need to look at the logic and figure out how it checks to know the correct password. ![Untitled](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F79f36589-48fc-4756-ad62-07f0135e84d3%2F174843c4-c5a3-42c6-aef9-30dd7445c8b1%2FUntitled.png?table=block&id=fe05a852-abe6-4482-a6da-76ca5cbd6aa7&cache=v2) First, at the beginning of the function, it will declare a String with 100 characters (0x64 - 64h). This string then saves the value entered from the **Easy_CrackMe** program user window using the **GetDlgItemTextA** function. Continuing, the program starts comparing the input string stored in String with a fixed number of strings. Here, the program has compared the character at position 2 (array index is 1 - 63h) with 61h (which is the ascii code of **'a'**). ![](https://hackmd.io/_uploads/HyqNn6Ykp.png) ![](https://hackmd.io/_uploads/HJyH26KJp.png) The program continues to compare the next two characters of the String with the string **"5y”**. ![](https://hackmd.io/_uploads/BJ4S3aYJ6.png) The next code looks complicated, but its purpose is to compare the remaining characters of the String with the string **"R3versing”** ![Untitled](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F79f36589-48fc-4756-ad62-07f0135e84d3%2F78ac5239-d538-4b8f-bce8-f8b8b824a9d8%2FUntitled.png?table=block&id=3bddfcad-fdec-430b-ae27-4f815d6eaf6a&cache=v2) At the end of the comparison before giving the password test results, the program compares the first character of the String with the character '**E**' (45h). ![](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F79f36589-48fc-4756-ad62-07f0135e84d3%2F4d9cc986-a8eb-46aa-9b1e-b79f582c8ea2%2FUntitled.png?table=block&id=0fa523df-1fff-4c57-a276-0bca4b27ac08&cache=v2) So the password after concatenating all the above strings will be **"Ea5yR3versing".** Let’s double check with this password ![Untitled](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F79f36589-48fc-4756-ad62-07f0135e84d3%2F5c1b0ddc-7595-40a6-b760-b00bf37aea86%2FUntitled.png?table=block&id=d340c714-04b6-49f2-9d55-b416fd9f4d11&cache=v2) Okay, mission impossible is not impossible hehe ^.^ > 💡 Password is: **Ea5yR3versing** >