Windows Metafile
From Wikipedia, the free encyclopedia
Windows Metafile | |
File extension: | .wmf, .emf |
---|---|
Developed by: | Microsoft |
Type of format: | Image file formats |
Windows Metafile (WMF) is a graphics file format on Microsoft Windows systems, originally designed in the early 1990s and not commonly used after the rise of the World Wide Web and the widely used graphics formats such as GIF and JPEG. It is a vector graphics format which also allows the inclusion of raster graphics. Essentially, a WMF file stores a list of function calls that have to be issued to the Windows graphics layer GDI in order to restore the image. Since some GDI functions accept pointers to callback functions for error handling, a WMF file may include executable code. It is somewhat similar in purpose and design to the PostScript format used in the Unix world.
WMF is a 16-bit format introduced in Windows 3.0; a newer 32-bit version with additional commands is called Enhanced Metafile (EMF). EMF is also used as a graphics language for printer drivers.
There is also a Compressed Windows Enhanced Metafile (EMZ).
Contents |
[edit] SetAbortProc exploit
Exploits using the "SetAbortProc" GDI function were discovered in December 2005. The function, which registers an error handler normally intended for use when a print job is cancelled during spooling, allows arbitrary code added to a WMF image to be executed without the permission of the user. Steve Gibson, in his Security Now! podcast claimed that the exploit was caused by a backdoor that was built into the Metafile handler of Windows by Microsoft itself. However, many other security researchers dispute this characterization, saying that in order to be called a backdoor, there would need to be proof that Microsoft actually used this vulnerability to secretly access computers. [1]
[edit] Alternative implementations
The WMF format was designed to be executed by the Windows graphics layer GDI in order to restore the image, but as the WMF binary files contain the definition of the GDI graphic primitives that constitute this image, it is possible to design alternative libraries that render WMF binary files, or convert them in other graphic formats.
For example, the Batik library is able to render WMF files and convert them to their SVG equivalent. The Vector Graphics package of the FreeHEP Java library allows to save Java2D drawings as EMF files.
[edit] See also
[edit] External links
[edit] Tutorials and articles
- Windows GDI
- File Format Summary at fileformat.info
- WMF operand documentation
- FAQ about Windows Metafile
[edit] Applications
[edit] Libraries
- Batik Java library : the WMF to SVG transcoder package allows to convert WMF Metafiles to SVG
- FreeHEP Java library : the Vector graphics package allows to convert EMF Metafiles to SVG, or Java2D drawings to EMF
- libWMF, a library for reading WMF Metafiles, which is able to display them or convert them to SVG
- libEMF, a C/C++ library which provides a drawing toolkit to create vector graphics files on POSIX systems
- wmf2svg, a small Java class to convert WMF Metafiles to SVG