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. Which

The correct answer is C. re.search(r'(\x47\x49\x46)(\x38\x3b)',raw_data). You've hit your limit · resets 1pm (America/New_York)

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]

How the community answered

(31 responses)
  • A
    26% (8)
  • B
    10% (3)
  • C
    48% (15)
  • D
    16% (5)

Explanation

You've hit your limit · resets 1pm (America/New_York)

Topics

#file carving#magic bytes#regex binary#forensics

Community Discussion

No community discussion yet for this question.

Full GPYC Practice