Indeed I was testing using the old version, thanks for the tip. :-)
But there's still a problem, the output is very different from aespipe. .. Then by trial and error I changed the line
if !dllCall("Advapi32\CryptHashData","Ptr",hHash,"Ptr",&passBuf,"Uint",passLen,"Uint",0 )
to (notice the passLen-1 part)
if !dllCall("Advapi32\CryptHashData","Ptr",hHash,"Ptr",&passBuf,"Uint",passLen-1,"Uint",0 )
And now, for my surpise the first block (the first 16 bytes) match exactly the output of aespipe, but the next one doesn't!
If the input is less than 16-bytes aespipe produces an encrypted message of 16 bytes, but Crypt.ahk output has 32 bytes. The first 16 bytes are the same produced by aespipe.
Thanks a lot again.