x86 Architecture Overview — THM Walkthrough
Hello Friends! I’m Muthumanikavel. This is the write-up for Tryhackme’s x86 Architecture Overview room. Let’s get started
Here is the link for the room:
https://tryhackme.com/room/x8664arch
TASK 1 Introduction
Learning Objectives:
Summing up, we will be covering the following topics in this room.
- Overview of CPU architecture and its components
- Different types of CPU registers and their usage
- Memory layout as viewed by a program
- Stack layout and stack registers
So let’s dive into the room and learn about the above-mentioned topics.
Answer the questions below
Go through the Learning Objectives
Ans: No answer needed
TASK 2 CPU architecture overview
The CPU architecture that is most widely used is derived from the Von Neumann architecture. A brief overview of this architecture is demonstrated in the below diagram.
Answers:
In which part of the Von Neumann architecture are the code and data required for a program to run stored?
Ans: Memory
What part of the CPU stores small amounts of data?
Ans: Registers
In which unit are arithmetic operations performed?
Ans: Arithmetic Logical Unit
TASK 3 Registers Overview
Registers are the CPU’s storage medium. The CPU can access data from the registers quicker than any other storage medium; however, its limited size means it has to be used effectively. For this purpose, the registers are divided into the following different types:
- Instruction Pointer
- General Purpose Registers
- Status Flag Registers
- Segment Registers
Let’s go through each of these registers one by one and answer for it.
Answers:
Which register holds the address to the next instruction that is to be executed?
Ans: Instruction Pointer
Which register in a 32-bit system is also called the Counter Register?
Ans: ECX
Which registers from the ones discussed above are not present in a 32-bit system?
Ans: R8-R15
TASK 4 Registers contd
Which flag is used by the program to identify if it is being run in a debugger?
Ans: Trap flag
Which flag will be set when the most significant bit in an operation is set to 1?
Ans: Sign flag
Which Segment register contains the pointer to the code section in memory?
Ans: Code Segment
TASK 5 Memory Overview
When a program is loaded into Memory, does it have a full view of the system memory? Y or N?
Ans: N
Which section of the Memory contains the code?
Ans: Code
Which Memory section contains information related to the program’s control flow?
Ans: Stack
TASK 6 Stack Layout
In this task, we need to find a flag by visiting the site. By arranging the Stack Layout, we can able to find the flag for this task.
Arranging the Stack to receive the flag.
Answers:
Follow the instructions in the attached static site and find the flag. What is the flag?
Ans: THM{SMASHED_THE_STACK}
TASK 7 Conclusion
Ans: No answer needed
Please Let me know if any mistakes have been done in this write-up and feel free to reach out @MuthumanikavelV
Thank you all. Happy Hacking!!