CS代写 SCI 3307 Quizzes Assignment 2

4220 COMP SCI 3307 Quizzes Assignment 2

Assignment 2
Quiz instructions

Copyright By PowCoder代写 加微信 powcoder

You are allowed to refer to lectures’ slides, but it’s NOT OK to get someone to help you.
You may submit as many !mes as you want. Only the last submission will be marked. If your last submission is a”er the due date, late penalty will be applied even if you have prior on-!me submissions.

In this part, you are asked to analyse a few func!on and understand what they do. The func!ons perform simple arithme!c and bitwise opera!ons on their inputs. We do not ask you to describe these opera!ons, but to explain what the outcome is. For example, consider the func!on:
int32_t example1(int32_t a) {
return (aˆ0xFFFFFFFF)+1;
Saying that example1 calculates the exclusive or of the input with the number 0xFFFFFFFF and adds one is technically correct, but is not the expected answer. The correct answer is that the func!on computes the two’s complement of the input. (Or any equivalent descrip!on.)
Similarly, for example2 below, the expected answer is that the func!on returns bit b of a . Saying that it shi”s the number 1 by b bits to the le” and returns the result of anding that with a is not sufficient.
uint32_t example2(uint32_t a, uint32_t b) {
return (1<> 31;
Ques!on 3 1 pts
int32_t f3(int32_t a) {
return (a | -a)>>31;
Ques!on 4 1 pts
uint32_t f4(uint32_t a, uint32_t b, int32_t c, int32_t d) {
c = (c | -c) >> 31;
return (a & ∼ c) | (b & c);
Ques!on 5 16 pts
For this part your task is to fuzz two versions of the solu!ons to Assignment 1. You can choose whether to fuzz the bignum library or the calc so”ware (or both). You can use any fuzzing tool
available online or develop your own tools. Two recommended tools are libfuzzer
american fuzzy lop
The so”ware to fuzz is included in bignums.tgz . The tar file contains a folder called bignums that has ten subfolders, BigNum-0 , BigNum-1 , …, BigNum-9 . Each of the subfolders contains a solu!on to Assignment 1. Each student should fuzz two of these, determined by the least significant digits of their students number. If the two least significant digits are iden!cal, keep considering digits towards the most significant digit un!l you have two different digits. Thus, student a1111400 should fuzz BigNum-0 and BigNum-4 .
As an answer:
upload a PDF file (up to two A4 pages in text) that describes what you have done and what you have found. Please upload the file here in this Ques!on.
upload a tar file with all the configura!on files and so”ware you have developed for the fuzzing. Please upload the file in Ques!on 6.
Choose a file
Ques!on 6 0 pts
Please upload a .tar or .tgz file with all the configura!on files and so”ware you have developed for the fuzzing.
Note that this is part of Ques!on 5. The 16 marks are for the PDF and the tar files.
Choose a file
Saved at 18:10
Submit quiz

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com