flat assembler
Message board for the users of flat assembler.

Index > Windows > Changing section flags at run-time

Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 13 May 2006, 07:55
Hi, i need to change flags for one PE section during executing file.

Problem is that block of memory is read-only on NT.

It also has to work on all winodows versions (95 and later)

I could use VirtualProctectEx to allow write to the memory... but is someone aware of some better solution?

thanks
Post 13 May 2006, 07:55
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 13 May 2006, 10:17
VirtualProtect(Ex) *is* the best solution - it's documented and works on both 9x and NT. You won't be able to change the pagetables directly anyway. If you want to do it with syscalls, you'll end up writing a lot of different versions (9x, NT, NT-with-SYSCALL-instruction and so on).

If your concern about calling VirtualProtect is from a security point, don't bother. It's easy to set a memory-range breakpoint.
Post 13 May 2006, 10:17
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.