> For the complete documentation index, see [llms.txt](https://ret2basic.gitbook.io/ctfnote/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ret2basic.gitbook.io/ctfnote/pwn/windows-exploitation/appendix-tools/mona.py.md).

# Mona.py

## Setup

Set the log directory:

```
!mona config -set workingfolder C:\ImmunityLogs\%p
```

## Offset

Create pattern:

```
!mona pc 1024
```

Find offset:

```
!mona po <eip>
```

## Classic

Find a `jmp esp` gadget:

```
!mona jmp -r esp -cpb "<badchars>"
```

## SEH

Find a `pop pop ret` gadget:

```
!mona seh
```

## Egghunting

Generate an egghunter:

```
!mona egg
```

## ROP

FInd modules with ASLR and Rebase disabled:

```bash
!mona modules -cm aslr=false,rebase=false
```

Search for ROP chains and gadgets in the range of certain modules:

```
!mona rop -m <modules> -cpb "<badchars>"
```
