# Memory Mapping

Memory-mapping is **a mechanism that maps a portion of a file, or an entire file, on disk to a range of addresses within an application's address space**. The application can then access files on disk in the same way it accesses dynamic memory.

## Unmaping **mechanism**&#x20;

To unmap the PE file manually we must make Raw Addr =  Virtual Addr and Raw Size = Virtual size

PE-bear used to unmap the PE file

<figure><img src="/files/eH3RoqvSitvONJoaS36i" alt=""><figcaption><p>mapped</p></figcaption></figure>

<figure><img src="/files/3xwiUWBRQUye4OLVxy2j" alt=""><figcaption><p>unmapped</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pwnsec-notes.gitbook.io/ctf-notes/malware-analysis/memory-mapping.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
