mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-07-30 15:49:03 +02:00
Updated DS refs
This commit is contained in:
@@ -0,0 +1,184 @@
|
||||
# Week 1 Quiz: Embedded Systems Reverse Engineering Fundamentals
|
||||
|
||||
## Instructions
|
||||
Choose the best answer for each question. There is only one correct answer per question.
|
||||
|
||||
---
|
||||
|
||||
## Questions
|
||||
|
||||
### Question 1
|
||||
What is the primary characteristic that defines a microcontroller?
|
||||
|
||||
A) It only processes data at high speeds
|
||||
B) It's a tiny computer with processor, memory, and storage on a single chip
|
||||
C) It requires an external power supply to function
|
||||
D) It can only run assembly code, not C programs
|
||||
|
||||
> 📖 **Reference:** Week 1, Part 1 – "What is a Microcontroller?"
|
||||
|
||||
**Correct Answer: B**
|
||||
|
||||
---
|
||||
|
||||
### Question 2
|
||||
Which special register in the ARM Cortex-M33 is also known as the Link Register (LR)?
|
||||
|
||||
A) r13
|
||||
B) r15
|
||||
C) r14
|
||||
D) r12
|
||||
|
||||
> 📖 **Reference:** Week 1, Part 2 – "The ARM Cortex-M33 Registers" (register table)
|
||||
|
||||
**Correct Answer: C**
|
||||
|
||||
---
|
||||
|
||||
### Question 3
|
||||
In ARM systems, what happens to the Stack Pointer (SP) when you PUSH data onto the stack?
|
||||
|
||||
A) The SP value increases because data is added
|
||||
B) The SP value decreases because the stack grows downward
|
||||
C) The SP value stays the same
|
||||
D) The SP value doubles to accommodate more data
|
||||
|
||||
> 📖 **Reference:** Week 1, Part 2 – "The Stack Pointer (r13 / SP)"
|
||||
|
||||
**Correct Answer: B**
|
||||
|
||||
---
|
||||
|
||||
### Question 4
|
||||
What does XIP (Execute In Place) mean for the RP2350 microcontroller?
|
||||
|
||||
A) The processor must copy all code to RAM before execution
|
||||
B) The processor can run code directly from flash memory without copying to RAM first
|
||||
C) The processor can only execute code in debug mode
|
||||
D) The processor executes instructions in parallel
|
||||
|
||||
> 📖 **Reference:** Week 1, Part 3 – "XIP - Execute In Place"
|
||||
|
||||
**Correct Answer: B**
|
||||
|
||||
---
|
||||
|
||||
### Question 5
|
||||
At which memory address does program code start in flash memory for the RP2350?
|
||||
|
||||
A) 0x00000000
|
||||
B) 0x20000000
|
||||
C) 0x10000000
|
||||
D) 0xFFFFFFFF
|
||||
|
||||
> 📖 **Reference:** Week 1, Part 3 – "XIP - Execute In Place" (Key Memory Address: 0x10000000)
|
||||
|
||||
**Correct Answer: C**
|
||||
|
||||
---
|
||||
|
||||
### Question 6
|
||||
What is the purpose of the Program Counter (PC) register?
|
||||
|
||||
A) It counts how many times a program has run
|
||||
B) It stores the total number of instructions executed
|
||||
C) It points to the next instruction the processor will execute
|
||||
D) It keeps track of how much time has elapsed
|
||||
|
||||
> 📖 **Reference:** Week 1, Part 2 – "The Program Counter (r15 / PC)"
|
||||
|
||||
**Correct Answer: C**
|
||||
|
||||
---
|
||||
|
||||
### Question 7
|
||||
Which GDB command is used to display the disassembled assembly code for the current function?
|
||||
|
||||
A) `info assembly`
|
||||
B) `show code`
|
||||
C) `disas`
|
||||
D) `list asm`
|
||||
|
||||
> 📖 **Reference:** Week 1, Part 4 – "Disassembling with `disas`"
|
||||
|
||||
**Correct Answer: C**
|
||||
|
||||
---
|
||||
|
||||
### Question 8
|
||||
Why do we start with ELF (.elf) files instead of stripped binary (.bin) files when learning reverse engineering?
|
||||
|
||||
A) ELF files are smaller and faster to load
|
||||
B) ELF files contain symbols like function names that make analysis easier
|
||||
C) Binary files cannot be analyzed by Ghidra
|
||||
D) ELF files run faster on the Pico 2
|
||||
|
||||
> 📖 **Reference:** Week 1, Part 5 – "Why We Start with .elf Files"
|
||||
|
||||
**Correct Answer: B**
|
||||
|
||||
---
|
||||
|
||||
### Question 9
|
||||
In the hello-world program, what assembly instruction creates the infinite loop?
|
||||
|
||||
A) `push {r3, lr}`
|
||||
B) `bl stdio_init_all`
|
||||
C) `b.n` (branch to earlier instruction)
|
||||
D) `ldr r0, [pc, #8]`
|
||||
|
||||
> 📖 **Reference:** Week 1, Part 4 – "Disassembling with `disas`" (the `disas` output showing `b.n 0x1000023a`)
|
||||
|
||||
**Correct Answer: C**
|
||||
|
||||
---
|
||||
|
||||
### Question 10
|
||||
What does the `stdio_init_all()` function do in the hello-world program?
|
||||
|
||||
A) It compiles the code into assembly
|
||||
B) It initializes standard I/O for USB CDC and UART communication
|
||||
C) It creates an infinite loop
|
||||
D) It loads the program into flash memory
|
||||
|
||||
> 📖 **Reference:** Week 1, Part 3.5 – "Initializing Standard I/O"
|
||||
|
||||
**Correct Answer: B**
|
||||
|
||||
---
|
||||
|
||||
## Answer Key
|
||||
|
||||
1. B - A microcontroller is a tiny computer with processor, memory, and storage on a single chip
|
||||
2. C - Register r14 is the Link Register (LR)
|
||||
3. B - The SP decreases because the stack grows downward in memory
|
||||
4. B - XIP allows the processor to run code directly from flash memory
|
||||
5. C - Program code starts at 0x10000000 in flash memory
|
||||
6. C - The PC points to the next instruction to be executed
|
||||
7. C - The `disas` command displays disassembled assembly code
|
||||
8. B - ELF files contain symbols that make learning and analysis easier
|
||||
9. C - The branch instruction `b.n` creates the infinite loop
|
||||
10. B - `stdio_init_all()` initializes standard I/O for USB and UART
|
||||
|
||||
---
|
||||
|
||||
## Scoring Guide
|
||||
|
||||
- **10 correct**: Excellent! You have a strong grasp of Week 1 concepts
|
||||
- **8-9 correct**: Very good! Review the topics you missed
|
||||
- **6-7 correct**: Good start. Go back and review the key concepts
|
||||
- **5 or fewer**: Review the Week 1 material again and try the practice exercises
|
||||
|
||||
---
|
||||
|
||||
## Topics Covered
|
||||
|
||||
This quiz tests your understanding of:
|
||||
- Microcontroller basics and the RP2350
|
||||
- ARM Cortex-M33 registers (general purpose and special registers)
|
||||
- Stack behavior and memory layout
|
||||
- XIP and memory addresses
|
||||
- GDB debugging commands
|
||||
- Assembly instructions and program flow
|
||||
- Static analysis with Ghidra and ELF files
|
||||
- The hello-world program structure
|
||||
Reference in New Issue
Block a user