From 1dd8671e2d6c4184a310f987f966ad3075f8e8c3 Mon Sep 17 00:00:00 2001 From: Infosec Gurung <72032538+InfosecGurung@users.noreply.github.com> Date: Tue, 15 Jun 2021 17:13:24 +0530 Subject: [PATCH 1/3] Fixed typo of "only" --- Lecture1/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lecture1/README.md b/Lecture1/README.md index a7f5c95..fd92b42 100644 --- a/Lecture1/README.md +++ b/Lecture1/README.md @@ -173,7 +173,7 @@ Lets take an example how the fucntion call code looks like. 804844c: 66 90 xchg %ax,%ax 804844e: 66 90 xchg %ax,%ax ``` -I have oly copied the code of main and foo fucntion here. Observe the call to the foo fucntion from main. +I have only copied the code of main and foo fucntion here. Observe the call to the foo fucntion from main. 1. Main seems to push nothing before the fucntion call. That means foo does not takes any arguments. 2. Call instruction will ask the CPU to save the return address(address next to instruction pointer) into the stack. This is done by the **call** intuction, so will not be visible in the code. 3. The first instruction of **foo** is to push **$ebp** into the stack. From cbb2348bca6f748697063c69b3428923c22ceb40 Mon Sep 17 00:00:00 2001 From: Infosec Gurung <72032538+InfosecGurung@users.noreply.github.com> Date: Tue, 15 Jun 2021 17:17:24 +0530 Subject: [PATCH 2/3] Fixed two typos of "function" Both the words were on the same line. --- Lecture1/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lecture1/README.md b/Lecture1/README.md index fd92b42..edbfc53 100644 --- a/Lecture1/README.md +++ b/Lecture1/README.md @@ -173,7 +173,7 @@ Lets take an example how the fucntion call code looks like. 804844c: 66 90 xchg %ax,%ax 804844e: 66 90 xchg %ax,%ax ``` -I have only copied the code of main and foo fucntion here. Observe the call to the foo fucntion from main. +I have only copied the code of main and foo function here. Observe the call to the foo function from main. 1. Main seems to push nothing before the fucntion call. That means foo does not takes any arguments. 2. Call instruction will ask the CPU to save the return address(address next to instruction pointer) into the stack. This is done by the **call** intuction, so will not be visible in the code. 3. The first instruction of **foo** is to push **$ebp** into the stack. From 6b690f129bfbab4ce212127702c8adccab9e9559 Mon Sep 17 00:00:00 2001 From: Infosec Gurung <72032538+InfosecGurung@users.noreply.github.com> Date: Tue, 15 Jun 2021 17:20:56 +0530 Subject: [PATCH 3/3] Fixed typos for "instruction", "immediate" --- Lecture1/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lecture1/README.md b/Lecture1/README.md index edbfc53..38f535e 100644 --- a/Lecture1/README.md +++ b/Lecture1/README.md @@ -175,9 +175,9 @@ Lets take an example how the fucntion call code looks like. ``` I have only copied the code of main and foo function here. Observe the call to the foo function from main. 1. Main seems to push nothing before the fucntion call. That means foo does not takes any arguments. -2. Call instruction will ask the CPU to save the return address(address next to instruction pointer) into the stack. This is done by the **call** intuction, so will not be visible in the code. +2. Call instruction will ask the CPU to save the return address(address next to instruction pointer) into the stack. This is done by the **call** instruction, so will not be visible in the code. 3. The first instruction of **foo** is to push **$ebp** into the stack. -4. The immidiate instruction will be to pint **$ebp** to point to **$esp**. +4. The immediate instruction will be to pint **$ebp** to point to **$esp**. Those instruction can be divided into three parts, which are explained in the flow below. ```