Question
I need these Secure Coding Questions in C PLEASE DO NOT COPY ANSWERS FROM CHEGG, BECAUSE THEY ARE WRONG In class, we gave a very
I need these Secure Coding Questions in C PLEASE DO NOT COPY ANSWERS FROM CHEGG, BECAUSE THEY ARE WRONG
In class, we gave a very basic macro design to implement stack guard with canary. In that design, we havent talk about how to define __SECRET_VAR in the macros. A simple way to define __SECRET_VAR is some marco like #define __SECRET_VAR 11223344 But the issue is that it is a constant so an attacker can know. A better strategy is to make it a variable and assign a random number to it at run time. You job is to write the entire set of macros in a head file mycanary.h so a users program can include the header file and use all macros for stack protection. You have already been given the following users code, which uses four macros: DEF_CANARY(), PLACE_CANARY(), SAFE_RETURN(), and INIT_CANARY(). Please complete all four macros in the header file mycanary.h so __SECRET_VAR can be assigned randomly at run time. Submit the content of your mycanary.h. Screen-shot the result to show your macros can successfully detect buffer overflow in the following code. (50pts) #include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started