79316424

Date: 2024-12-29 22:06:42
Score: 1
Natty:
Report link

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

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Natrome tex