Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Garbage characters in PCAPdtoid trailer app name #435

Closed
emanuele-f opened this issue May 9, 2024 · 6 comments
Closed

Garbage characters in PCAPdtoid trailer app name #435

emanuele-f opened this issue May 9, 2024 · 6 comments

Comments

@emanuele-f
Copy link
Owner

See #428 (comment)

@Qpp0
Copy link

Qpp0 commented May 14, 2024

I have the same problem here. It seems that because these ASCII encodings correspond to Chinese characters, there is an issue with the display. Is there a way to make the Lua script support decoding to UTF-8?

@emanuele-f
Copy link
Owner Author

@Qpp0 can you try changing this line base.ASCII to base.UNICODE here in the wireshark plugin, to see if it works?

@Qpp0
Copy link

Qpp0 commented May 16, 2024

@Qpp0 can you try changing this line base.ASCII to base.UNICODE here in the wireshark plugin, to see if it works?

@emanuele-f
I have already tried doing it,but it doesn't work.I’m not sure if it’s related to the Lua version used by Wireshark. In fact, by right-clicking on ‘appname’ and selecting ‘Show Packet Bytes,’ choosing UTF-8 encoding, it displays correctly.”
image

@emanuele-f
Copy link
Owner Author

emanuele-f commented May 17, 2024

@Qpp0 please try this other change, other than base.UNICODE also modify line 54 to local appname = trailer(8, 20):raw(). Here is the full diff:

diff --git a/tools/pcapdroid.lua b/tools/pcapdroid.lua
index 0cb2c52a..c0127cbf 100644
--- a/tools/pcapdroid.lua
+++ b/tools/pcapdroid.lua
@@ -30,7 +30,7 @@ local fields = {}
 
 fields.magic   = ProtoField.uint32("pcapdroid.magic", "Magic", base.HEX)
 fields.uid     = ProtoField.int32("pcapdroid.uid", "UID", base.DEC)
-fields.appname = ProtoField.string("pcapdroid.appname", "App name", base.ASCII)
+fields.appname = ProtoField.string("pcapdroid.appname", "App name", base.UNICODE)
 
 pcapdroid.fields = fields
 
@@ -51,7 +51,7 @@ function pcapdroid.dissector(buffer, pinfo, tree)
     return
   end
 
-  local appname = trailer(8, 20):string()
+  local appname = trailer(8, 20):raw()
   local subtree = tree:add(pcapdroid, buffer(), string.format("PCAPdroid, App: %s", appname))
 
   subtree:add(fields.magic, trailer(0, 4))

@Qpp0
Copy link

Qpp0 commented May 22, 2024

local appname = trailer(8, 20):raw()

Problem solved!

@emanuele-f
Copy link
Owner Author

Thanks for confirming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants