Hi all!
In addition to useful Iczelion Tutorial I think it would be useful to publish a section in which small programs masm64 that might be helpful for others.
Simply Loader
OPTION DOTNAME
option casemap:none
include temphls.inc
include win64.inc
include kernel32.inc
includelib kernel32.lib
include user32.inc
includelib user32.lib
OPTION PROLOGUE:rbpFramePrologue
OPTION EPILOGUE:rbpFrameEpilogue
.code
WinMain proc
LOCAL TEMP:QWORD ;needed
invoke CreateProcess, ADDR process, NULL, NULL, NULL, NULL, CREATE_SUSPENDED, NULL, NULL, ADDR Startup, ADDR processinfo
cmp eax, 0
jne ProcessCreated
invoke MessageBox,0,offset ErrorMessage,offset ErrorTit,0
invoke ExitProcess,0
jmp endLoader
ProcessCreated:
invoke WriteProcessMemory, processinfo.hProcess, AddressToPatch1, ADDR ReplaceBy, ReplaceSize, byteswritten
invoke ResumeThread, processinfo.hThread
invoke ExitProcess,0
endLoader:
WinMain endp
.data
process db 'yourapp.exe',0
Startup STARTUPINFO <>
processinfo PROCESS_INFORMATION <>
ErrorTit db "Error:",0
ErrorMessage db "Process not loaded!",0
AddressToPatch1 qWORD 100XXXXXXh ;put your address
ReplaceBy db 090h,090h ;put your bytes
ReplaceSize qWORD 2
.data?
byteswritten qWORD ?
end