News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

DLL Query

Started by RedXVII, July 03, 2006, 12:19:21 AM

Previous topic - Next topic

RedXVII

Im experimenting with dll's as they are a new topic for me. Let me get this straight - after reading iczelions, i understand that a DLL's .code is reused throught different processes, but the .data section is saved individually for each process. So, as a side thaught, i tried to modify part of the code section (which would normall be "ok" in normal .exe's) - and naturally, windows crashed it for me. Does windows protect the dll's .code section from modifications in some way? Doesnt that mean i cant have self modifing code in dll's or is there a way round it?

Thanks :U
RedXVII

dougiem

as it happens I was looking for standard techniques, and I came across this, which helped,

http://doc.ddart.net/asm/Microsoft_MASM_Programmers_Guide_v6.1/Chap_10.htm

hope its of some use

dougiem

RedXVII


hutch--

Red,

Have a play with making the secftions read/write/execute and it should solve most of your problems. They are linker options.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

sluggy

Quote from: RedXVII on July 03, 2006, 12:19:21 AMi tried to modify part of the code section (which would normall be "ok" in normal .exe's) - and naturally, windows crashed it for me. Does windows protect the dll's .code section from modifications in some way?
It depends what OS you are running. Apart from making code pages writable, in WinXP SP2 it is advisable to turn off DEP (data execution protection, and surprisingly some big name apps require you to disable DEP), and in Vista the whole security scene changes dramatically.