What dose this do? If a section is allready set to Readable/writable then what dose adding the initialized data flag do?
ENF,
Both data and data? sections are read/write which is normal and you usually only change the linker flags if you want to write to the code section. It is possible from memory to make the data or data? sections executable as well which can be occasionally useful if you want to store a code sequence in data.
Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Both data and data? sections are read/write which is normal and you usually only change the linker flags if you want to write to the code section. It is possible from memory to make the data or data? sections executable as well which can be occasionally useful if you want to store a code sequence in data.
Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Maybe the initialization flag is related to what NT drivers usually did.
You could designate code and data to reside in an "initialization" section. The code was expected to be run exactly once (on startup), and would never need to load again. Data marked as initialization data would be discarded rather than paged out into a swap file. Traditional NT drivers had to hunt for physically installed devices on startup.
You could designate code and data to reside in an "initialization" section. The code was expected to be run exactly once (on startup), and would never need to load again. Data marked as initialization data would be discarded rather than paged out into a swap file. Traditional NT drivers had to hunt for physically installed devices on startup.
ENF,
Both data and data? sections are read/write which is normal and you usually only change the linker flags if you want to write to the code section. It is possible from memory to make the data or data? sections executable as well which can be occasionally useful if you want to store a code sequence in data.
Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
i thought that data and data? are executable by default, how can i set them as executable ??
They are executable by default since x86 doesn't (natively, without some interesting kernel hacks) support a "execute" permission per-page. However, since upcoming x86 systems (amd64 crap) is going to support a per-page x bit (at least in PAE mode), you really _should_ mark your data section as executable if you plan on putting code there - and you can no longer use HeapAlloc memory to execute data from, you must use VirtualAlloc and add the EXECUTE flag.
As for what the 'initialized data' flag is for - dunno, really. A lot of the PE flags aren't really used by the loader or the OS, and since linkers may or may not set them, you cannot really depend on them. But I'd say it's "good practice" to set the flag for your .data and not .data?. Depending on the meaning of the flag, it could mean any section that has data loaded from disk - ie, code and resource, too.
The VXD and KMD stuff is another flag, iirc "DISCARDABLE".
As for what the 'initialized data' flag is for - dunno, really. A lot of the PE flags aren't really used by the loader or the OS, and since linkers may or may not set them, you cannot really depend on them. But I'd say it's "good practice" to set the flag for your .data and not .data?. Depending on the meaning of the flag, it could mean any section that has data loaded from disk - ie, code and resource, too.
The VXD and KMD stuff is another flag, iirc "DISCARDABLE".
f0dder,
While I remember, some time ago you wrote a tool that embedded binary data in an OBJ file. I have most of one written but I don't have the reference material for the ".file" header format after the data that is written in from a binary file.
I matched the start header and two section headers plus the data starting offset in a hex editor but I cannot find any reference on the layout after the embedded data.
If you remember the reference material I would appreciate if you posted it here.
Reards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
While I remember, some time ago you wrote a tool that embedded binary data in an OBJ file. I have most of one written but I don't have the reference material for the ".file" header format after the data that is written in from a binary file.
I matched the start header and two section headers plus the data starting offset in a hex editor but I cannot find any reference on the layout after the embedded data.
If you remember the reference material I would appreciate if you posted it here.
Reards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
I don't really have any clue which part's you're referring too... but there's a lot of info around. http://www.delorie.com/djgpp/doc/coff/ is the coff format used by DJGPP - it's almost similar to ms-coff, apart from some issues regarding relocations (which you don't need for a bin->coff tool). There's a large and good article about PE+COFF in MSDN, you should be able to find it here: http://www.microsoft.com/whdc/hwdev/hardware/PECOFF.mspx
f0dder,
Thanks, its about 2 years later than the version I had and it has far more data in it.
Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd
Thanks, its about 2 years later than the version I had and it has far more data in it.
Regards,
http://www.asmcommunity.net/board/cryptmail.php?tauntspiders=in.your.face@nomail.for.you&id=2f46ed9f24413347f14439b64bdc03fd