Use the 64-bit integer fetch routines to support 64-bit NDR integers.

svn path=/trunk/; revision=13198
This commit is contained in:
Guy Harris 2005-01-29 20:39:14 +00:00
parent d9d7d0be95
commit 75e4d0a2ce
8 changed files with 28 additions and 72 deletions

View File

@ -109,7 +109,7 @@ dissect_ndr_uint32 (tvbuff_t *tvb, gint offset, packet_info *pinfo,
int
dissect_ndr_duint32 (tvbuff_t *tvb, gint offset, packet_info *pinfo,
proto_tree *tree, guint8 *drep,
int hfindex, unsigned char *pdata)
int hfindex, guint64 *pdata)
{
dcerpc_info *di;

View File

@ -1003,23 +1003,19 @@ dissect_dcerpc_time_t (tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
int
dissect_dcerpc_uint64 (tvbuff_t *tvb, gint offset, packet_info *pinfo _U_,
proto_tree *tree, guint8 *drep,
int hfindex, unsigned char *pdata)
int hfindex, guint64 *pdata)
{
if(pdata){
tvb_memcpy(tvb, pdata, offset, 8);
if(drep[0] & 0x10){/* XXX this might be the wrong way around */
unsigned char data;
data=pdata[0];pdata[0]=pdata[7];pdata[7]=data;
data=pdata[1];pdata[1]=pdata[6];pdata[6]=data;
data=pdata[2];pdata[2]=pdata[5];pdata[5]=data;
data=pdata[3];pdata[3]=pdata[4];pdata[4]=data;
}
}
guint64 data;
data = ((drep[0] & 0x10)
? tvb_get_letoh64 (tvb, offset)
: tvb_get_ntoh64 (tvb, offset));
if (tree) {
proto_tree_add_item(tree, hfindex, tvb, offset, 8, (drep[0] & 0x10));
}
if (pdata)
*pdata = data;
return offset+8;
}

View File

@ -125,7 +125,7 @@ int dissect_dcerpc_uint32 (tvbuff_t *tvb, gint offset, packet_info *pinfo,
int hfindex, guint32 *pdata);
int dissect_dcerpc_uint64 (tvbuff_t *tvb, gint offset, packet_info *pinfo,
proto_tree *tree, guint8 *drep,
int hfindex, unsigned char *pdata);
int hfindex, guint64 *pdata);
int dissect_dcerpc_float (tvbuff_t *tvb, gint offset, packet_info *pinfo,
proto_tree *tree, guint8 *drep,
int hfindex, gfloat *pdata);
@ -153,7 +153,7 @@ int dissect_ndr_uint32 (tvbuff_t *tvb, gint offset, packet_info *pinfo,
int hfindex, guint32 *pdata);
int dissect_ndr_duint32 (tvbuff_t *tvb, gint offset, packet_info *pinfo,
proto_tree *tree, guint8 *drep,
int hfindex, unsigned char *pdata);
int hfindex, guint64 *pdata);
int dissect_ndr_uint64 (tvbuff_t *tvb, gint offset, packet_info *pinfo,
proto_tree *tree, guint8 *drep,
int hfindex, guint64 *pdata);

View File

