I'm wwh1004.
Focus on .NET reverse engineering and Windows security.
Also love architecture design and software development.
Programming mainly in C#, C++.
This is my new blog wwh1004.com and knowledge will be shared here.
This project forked from 0xd4d/dnlib
Reads and writes .NET assemblies and modules, with updates and supports
License: MIT License
I'm wwh1004.
Focus on .NET reverse engineering and Windows security.
Also love architecture design and software development.
Programming mainly in C#, C++.
This is my new blog wwh1004.com and knowledge will be shared here.
When trying to load an assembly + pdb
from:
using System;
namespace HelloWorld
{
class Test
{
static void ErrorMethod()
{
const decimal decimalValue = 7922816251426433759354395033M;
}
}
}
dnlib loads the decimal local constant with a ClassSig
instead a ValueTypeSig
.
This cause a problem when trying to write the module again with the PDB, example:
_module.Write(filePath, new ModuleWriterOptions(_module)
{
WritePdb = true
});
In this case the following exception is thrown:
dnlib.DotNet.Writer.ModuleWriterException: Expected a null constant
at dnlib.DotNet.DummyLogger.Log(Object sender, LoggerEvent loggerEvent, String format, Object[] args)
at dnlib.DotNet.Writer.ModuleWriterBase.dnlib.DotNet.ILogger.Log(Object sender, LoggerEvent loggerEvent, String format, Object[] args)
at dnlib.DotNet.Writer.Metadata.Error(String message, Object[] args)
at dnlib.DotNet.Writer.Metadata.dnlib.DotNet.Writer.IWriterError.Error(String message)
at dnlib.DotNet.Pdb.Portable.LocalConstantSigBlobWriter.Write(DataWriter writer, TypeSig type, Object value)
at dnlib.DotNet.Pdb.Portable.LocalConstantSigBlobWriter.Write(IWriterError helper, Metadata systemMetadata, DataWriter writer, TypeSig type, Object value)
at dnlib.DotNet.Writer.Metadata.AddLocalConstant(PdbConstant constant)
at dnlib.DotNet.Writer.Metadata.WriteMethodBodies()
at dnlib.DotNet.Writer.Metadata.Create()
at dnlib.DotNet.Writer.Metadata.CreateTables()
at dnlib.DotNet.Writer.ModuleWriter.WriteImpl()
at dnlib.DotNet.Writer.ModuleWriterBase.Write(Stream dest)
at dnlib.DotNet.Writer.ModuleWriterBase.Write(String fileName)
at dnlib.DotNet.ModuleDef.Write(String filename, ModuleWriterOptions options)
If the loader uses a ValueTypeSig I would expect the path to be properly handled by: https://github.com/wwh1004/dnlib/blob/master/src/DotNet/Pdb/Portable/LocalConstantSigBlobWriter.cs#L110
I´m using .NET 5.0 on my tests.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.