Re: change page protection, how to



Hi,
I have a very small stub of code (not a virus)
that needs to patch some functions, which reside
on read only pages... by patching I mean
overwrite the begining of the function with a
a 'jmp' to my stub... is there an easy way to
unprotect that page? or do I really have to
call the kernel (windows) to do it?
Thanks, any pointer appreciated

If you are running your code in user mode,
under windows and a page is read only,
then the only way to change that is by
the kernel. If it refuses to do so, then it's
not possible to circumwent it from user mode.

The idea behind hardware protection is to
protect the whole system (inclusive all running
programs) from user mode programs that
want to change something.

Viktor

ps:
Overwriting a function is not a nice way to
patch an application. There are standard
hooks and call tables. For patching dlls,
you can use a wrapper dll linking back
to the original.

.



Relevant Pages

  • Re: change page protection, how to
    ... I have a very small stub of code ... that needs to patch some functions, which reside ... by patching I mean ...
    (comp.lang.asm.x86)
  • change page protection, how to
    ... I have a very small stub of code ... that needs to patch some functions, which reside ... by patching I mean ...
    (comp.lang.asm.x86)
  • Re: Russ Coopers AusCERT Presentation on MS Security Bulletins
    ... but this gal in SBSland thinks that non-patching is NOT the ... I'll take a Security hotfix anyday, thank you, ... feel that I get 100% in my lan of patching. ... there on XP sp2 RC, firewall in place AND the Sasser patch in place, I ...
    (NT-Bugtraq)
  • Re: Patch Management on Critical Servers (Healthcare)
    ... *nix servers patch management is handled at two levels. ... meeting and approved, especially patching. ... change meetings for the hospitals and dates set. ...
    (Focus-Microsoft)
  • Re: [Full-Disclosure] RE: Linux (in)security
    ... > There's a vast difference in having to backout patches in complex ... And I don't recall the last time that we had to back out a patch in an over ... There isn't a vast difference between patching ... Windows and patching *nix. ...
    (Full-Disclosure)