
I have documented all of the AMSI patches that I learned till now
I have documented all of the AMSI patches that I learned till now


a. To Skip Entering amsi!AmsiOpenSession+0x4c via jne, if all instructions succeed before the calling of jne
=> We would end up directly to amsi!AmsiCloseSession.
jne from amsi!AmsiOpenSession Github. I have used his AMSI patch code template and added other methods I have worked on till now.b. To Skip Entering amsi!AmsiOpenSession+0x4c (Opens a session within which multiple scan requests can be correlated) via ret, by directly pasting c3 at the beginning of the amsi!AmsiOpenSession
=> We would end up directly to amsi!AmsiCloseSession.
a. To Skip the execution of the main intructions of amsi!AmsiScanBuffer via ret, by directly pasting c3 at the beginning of the amsi!AmsiScanBuffer
b. To Skip the branch that does the actual scanning in amsi!AmsiScanBuffer and returns, by directly pasting \\xB8\\x57\\x00\\x07\\x80\\xC3 ('mov eax, 0x80070057; ret') at the beginning of the amsi!AmsiScanBuffer
Here, the value (rather error Value) of HRESULT being 'E_INVALIDARG' (Source: https://pre.empt.dev/posts/maelstrom-etw-amsi/#Historic_AMSI_Bypasses)
c. To Skip the branch that does the actual scanning in amsi!AmsiScanBuffer and returns, by directly pasting \\xB8\\x05\\x00\\x07\\x80\\xC3 ('mov eax, 0x80070005; ret') at the beginning of the amsi!AmsiScanBuffer
Here, the value (rather error Value) of HRESULT being 'E_ACCESSDENIED' (Source: https://pre.empt.dev/posts/maelstrom-etw-amsi/#Historic_AMSI_Bypasses)
d. To Skip the branch that does the actual scanning in amsi!AmsiScanBuffer and returns, by directly pasting \\xB8\\x06\\x00\\x07\\x80\\xC3 ('mov eax, 0x80070006; ret') at the beginning of the amsi!AmsiScanBuffer
Here, the value (rather error Value) of HRESULT being 'E_HANDLE' (Source: https://pre.empt.dev/posts/maelstrom-etw-amsi/#Historic_AMSI_Bypasses)
e. To Skip the branch that does the actual scanning in amsi!AmsiScanBuffer and returns, by directly pasting \\xB8\\x0E\\x00\\x07\\x80\\xC3 ('mov eax, 0x8007000E; ret') at the beginning of the amsi!AmsiScanBuffer
Here, the value (rather error Value) of HRESULT being 'E_OUTOFMEMORY' (Source: https://pre.empt.dev/posts/maelstrom-etw-amsi/#Historic_AMSI_Bypasses)
JE to JMP so it returns directly... : https://github.com/ZeroMemoryEx/Amsi-Killer