Giter Site home page Giter Site logo

Comments (4)

endrazine avatar endrazine commented on June 24, 2024

Hi sp3d,
Very cool finding ! May I ask you to share a minimal sample code to reproduce ? I'm unsure if demangling in rust follows the same rules as in cpp. If so, should be not too hard to fix :)

from wcc.

sp3d avatar sp3d commented on June 24, 2024

This happens even with a hello-world compiled with rustc:

fn main() {println!("Hello, world!")}

Rust symbol-mangling rules aren't stable or formally specified, but roughly coincide with C++ mangling. The implementation lives here: https://github.com/rust-lang/rust/blob/master/src/librustc_trans/back/symbol_names.rs

from wcc.

endrazine avatar endrazine commented on June 24, 2024

Hi sp3d,
Do you happen to know if I may demangle rust symbols using libiberty ?
Thanks and regards,
j-

from wcc.

sp3d avatar sp3d commented on June 24, 2024

Rust has an old "legacy" mangling scheme that mostly follows C++ rules, and a new scheme that works much better for the needs of Rust symbols. Both are supported by the rustc-demangle crate.

That said, it may be easiest for now to simply make wsh escape symbols somehow so that it doesn't rely on being able to demangle them. Binaries created by more arcane toolchains (e.g. malware) are likely to have unprintable and undemangleable symbol names, for example.

from wcc.

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.