flat assembler
Message board for the users of flat assembler.

Index > Windows > File Mapping

Author
Thread Post new topic Reply to topic
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav 23 Mar 2005, 05:41
Please, i need help!

I have mapped file to memory by standart way (CreateFile, CreateFileMapping,
MapView OfFile). But i need to increase size of this file in memory (e.g. i add new section to executable), can i doing this, and how to unmapview with new size (or it's impossible)? or better way to use buffers?

ps. i search answer in MSDN, but nothing found

_________________
[not enough memory]
Post 23 Mar 2005, 05:41
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 23 Mar 2005, 10:41
If you need to grow a file mapping, you must first close the handles, then do a new CreateFileMapping with the increased size. When modifying PE executables, I tend to HeapAlloc a buffer of peheader.SizeOfImage bytes, then read in the executable data like the PE loader would - this is much easier for manipulating the image file.
Post 23 Mar 2005, 10:41
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.