GithubHelp home page GithubHelp logo

CustomAttributes messed up about il-repack HOT 3 CLOSED

gluck avatar gluck commented on July 24, 2024
CustomAttributes messed up

from il-repack.

Comments (3)

gluck avatar gluck commented on July 24, 2024

When you say "merge with mscorlib" what do you mean/want to achieve?

from il-repack.

KenMacD avatar KenMacD commented on July 24, 2024

I'm looking to inject a static class into mscorlib.dll and then inject calls to that class in the standard calls. I'm doing this to better monitor malware that is packed. It does things like unpack it's strings and code, and it also detects debuggers and most attempts to unpack.

What I want to do is take a small assembly with that static class and the mscorlib.dll from \Microsoft.NET\assembly\GAC_32\mscorlib\v4....\mscorlib.dll and put them together. I have some code to do this myself but it's not very robust so I was looking for anything that has already solved the problem.

from il-repack.

gluck avatar gluck commented on July 24, 2024

This only occurs because you're merging mscorlib, which defines System.Int32 (etype == I4).
The base enum type then references the (newly created) merged type System.Int32 (etype == None).
When writing the assembly, having an enum overriding a custom value type isn't valid/supported.

I can't really tell if the behaviour should be changed for this use case, neither can I tell if things will work fine.

If you (still) want to pursue the use of ILRepack in this context, I suggest patching it so that you reuse the mscorlib AssemblyDefinition, and only import your extra stuff in it.
(ILRepack used to support this behavior, but it was 'hiding' too many issues, so I prefered merging all assemblies into a new empty one, instead of merging all others into the primary one)

PR welcome if you make that into an option (/reusePrimaryAssembly or something)

from il-repack.

Related Issues (20)

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.