Case on Reverse Engineering
Subject
Programming
Question Description
TASK:
Using the ASM code below describe all items in section "It is requested".
There is no need for introductory part, please, get right to the analysis.
Good quality and readable screenshots with description are a must.
Attached document is a course material on Reverse Engineering for your convenience. In the end of the document there are practical cases examples.
STATEMENT
An executable binary file has been obtained that, after its execution, shows a text with a numeric code. This code is generated from a text string stored in the binary itself.
After listing the ASM code, the binary file was deleted and it is not possible to access it, only the ASM code copied at the end of the exercise.
It is necessary to be able to reuse said code generation algorithm, which is why reverse engineering work is required to analyze the binary and reconstruct the source code in such a way that it can be modified and recompiled correctly.
It is requested:
1. Divide the code into basic blocks.
Take into account the existing breaks within the function and divide the lines into basic blocks of code.
2. Make the flow diagram with the basic blocks.
Once the basic blocks of the previous exercise have been obtained, carry out the flow diagram by joining the basic blocks with arrows.
3. Is there any control structure? Indicates which basic blocks are involved in it.
4. Convert the complete code of the function to code C.
With what you learned about code reconstruction, convert this main () function to C code.
In <+36> the address of the string indicated in bold is loaded in eax .