Giter VIP home page Giter VIP logo

Comments (6)

RazrFalcon avatar RazrFalcon commented on July 3, 2024

I'm not sure I have time to do this. Especially to support it later. But if you like, you can simply copy-paste the current code to your library and I will happily switch to it, as long is it doesn't have many dependencies (proc-macros in particular).

from cargo-bloat.

Shnatsel avatar Shnatsel commented on July 3, 2024

Great! I will have to audit and support some code anyway, so I don't mind doing the work. I'll let you know once I have something usable.

from cargo-bloat.

Shnatsel avatar Shnatsel commented on July 3, 2024

I've split the parsers into a shared library https://github.com/Shnatsel/binfarce, made the ELF parsers more general and hardened them against untrusted input so that they don't over-allocate or panic.

The changes this entails for cargo-bloat can be seen here: https://github.com/RazrFalcon/cargo-bloat/compare/master...Shnatsel:shared-library?expand=1 (although it still has a bit of file format detection code, I'm going to drop that too)

I'm open to feedback. If you don't have any objections, I'll give the Mach-o and PE parsers a similar treatment and open a pull request against cargo-bloat. I'm happy to add you as an owner on the git repo and on crates.io.

from cargo-bloat.

RazrFalcon avatar RazrFalcon commented on July 3, 2024

Yes, looking good.

from cargo-bloat.

Shnatsel avatar Shnatsel commented on July 3, 2024

Mach-O is now converted too. I know section extraction works, but I couldn't test the full cargo-bloat workflow because I don't have a mac.

from cargo-bloat.

Shnatsel avatar Shnatsel commented on July 3, 2024

The code looks pretty much complete to me now. I'll publish on crates.io and send a PR to cargo-bloat soon-ish.

I've refactored all 4 parsers, switched section extraction from allocations to iterators and callbacks, and fuzzed all 4 parsers. Removing allocations didn't affect the APIs used by cargo-bloat at all (symbol extraction still allocates).

from cargo-bloat.

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.