Computer Organization & Architecture In which section of an executable would str
ID: 3583778 • Letter: C
Question
Computer Organization & Architecture
In which section of an executable would string literals most likely be stored?
the stack section
the data section
the heap section
the bss section
the text section
What determines the order in which parameters are pushed onto the stack, where return values are located, and who is responsible for cleanup after a function call?
a. the alignment restrictions of the types of the parameters
the calling convention
the function prototype
the compiler optimization flags
the endianness
In which section of memory would a local variable declared in a C function most likely be stored?
a. the stack section
the data section
the heap section
the bss section
the text section
In x86 assembly, which instruction, or sequence of instructions, causes a C function declared to return “int” to return the value 9?
ret 9
int 9
push 9 ret
mov eax, 9 ret
fld 9 ret
In which section of an executable would a global int variable initially holding the number 6 most likely be stored?
the stack section
the data section
the heap section
the bss section
the text section
In which section of an executable would the machine code making up a function be stored?
the stack section
the data section
the heap section
the bss section
the text section
What is the difference between a 32-bit processor and a 64-bit processor?
64-bit processors can perform more calculations per second (thus making them faster) and a 64-bit processor supports more ram (4gb or higher) whereas a 32-bit processor supports a max 3-4gb of memory.
Networking
A user types ping www.google.com, but the ping program hangs without producing any output. What is most likely to be the problem?
the user made a typographical error in typing the command
the DNS server is unreachable or not responding
neither the Ethernet or wireless interfaces of the user’s system are connected
the firewall is blocking ICMP traffic
the DHCP server is unreachable or not responding
A user types ssh someserver.example.com, but the ssh program hangs without producing any output. What is least likely to be the problem?
a. the network is extremely congested
the user’s ISP is blocking outbound connections to port 22
the server’s ISP is blocking inbound connections to port 22
the server’s host firewall is blocking inbound connections to port 22
the server’s TCP RST messages keep causing the client to continuously reset and retry making the connection
What error message would most likely occur when attempting to connect to port 80 of a public-facing server that has no HTTP daemon running on that port? a. Network unreachable.
HTTP/404 - file not found.
Broken pipe.
Connection refused.
Unknown host.
A programmer instructs a program to open a listening socket on port 20000, but the program instead listens on port 8270. What went wrong?
Hint: convert the port numbers to hexadecimal.
_________________________________________________________________________
C
When compiling a C program, which tool or GCC component is responsible for resolving the crossreferences that are introduced when code in one separately-compiled C file reads or writes to a global variable defined in a different C file? a. the assembler (as)
the lexer/parser/code generator (“compiler”) (cc1)
the linker/loader (ld)
the runtime linker/loader (ld.so)
the preprocessor (cpp)
During which part of the compilation process are expressions using the sizeof operator (e.g., sizeof int) replaced by the correct numeric value? a. during assembly
during linking
during compilation (lexical analysis, parsing and code generation)
upon the invocation of the make command
during preprocessing
During which part of the compilation process are #define directives processed?
during assembly
during linking
during compilation (lexical analysis, parsing and code generation)
upon the invocation of the make command
during preprocessing
Suppose a programmer declares a local int variable in a C function, but fails to initialize it to any value. What value does the variable hold?
zero
zero if the compiler flag -fautoinit-vars is specified, but the value is undefined in the default legacy mode
the value is undefined, i.e., garbage
NULL
-1
Which statement is most likely to be true on a 64-bit x86 machine?
sizeof char == sizeof short
sizeof char * < sizeof short * && sizeof short * < sizeof int *
&& sizeof int * <= sizeof long *
sizeof char ** > sizeof char *
sizeof char < sizeof short && sizeof short < sizeof int && sizeof int <= sizeof long
sizeof int == sizeof int *
Operating Systems
Which symbolic Unix filesystem permissions (i.e., as shown in the leftmost column when running ls -l) correspond to the octal mode 644?
-r-sr-xr-x
-r-xr--r--
-rw-r--r--
-rwxr-xr-x
-r--------
Suppose that a programmer has installed the Java SDK onto a Windows machine, but when attempting to run javac from the command line, receives an error. Which command is most likely to resolve the problem?
export PATH="C:Program FilesJavajdk1.8.0_31in:$PATH"
dir /s c:javac.exe
which javac
alias javac="C:Program FilesJavajdk1.8.0_31injavac.exe"
set PATH=C:Program FilesJavajdk1.8.0_31in;%PATH%
A programmer compiles a C program on Linux using the command gcc -o myprog myprog.c and receives no errors, but upon running it by typing myprog, receives an error indicating that the myprog command is not found. What is the most likely problem and its solution?
_________________________________________________________________________
Which Unix utility would be the most useful in replacing all occurrences of the string “2014” in a file with the new string “2015” very quickly?
sed
patch
tr
date
m4
Which Unix utility would be most useful in removing all of the comments from an HTML file?
Note: HTML comments are multi-line, begin with <!-- and end with -->, and do not nest.
pr
sed
cut
awk
expr
On which operating system are wildcard characters, e.g. *, expanded only after they are received by a program executed at the command line, rather than by the shell prior to launching the program?
Android
Solaris
Linux
Mac OS X
Windows
Which description of the term “virtual memory” is most technically precise and accurate?
Each process running on the machine has its own page table, allowing the processor’s memory management unit to translate addresses
Disk space is used as memory once physical memory is exhausted
Recently-used disk files are buffered in memory for quick access
Memory is written to disk as part of hibernation so that it persists across power loss
Each virtual machine running on the system has a dedicated allotment of memory
Reverse Engineering
Suppose a C/C++ program has been stripped of its debugging symbols before shipment. What will happen when an analyst attempts to attach a debugger to the program during reverse engineering?
The analyst will only be able to use the debugger’s breakpoint-by-name functionality on calls to shared library functions
The analyst will not be able to set any breakpoints at all
The analyst will be unable to see the contents of the registers
The analyst will still be able to set hardware breakpoints, but not software breakpoints
The debugger will refuse to attach to the program due to the missing debug symbols
Which of the following best and most accurately describes name mangling?
Authors of software libraries prefix variable/function names with double underscore (__) to prevent accidental collisions with names in other libraries or programs
Variable/function names are obfuscated by changing them to meaningless values to resist reverse engineering
The number and types of arguments to a function are encoded into its name to support function overloading without necessarily modifying the linker
Variable/function names are compressed to reduce their size, increasing performance by speeding table lookups
Certain characters, including control characters, newlines, and double quotes, must be escaped using when inside a string literal
When an analyst uses a debugger to set a software breakpoint, what happens?
A software breakpoint instruction (e.g., int3 on x86) is inserted into the instruction stream just before the breakpoint location, with subsequent instructions shifted in memory to make room
The instruction at the breakpoint location is temporarily overwritten with a software breakpoint instruction (e.g., int3 on x86)
The memory address of the breakpoint location is written to one of the processor’s debug registers
The memory address of the breakpoint location is written into the master breakpoint table of the running process
The debugger must single-step the program instruction-by-instruction while any software breakpoints are active
Cryptography
Check off each of the values that must be kept secret in order for a cryptosystem to maintain its security.
___ the pad bytes
___ the mode the programmer has selected for encryption
___ the private key
___ the seed used to initialize the random generator used to produce keys
___ the initialization vector
___ the public key
___ the symmetric key
___ the specific cipher (AES, RC4, DES, etc.) that the programmer has selected for performing encryption
Suppose two parties want to exchange messages. The messages need not be secret, but must not be modified in transit. Which technology could provide this security with the smallest performance trade-off? Assume the key distribution problem is solved. a. a symmetric block cipher, such as AES
an digital signature, such as RSA
a symmetric stream cipher, such as RC4
a cyclic redundancy check, such as CRC-32
a message authentication code, such as HMAC-SHA256
Suppose a computer program auto-updates itself over an HTTP connection. The software is distributed through a set of mirror sites and HTTPS is not feasible. The software company wishes to prevent the autoupdate feature from downloading a modified or Trojan horse update from a malicious or compromised mirror site. Which technology could provide this security with the smallest performance trade-off? Assume the key distribution problem is solved. a. a symmetric block cipher, such as AES
an digital signature, such as RSA
a symmetric stream cipher, such as RC4
a hash function, such as SHA-3
a message authentication code, such as HMAC-SHA256
Which is strongest?
256-bit RSA
128-bit AES
How long must a key be in order to be twice as difficult to break as a 128-bit AES key?
_________________________________________________________________________
Web Security
Which prevents JavaScript code running on badsite.com from reading the session cookie for amazon.com?
the certificate authority
the Secure flag
the P3P privacy policy
the HttpOnly flag
the same origin policy
Which prevents JavaScript code successfully injected by an attacker into a page on amazon.com from reading the session cookie for amazon.com? a. the certificate authority
the Secure flag
the P3P privacy policy
the HttpOnly flag
the same origin policy
Suppose a web server needs to distinguish a legitimate form submission generated by a user’s explicit action from a fraudulent one initiated by a third-party, malicious site. Validating which of the following would be the least effective in performing this task?
that the Cookie header contains the correct session cookie
that the correct CAPTCHA was submitted
that the referrer points to a trusted server
that the submitted password is correct
that the submitted anti-CSRF token is correct
Which of the following techniques for preventing an attacker from injecting unwanted JavaScript into a response would be the least effective?
replacing <, >, ", and ’ with <, >, ", and ', respectively.
replacing all non-alphanumeric characters by their HTML-entity equivalents
removing each string in the original input matching the regular expressions <script[ˆ>]*> and </script[ˆ>]*>
using a Content-Security-Policy that disallows inline JavaScript
using the innerText property, rather than innerHTML, to dynamically modify the DOM
Detour is a town in Carroll County, Maryland. To avoid confusion, traffic engineers place signs directing motorists to Detour or labeling roads named Detour on a green background, while construction-related detours requiring drivers to divert from their usual route are shown on a sign with an orange background. Which technical solution and problem are analogous?
replacing < with <, so that a browser will not confuse < with the start of an HTML tag
replacing a JavaScript identifier named for with _for, to prevent the parser from confusing the identifier with the for keyword
commenting code whenever other developers are likely to be confused by a particular statement or design
using _3d for a JavaScript identifier rather than 3d, since JavaScript will not allow an identi-
fier to start with a digit
using SQL parameterized queries to pass input data separately from the query, so that data will not be confused with code
Problem Solving
log
10x
÷
7
8
9
×
4
5
6
-
1
2
3
+
0
.
+/-
=
Using the calculator above, how would you compute 7.0962.1018, if possible?
_________________________________________________________________________
Using the calculator above, how would you compute 18, if possible?
_________________________________________________________________________
Using the calculator above, how would you compute ln3, if possible?
__________________________________________________________________________
Using the calculator above, how would you compute sin63. 24°, if possible?
_________________________________________________________________________
log
10x
÷
7
8
9
×
4
5
6
-
1
2
3
+
0
.
+/-
=
Explanation / Answer
Hi
I will be answering some of the questions.
Q. In which section of an executable would string literals most likely be stored?
Ans. String literals will be stored in data section.
Q.In which section of memory would a local variable declared in a C function most likely be stored?
Ans. Variable declared in a C function most likely be stored in stack section.for example if we declare a pointer p , it would be stored in stack.
Q.What determines the order in which parameters are pushed onto the stack, where return values are located, and who is responsible for cleanup after a function call?
Ans. It is calling Convention.
Q.In x86 assembly, which instruction, or sequence of instructions, causes a C function declared to return “int” to return the value 9?
Ans. return by function : ret 9
Q.In which section of an executable would a global int variable initially holding the number 6 most likely be stored?
Ans. The stack section.
Q. What is the difference between a 32-bit processor and a 64-bit processor?
Ans. 64-bit processors can perform more calculations per second (thus making them faster)
and a 64-bit processor supports more ram (4gb or higher) whereas a 32-bit processor supports a max 3-4gb of memory.
Q.A user types ping www.google.com, but the ping program hangs without producing any output. What is most likely to be the problem?
Ans. The most likely problem could be the DNS server is unreachable or not responding. erro message it will throw would be Ping request could not find host google.com.
Q. A user types ssh someserver.example.com, but the ssh program hangs without producing any output. What is least likely to be the problem?
Ans. The least likely to be the problem would be "the network is extremely congested".
Q.What error message would most likely occur when attempting to connect to port 80 of a public-facing server that has no HTTP daemon running on that port?
Ans. Connection refused.
Thanks
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.