-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wsh: invalid lua syntax from mangled symbols #24
Comments
Hi sp3d, |
This happens even with a hello-world compiled with rustc:
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 |
Hi sp3d, |
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. |
Running wsh on binaries with non-alphanumeric symbols (e.g. the mangled ones produced by rustc) results in output like
which refers to this line in the generated lua:
It might be nice to support demangling, though that may complicate parsing (angle brackets, parentheses, and colons would be valid in symbol names); in any event it would be nice for these symbols to not prevent wsh from running.
The text was updated successfully, but these errors were encountered: