Skip to content

Commit

Permalink
Force stack alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-ZecOps authored Aug 13, 2020
1 parent f043e4b commit 5877c79
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/msf/core/exe/segment_injector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def create_thread_stub

def create_thread_stub_x64
<<-EOS
push rbp
mov rbp, rsp
and rsp, FFFFFFFFFFFFFFF0h
sub rsp, 38h
mov rcx, hook_libname
Expand All @@ -77,8 +80,7 @@ def create_thread_stub_x64
mov rdx, rcx
call rax
add rsp, 38h
leave
jmp entrypoint
hook_libname db 'kernel32', 0
Expand Down

0 comments on commit 5877c79

Please sign in to comment.