From: MX%"MACRO32@WKUVX1.BITNET" 1-JAN-1992 22:08:22.47 To: GOATHUNTER CC: Subj: page protection utility Return-Path: Errors-To: MacroMan@WKUVX1.BITNET X-ListName: "VMS Internals, MACRO, and BLISS Discussions" Received: from CUNYVM.BITNET (MAILER) by WKUVX1 (MX V3.0) with BSMTP; Wed, 01 Jan 1992 22:06:52 EST Received: from CUNYVM by CUNYVM.BITNET (Mailer R2.08) with BSMTP id 8074; Wed, 01 Jan 92 19:18:16 EST 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 Here's a program that allows you to examine and change the page protection of pages in system space. This is useful for a number of things. For instance, while debugging something in system space, like a driver or non-process based routine, you can change the protection 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. You can also bury yourself pretty damn quick if you don't know what you are doing. Aside from the obvious problems you could create by setting pages that the executive needs to NA (no access), or setting a drivers fork block to KR(Kernel Read, no write), there are the subtle problems you can create by making changes that the memory management logic doesn't like...for instance, before you modify any pageable 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 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 a concern...still, you better know what you are doing...Don't say I didn't warn ya! Typical caveats apply - this may crash your system, you may over write images on disk, we assume no responsibility for problems, but would be interested in bug reports, and like that. Like one of the VMS developers said at a DECUS session in Anaheim... "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 $ 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