Giter Site home page Giter Site logo

dnlib's Introduction

🎉Hello🎉

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.

wwh1004's github stats

dnlib's People

Contributors

alanliu90 avatar alexrp avatar batzen avatar createandinject avatar dyarkovoy avatar echalone avatar elektrokill avatar holly-hacker avatar kiootic avatar mkaring avatar slowlogicboy avatar twsl avatar wtfsck avatar wwh1004 avatar y4er avatar yck1509 avatar yyjdelete avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tonyredondo

dnlib's Issues

Error in LocalConstantSigBlobWriter from wrong TypeSig

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)

From here: https://github.com/wwh1004/dnlib/blob/master/src/DotNet/Pdb/Portable/LocalConstantSigBlobWriter.cs#L150

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.