lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Jerry White once stated:
> I'm having a dickens of a time working with the packet data in my Lua
> dissector. I'm trying to see if a particular byte has a particular value.
> This byte exists in three different places in the below code, and all I
> want to do is test if it contains 0xc4, which is D in ebcdic. I just can't
> get it right. Any help is appreciated.

  If you know the offset of the character, then you can do:

	if data:sub(offset):byte() == 0xC4 then
	  -- we have a 'D' in EBCDIC at the given offset
	end

  -spc