@ -2390,7 +2390,6 @@ dissect_ICBAAccoSync_ReadItems_resp(tvbuff_t *tvb, int offset,
{
guint32 u32Pointer;
guint16 u16QC;
unsigned char pu64TimeStamp[8];
guint32 u32ArraySize;
guint32 u32HResult;
guint32 u32Idx;
@ -2428,7 +2427,7 @@ dissect_ICBAAccoSync_ReadItems_resp(tvbuff_t *tvb, int offset,
offset = dissect_dcom_WORD(tvb, offset, pinfo, sub_tree, drep,
hf_cba_acco_qc, &u16QC);
offset = dissect_dcom_FILETIME(tvb, offset, pinfo, sub_tree, drep,
hf_cba_acco_time_stamp, pu64TimeStamp);
hf_cba_acco_time_stamp, NULL);
offset = dissect_dcom_indexed_HRESULT(tvb, offset, pinfo, sub_tree, drep,
&u32HResult, u32Idx);
@ -2531,8 +2530,6 @@ dissect_ICBAAccoSync_WriteItemsQCD_rqst(tvbuff_t *tvb, int offset,
guint32 u32SubStart;
guint32 u32Idx;
guint16 u16QC;
unsigned char pu64TimeStamp[8];
offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep);
@ -2567,7 +2564,7 @@ dissect_ICBAAccoSync_WriteItemsQCD_rqst(tvbuff_t *tvb, int offset,
hf_cba_acco_qc, &u16QC);
offset = dissect_dcom_FILETIME(tvb, offset, pinfo, sub_tree, drep,
hf_cba_acco_time_stamp, pu64TimeStamp);
hf_cba_acco_time_stamp, NULL);
proto_item_append_text(sub_item, "[%u]: Item=\"%s\" QC=%s (0x%02x)",
u32Idx, szStr,

View File

@ -67,11 +67,8 @@ static int
dissect_oxid_simple_ping_rqst(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree, guint8 *drep)
{
unsigned char pu64SetId[8];
offset = dissect_dcom_ID(tvb, offset, pinfo, tree, drep,
hf_oxid_setid, pu64SetId);
hf_oxid_setid, NULL);
return offset;
}
@ -101,17 +98,14 @@ static int
dissect_oxid_complex_ping_rqst(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree, guint8 *drep)
{
unsigned char pu64SetId[8];
guint16 u16SeqNum;
guint16 u16AddToSet;
guint16 u16DelFromSet;
guint32 u32Pointer;
guint32 u32ArraySize;
unsigned char pu64OId[8];
offset = dissect_dcom_ID(tvb, offset, pinfo, tree, drep,
hf_oxid_setid, pu64SetId);
hf_oxid_setid, NULL);
offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
hf_oxid_seqnum, &u16SeqNum);
@ -133,7 +127,7 @@ dissect_oxid_complex_ping_rqst(tvbuff_t *tvb, int offset,
while (u16AddToSet--) {
offset = dissect_dcom_ID(tvb, offset, pinfo, tree, drep,
hf_oxid_oid, pu64OId);
hf_oxid_oid, NULL);
}
}
@ -145,7 +139,7 @@ dissect_oxid_complex_ping_rqst(tvbuff_t *tvb, int offset,
while (u16DelFromSet--) {
offset = dissect_dcom_ID(tvb, offset, pinfo, tree, drep,
hf_oxid_oid, pu64OId);
hf_oxid_oid, NULL);
}
}
@ -157,13 +151,12 @@ static int
dissect_oxid_complex_ping_resp(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree, guint8 *drep)
{
unsigned char pu64SetId[8];
guint16 u16PingBackoffFactor;
guint32 u32HResult;
offset = dissect_dcom_ID(tvb, offset, pinfo, tree, drep,
hf_oxid_setid, pu64SetId);
hf_oxid_setid, NULL);
offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
hf_oxid_ping_backoff_factor, &u16PingBackoffFactor);
@ -183,14 +176,13 @@ static int
dissect_oxid_resolve_oxid2_rqst(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree, guint8 *drep)
{
unsigned char pu64OxId[8];
guint16 u16ProtSeqs;
guint32 u32ArraySize;
guint32 u32ItemIdx;
offset = dissect_dcom_ID(tvb, offset, pinfo, tree, drep,
hf_oxid_oxid, pu64OxId);
hf_oxid_oxid, NULL);
offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep,
hf_oxid_requested_protseqs, &u16ProtSeqs);
@ -258,22 +250,19 @@ dissect_oxid_server_alive2_resp(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, guint8 *drep) {
guint16 u16VersionMajor;
guint16 u16VersionMinor;
unsigned char unknown1[8];
unsigned char unknown2[8];
offset = dissect_dcom_COMVERSION(tvb, offset, pinfo, tree, drep, &u16VersionMajor, &u16VersionMinor);
/* XXX - understand what those 8 bytes mean! don't skip'em!*/
dissect_dcerpc_uint64(tvb , offset, pinfo, tree, drep, hf_oxid_Unknown1, unknown1);
offset += sizeof(unknown1);
dissect_dcerpc_uint64(tvb , offset, pinfo, tree, drep, hf_oxid_Unknown1, NULL);
offset += 8;
offset = dissect_dcom_DUALSTRINGARRAY(tvb, offset, pinfo, tree, drep, hf_oxid_ds_array);
/* unknown field 2 */
dissect_dcerpc_uint64(tvb, offset, pinfo, tree, drep, hf_oxid_Unknown2, unknown2);
offset += sizeof(unknown2);
return offset;
dissect_dcerpc_uint64(tvb, offset, pinfo, tree, drep, hf_oxid_Unknown2, NULL);
offset += 8;
return offset;
}

