CRC calc mbs plugin

Hi.
I have a binary file and want to calc checksum with Mbs plugin CRC_32…
I wan t to calc from position h024D to position hh045D
and yes, i can open file and loop thru it but how do i calc?

my code…
Dim f As FolderItem = GetFolderitem(“vbf_tmp.bin”)
bs = BinaryStream.Open(f, True)

	If bs <> Nil Then
			For i as Integer = &H024D To &H045D
					bs.Position = i
					Help help help  = hex(bs.ReadInt8() ) // make sure we craft this so its 2 characters for each byte
				Help help help	
			next
			bs.Close

X = CRC_HELP

Please Mike from a snowy cold Sweden…

Why not read the area in binary stream into a string and pass it to plugin CRC function?

Hi.
Yes, I try. when i calc i get 51424F72 but when i calc same information but in bin application i get 92E32A30
I do something very wrong…

if some one want to try. here is a link to the file. https://dl.dropboxusercontent.com/u/3397347/b.bin

		Dim inputFile As FolderItem = GetOpenFolderItem("text")
		Dim br As BinaryStream = BinaryStream.Open(inputFile)
		Dim iCounter as Integer
		DIm sCounter as String
		
		For i as Integer = &H0000 To &H0210
				br.position = i
				dim tmp as string = hex(br.ReadInt8() ) // make sure we craft this so its 2 characters for each byte
				if len(tmp)=1 then tmp= "0" +tmp
				sCounter =sCounter +  tmp 
		next
		iCounter = CRC_32OfStrMBS(sCounter)
		msgbox hex(iCounter)
		br.close()

Edit (Paul): Applied code formatting as described in Post Formatting Tips

Why so complicated? Why hex function?

Dim inputFile As FolderItem = SpecialFolder.Desktop.Child("b.bin") Dim br As BinaryStream = BinaryStream.Open(inputFile) dim data as string = br.Read(br.Length) iCounter = CRC_32OfStrMBS(data) msgbox hex(iCounter)

this works.