OfficeDev / Office-Inspectors-for-Fiddler

Microsoft Office (MAPI, WOPI, and FSSHTTP) inspectors for Fiddler
MIT License
83 stars 55 forks source link

ExecuteResponse with binary file attached won't parse. #20

Closed Civerooni closed 7 years ago

Civerooni commented 7 years ago

Hello,

MAPI Parsing is not working if a binary file is attached in the message that is being parsed. Fiddler will either appear to hang while nothing gets populated in the MAPI context window for responses or I will see the error message "The Attachment cannot be parsed successfully. The EndAttach Marker is missed.".

I suspect this has to do with the handling of Packed ROPs, this is where I am having issues in my parsing of the messages as well.

Thanks, Shayne

Civerooni commented 7 years ago

The problem is with handling of packedRops which have a ropSize over 32k. I am able to get a little further in the parsing if I add the following code in VarPropTypePropValue:

else if (this.PropInfo.PropID == 0x3701) { this.ValueArray = stream.ReadBlock((int)(stream.RopSize - stream.Position)); }

I use this code because the full RopSize is passed the limit of the current ropBuffer. I can't find a more reliable way to get this value, but this does seem to capture the appropriate byes.

I also need to remove the throwing of a generic exception when an AttachmentEnd and IncrSyncEnd are missing as they won't be included until the RopBuffer that contains the Last flag. I am also moving back 4 bytes the marker that was read is not *End.

I still am not properly parsing the remaining ContentSync object that remains (the remaining bytes of the attachment), the bytes that come out of the decompression algorithm have the first 8 expected bytes missing, but I am not sure how they are skipped... The only 8 bytes I read are the new RPCHeaderExt values, but those read in properly and I get expected values.

I can provide more information including more complete steps to reproduce with the sample file I am using if anyone is listening.

tarunchopra commented 7 years ago

@Civerooni : Sorry for the delay, can you please sample file and more details to repro the issue so that we can have a look ?

Civerooni commented 7 years ago

@tarunchopra No worries, unfortunately I was unable to take the issue much further myself so my description above still holds.

I did discover that the situation is easier to reproduce than I first thought. All that you need to do is have Fiddle capturing the receive of an email message sent from an Office365 Exchange server to an Outlook client. This email message needs to contain a binary attachment that has a size larger than 32k. Please let me know if you have any trouble reproducing this message.

Thanks, Shayne

tarunchopra commented 7 years ago

@Civerooni : Thanks for the update. I'll try to repro the issue as you stated but if you can share any existing fiddler trace then that will expedite our analysis.

tarunchopra commented 7 years ago

@Civerooni : We have uploaded new inspector binaries which should resolve your issue. If you still face issue, please feel free to open a new thread with details.

Civerooni commented 7 years ago

@tarunchopra Thanks for resolving this issue! I will give this another try when I get a chance.