Dailydave mailing list archives

RE: Shellcode


From: "Dave Korn" <dave.korn () artimi com>
Date: Tue, 29 Nov 2005 19:06:20 -0000

Dave Korn wrote:

  The .text section of a program is protected read-only when the
executable file image is loaded into memory.

  You need to place your shellcode into either the .data section, the
heap (by mallocing and copying it there), or the stack.

  ... or, of course, you could first call VirtualProtect(Ex) to change the
readonly protection on the page to readwrite ...

  ... although, that will of course leave you with the problem of how to get
the function address of VirtualProtect without first having to write a zero to
the end of a string that says "VirtualProtectN" ...


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


Current thread: