Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
E32Image file format on pre-Symbian OS 9
This article explains briefly about E32Image file format on pre-Symbian OS 9. Please check some links at the end of this article for more detail information.
The executable files in pre-Symbian OS 9, i.e. .app, .exe or .dll, use a special format, called E32Image. It is based on PE file format. E32Image added some Symbian-specific information to the header. It replaces function names with ordinal numbers. The tool used to translate PE into E32Image is called petran.
Like PE executable file, E32Image contains of several sections, i.e.:
- Code section. It contains three parts, text section, export address table and import address table.
- BSS section. It contains un-initialized data. This section is usually not available.
- Data section. It contains initialized data. Since most pre Symbian OS 9 applications are .app or .dll format, this section usually does not exist either.
- Import section. It contains the information about all imported functions used by the code.
- Relocation section. It contains relocation table needed by Symbian OS loader to load the code.
The header information of E32Image is defined in a header file called f32image.h. It is part of the public Symbian SDKs located at \epoc32\include.
- TUint32 iUid1, TUint32 iUid2, TUint32 iUid3, represent the identifiers that uniquely identify the application.
- TUint32 iCheck, is the checksum of the first three UIDs.
- TUint iSignature, is a unique signature of E32 file, always has a value 'EPOC'.
- TCpu iCpu, the platform of the programs, usually has a value ECpuX86 = 0x1000 for the Intel processor and ECpuArm = 0x2000 for the ARM processor.
- TUint iCheckSumCode, is checksum of the code section. It is the sum of all 32 bits words in the code section.
- TUint iCheckSumData, is checksum of all 32 bit words in the data section. This field is normally 0.
- TVersion iVersion, the version of PETRAN used to generate this E32 file.
- TInt64 iTime, is the timestamp when the application was built.
- TUint iFlags, is a flag with the value 0 for .exe, 1 for .dll and +2 for no call of entry points.
- TInt iCodeSize, the size of the code section.
- TInt iDataSize, the size of the initialized data section. This field is normally 0.
- TInt iHeapSizeMin, the minimum size of the heap.
- TInt iHeapSizeMax, the maximum size of the heap.
- TInt iStackSize, the size of the stack.
- TInt iBssSize, the size of the un-initialized data section.
- TUint iEntryPoint, the offset into code of entry point.
- TUint iCodeBase, where the code is linked for.
- TUint iDataBase, where the data is linked for.
- TInt iDllRefTableCount, the number of DLLs imported by this program.
- TUint iExportDirOffset, the offset of the export address table.
- TInt iExportDirCount, the number of functions exported by this program.
- TInt iTextSize, the size of the text section, i.e. the size of all the object files (.obj) compiled from the source code.
- TUint iCodeOffset, the file offset to the code section.
- TUint iDataOffset, the file offset to the data section. This field is normally 0.
- TUint iImportOffset, the file offset to the import section.
- TUint iCodeRelocOffset, relocation offset for code and constant.
- TUint iDataRelocOffset, relocation offset for data.
- TProcessPriority iPriority, the priority of this process, for normal applications the value is EPriorityForeground, it means priority for the foreground tasks.