aboutsummaryrefslogtreecommitdiff
path: root/CodeExecution/Invoke-ReflectivePEInjection_Resources/Shellcode/x64/CallDllMain.asm
diff options
context:
space:
mode:
Diffstat (limited to 'CodeExecution/Invoke-ReflectivePEInjection_Resources/Shellcode/x64/CallDllMain.asm')
-rw-r--r--CodeExecution/Invoke-ReflectivePEInjection_Resources/Shellcode/x64/CallDllMain.asm20
1 files changed, 20 insertions, 0 deletions
diff --git a/CodeExecution/Invoke-ReflectivePEInjection_Resources/Shellcode/x64/CallDllMain.asm b/CodeExecution/Invoke-ReflectivePEInjection_Resources/Shellcode/x64/CallDllMain.asm
new file mode 100644
index 0000000..02d6848
--- /dev/null
+++ b/CodeExecution/Invoke-ReflectivePEInjection_Resources/Shellcode/x64/CallDllMain.asm
@@ -0,0 +1,20 @@
+[SECTION .text]
+global _start
+
+_start:
+ ; Get stack setup
+ push rbx
+ mov rbx, rsp
+ and sp, 0xff00
+
+ ; Call DllMain
+ mov rcx, 0x4141414141414141 ; DLLHandle, set by PowerShell
+ mov rdx, 0x1 ; PROCESS_ATTACH
+ mov r8, 0x0 ; NULL
+ mov rax, 0x4141414141414141 ; Address of DllMain, set by PS
+ call rax
+
+ ; Fix stack
+ mov rsp, rbx
+ pop rbx
+ ret