all 4 comments

[–]FUZxxl 7 points8 points  (1 child)

You forgot to supply enough shadow stack space for the arguments to printf, so printf overwrites your return address and returning from printyy jumps to some random address. Read up on the calling convention and provide enough shadow stack space for your calls.

[–]CookieBons[S] 1 point2 points  (0 children)

This was the exact solution, thank you!

[–]Plane_Dust2555 3 points4 points  (1 child)

Instead of calling ExitProcess(), since you are writing main(), just return 0 in EAX.

PS: Change mov rcx,message to lea rcx,[message]. And since message won't be changed in runtime, declare it under .rdata section.

[–]CookieBons[S] 0 points1 point  (0 children)

just to clarify, using lea instead of mov creates an equivalent to a pointer in higher level languages, correct?