Path: blob/master/data/templates/src/pe/exe/template_x64_windows.asm
19721 views
; Author: Stephen Fewer (stephen_fewer[at]harmonysecurity[dot]com)1; Architecture: x642;3; Assemble and link with the following command:4; "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\x86_amd64\ml64" template_x64_windows.asm /link /subsystem:windows /defaultlib:"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\x64\kernel32.lib" /entry:main56extrn ExitProcess : proc7extrn VirtualAlloc : proc89.code1011main proc12sub rsp, 40 ;13mov r9, 40h ;14mov r8, 3000h ;15mov rdx, 4096 ;16xor rcx, rcx ;17call VirtualAlloc ; lpPayload = VirtualAlloc( NULL, 4096, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE );18mov rcx, 4096 ;19mov rsi, payload ;20mov rdi, rax ;21rep movsb ; memcpy( lpPayload, payload, 4096 );22call rax ; lpPayload();23xor rcx, rcx ;24call ExitProcess ; ExitProcess( 0 );25main endp2627payload proc28A byte 'PAYLOAD:'29B db 4096-8 dup ( 0 )30payload endp31end323334