8 From:	MX%"MACRO32@WKUVX1.BITNET"  1-JAN-1992 22:08:22.47 To:	GOATHUNTER CC:	 Subj:	page protection utility   % Return-Path: <MacroMan@WKUVX1.BITNET> ! Errors-To: MacroMan@WKUVX1.BITNET 9 X-ListName: "VMS Internals, MACRO, and BLISS Discussions"      <MACRO32@WKUVX1.BITNET> M Received: from CUNYVM.BITNET (MAILER) by WKUVX1 (MX V3.0) with BSMTP; Wed, 01            Jan 1992 22:06:52 EST N Received: from CUNYVM by CUNYVM.BITNET (Mailer R2.08) with BSMTP id 8074; Wed,            01 Jan 92 19:18:16 ESTK Received: from MVB.SAIC.COM by CUNYVM.CUNY.EDU (IBM VM SMTP V2R2) with TCP; %           Wed, 01 Jan 92 19:18:12 EST  From: gleason@mwk.uucp Reply-To: MACRO32@WKUVX1.BITNET  X-Newsgroups: vmsnet.internals  Subject: page protection utility* Message-ID: <1992Jan1.161258.707@mwk.uucp> Date: 1 Jan 92 22:12:58 GMT ' Organization: M. W. Kellogg, Houston TX 
 Lines: 371 X-Gateway-Source-Info: USENET     A   Here's a program that allows you to examine and change the page C protection of pages in system space. This is useful for a number of E things. For instance, while debugging something in system space, like D a driver or non-process based routine, you can change the protectionE on its pages to allow UW, and then examine code and data with the DCL > EXAMINE command. You can also make pages UW and try depositing= debug code or data with the DCL DEPOSIT command.  I use it to @ change the protection on code and data that I store in non paged@ pool to URKW (from ERKW) so that I can access them in user mode.  E   You can also bury yourself pretty damn quick if you don't know what B you are doing. Aside from the obvious problems you could create byF setting pages that the executive needs to NA (no access), or setting aE drivers fork block to KR(Kernel Read, no write), there are the subtle D problems you can create by making changes that the memory managementA logic doesn't like...for instance, before you modify any pageable D pages from read only to  writeable, you better have a damn good idea? what will happen if the page is faulted out and gets written to B whatever backing store it is assigned to! In the case of non paged> pool, and other non paged parts of the exec, this is less of aA concern...still, you better know what you are doing...Don't say I  didn't warn ya!   B   Typical caveats apply - this may crash your system, you may overC write images on disk, we assume no responsibility for problems, but 2 would be interested in bug reports, and like that.  F   Like one of the VMS developers said at a DECUS session in Anaheim...  G "If you shoot yourself in the foot it hurts, so don't shoot yourself in 
 the foot!"  !   I try to live by those words...      To use...   
 $ mac aprt $ link aprt $ $ aprt :== $disk:[directory]aprt.exe  ?   To list a protection, enter the address you are interested in  $ aprt 81000000  Page 81000000 protection = URKW  $   7   To list a range of protections, enter a range ala SDA  $ aprt 81000000:81000400 Page 81000000 protection = URKW  Page 81000200 protection = URKW  Page 81000400 protection = URKW  $      To modify a page...    $ aprt 81000000/prot=urew  Page 81000000 protection = URKW    To modify a range of pages...   " $ aprt 81000000:81000400/prot=urew Page 81000000 protection = UREW  Page 81000200 protection = URKW  Page 81000400 protection = URKW   >   Note that the protection listed is the protection BEFORE the
 modification.      Lee K. Gleason Control-G Consultants  1734 Wakefield Houston TX 77018 Phone 713/681-3985 gleason@mwk.uucp