[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to evaluate hex/ebcdic packet data LUA
- From: Sean Conner <sean@...>
- Date: Mon, 24 Oct 2016 02:10:18 -0400
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