Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当一个 Windows EXE 被加载时,它被映射到内存中。此映射锁定文件并防止对文件进行任何正常修改或替换。但是,由于它被映射为 Copy-on-Write,您是否可以将其更改为 Write,然后修改内存以更改文件的内容?
不会。将保护更改为写入并更新内存只会更新您进程的文件字节的私有副本。(您已经有效地创建了进程本地内存,可以方便地初始化为文件的当前内容。)实际文件保持不变。