Giter VIP home page Giter VIP logo

cargo-disasm's People

Contributors

dependabot[bot] avatar expixel avatar

Stargazers

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

Watchers

 avatar  avatar

cargo-disasm's Issues

Initial Features

Features I Want To Finish First

  • Showing source code alongside disassembly

Windows

  • PE/COFF file disassembly and symbol discovery
  • use PDB for symbol discovery (MSVC toolchain)
  • use DWARF for symbol discovery (GNU)

MacOS

  • Mach file disassembly and symbol discovery
  • use dSYM (DWARF) for symbol discovery

Linux

  • ELF file disassembly and symbol discovery
  • use DWARF for symbol discovery

Line Information

  • use DWARF for line information
  • use PDB for line information

Postponed

  • Syntax highlighting for disassembly (good for higher level source code, unecessary for assembly)
  • Optional arrows for displaying jump sources and targets (too noisy)

Find libc symbols in symbol discovery

At the moment if you run cargo disasm copy_nonoverlapping, this is the output:

core::intrinsics::copy_nonoverlapping:
  cc6e0    sub   rsp, 0x28                      
  cc6e4    mov   qword ptr [rsp + 0x10], rdi    
  cc6e9    mov   qword ptr [rsp + 0x18], rsi    
  cc6ee    mov   qword ptr [rsp + 0x20], rdx  
  cc6f3    shl   rdx, 4                         
  cc6f7    mov   qword ptr [rsp + 8], rdi       
  cc6fc    mov   rdi, rsi                       
  cc6ff    mov   rsi, qword ptr [rsp + 8]       
  cc704    call  0xba150                        ; Not symbolicated
  cc709    add   rsp, 0x28                      
  cc70d    ret

For some reason the symbol for memcpy isn't being found using the current symbol discovery methods. I think it might
have something to do with this:

// FIXME handle symbols with a size of 0 (usually external symbols).
if sym.st_size == 0 {
continue;
}

But I'm not sure.

Error on cargo install cargo-disasm

Running cargo install cargo-disasm on my machine (Windows 10 64bit x86) results on the following errors:


   Compiling cargo-disasm v0.5.0
error[E0432]: unresolved import `clap::Clap`
 --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:1:5
  |
1 | use clap::Clap;
  |     ^^^^^^^^^^ no `Clap` in the root

error[E0432]: unresolved import `clap::Clap`
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\mod.rs:11:5
   |
11 | use clap::Clap as _;
   |     ^^^^^^^^^^^^^^^ no `Clap` in the root

error: cannot determine resolution for the derive macro `Clap`
 --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:5:10
  |
5 | #[derive(Clap)]
  |          ^^^^
  |
  = note: import resolution is stuck, try simplifying macro imports

error: cannot find attribute `clap` in this scope
 --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:6:3
  |
6 | #[clap(name = "cargo-disasm", version = env!("CARGO_PKG_VERSION"), author = "Marc C.")]
  |   ^^^^
  |
  = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:22:7
   |
22 |     #[clap(
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:31:7
   |
31 |     #[clap(long = "manifest-path")]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:36:7
   |
36 |     #[clap(short = 'p', long = "package")]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:41:7
   |
41 |     #[clap(short = 't', long = "target")]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:45:7
   |
45 |     #[clap(long = "release")]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:50:7
   |
50 |     #[clap(short, long, parse(from_occurrences))]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:54:7
   |
54 |     #[clap(short, long)]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:58:7
   |
58 |     #[clap(long = "color", default_value = "auto", parse(try_from_str = parse_colorchoice))]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:62:7
   |
62 |     #[clap(short = 'S', long = "show-source")]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error: cannot find attribute `clap` in this scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:66:7
   |
66 |     #[clap(short = 'B', long = "show-bytes")]
   |       ^^^^
   |
   = note: `clap` is in scope, but it is a crate, not an attribute

error[E0599]: no function or associated item named `parse_from` found for struct `Opts` in the current scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\mod.rs:24:19
   |
24 |             Opts::parse_from(args)
   |                   ^^^^^^^^^^ function or associated item not found in `Opts`
   |
  ::: D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:7:1
   |
7  | pub struct Opts {
   | --------------- function or associated item `parse_from` not found for this
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `parse_from`, perhaps you need to implement it:
           candidate #1: `Parser`

error[E0599]: no function or associated item named `parse_from` found for struct `Opts` in the current scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\mod.rs:26:19
   |
26 |             Opts::parse_from(args)
   |                   ^^^^^^^^^^ function or associated item not found in `Opts`
   |
  ::: D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:7:1
   |
7  | pub struct Opts {
   | --------------- function or associated item `parse_from` not found for this
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `parse_from`, perhaps you need to implement it:
           candidate #1: `Parser`

error[E0599]: no function or associated item named `parse` found for struct `Opts` in the current scope
  --> D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\mod.rs:29:15
   |
29 |         Opts::parse()
   |               ^^^^^ function or associated item not found in `Opts`
   |
  ::: D:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-disasm-0.5.0\src\app\cli.rs:7:1
   |
7  | pub struct Opts {
   | --------------- function or associated item `parse` not found for this
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following traits define an item `parse`, perhaps you need to implement one of them:
           candidate #1: `Parser`
           candidate #2: `pest::parser::Parser`
           candidate #3: `Parse`

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: failed to compile `cargo-disasm v0.5.0`, intermediate artifacts can be found at `C:\Users\Nick\AppData\Local\Temp\cargo-installMWJtNM`

Caused by:
  could not compile `cargo-disasm` due to 17 previous errors

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.