rwallace
rwallace

Reputation: 33365

Generating a PE format executable

I'm trying to generate a PE format executable; I'm at the stage where I have something that dumpbin is happy with, and as far as I can tell is not materially different from an empty program linked with Microsoft's linker, but Windows still rejects it: PE file - what's missing?

If I had some algorithm for generating a valid PE file, maybe I could hill climb from there. Here's what I've found so far:

Is there any sample code available that generates a correct PE file?

Upvotes: 2

Views: 3323

Answers (1)

Igor Skochinsky
Igor Skochinsky

Reputation: 25268

Here's the classic page about generating PE from scratch:

http://www.phreedom.org/research/tinype

As for the generic list of required/optional parts, see corkami page on the PE format:

http://code.google.com/p/corkami/wiki/PE

See also the code tree for many examples of small PE files, generated completely from scratch.

Upvotes: 4

Related Questions