{"id":1977,"date":"2013-07-06T00:37:08","date_gmt":"2013-07-06T00:37:08","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=1977"},"modified":"2013-07-06T00:37:08","modified_gmt":"2013-07-06T00:37:08","slug":"the-argument-about-prefetchx-or-the-other-way-around","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2013\/07\/06\/the-argument-about-prefetchx-or-the-other-way-around\/","title":{"rendered":"The argument about \/prefetch:X, or &#8230; the other way around"},"content":{"rendered":"<p>My <a title=\"Prefetch Hash Calculator + a hash lookup table xp\/vista\/w7\/w2k3\/w2k8\" href=\"https:\/\/www.hexacorn.com\/blog\/2012\/06\/13\/prefetch-hash-calculator-a-hash-lookup-table-xpvistaw7w2k3w2k8\/\">older<\/a> <a title=\"Prefetch file names and UNC paths\" href=\"https:\/\/www.hexacorn.com\/blog\/2012\/10\/29\/prefetch-file-names-and-unc-paths\/\">posts <\/a>about the algorithm used by Prefetch files mentioned the \/prefetch:X command line argument, but I never got a chance to explain this in detail. Today I accidentally came across an old post on <a href=\"http:\/\/blogs.msdn.com\/b\/ryanmy\/archive\/2005\/05\/25\/421882.aspx\">MSDN<\/a> that goes to a great extent explaining this bit. As per the blog:<\/p>\n<p style=\"padding-left: 30px;\">The \/prefetch:# flag is looked at by the OS when we create the process &#8212; however, it has one (and only one) purpose.\u00a0 We add the passed number to the hash.\u00a0 Why?\u00a0 WMP is a multipurpose application and may do many different things.\u00a0 The DLLs and code that it touches will be very different when playing a WMV than when playing a DVD, or when ripping a CD, or when listening to a Shoutcast stream, or any of the other things that WMP can do.\u00a0 If we only had one hash for WMP, then the prefetch would only be correct for one such use.\u00a0 Having incorrect prefetch data would not be a fatal error &#8212; it&#8217;d just load pages into memory that&#8217;d never get used, and then get swapped back out to disk as soon as possible.\u00a0 Still, it&#8217;s counterproductive.\u00a0 By specifying a \/prefetch:# flag with a different number for each &#8220;mode&#8221; that WMP can do, each mode gets its own separate hash file, and thus we properly prefetch.\u00a0 (This behavior isn&#8217;t specific to WMP &#8212; it does the same for any app.)<\/p>\n<p>Isn&#8217;t that great when we don&#8217;t need to reinvent the wheel? \ud83d\ude42<\/p>\n<p>Still, at the bottom of the article it says:<\/p>\n<p style=\"padding-left: 30px;\">(ATTENTION: This is merely an informative article; this information is completely unsupported, and the functionality may change or disappear entirely in future versions of Windows or service packs.\u00a0 Furthermore, it is merely a hint for the XP prefetcher, and it may choose to ignore it if it wishes.)<\/p>\n<p>Oh well.. most of the forensic analysis is based on the &#8216;undocumented&#8217; &#8216;unsupported&#8217; and guesswork anyway, so it kinda fits in perfectly \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My older posts about the algorithm used by Prefetch files mentioned the \/prefetch:X command line argument, but I never got a chance to explain this in detail. Today I accidentally came across an old post on MSDN that goes to &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2013\/07\/06\/the-argument-about-prefetchx-or-the-other-way-around\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1977"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=1977"}],"version-history":[{"count":5,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1977\/revisions"}],"predecessor-version":[{"id":1985,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1977\/revisions\/1985"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=1977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=1977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=1977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}