So the main problem seemed to be that rsp
would go out of alignment every time I pushed to it, the solution was simple enough, add rsp, 8
fixed the code.
fixed assembly:
default rel
extern ExitProcess
section .text
global _start
_start:
and rsp, 0xFFFFFFFFFFFFFFF0
mov rax, 32
push rax
push QWORD [rsp+0]
add rsp, 8
pop rcx
mov ecx, ecx
call ExitProcess
Basically I had to align the stack pointer after every push