> For the complete documentation index, see [llms.txt](https://sayonara.gitbook.io/writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sayonara.gitbook.io/writeups/malware-developement/essentials/payload-storage.md).

# Payload Storage

Storing Payload in PE file

## <mark style="color:red;">Where i can store my Payload ?</mark>

in an EXE program we have sections and there is 3 sections that are good to store your payload inside them&#x20;

* **.text**
* **.data**
* **.rsrc**

to store your payload inside <mark style="color:blue;">**.text**</mark> section you need to put your payload into one of the functions in your code like main function for more info [go here](/writeups/malware-developement/essentials/payload-storage/storing-payload-in-.text-section.md)

to store your payload inside <mark style="color:blue;">**.data**</mark> section you need to tell your compiler that your payload is read only data and the easiest way to do that is to create a global variable holding your payload for more info [go here](/writeups/malware-developement/essentials/payload-storage/storing-payload-in-.data-section.md)

to store your payload inside <mark style="color:blue;">**.rsrc**</mark> section (.rsrc is a dedicated section for storing other files within a PE file like icons, images) we need to create a small file containing the payload and tell the compiler that this file should be part of the .rsrc section and then when the program runs your code has to use specific API Calls to reach out to .rsrc section and extract the payload from there for more info [go here](/writeups/malware-developement/essentials/payload-storage/storing-payload-in-.rsrc-section.md)

<div align="left"><figure><img src="https://1410593648-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYI2noEqPw69jd0hR7Prp%2Fuploads%2FHDFzjIBrJcH9zmSlkZfc%2Fimage.png?alt=media&amp;token=9b88fabe-9c4e-48a8-89df-8f9fd9677037" alt=""><figcaption></figcaption></figure></div>

### <mark style="color:red;">Dropper</mark>

**Droppers** are malicious programs that are used to deliver your payload to the target machine and execute it
