What is a PIF file?
A PIF file consists of information used to determine how an MS-DOS-based program should run. It can also be used as a shortcut of an executable file, and is commonly created when the user creates a shortcut to a DOS program or update the properties of a program. Microsoft Windows recognize the PIF files as executable programs and it can be run as other DOS based programs. The PIF files are not commonly used today in software due to the absence of DOS applications.
PIF file format
The PIF file basically consists of just one block of data storing the parameters required to execute under the TopView. For switches like whether or not the window should be turned off when the program ends, the fields for the window title include the maximum and minimum amount of RAM and bitmaps. The developers faced the problem that there were additional switches that did not apply to TopView, when the system was adapted for use under Windows. Instead of incorporating the new switches to the end of the file, they create the file as a database file that containing any number of entries. In this way the file consisted of a number of header areas describing what operating system should read the section, and an offset to the next section. Systems will read down the list until they found the most appropriate one. Therefore, this theory left a problem of backward compatibility. The file was finally re-arranged with the first header appearing after the starting data, which left the first 253 bytes of the file in the same format as before.
PIF Example
Here is a hex representation of a PIF file:
0000000: 0078 494e 5354 414c 4c20 2020 2020 2020 .xINSTALL
0000010: 2020 2020 2020 2020 2020 2020 2020 2020
0000020: 8002 0000 433a 5c74 656d 705c 7465 6d70 ....C:\temp\temp
0000030: 335c 494e 5354 414c 4c2e 4558 4500 0000 3\INSTALL.EXE...
0000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000060: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000070: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000080: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000090: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000e0: 0000 0000 0000 0100 ff19 5000 0007 0000 ..........P.....
00000f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000100: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000110: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000120: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000130: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000140: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000150: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000160: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000170: 004d 4943 524f 534f 4654 2050 4946 4558 .MICROSOFT PIFEX
0000180: 0087 0100 0071 0157 494e 444f 5753 2033 .....q.WINDOWS 3
0000190: 3836 2033 2e30 0005 029d 0168 0080 0200 86 3.0.....h....
00001a0: 0064 0032 00ff ff00 00ff ff00 0002 1002 .d.2............
00001b0: 001f 0000 0000 0000 0000 0000 0000 0000 ................
00001c0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00001d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00001e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00001f0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000200: 0000 0000 0057 494e 444f 5753 2056 4d4d .....WINDOWS VMM
0000210: 2034 2e30 00ff ff1b 02ac 0100 0000 0000 4.0............
0000220: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000230: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000240: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000250: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000260: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000270: 0000 0050 4946 4d47 522e 444c 4c00 0000 ...PIFMGR.DLL...
0000280: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000290: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00002a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00002b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00002c0: 0000 0000 0002 0000 0000 0000 0000 0000 ................
00002d0: 0032 0001 0000 0000 0000 0000 0000 0001 .2..............
00002e0: 0000 0005 0019 0003 00c8 00e8 0302 000a ................
00002f0: 0001 0000 0000 0000 001c 0000 0000 0000 ................
0000300: 0008 000c 0054 6572 6d69 6e61 6c00 0000 .....Terminal...
0000310: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000320: 0000 0000 004c 7563 6964 6120 436f 6e73 .....Lucida Cons
0000330: 6f6c 6500 0000 0000 0000 0000 0000 0000 ole.............
0000340: 0000 0000 0000 0003 0000 0050 0019 0080 ...........P....
0000350: 022c 018c 0267 0116 0000 0001 00ff ffff .,...g..........
0000360: ffff ffff ffae 0626 013a 098d 0200 0000 .......&.:......
0000370: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000380: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000390: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00003a0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00003b0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00003c0: 0000 0000 0001 00 .......