@vic4key
To avoid the application crash you need to allocate/align the stack...
Compiled and tested (MSVC 2017 15.7.3)
PHP Code:
F1 PROC
SUB RSP, 40 ; Allocate space on the stack (8 for alignment and 32 for shadow space)...
PUSH RBP
MOV RBP, RSP
LEA RCX, TXT_F1
CALL puts
LEAVE
ADD RSP, 40 ; Cleanup the stack...
RET
F1 ENDP
F2 PROC
SUB RSP, 40 ; Allocate space on the stack (8 for alignment and 32 for shadow space)...
PUSH RBP
MOV RBP, RSP
LEA RCX, TXT_F2
CALL puts
LEAVE
ADD RSP, 40 ; Cleanup the stack...
RET
F2 ENDP