Looking at specific data when reading file as "data"

Hello all,

I’m having some trouble reading a file – when reading a file as text, some of the characters are getting cut out (I’d guess it has to do with reading a hex file as text and all the non-printing characters which are in that kind of file)

So, I figured the better solution was to read the file in as data, but I’m drawing a blank at how to tell Applescript to look at a specific part of the file.

e.g:

read thefile as text
if (text 1 thru 5) of thefile is “Hello” then
set value to true
end if

That should work just fine, however:

read thefile as data
if (____ 1 thru 4) of thefile is 0A35 then
– do something
end if

Is the proper thing to read the file in as data, then set that information into text?