NO

Author Topic: How to add a custom SECTION to a .exe file?  (Read 3380 times)

Seltsamuel

  • Guest
How to add a custom SECTION to a .exe file?
« on: December 07, 2009, 11:18:04 AM »
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

  • Guest
Re: How to add a custom SECTION to a .exe file?
« Reply #1 on: January 25, 2010, 12:10:30 PM »
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