# Lab-5 Solution
1. This lab is similar to `lab4`, except that the binary is a PE64 executable. The source code is the same except for the flag, so the debugging procedure is similar to lab4
2. Launch x64dbg. Press File > Open

Choose `lab5.exe` and start debugging

3. Now you need to find the main function. You can throw this executable into IDA and find the main address at the `Function` bar on the left side.

`main` calls two functions: `initialize` and `real_routine`. According to lab4, you'll probably want to look into `real_routine`, which is located at `0x4015BD`.

Now, head back to x64dbg and type `Ctrl-G`

Type `4015BD` in the search bar,

Then press OK.

Press `F2` at `4015BD` to add a breakpoint

Press several `F9` until the process stop at the breakpoint.
Now you can debug the function!
4. Similarly, press several `F8` until you land on the `call read` instruction

Observe the flag comparison instructions similar to lab4.

Extract all bytes from the `cmp` instructions similar to lab4, and you can get the flag.