View Single Post
  #14  
Old 07-19-2018, 01:45
Insid3Code's Avatar
Insid3Code Insid3Code is offline
Family
 
Join Date: May 2013
Location: Algeria
Posts: 84
Rept. Given: 47
Rept. Rcvd 60 Times in 30 Posts
Thanks Given: 24
Thanks Rcvd at 108 Times in 56 Posts
Insid3Code Reputation: 60
@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 
__________________
Computer Forensics
Reply With Quote
The Following User Says Thank You to Insid3Code For This Useful Post:
niculaita (07-19-2018)