How to add a custom SECTION to a .exe file?

Started by Seltsamuel, December 07, 2009, 11:18:04 AM

Previous topic - Next topic

Seltsamuel

Hi,

i have some sort of Problem.
I did some workaround to bypass DEP on Windowssystem that activate this by default for a Programm i made. At the beginning this was inside a dll and so it worked as expected:

//Programms and dlls with such namend sections deactivate DEP ;-)
#pragma data_seg(".sforce")
int Status = 0;         // initialize data!
#pragma data_seg()
#pragma comment(linker, "/SECTION:.sforce,RWS")

But now i want the same workaround into my executable but pellesC refuses to add the section:
POLINK: warning: /SECTION:.sforce ignored; section is missing.

How can i bypass this Linkerproblem ?

Greetings

Seltsamuel

Seltsamuel

Hi,

in the meantime i solved it myself.
For the ones interested i renamed my Codesection to .sforce using this pragma line:
#pragma code_seg(".sforce")

It does as intended and disables DEP on startup.

Greetings

Seltsamuel