This is our old Q&A Site. Please post any new questions and answers at


I am trying to use lua tvb_range:le_uint64() but it does not return the correct value when converted from userdata to a lua integer? It seems to always return tvb_range:int64()

The captured buffer contains; "aa c8 74 91 ba d2 4c 00"

local f.my_proto.fields
f.my_int64 = ProtoField.int64("my_proto.my_int64", "My Int 64", base.Dec)
tree:add_le(f.mt_int64, tvb(0,8))

This code correctly dissects the bytes and displays

"My Int 64: 216237969109738"

Then I try and convert the range from userdata to a lua integer

print (tvb(0,8):le_int64(), tvb(0,8):int64())
>-6140529922666247168 -6140529922666247168

print (tostring(tvb(0,8):le_int64()), tostring(tvb(0,8):int64()) 
>-6140529922666247168 -6140529922666247168

But it should return

print (tvb(0,8):le_int64(), tvb(0,8):int64())
>216237969109738  -6140529922666247168

Is there a bug in the le_uint64() function? I couldn't find it in Bugzilla.


OS: Centos 5.3 Wireshark 1.4.1 Lua 5.1

This question is marked "community wiki".

asked 13 Nov '11, 19:48

mrb's gravatar image

accept rate: 0%

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 13 Nov '11, 19:48

question was seen: 4,952 times

last updated: 13 Nov '11, 19:48

p​o​w​e​r​e​d by O​S​Q​A