Archive name - Name of your portable program Compression method - Best Archiving options - Create SFX archive Now go to 'Advanced' tab - SFX Options Run after extraction - Put name of your program.exe file (in my case its everest.exe) Go to 'Modes' tab - Unpack to temporary folder Silent mode - Hide all Ok - Ok.
Filename extension | .acm, .ax, .cpl, .dll, .drv, .efi, .exe, .mui, .ocx, .scr, .sys, .tsp |
---|---|
Internet media type | application/vnd.microsoft.portable-executable |
Developed by | Currently: Microsoft |
Type of format | Binary, executable, object, shared libraries |
Extended from | DOS MZ executable COFF |
The Portable Executable (PE) format is a file format for executables, object code, DLLs, FON Font files, and others used in 32-bit and 64-bit versions of Windowsoperating systems. The PE format is a data structure that encapsulates the information necessary for the Windows OS loader to manage the wrapped executable code. This includes dynamic library references for linking, API export and import tables, resource management data and thread-local storage (TLS) data. On NT operating systems, the PE format is used for EXE, DLL, SYS (device driver), and other file types. The Extensible Firmware Interface (EFI) specification states that PE is the standard executable format in EFI environments.[1]
On Windows NT operating systems, PE currently supports the IA-32, IA-64, x86-64 (AMD64/Intel 64), ARM and ARM64instruction set architectures (ISAs). Prior to Windows 2000, Windows NT (and thus PE) supported the MIPS, Alpha, and PowerPC ISAs. Because PE is used on Windows CE, it continues to support several variants of the MIPS, ARM (including Thumb), and SuperH ISAs. [2]
Analogous formats to PE are ELF (used in Linux and most other versions of Unix) and Mach-O (used in macOS and iOS).
- 2Technical details
History[edit]
Microsoft migrated to the PE format with the introduction of the Windows NT 3.1 operating system. All later versions of Windows, including Windows 95/98/ME and the Win32s addition to Windows 3.1x, support the file structure. The format has retained limited legacy support to bridge the gap between DOS-based and NT systems. For example, PE/COFF headers still include a DOS executable program, which is by default a DOS stub that displays a message like 'This program cannot be run in DOS mode' (or similar), though it can be a full-fledged DOS version of the program (a later notable case being the Windows 98 SE installer).[3] This constitutes a form of fat binary. PE also continues to serve the changing Windows platform. Some extensions include the .NET PE format (see below), a 64-bit version called PE32+ (sometimes PE+), and a specification for Windows CE.
Technical details[edit]
Layout[edit]
Structure of a Portable Executable 32 bit
A PE file consists of a number of headers and sections that tell the dynamic linker how to map the file into memory. An executable image consists of several different regions, each of which require different memory protection; so the start of each section must be aligned to a page boundary.[4] For instance, typically the .text section (which holds program code) is mapped as execute/readonly, and the .data section (holding global variables) is mapped as no-execute/readwrite. However, to avoid wasting space, the different sections are not page aligned on disk. Part of the job of the dynamic linker is to map each section to memory individually and assign the correct permissions to the resulting regions, according to the instructions found in the headers.[5]
Import table[edit]
One section of note is the import address table (IAT), which is used as a lookup table when the application is calling a function in a different module. It can be in the form of both import by ordinal and import by name. Because a compiled program cannot know the memory location of the libraries it depends upon, an indirect jump is required whenever an API call is made. As the dynamic linker loads modules and joins them together, it writes actual addresses into the IAT slots, so that they point to the memory locations of the corresponding library functions. Though this adds an extra jump over the cost of an intra-module call resulting in a performance penalty, it provides a key benefit: The number of memory pages that need to be copy-on-write changed by the loader is minimized, saving memory and disk I/O time. If the compiler knows ahead of time that a call will be inter-module (via a dllimport attribute) it can produce more optimized code that simply results in an indirect call opcode.[5]
Relocations[edit]
PE files normally do not contain position-independent code. Instead they are compiled to a preferred base address, and all addresses emitted by the compiler/linker are fixed ahead of time. If a PE file cannot be loaded at its preferred address (because it's already taken by something else), the operating system will rebase it. This involves recalculating every absolute address and modifying the code to use the new values. The loader does this by comparing the preferred and actual load addresses, and calculating a delta value. This is then added to the preferred address to come up with the new address of the memory location. Base relocations are stored in a list and added, as needed, to an existing memory location. The resulting code is now private to the process and no longer shareable, so many of the memory saving benefits of DLLs are lost in this scenario. It also slows down loading of the module significantly. For this reason rebasing is to be avoided wherever possible, and the DLLs shipped by Microsoft have base addresses pre-computed so as not to overlap. In the no rebase case PE therefore has the advantage of very efficient code, but in the presence of rebasing the memory usage hit can be expensive. This contrasts with ELF which uses fully position-independent code and a global offset table, which trades off execution time in favor of lower memory usage.
.NET, metadata, and the PE format[edit]
In a .NET executable, the PE code section contains a stub that invokes the CLR virtual machine startup entry, _CorExeMain or _CorDllMain in mscoree.dll, much like it was in Visual Basic executables. The virtual machine then makes use of .NET metadata present, the root of which, IMAGE_COR20_HEADER (also called 'CLR header') is pointed to by
IMAGE_DIRECTORY_ENTRY_COMHEADER
[6] entry in the PE header's data directory. IMAGE_COR20_HEADER strongly resembles PE's optional header, essentially playing its role for the CLR loader.[2]The CLR-related data, including the root structure itself, is typically contained in the common code section, .text. It is composed of a few directories: metadata, embedded resources, strong names and a few for native-code interoperability. Metadata directory is a set of tables that list all the distinct .NET entities in the assembly, including types, methods, fields, constants, events, as well as references between them and to other assemblies.
Use on other operating systems[edit]
The PE format is also used by ReactOS, as ReactOS is intended to be binary-compatible with Windows. It has also historically been used by a number of other operating systems, including SkyOS and BeOS R3. However, both SkyOS and BeOS eventually moved to ELF.
As the Mono development platform intends to be binary compatible with Microsoft .NET, it uses the same PE format as the Microsoft implementation.
On x86Unix-like operating systems,Windows binaries (in PE format) can be executed with Wine. The HX DOS Extender also uses the PE format for native DOS 32-bit binaries, plus it can, to some degree, execute existing Windows binaries in DOS, thus acting like an equivalent of Wine for DOS.
On IA-32 and x86-64Linux one can run Windows' DLLs under loadlibrary.[7]
Mac OS X 10.5 has the ability to load and parse PE files, but is not binary compatible with Windows.[8]
UEFI and EFI firmware use Portable Executable files for applications, as well as the Windows ABI.
See also[edit]
- ar (Unix) since all COFF libraries use that same format
References[edit]
- ^'UEFI Specification, version 2.4'(PDF)., a note on p.18, states that 'this image type is chosen to enable UEFI images to contain Thumb and Thumb2 instructions while defining the EFI interfaces themselves to be in ARM mode.'
- ^ ab'PE Format (Windows)'. Retrieved 2017-10-21.
- ^E.g. Microsoft's linker has /STUB switch to attach one
- ^'The Portable Executable File From Top to Bottom'. Retrieved 2017-10-21.
- ^ ab'Peering Inside the PE: A Tour of the Win32 Portable Executable File'. Retrieved 2017-10-21.
- ^The entry was previously used for COM+ metadata in COM+ applications, hence the name
- ^https://github.com/taviso/loadlibrary
- ^Chartier, David (2007-11-30). 'Uncovered: Evidence that Mac OS X could run Windows apps soon'. Ars Technica. Retrieved 2007-12-03.
... Steven Edwards describes the discovery that Leopard apparently contains an undocumented loader for Portable Executables, a type of file used in 32-bit and 64-bit versions of Windows. More poking around revealed that Leopard's own loader tries to find Windows DLL files when attempting to load a Windows binary.
External links[edit]
- PE Format (latest online document)
- Microsoft Portable Executable and Common Object File Format Specification (revision 8.1, OOXML format)
- Microsoft Portable Executable and Common Object File Format Specification (revision 6.0, .doc format)
- The original Portable Executable article by Matt Pietrek (MSDN Magazine, March 1994)
- Part I. An In-Depth Look into the Win32 Portable Executable File Format by Matt Pietrek (MSDN Magazine, February 2002)
- Part II. An In-Depth Look into the Win32 Portable Executable File Format by Matt Pietrek (MSDN Magazine, March 2002)
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Portable_Executable&oldid=905533093'
Portable applications are useful if you use many different computers. You can take your library of applications with you and use any Windows computer to run them. However, what if there is an application you use that does not come in a portable format?
There are many useful portable applications out there, but there may be some applications you use in your daily work that are not among them. Cameyo is a free portable application creator that creates a single executable (.exe) file from an entire Windows program. Copy this single file to a USB flash drive or external hard drive and you can run the program on any Windows computer without having to install the program.
Download Cameyo to a folder on your hard drive. Cameyo does not need to be installed. The file you download for Cameyo is not an installation file; rather is a portable program itself. Double-click on the .exe file to open Cameyo.
The company that produces Cameyo says that you must create your portable application in a virtual machine. As they say in their Virtual Application Packaging – Best Practice Guide:
“Prepare a clean, basic virtual machine. Make sure no unnecessary programs run on it. Turn off all possible updates, including Windows Updates or anti-virus updates. Avoid using other programs on your machine. In general, anything that can modify files or registry keys, will interfere with the packaging process. We recommend using XP SP3 32-bit, unless your software requires some higher systems to install & function.”
For information on creating a virtual machine see our article on installing Windows 8 in VirtualBox. That will give you an idea on how to install other operating systems in VirtualBox as well.
NOTE: Cameyo creates a portable application by taking a snapshot of your system before the application is installed and again after, capturing the changes to the system. Therefore, make sure the application you want to make into a portable application is NOT installed on your computer before you start this process.
A dialog box displays asking which program you want to open. We’re going to create a portable application, so we select Capture an installation and click OK.
Cameyo displays a dialog box in the lower-left corner of your screen while it takes an initial snapshot before installation.
When Cameyo displays the following dialog box, install the software you want to package as a portable application.
Go through the normal installation procedure for your software.
While initially installing and packaging the application, any settings you modify in the application before ending the capture will be stored within the application. Therefore, once the software is installed, and BEFORE clicking Install done, run the application and configure it how you want. Then, click Install done to finish the capture process.
If you don’t want to change any settings in the application, simply click Install done once the installation if finished.
Cameyo takes a post-installation snapshot.
A dialog box displays once the package was successfully created. Click OK to close the dialog box.
Your portable application should be in C:Users<username>DocumentsCameyo apps. It will have the name of the program with “.cameyo.exe” at the end. Double-click the file to run the program.
If the User Account Control dialog box displays, click Yes to continue.
NOTE: You may not see this dialog box, depending on your User Account Control settings. The User Account Control dialog box displays every time you open the packaged application, depending on your settings.
If you need to register the application, do so when prompted.
NOTE: You will not have to do this again. The information is stored in the portable application.
There are more modules available in Cameyo. To open the main program, double-click the Cameyo.exe file again, select Cameyo on the dialog box, and click OK.
If this is the first time you’ve opened the main Cameyo program, you will be asked to register. Registration is free and provides additional features. Fill out the form and click Register.
To see what portable apps are available through Cameyo, click the Computer icon at the bottom of the window. You’ll notice the application you just created. Click it to run it or click the X to delete it.
Click the Studio icon at the bottom of the screen.
Once you have created a packaged, portable application, you can change settings for it. To do this for the application you just created, click the icon next to Package editor.
NOTE: You can also edit a package my selecting Edit a package on the Cameyo dialog box that displays after double-clicking the Cameyo.exe file.
In the Package Editor, click the Open existing virtual app link.
NOTE: If you’ve opened a package for editing previously, it is listed under Recently edited.
Navigate to the Cameyo apps directory, select the portable application you just created and click Open.
There are several options to set on the General tab. Click Advanced for additional options.
On the Advanced tab, you can change additional settings, such as whether the program will leave any traces on the computer.
For additional information on these settings, see the User Guide available on Cameyo’s site.
If you make any changes to the settings, select Save from the File menu to save your changes.
A dialog box displays once the package has been saved. Click OK to close it.
To close the Package Editor, select Exit from the File menu.
There are some general settings for Cameyo that can be adjusted. If you’ve closed the main Cameyo window, open it again (as discussed earlier) and click the wrench icon in the lower-right corner of the window.
Make Exe Portable Pc
Here, you can change the directory into which your portable apps are saved, and set several other options. Click OK once you’ve made your changes.
Make Exe Portable For Windows 10
To close the main Cameyo window, click the X in the upper-right corner of the window.
Cameyo comes with an extensive apps library (using the Library icon in the main Cameyo app), composed of hundreds of the most popular software. This allows you to try out software without having to install it. If you don’t want the app anymore, simply remove it. It will not leave any remnants on your computer.
You can use Cameyo free for home use and for smaller companies and on up to 49 machines.
There are also other methods of transforming install only applications into portable applications.
READ NEXTMake Any Exe Portable
- › A New Wireless Standard: What Is Amazon Sidewalk?
- › How to Use Text Editing Gestures on Your iPhone and iPad
- › Windows 10’s BitLocker Encryption No Longer Trusts Your SSD
- › How to Disable or Enable Tap to Click on a PC’s Touchpad
- › How HTTP/3 and QUIC Will Speed Up Your Web Browsing