I’m trying to use the HeapAlloc function, seems that it fails and block the program, as the program only print one “hello”(only the first printf is called), how to know what prevent the program from printing?
If I comment the four lines of code that use HeapAlloc then the program works well(it prints two “hello”).
I’m using nasm in Windows 10(64bit).
segment .data
hello db "hello", 0xd, 0xa, 0
segment .text
global main
extern ExitProcess
extern printf
extern HeapAlloc
main:
lea rcx, [hello]
call printf
mov rcx, 0
mov rdx, 0
mov r8, 4096
call HeapAlloc
lea rcx, [hello]
call printf
call ExitProcess