Тема: AHK: бинарная строка
Привет форум. Помогите пожалуйста с бинарной строкой. Не могу её впихнуть в bData с offset'oм 24.
Может не правильно перекодирую, точно не знаю.
sText := "{hi}{im info:)}"
aSockets%i%_iPackets := 1337
iLength := StrPut(sText, &bText, "CP0")
msgbox % iLength
VarSetCapacity(bData, 24 + iLength, 0)
NumPut(aSockets%i%_iPackets, bData, 0, "int64")
NumPut(1, bData, 8, "int64")
NumPut(iLength, bData, 16, "int64")
CopyBinData(&bText, &bData + 24, iLength)
Msgbox % NumGet(bData, 0, "int64") "`n" NumGet(bData, 8, "int64") "`n" NumGet(bData, 16, "int64") "`n" StrGet(&bData, "UTF-16")
Msgbox End
Reload
CopyBinData(ptrSource, ptrDestination, iLength) {
If iLength ;Only do it if there's anything to copy
DllCall("RtlMoveMemory", "Ptr", ptrDestination, "Ptr", ptrSource, "UInt", iLength)
}