Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Crypt HexString To Binary
Using Windows API in QM is convenient. I would like to convert the following AutoHotKey (AHK) code into QM code.

However, the function names include a path(crypt32\CryptStringToBinaryW), and I am unsure how to handle it.

Additionally, Is there simpler QM built-in function that can achieve the same functionality as the AHK code?

Thanks any suggestions and help in advance.
Copy      Help
CryptHexStringToBinary(hexString, &binary){
    DllCall("crypt32\CryptStringToBinaryW", "str", hexString, "uint", len := StrLen(hexString), "uint", 4, "ptr", 0, "uint*", &bytes := 0, "ptr", 0, "ptr", 0)
    return DllCall("crypt32\CryptStringToBinaryW", "str", hexString, "uint", len, "uint", 4, "ptr", binary := binary ?? Buffer(bytes), "uint*", bytes, "ptr", 0, "ptr", 0)
CryptHexStringToBinary("48B80000000000000000FFD0C3", &resBinary)
looks like it uses this 
Copy      Help

for more information on that function see

for winap2 see here
kevin Thank you very much, this is exactly what I was looking for.

QM is much more concise and efficient than AHK in using Windows API.

Forum Jump:

Users browsing this thread: 1 Guest(s)