Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
FileRead,BINFileData,%A_ScriptDir%\my.bin
Pointer := &BINFileData
;https://autohotkey.com/board/topic/6946-binary-file-reading-and-writing/
hFile := DllCall("CreateFile","Str",A_LoopFileName,"UInt",0x80000000,"UInt",3,"UInt",0,"UInt",3,"UInt",0,"UInt",0)
if not hFile
{
MsgBox,16,%ApplicationTitle%,Can't open %A_LoopFileName%.
ExitApp
}
P1 := *(pointer)
pointer++
pointer++
P2 := *(pointer)
pointer++
pointer++
P3 := *(pointer)
msgbox % P1 . A_Space . P2 . A_Space . P3
DllCall("CloseHandle",UInt,hFile)
exitapp
my.bin contains 3 hex values
Code: Select all
98 C3 78
Can anyone assist ?