diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-02-08 02:59:05 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-02-08 02:59:05 +0000 |
commit | 126e1e90f747396bac5c80b73b89c12fc68cc067 (patch) | |
tree | 3ec76559b911469cc87c92608789340474ab4d9e /ncp2222.py | |
parent | b4252eb6e05eefce04ba3683a36acb0178dd1b1f (diff) |
Force the endianness of the dates and times in DirectoryInstance and
FileInstance to big-endian.
Those structures apparently contain a last access date rather than a
creation time.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7098 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'ncp2222.py')
-rwxr-xr-x | ncp2222.py | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/ncp2222.py b/ncp2222.py index a3cadaed71..87b054da0f 100755 --- a/ncp2222.py +++ b/ncp2222.py @@ -24,7 +24,7 @@ http://developer.novell.com/ndk/doc/docui/index.htm#../ncp/ncp__enu/data/ for a badly-formatted HTML version of the same PDF. -$Id: ncp2222.py,v 1.47 2003/02/05 20:52:48 guy Exp $ +$Id: ncp2222.py,v 1.48 2003/02/08 02:59:05 guy Exp $ Copyright (c) 2000-2002 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -1164,6 +1164,12 @@ class bitfield32(bitfield, uint32): uint32.__init__(self, abbrev, descr, endianness) bitfield.__init__(self, vars) +# +# Force the endianness of a field to a non-default value; used in +# the list of fields of a structure. +# +def endian(field, endianness): + return [-1, field.Length(), field, endianness, NO_VAR, NO_REPEAT, NO_REQ_COND] ############################################################################## # NCP Field Types. Defined in Appendix A of "Programmer's Guide..." @@ -4183,19 +4189,14 @@ DirEntryStruct = struct("dir_entry_struct", [ DOSDirectoryEntryNumber, VolumeNumberLong, ], "Directory Entry Information") -# -# XXX - CreationDate and CreationTime here appear to be big-endian, -# but there's no way to say that *this* instance of a field is -# big-endian but *other* instances are little-endian. -# DirectoryInstance = struct("directory_instance", [ SearchSequenceWord, DirectoryID, DirectoryName14, DirectoryAttributes, DirectoryAccessRights, - CreationDate, - CreationTime, + endian(CreationDate, BE), + endian(AccessDate, BE), CreatorID, Reserved2, DirectoryStamp, @@ -4344,12 +4345,6 @@ FileInfoStruct = struct("file_info_struct", [ TotalBlocksToDecompress, CurrentBlockBeingDecompressed, ], "File Information") -# -# XXX - CreationDate, CreationTime, UpdateDate, and UpdateTime here -# appear to be big-endian, but there's no way to say that *this* -# instance of a field is big-endian but *other* instances are -# little-endian. -# FileInstance = struct("file_instance", [ SearchSequenceWord, DirectoryID, @@ -4357,10 +4352,10 @@ FileInstance = struct("file_instance", [ AttributesDef, FileMode, FileSize, - CreationDate, - CreationTime, - UpdateDate, - UpdateTime, + endian(CreationDate, BE), + endian(AccessDate, BE), + endian(UpdateDate, BE), + endian(UpdateTime, BE), ], "File Instance") FileNameStruct = struct("file_name_struct", [ FileName, |