Hi,

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.

Thanks

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

mrb
16337
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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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

Tags:

×194
×1

Asked: 13 Nov '11, 19:48

Seen: 2,513 times

Last updated: 13 Nov '11, 19:48

powered by OSQA