View File

@ -134,7 +134,6 @@ static int
dissect_remact_remote_activation_resp(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree, guint8 *drep)
{
unsigned char pu64Oxid[8];
guint32 u32Pointer;
e_uuid_t ipid;
guint32 u32AuthnHint;
@ -149,7 +148,7 @@ dissect_remact_remote_activation_resp(tvbuff_t *tvb, int offset,
offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep);
offset = dissect_dcom_ID(tvb, offset, pinfo, tree, drep,
hf_remact_oxid, pu64Oxid);
hf_remact_oxid, NULL);
offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep,
&u32Pointer);
if (u32Pointer) {

View File

@ -670,30 +670,6 @@ gchar* dcom_uuid_to_str(e_uuid_t *uuid) {
}
/* dissect 64bits integer with alignment of 8 bytes (use this for VT_I8 type only) */
int
dissect_dcom_I8(tvbuff_t *tvb, gint offset, packet_info *pinfo,
proto_tree *tree, guint8 *drep,
int hfindex, unsigned char *pdata)
{
dcerpc_info *di;
di=pinfo->private_data;
if(di->conformant_run){
/* just a run to handle conformant arrays, no scalars to dissect */
return offset;
}
if (offset % 8) {
offset += 8 - (offset % 8);
}
return dissect_dcerpc_uint64(tvb, offset, pinfo,
tree, drep, hfindex, pdata);
}
/* dissect a dcerpc array size */
int
dissect_dcom_dcerpc_array_size(tvbuff_t *tvb, gint offset, packet_info *pinfo,
@ -1469,8 +1445,6 @@ dissect_dcom_STDOBJREF(tvbuff_t *tvb, gint offset, packet_info *pinfo,
{
guint32 u32Flags;
guint32 u32PublicRefs;
unsigned char pu64Oxid[8];
unsigned char pu64Oid[8];
e_uuid_t ipid;
proto_item *sub_item;
proto_tree *sub_tree;
@ -1488,9 +1462,9 @@ dissect_dcom_STDOBJREF(tvbuff_t *tvb, gint offset, packet_info *pinfo,
offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep,
hf_dcom_stdobjref_public_refs, &u32PublicRefs);
offset = dissect_dcom_ID(tvb, offset, pinfo, sub_tree, drep,
hf_dcom_stdobjref_oxid, pu64Oxid);
hf_dcom_stdobjref_oxid, NULL);
offset = dissect_dcom_ID(tvb, offset, pinfo, sub_tree, drep,
hf_dcom_stdobjref_oid, pu64Oid);
hf_dcom_stdobjref_oid, NULL);
offset = dissect_dcom_UUID(tvb, offset, pinfo, sub_tree, drep,
hf_dcom_stdobjref_ipid, &ipid);

View File

@ -47,6 +47,7 @@ dissect_dcom_that(tvbuff_t *tvb, int offset,
#define dissect_dcom_BYTE dissect_ndr_uint8
#define dissect_dcom_WORD dissect_ndr_uint16
#define dissect_dcom_DWORD dissect_ndr_uint32
#define dissect_dcom_I8 dissect_ndr_uint64
#define dissect_dcom_ID dissect_ndr_duint32
#define dissect_dcom_UUID dissect_ndr_uuid_t
#define dissect_dcom_FILETIME dissect_ndr_duint32 /* ToBeDone */