Difference between pages "Java" and "Prefetch"

From ForensicsWiki
(Difference between pages)
Jump to: navigation, search
(Update links to corrected URLs)
 
(External Links)
 
Line 1: Line 1:
 
{{Expand}}
 
{{Expand}}
 +
Windows Prefetch files, introduced in [[Windows|Windows XP]], are designed to speed up the application startup process. Prefetch files contain the name of the executable, a Unicode list of DLLs used by that executable, a count of how many times the executable has been run, and a timestamp indicating the last time the program was run. Although Prefetch is present in Windows 2003, by default it is only enabled for boot prefetching. The feature is also found in [[Windows|Windows Vista]], where it has been augmented with [[SuperFetch]], [[ReadyBoot]], and [[ReadyBoost]]. For SSD drives Prefetch is disabled by default [http://blogs.msdn.com/b/e7/archive/2009/05/05/support-and-q-a-for-solid-state-drives-and.aspx].
  
== Java WebStart Cache ==
+
Up to 128 Prefetch files are stored in the <tt>%SystemRoot%\Prefetch</tt> directory [http://blogs.msdn.com/ryanmy/archive/2005/05/25/421882.aspx]. Each file in that directory should contain the name of the application, a dash, and then an eight character hash of the location from which that application was run, and a <tt>.pf</tt> extension. The filenames should be all uppercase except for the extension. The format of hashes is not known. A sample filename for [[md5deep]] would look like: <tt>MD5DEEP.EXE-4F89AB0C.pf</tt>. If an application is run from two different locations on the drive (i.e. the user runs <tt>C:\md5deep.exe</tt> and then <tt>C:\Apps\Hashing\md5deep.exe</tt>), there will be two different prefetch files in the Prefetch folder.
As of Java version 6 the Java WebStart Cache can be found in the following locations.
+
  
On Linux for user accounts:
 
<pre>
 
/home/$USER/.java/deployment/cache/
 
</pre>
 
  
On MacOS-X for user accounts:
+
== Signature ==
<pre>
+
Each Prefetch file has a signature in the first 8 bytes of the file.
/Users/$USER/Library/Caches/Java/cache/
+
* Windows XP and Windows 2003 Prefetch file's signature is \x11\x00\x00\x00\x53\x43\x43\x41 (0x41434353 0x00000011).
</pre>
+
* Windows Vista and Windows 7 Prefetch file's signature is \x17\x00\x00\x00\x53\x43\x43\x41 (0x41434353 0x00000017).
  
On Windows XP  for user accounts:
+
The [http://en.wikipedia.org/wiki/ASCII ASCII] representation of these bytes will display "....SCCA".
<pre>
+
C:\Documents and Settings\%USERNAME%\Application Data\Sun\Java\Deployment\cache\
+
</pre>
+
  
On Windows Vista and later for user accounts:
+
== Timestamps ==
<pre>
+
C:\Users\%USERNAME%\AppData\LocalLow\Sun\Java\Deployment\cache\
+
</pre>
+
  
On Windows Vista and later for system accounts:
+
Both the [[NTFS]] timestamps for a Prefetch file and the timestamp embedded in each Prefetch file contain valuable information. The timestamp embedded within the Prefetch file is a 64-bit (QWORD) [http://msdn2.microsoft.com/en-us/library/ms724284.aspx FILETIME] object The creation date of the file indicates the first time the application was executed. Both the modification date of the file and the embedded timestamp indicate the last time the application was executed.
<pre>
+
C:\Windows\System32\config\systemprofile\AppData\LocalLow\Sun\Java\Deployment\cache\
+
</pre>
+
  
On Windows Vista and later for system accounts using SysWOW64:
+
Windows will store timestamps according to Windows [http://msdn.microsoft.com/en-us/library/ms724290%28VS.85%29.aspx epoch].
<pre>
+
C:\Windows\SysWOW64\config\systemprofile\AppData\LocalLow\Sun\Java\Deployment\cache\
+
</pre>
+
  
Note: there also can be an additional SystemCache directory e.g. on Windows Vista and later for user accounts:
+
==== Creation Time ====
<pre>
+
The creation time does not have a static offset on any Windows platform. The location of the creation time can be found using the offset 0x8 + length of Volume path offset. See section Volume for more information.
C:\Users\%USERNAME%\AppData\LocalLow\Sun\Java\Deployment\SystemCache\
+
</pre>
+
  
Note that if JAR files are cached it does not imply that they have been executed. The behavior seen with Microsoft Internet Explorer in combination with JRE 1.7 in high security mode is that it will download the JAR file and then prompt the user if he/she want to execute the Java applet.
+
==== Last Run Time ====
 +
A timestamp of when the application was last ran is embedded into the Prefetch file.
 +
The offset from the beginning of the file to the "Last Run Time" is located:
 +
* at offset 0x78 on Windows XP and Windows 2003.
 +
* at offset 0x80 on Windows Vista and Windows 7.
  
== IDX file format ==
+
== MetaData ==
Caveat: The following information is based on analysis of several dozen *.idx files from different Windows 7 systems. As such, the following information should not be considered to have been exhaustively researched.
+
==== Header ====
 +
In each Prefetch file, the size of the header is stored and can be found at offset 0x54 on [[Windows|Windows XP]], [[Windows|Windows Vista]], and [[Windows|Windows 7]]. The header size for [[Windows|Windows XP]] is 0x98 (152) and 0xf0 (240) on Windows Vista and Windows 7.
  
Values are in big-endian.
+
The Prefetch file will embed the application's name into the header at offset 0x10.
  
<pre>
+
==== Run Count ====
00000000  01 00 00 00 02 5b 00 00  00 00 1d c7 b4 00 00 01  |.....[..........|
+
The run count, or number of times the application has been run, is a 4-byte (DWORD) value located at offset 0x90 from the beginning of the file on [[Windows|Windows XP]]. On [[Windows|Windows Vista]] and [[Windows|Windows 7]], the run time can be found at 0x98.
00000010  1f 81 29 fe b8 00 00 00  00 00 00 00 00 00 00 01  |..).............|
+
00000020  2b 24 4a cb dd 01 00 00  00 00 00 00 00 00 00 00  |+$J.............|
+
00000030  00 00 00 00 00 00 00 00  01 2b 24 4a a4 cd 00 00  |.........+$J....|
+
00000040  01 2e 45 83 f4 18 00 00  00 00 00 00 00 00 00 01  |..E.............|
+
00000050  01 00 00 00 00 00 00 00  00 00 00 00 01 2b 24 4a  |.............+$J|
+
00000060  a4 cd 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+
</pre>
+
  
The header (or section 1) is 128 bytes in size and contains:
+
==== Volume ====
{| class="wikitable"
+
Volume related information, volume path and volume serial number, are embedded into the Prefetch file. The precise offset for this information is the same for each Prefetch file and Windows operating system. In the header at offset 0x6c, the location of the volume path is stored. The location is a 4-bytes (DWORD) value.
! align="left"| Offset
+
! Size
+
! Value
+
! Description
+
|-
+
| 0
+
| 1
+
|
+
| Busy (flag byte)
+
|-
+
| 1
+
| 1
+
|
+
| Incomplete (flag byte)
+
|-
+
| 2
+
| 4
+
| 00 00 02 5b (603)
+
| Format version
+
|-
+
| 6
+
| 1
+
|
+
| Force update (flag byte)
+
|-
+
| 7
+
| 1
+
|
+
| No-href (flag byte)
+
|-
+
| 8
+
| 1
+
|
+
| Is shortcut image (flag byte)
+
|-
+
| 9
+
| 4
+
|
+
| Content-Length
+
|-
+
| 13
+
| 8
+
| 00 00 01 1f 81 29 fe b8
+
| Last modification date (Number of milli seconds since Jan 1, 1970 00:00:00)
+
|-
+
| 21
+
| 8
+
|
+
| expiration date (Number of milli seconds since Jan 1, 1970 00:00:00) 0 if not expires?
+
|-
+
| 29
+
| 8
+
| 00 00 01 2b 24 4a cb dd
+
| Validation timestamp (Number of milli seconds since Jan 1, 1970 00:00:00)
+
|-
+
| 37
+
| 1
+
|
+
| Known to be signed (flag byte)
+
|-
+
| 38
+
| 4
+
|
+
| Size of section 2
+
|-
+
| 42
+
| 4
+
|
+
| Size of section 3
+
|-
+
| 46
+
| 4
+
|
+
| Size of section 4
+
|-
+
| 50
+
| 4
+
|
+
| Size of section 5
+
|-
+
| 54
+
| 8
+
| 00 00 01 2b 24 4a a4 cd
+
| Blacklist validation time (Number of milli seconds since Jan 1, 1970 00:00:00)
+
|-
+
| 62
+
| 8
+
| 00 00 01 2e 45 83 f4 18
+
| Certificate expiration date (Number of milli seconds since Jan 1, 1970 00:00:00)
+
|-
+
| 70
+
| 1
+
|
+
| Class verification status
+
|-
+
| 71
+
| 4
+
|
+
| Reduced manifest size
+
|-
+
| 75
+
| 4
+
|
+
| section4Pre15Length?
+
|-
+
| 79
+
| 1
+
|
+
| Has only signed entries (flag byte)
+
|-
+
| 80
+
| 1
+
|
+
| Has single code source (flag byte)
+
|-
+
| 81
+
| 4
+
|
+
| section4CertsLength?
+
|-
+
| 85
+
| 4
+
|
+
| section4SignersLength?
+
|-
+
| 89
+
| 1
+
|
+
| Has missing signed entries (flag byte)
+
|-
+
| 90
+
| 8
+
| 00 00 01 2b 24 4a a4 cd
+
| Trusted libraries validation time (Number of milli seconds since Jan 1, 1970 00:00:00)
+
|-
+
| 98
+
| 4
+
|
+
| reducedManifest2Length?
+
|-
+
| 102
+
| 26
+
|
+
| Unknown, empty values (likely reserved for future expansion of the header)
+
|}
+
  
The values present in the header are dependent on the version. The definition above is based on version 603 and intended as an example check the [https://github.com/woanware/javaidx/blob/master/Documents/Java.IDX.Format.pdf Java IDX Format Specification] for more current information.
+
At the location given from offset 0x6c, a 4-byte value is stored which is the number of bytes from current offset (location from offset 0x6c) to the beginning of the volume path string. The location from the offset 0x6c, for ease of reading, will be called the "volume path offset." The volume path is embedded as an [http://en.wikipedia.org/wiki/UTF-16/UCS-2 UTF-16] encoded string.
  
To convert a timestamp in e.g. Python
+
The length of the volume path string is a 4-byte value is located at volume path offset + 0x4.
<pre>
+
print datetime.datetime(1970, 1, 1) + datetime.timedelta(milliseconds=0x011f8129feb8)
+
2009-02-16 22:17:07
+
</pre>
+
  
<pre>
+
The volume [http://en.wikipedia.org/wiki/Volume_serial_number serial number] is a 4-byte value that identifies a media storage. A serial number does not have a consistent offset within a Prefetch between Windows operating systems. The 4-byte value can be found eight (8) bytes from the creation time location. The [http://en.wikipedia.org/wiki/Vol_%28command%29 vol] command on Windows can verify the volume serial number.
00000080  00 00 00 39 68 74 74 70  3a 2f 2f 77 77 77 2e 74  |...9http://www.t|
+
00000090  6f 70 63 6f 64 65 72 2e  63 6f 6d 2f 63 6f 6e 74  |opcoder.com/cont|
+
000000a0  65 73 74 2f 63 6c 61 73  73 65 73 2f 43 6f 6e 74  |est/classes/Cont|
+
000000b0  65 73 74 41 70 70 6c 65  74 2e 6a 61 72          |estApplet.jar  |
+
</pre>
+
  
{| class="wikitable"
+
==== End of File ====
! align="left"| Offset
+
The end of file (EOF) for each Prefetch file is located at offset 0xc. The location of EOF also denotes the size of the Prefetch file.
! Size
+
! Value
+
! Description
+
|-
+
| 128
+
| 2
+
| 00 00
+
| Version string size
+
|-
+
| 130
+
| 2
+
| 00 39
+
| Original URL string size
+
|-
+
| 132
+
| size
+
|
+
| Original URL string (UTF-8 without an end-of-string character?)
+
|}
+
  
<pre>
+
==== Files ====
000000b0                                          00 00 00  |            ...|
+
000000c0  0c 36 36 2e 33 37 2e 32  31 30 2e 38 36 00 00 00  |.66.37.210.86  |
+
</pre>
+
  
{| class="wikitable"
+
Embedded within each Prefetch file are files and directories that were used doing the application's startup. The Prefetch file separates both filenames and directories into two different location in the file. Each string is encoded as a [http://en.wikipedia.org/wiki/UTF-16/UCS-2 UTF-16] string. Windows operating system uses UTF-16 encoding.
! align="left"| Offset
+
! Size
+
! Value
+
! Description
+
|-
+
| ...
+
| 2
+
| 00 00
+
| Namespace string size
+
|-
+
| ...
+
| 2
+
| 00 0c
+
| IP string size
+
|-
+
| ...
+
| size
+
|
+
| IP string (UTF-8 without an end-of-string character?)
+
|}
+
  
<pre>
+
The offset to the first set of filenames are at 0x64. The size of the first set of filenames can be found at offset 0x68. Both offsets are consistent between Windows XP, Windows Vista and Windows 7.
000000c0                                          00 00 00  |            ...|
+
000000d0  07 00 06 3c 6e 75 6c 6c  3e 00 0f 48 54 54 50 2f  |...<null>..HTTP/|
+
000000e0  31 2e 31 20 32 30 30 20  4f 4b 00 0e 63 6f 6e 74  |1.1 200 OK..cont|
+
000000f0  65 6e 74 2d 6c 65 6e 67  74 68 00 07 31 39 35 31  |ent-length..1951|
+
00000100  36 36 38 00 0d 6c 61 73  74 2d 6d 6f 64 69 66 69  |668..last-modifi|
+
00000110  65 64 00 1d 4d 6f 6e 2c  20 31 36 20 46 65 62 20  |ed..Mon, 16 Feb |
+
00000120  32 30 30 39 20 32 32 3a  31 37 3a 30 37 20 47 4d  |2009 22:17:07 GM|
+
00000130  54 00 0c 63 6f 6e 74 65  6e 74 2d 74 79 70 65 00  |T..content-type.|
+
00000140  18 61 70 70 6c 69 63 61  74 69 6f 6e 2f 6a 61 76  |.application/jav|
+
00000150  61 2d 61 72 63 68 69 76  65 00 04 64 61 74 65 00  |a-archive..date.|
+
00000160  1d 53 61 74 2c 20 31 38  20 53 65 70 20 32 30 31  |.Sat, 18 Sep 201|
+
00000170  30 20 31 30 3a 30 31 3a  30 36 20 47 4d 54 00 06  |0 10:01:06 GMT..|
+
00000180  73 65 72 76 65 72 00 06  41 70 61 63 68 65 00 1b  |server..Apache..|
+
00000190  64 65 70 6c 6f 79 2d 72  65 71 75 65 73 74 2d 63  |deploy-request-c|
+
000001a0  6f 6e 74 65 6e 74 2d 74  79 70 65 00 1a 61 70 70  |ontent-type..app|
+
000001b0  6c 69 63 61 74 69 6f 6e  2f 78 2d 6a 61 76 61 2d  |lication/x-java-|
+
000001c0  61 72 63 68 69 76 65 1f  8b 08 00 00 00 00 00 00  |archive.........|
+
...
+
</pre>
+
  
{| class="wikitable"
+
In the bottom section of the Prefetch file are UTF-16 strings of directories. At the time of this writing (7/2011), the precise offset and size of the directory listing is unknown. The distance between the end of the Volume Path string and the beginning of the directory strings is given. An approach to finding the offset to the beginning of the directories listing is to obtain the distance value and the offset when the Volume Path string ends (after the NULL bytes). The distance value is at volume path offset + 0x18 (24). The distance is a 4-byte (DWORD) value. The end of second set of strings will complete the Prefetch file. The size of the directory listing is calculated by subtracting the start position of the directory listing from the end of file position.
! align="left"| Offset
+
! Size
+
! Value
+
! Description
+
|-
+
| ...
+
| 4
+
|
+
| Number of header value pairs
+
|-
+
| ...
+
| ...
+
|
+
| Array of header value pairs
+
|}
+
  
A value pair is variable of size and consists of:
+
== See Also ==
{| class="wikitable"
+
* [[Windows Prefetch File Format]]
! align="left"| Offset
+
* [[SuperFetch]]
! Size
+
* [[Prefetch XML]]
! Value
+
* [[Windows]]
! Description
+
|-
+
| 0
+
| 2
+
|
+
| Header value identifier string size
+
|-
+
| 2
+
| size
+
|
+
| Header value identifier string
+
|-
+
| ...
+
| 2
+
|
+
| Header value string size
+
|-
+
| ...
+
| size
+
|
+
| Header value string
+
|}
+
 
+
For the example above the size of the URL string can be found at offset 130 (0x82). The first 4 string values to extract from this data are prefaced with their lengths (or sizes) as 16-bit big-endian values. E.g. to retrieve the original URL string, read the WORD at offset 0x82, and translate it as a big-endian value (e.g. using Perl, <i>unpack("n",$data)</i>). Beginning at offset 0x84, the string is 57 (0x39) bytes long. At the end of that string, the next WORD is the length of the third string, also in big-endian format.
+
 
+
Once you've completed reading the initial 4 strings, there is a DWORD value which can be interpreted as the number of header values, followed by the individual header value definitions. Each header value definition consists of an identifier and a value string. Both strings are prefaced by a 16-bit big-endian (2-byte) value, containing the length of the string.
+
 
+
In many cases, the first header value contains the HTTP Response code of 302. Other header values (that have been observed so far) include a response of 200, as well as additional data (including time stamps), and the *.idx files themselves appear to contain certificate (and perhaps other) information.
+
  
 
== External Links ==
 
== External Links ==
* [http://docs.oracle.com/javase/6/docs/technotes/guides/deployment/deployment-guide/tracing_logging.html Tracing and Logging], by [[Oracle]]
+
* [http://www.microsoft.com/whdc/driver/kernel/XP_kernel.mspx#ECLAC Microsoft's description of Prefetch when Windows XP was introduced]
* [http://sploited.blogspot.ch/2012/08/java-forensics-using-tln-timelines.html Java Forensics using TLN Timelines]
+
* [http://msdn.microsoft.com/msdnmag/issues/01/12/XPKernel/default.aspx More detail from Microsoft]
* [http://journeyintoir.blogspot.com/2011/02/almost-cooked-up-some-java.html Almost Cooked UP Some Java]
+
* [http://en.wikipedia.org/wiki/Prefetcher Wikipedia Prefetcher]
* [http://journeyintoir.blogspot.com/2011/11/finding-initial-infection-vector.html Finding Initial Infection Vector]
+
* [http://42llc.net/?page_id=215 Yogesh Khatri's Prefetch Research]
* [https://github.com/woanware/javaidx/blob/master/Documents/Java.IDX.Format.pdf Java IDX Format Specification], by [[Mark Woan]], January 2013
+
* [http://blogs.msdn.com/b/e7/archive/2009/05/05/support-and-q-a-for-solid-state-drives-and.aspx Support and Q&A for Solid-State Drives], by Steven Sinofsky, May 5, 2009
* [http://www.ghettoforensics.com/2013/04/java-malware-identification-and-analysis.html Java Malware - Identification and Analysis], by [[Brian Baskin]], January 12, 2013
+
* [http://www.dfinews.com/articles/2010/12/decoding-prefetch-files-forensic-purposes-part-1 Decoding Prefetch Files for Forensic Purposes: Part 1], by Mark Wade, December 8, 2010
* [http://tojoswalls.blogspot.ch/2013/05/java-web-vulnerability-mitigation-on.html Java Web Vulnerability Mitigation on Windows], by Tim Johnson, May 23, 2013
+
* [http://windowsir.blogspot.ch/2012/03/prefetch-analysis-revisited.html Prefetch Analysis, Revisited], by [[Harlan Carvey]], March 8, 2012
* [http://www.ghettoforensics.com/2013/09/malware-analysis-state-of-java-analysis.html The State of Java Reversing Tools], by [[Brian Baskin]], September 3, 2013
+
* [http://journeyintoir.blogspot.ch/2012/12/ntosboot-prefetch-file.html NTOSBOOT Prefetch File], by [[Corey Harrell]], December 5, 2012
 
+
=== Java source code ===
+
* [http://jdk-source-code.googlecode.com/svn/trunk/jdk6u21_src/deploy/src/common/share/classes/com/sun/deploy/cache/Cache.java Cache.java]
+
* [http://jdk-source-code.googlecode.com/svn/trunk/jdk6u21_src/deploy/src/common/share/classes/com/sun/deploy/cache/CacheEntry.java CacheEntry.java]
+
  
[[Category:Analysis]]
+
=== Tools ===
 +
* [http://milo2012.wordpress.com/2009/10/19/windows-prefetch-folder-tool/ Prefetch-Tool Script] - Python looks Prefetch files up on a web server.
 +
* [http://www.mitec.cz/wfa.html Windows File Analyzer] - Parses Prefetch files, thumbnail databases, shortcuts, index.dat files, and the recycle bin
 +
* [http://www.tzworks.net/prototype_page.php?proto_id=1 Windows Prefetch parser] Free tool that can be run on Windows, Linux or Mac OS-X.

Revision as of 02:05, 20 October 2013

Information icon.png

Please help to improve this article by expanding it.
Further information might be found on the discussion page.

Windows Prefetch files, introduced in Windows XP, are designed to speed up the application startup process. Prefetch files contain the name of the executable, a Unicode list of DLLs used by that executable, a count of how many times the executable has been run, and a timestamp indicating the last time the program was run. Although Prefetch is present in Windows 2003, by default it is only enabled for boot prefetching. The feature is also found in Windows Vista, where it has been augmented with SuperFetch, ReadyBoot, and ReadyBoost. For SSD drives Prefetch is disabled by default [1].

Up to 128 Prefetch files are stored in the %SystemRoot%\Prefetch directory [2]. Each file in that directory should contain the name of the application, a dash, and then an eight character hash of the location from which that application was run, and a .pf extension. The filenames should be all uppercase except for the extension. The format of hashes is not known. A sample filename for md5deep would look like: MD5DEEP.EXE-4F89AB0C.pf. If an application is run from two different locations on the drive (i.e. the user runs C:\md5deep.exe and then C:\Apps\Hashing\md5deep.exe), there will be two different prefetch files in the Prefetch folder.


Signature

Each Prefetch file has a signature in the first 8 bytes of the file.

  • Windows XP and Windows 2003 Prefetch file's signature is \x11\x00\x00\x00\x53\x43\x43\x41 (0x41434353 0x00000011).
  • Windows Vista and Windows 7 Prefetch file's signature is \x17\x00\x00\x00\x53\x43\x43\x41 (0x41434353 0x00000017).

The ASCII representation of these bytes will display "....SCCA".

Timestamps

Both the NTFS timestamps for a Prefetch file and the timestamp embedded in each Prefetch file contain valuable information. The timestamp embedded within the Prefetch file is a 64-bit (QWORD) FILETIME object The creation date of the file indicates the first time the application was executed. Both the modification date of the file and the embedded timestamp indicate the last time the application was executed.

Windows will store timestamps according to Windows epoch.

Creation Time

The creation time does not have a static offset on any Windows platform. The location of the creation time can be found using the offset 0x8 + length of Volume path offset. See section Volume for more information.

Last Run Time

A timestamp of when the application was last ran is embedded into the Prefetch file. The offset from the beginning of the file to the "Last Run Time" is located:

  • at offset 0x78 on Windows XP and Windows 2003.
  • at offset 0x80 on Windows Vista and Windows 7.

MetaData

Header

In each Prefetch file, the size of the header is stored and can be found at offset 0x54 on Windows XP, Windows Vista, and Windows 7. The header size for Windows XP is 0x98 (152) and 0xf0 (240) on Windows Vista and Windows 7.

The Prefetch file will embed the application's name into the header at offset 0x10.

Run Count

The run count, or number of times the application has been run, is a 4-byte (DWORD) value located at offset 0x90 from the beginning of the file on Windows XP. On Windows Vista and Windows 7, the run time can be found at 0x98.

Volume

Volume related information, volume path and volume serial number, are embedded into the Prefetch file. The precise offset for this information is the same for each Prefetch file and Windows operating system. In the header at offset 0x6c, the location of the volume path is stored. The location is a 4-bytes (DWORD) value.

At the location given from offset 0x6c, a 4-byte value is stored which is the number of bytes from current offset (location from offset 0x6c) to the beginning of the volume path string. The location from the offset 0x6c, for ease of reading, will be called the "volume path offset." The volume path is embedded as an UTF-16 encoded string.

The length of the volume path string is a 4-byte value is located at volume path offset + 0x4.

The volume serial number is a 4-byte value that identifies a media storage. A serial number does not have a consistent offset within a Prefetch between Windows operating systems. The 4-byte value can be found eight (8) bytes from the creation time location. The vol command on Windows can verify the volume serial number.

End of File

The end of file (EOF) for each Prefetch file is located at offset 0xc. The location of EOF also denotes the size of the Prefetch file.

Files

Embedded within each Prefetch file are files and directories that were used doing the application's startup. The Prefetch file separates both filenames and directories into two different location in the file. Each string is encoded as a UTF-16 string. Windows operating system uses UTF-16 encoding.

The offset to the first set of filenames are at 0x64. The size of the first set of filenames can be found at offset 0x68. Both offsets are consistent between Windows XP, Windows Vista and Windows 7.

In the bottom section of the Prefetch file are UTF-16 strings of directories. At the time of this writing (7/2011), the precise offset and size of the directory listing is unknown. The distance between the end of the Volume Path string and the beginning of the directory strings is given. An approach to finding the offset to the beginning of the directories listing is to obtain the distance value and the offset when the Volume Path string ends (after the NULL bytes). The distance value is at volume path offset + 0x18 (24). The distance is a 4-byte (DWORD) value. The end of second set of strings will complete the Prefetch file. The size of the directory listing is calculated by subtracting the start position of the directory listing from the end of file position.

See Also

External Links

Tools