Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] Adding Hebrew support to SMB

From: Guy Shtub <guy@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 6 Aug 2009 11:11:54 +0200
Hi,
Currently when I monitor SMB traffic, if a file name is in Hebrew I get question marks instead of the file name.
For example when I do a rename of a file from a English name to a Hebrew name:

Old File Name: \New_Root_Directory\
shlomitest\asdf.txt
Buffer Format: ASCII (4)
File Name: \New_Root_Directory\shlomitest\???????.txt

This can be fixed by adding to the function "unicode_to_str" in "packet-smb-common.c" another if:
original code:
if ((uchar & 0xFF00) == 0)

        *p++ = (gchar) uchar; /* ISO 8859-1 */

      else

        *p++ = '?';     /* not 8859-1 */

changed to:
if ((uchar & 0xFF00) == 0)

        *p++ = (gchar) uchar; /* ISO 8859-1 */

      // Added support for Hebrew ASCII

else if((uchar & 0xFF00) == 0x500) {

  // 1264 is the offset between Unicode and ASCII in Hebrew

  uchar = uchar - 1264;

        *p++ = (gchar) uchar;

        }

      else {

        *p++ = '?';     /* not 8859-1 */

      }


How can I go about adding this code to the main Wireshark development code?
Thanks,
Guy Shtub.