1
Vote

Exception while reading and writing PE file

description

This is really a good liberary.
 
I've attached dll "App_Web_0lfs3pjb.dll". This dll is for sample web application and created with visual studio c# 2005. If I read the dll with PEFile and write same then I'm getting following exception,
 
[RoundTrip] Reading c:\App_Web_0lfs3pjb.dll
[RoundTrip] Processing c:\App_Web_0lfs3pjb.dll
[RoundTrip] System.Exception: The MethodOp for this MethInstr is not supported.
at QUT.PERWAPI.MethInstr.GetDeltaDistance() in D:\NewProjects\TraceCodeProject\perwapi-52406\PERWAPI\Instructions.cs:line 2697
at QUT.PERWAPI.CILInstructions.GetMaxStackDepthRequired() in D:\NewProjects\TraceCodeProject\perwapi-52406\PERWAPI\Instructions.cs:line 1182
at QUT.PERWAPI.MethodDef.BuildSignatures(MetaDataOut md) in D:\NewProjects\TraceCodeProject\perwapi-52406\PERWAPI\MDMethodElems.cs:line 1158
at QUT.PERWAPI.MetaDataOut.BuildMDTables() in D:\NewProjects\TraceCodeProject\perwapi-52406\PERWAPI\MetaDataOut.cs:line 424
at QUT.PERWAPI.PEFile.BuildMetaData() in D:\NewProjects\TraceCodeProject\perwapi-52406\PERWAPI\PEFile.cs:line 372
at QUT.PERWAPI.PEFile.WritePEFile(Boolean writePDB) in D:\NewProjects\TraceCodeProject\perwapi-52406\PERWAPI\PEFile.cs:line 400
at RoundTripPE.Program.Process(String fileName) in D:\NewProjects\TraceCodeProject\perwapi-52406\RoundTripPE\Program.cs:line 48
[RoundTrip] Halting
 
I'm using latest version of source code and built with studio 2008. I've attached dll to test.

file attachments

comments

k_john_gough wrote Jul 27, 2010 at 2:56 AM

Thanks to shah_amish_b for turning up this issue. The problem with this particular DLL was a bug in computing stack depth for methods that have "ldftn" instructions. Now fixed in the source code repository, and with "beta release distribution v1.1.4.53022.
I shall leave the distribution as beta until I get more feedback on whether there are other issues.

wrote Feb 13, 2013 at 1:06 AM