Daniele
Daniele

Reputation: 892

How to remove Mingw version information from PE?

When using mingw, the compiler adds a lot of version strings in the .rdata section. For instance in linux:

GCC: (Gentoo Hardened 4.8.1-r1 p1.2, pie-0.5.7) 4.8.1
GCC: (Gentoo Hardened 4.8.1-r1 p1.2, pie-0.5.7) 4.8.1
GCC: (Gentoo Hardened 4.8.1-r1 p1.2, pie-0.5.7) 4.8.1
...

Or in windows:

GCC: (GNU) 4.8.1
GCC: (GNU) 4.8.1
GCC: (GNU) 4.8.1
...

Is there a way to remove them, or at least to put them into a separate section (such as .comment)?

Thanks!

Upvotes: 3

Views: 861

Answers (1)

Valerij
Valerij

Reputation: 27768

propper solution: recompile your toolchain without --with-pkgversion flag.

hacky solution: open g++ in hex editor, find said string, replace with 0x00s

Upvotes: 2

Related Questions