How to do it...

Let's perform the following steps:

  1. In the open Terminal session, start the Python prompt by typing in the following command:
$ python
  1. Type the following in the Python prompt:
>>> ('A' * 28) + ('B' * 28) + ('C' * 28)
  1. Highlight and copy the output from this command without the single quotes, and open another Terminal tab by pressing Shift + Ctrl +  on your keyboard.
  2. Run the ch08-SalesFigures program in the new Terminal tab:
$ ./ch08-SalesFigures
  1. Paste the copied output from steps 2 and 3 as the input to the ch08-SalesFigures program and press Enter on your keyboard. Review the results. You should receive a Segmentation fault (core dumped) message, indicating that we've crashed the program.
  2. Next, in the same Terminal tab, start EDB:
$ edb --run ./ch08-SalesFigures
  1. Next, press the Run button to hit the first breakpoint on main.
  2. Press the Run button again to run the program up until it stops and waits for user input.
  3. Switch over to the EDB X-term window and type the letter A on the keyboard 28 times, followed by the letter 28 times, followed by the letter 28 times, and then press Enter on your keyboard.
  4. An Illegal Access Fault warning message will appear. Press the OK button to continue.
  5. Review the Registers section of the UI, specifically the RIP register and RSP register, and then review the output area immediately beneath the disassembly section of the UI. It should read return to 0x4343434343434343.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.4.181