Questions tagged [pe]

a file format for Windows executables, object code, DLLs, and more. Commonly found extensions of PE files include .exe, .dll, .ocx, .sys, and .scr.

The Portable Executable file format is used in Windows to represent executables and other code objects. Microsoft first migrated to it with the Windows NT 3.1 OS. Each PE file is essentially a data structure that encapsulates the information necessary for the Windows OS loader to manage the wrapped executable code. It has been wrapped by the .NET framework to support CLR features, like assembly metadata and Intermediate Language code.

The PE format is used for the (32 bits) x86, x64, ARM, Alpha, Mips, and PowerPC versions of Windows, as well as (under the wrapped .NET format) containing code satisfying the .NET Common Intermediate Language requirement. Related structures include EntryPoint, sections, Imports, Exports, Thread Local Storage, and Bound/Delay imports.

Official Specification: Microsoft PE and COFF specification

From Wikipedia:

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 Windows operating systems. The term "portable" refers to the format's versatility in numerous environments of operating system software architecture. 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.

Papers

Libraries

250 questions
9
votes
3 answers

How can one extract the appended data of a Portable Executable?

How do you reliably extract appended data in a Portable Executable?
Ange
  • 6,694
  • 3
  • 28
  • 62
7
votes
3 answers

Reliable algorithm to extract overlay of a PE

I write a Portable Executable (PE) library that also provides finding the starting offset of the overlay (appended data to the PE that is not mapped into memory). My algorithm finding the overlay offset looks like this so far: public long…
Karsten Hahn
  • 315
  • 2
  • 10
7
votes
1 answer

Patching PE File - Adding data

After opening a PE file with a disassembler, I know which instructions I have to patch. And if I have to add some data I can adjust the PE file structure manually so that it gets parsed correctly and executes. Example, Replace EB 1C with E9 1C…
Zingaro
  • 73
  • 3
4
votes
1 answer

Unexpected value present in IMAGE_THUNK_DATA array

I am attempting to understand the PE File Format and I have come across an unexpected value in the IMAGE_THUNK_DATA Array. Here are the file details: MD5: d82d3e003eb5c728d584e22ce7f36fbf File Name: ChromeSetup.exe Link:…
3
votes
1 answer

What implications has the low alignment mode of a PE file?

I only found this term "low alignment mode" in the corkami wiki. standard mode: 200 <= FileAlignment <= SectionAlignment and 1000 <= SectionAlignment low alignment: 1 <= FileAlignment = SectionAlignment <= 800 The numbers are hex values. Some…
Karsten Hahn
  • 315
  • 2
  • 10
3
votes
0 answers

What in this modified PE file causes MsMpEng.exe to consume 4 seconds of CPU?

The relevant files for this question are here: https://cubiclesoft.com/Unrelated/32_pe_msmpeng_test.zip Contains a before and after DLL. This simple PHP script demonstrates the problem:
CubicleSoft
  • 141
  • 3
2
votes
2 answers

PE file - data directory

If you remove "data directory" from a "PE file" what will happen ? I think loader will give an error, but I'm not sure. Please try to correct me.
2
votes
5 answers

Question regarding sections in PE image

I have a file that among other sections has: code .text .bss And this file was not crafted manually, so I suspect. The question is what could be the meaning of code and .text sections? As far as I know, executable code is located in .text…
PhoeniX
  • 3,052
  • 16
  • 30
1
vote
2 answers

parse PE section variables

I have extracted the .rdata section from a windows executable. I would like to parse the variables contained in the section into a easily understandable format, such as: char s[] = "hello world" int i = 0 There does not appear, however, to be data…
user4446
1
vote
0 answers

How to find executable code in PE-file

Please help me to find out how to locate the start and the end of executable code in Windows PE-file. Which adresses in header of PE can tell me to locate what I find? Thanks!
Denis Leonov
  • 121
  • 4
1
vote
0 answers

What does the "Hint" entry in the PE import section mean?

In a ctf there was a rev PE challenge where it appeared in the deassembly as if the programm was calling functions from the ADVAPI32 but instead called some different code because the import table was modified. I can't quite figure out what was…
1
vote
1 answer

Why are relocation tables needed?

I understand that the relocation table exists for when an image isn't loaded at its preferred address, but if an image isn't loaded at its preferred address, doesn't everything need to be relocated relative to the actual load address? Isn't that the…
ehargitt
  • 13
  • 2
1
vote
3 answers

A question about the Base field in the PE Export Directory

I've been examining the PE file structure graph located here. The following is written there about the export directory: If a symbol N is exported by ordinal and name then: -Its name will be located at AddressOfNames[N] -Its ordinal at…
Student12
  • 111
  • 4
1
vote
0 answers

How to display processes that are running of computer in LordPE?

I tried to install some LordPE version but all when I open then no program that is running displayed in LordPE.I don't know why? I hope you guys show me the way to fix this problem.I appreciate all of your help?
1
vote
1 answer

Can I use the Rich Header To Find out Compiler and Linker used?

I heard that I can use look at the RICH HEADER to find out what compiler was used. I looked at the Rich header and I cannot seem to make sense of this. Can I find the Compiler used for this program and is there a tool to decode this? Here is the…
LUser
  • 783
  • 1
  • 4
  • 22
1
2