nerdexam
GIAC

GPYC · Question #52

A .gif file has the following attributes: Extension: .gif Magic value for start of file: \x47\x49\x46\x38 Magic value for end of file: \x3b A small data file called "raw_data" contains one gif…

Sign in or unlock GPYC to reveal the answer and full explanation for question #52. The question stem and answer options stay visible for context.

Web Scraping & Forensics with Python

Question

A .gif file has the following attributes: Extension: .gif Magic value for start of file: \x47\x49\x46\x38 Magic value for end of file: \x3b A small data file called "raw_data" contains one gif. Which of the following statements is most likely to successfully extract the file?

Options

  • Are.findall(r'^.gif,raw_data)[0]
  • Bre.match(r'(\x47\x49\x46)(\x38)',raw_data).group(1)
  • Cre.search(r'(\x47\x49\x46)(\x38\x3b)',raw_data)
  • Dre.findall(r'\x47\x49\x46.\x3b,raw_data,re.DOTALL)[0]

Unlock GPYC to see the answer

You've previewed enough free GPYC questions. Unlock GPYC for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#file carving#magic bytes#regex binary#forensics
Full GPYC Practice