> For the complete documentation index, see [llms.txt](https://gurpreet-portfolio.gitbook.io/gurpreet06/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gurpreet-portfolio.gitbook.io/gurpreet06/projects/amsi-patcher-bypassing-antivirus.md).

# AMSI Patcher (Bypassing Antivirus)

{% embed url="<https://github.com/Gurpreet06/AMSI_Patcher>" %}

Thanks to @D1rkMtr for the technique of using `jne` from amsi!AmsiOpenSession. I have used his AMSI patch code template and added other methods. This script skips entering amsi!AmsiOpenSession+0x4c via `ret`, by directly pasting `c3` at the beginning of the amsi!AmsiOpenSession. As a result, we end up directly at amsi!AmsiCloseSession.

## Methods Added

* The script checks whether `NtProtectVirtualMemory` and `NtAllocateVirtualMemory` are hooked by any security vendor or not.

### Proof

![image](https://github.com/Gurpreet06/AMSI_Patcher/assets/74554439/675eef88-96d9-4e84-a63d-13859353c209)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://gurpreet-portfolio.gitbook.io/gurpreet06/projects/amsi-patcher-bypassing-antivirus.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.
