hi guys,
i'm confused about calling functions in x64. I heard, that if the function is called it needs always to make a shadow space for rcx, rdx, r8, r9 on the stack. Even if the proc needs less then 4 args. Cleaning after call is also needed.
First question is do i understood this correct and second - wired thing to me is:
mov rcx, rax
mov rdx, offset msg
mov r8, lengthof msg
mov r9, offset BytesWritten
mov qword [rsp + 8 * 4], 0
call WriteConsole
mov qword [rsp + 8 * 4], 0
i think it should be:
sub rsp, [4 * 8]
push 0
how this affects on the frames of other functions, that are called by WriteConsole if the stack pointer remains unchanged after
mov qword [rsp + 8 * 4], 0
thanks in advance