Strategies for finding binary dependencies
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add symbol printing draft

+232
+1
.gitignore
··· 1 + /target
+193
Cargo.lock
··· 1 + # This file is automatically @generated by Cargo. 2 + # It is not intended for manual editing. 3 + version = 4 4 + 5 + [[package]] 6 + name = "anstream" 7 + version = "0.6.21" 8 + source = "registry+https://github.com/rust-lang/crates.io-index" 9 + checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" 10 + dependencies = [ 11 + "anstyle", 12 + "anstyle-parse", 13 + "anstyle-query", 14 + "anstyle-wincon", 15 + "colorchoice", 16 + "is_terminal_polyfill", 17 + "utf8parse", 18 + ] 19 + 20 + [[package]] 21 + name = "anstyle" 22 + version = "1.0.13" 23 + source = "registry+https://github.com/rust-lang/crates.io-index" 24 + checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" 25 + 26 + [[package]] 27 + name = "anstyle-parse" 28 + version = "0.2.7" 29 + source = "registry+https://github.com/rust-lang/crates.io-index" 30 + checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" 31 + dependencies = [ 32 + "utf8parse", 33 + ] 34 + 35 + [[package]] 36 + name = "anstyle-query" 37 + version = "1.1.5" 38 + source = "registry+https://github.com/rust-lang/crates.io-index" 39 + checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" 40 + dependencies = [ 41 + "windows-sys", 42 + ] 43 + 44 + [[package]] 45 + name = "anstyle-wincon" 46 + version = "3.0.11" 47 + source = "registry+https://github.com/rust-lang/crates.io-index" 48 + checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" 49 + dependencies = [ 50 + "anstyle", 51 + "once_cell_polyfill", 52 + "windows-sys", 53 + ] 54 + 55 + [[package]] 56 + name = "bindep" 57 + version = "0.1.0" 58 + dependencies = [ 59 + "clap", 60 + "glob", 61 + ] 62 + 63 + [[package]] 64 + name = "clap" 65 + version = "4.5.53" 66 + source = "registry+https://github.com/rust-lang/crates.io-index" 67 + checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" 68 + dependencies = [ 69 + "clap_builder", 70 + "clap_derive", 71 + ] 72 + 73 + [[package]] 74 + name = "clap_builder" 75 + version = "4.5.53" 76 + source = "registry+https://github.com/rust-lang/crates.io-index" 77 + checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" 78 + dependencies = [ 79 + "anstream", 80 + "anstyle", 81 + "clap_lex", 82 + "strsim", 83 + ] 84 + 85 + [[package]] 86 + name = "clap_derive" 87 + version = "4.5.49" 88 + source = "registry+https://github.com/rust-lang/crates.io-index" 89 + checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" 90 + dependencies = [ 91 + "heck", 92 + "proc-macro2", 93 + "quote", 94 + "syn", 95 + ] 96 + 97 + [[package]] 98 + name = "clap_lex" 99 + version = "0.7.6" 100 + source = "registry+https://github.com/rust-lang/crates.io-index" 101 + checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" 102 + 103 + [[package]] 104 + name = "colorchoice" 105 + version = "1.0.4" 106 + source = "registry+https://github.com/rust-lang/crates.io-index" 107 + checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" 108 + 109 + [[package]] 110 + name = "glob" 111 + version = "0.3.3" 112 + source = "registry+https://github.com/rust-lang/crates.io-index" 113 + checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" 114 + 115 + [[package]] 116 + name = "heck" 117 + version = "0.5.0" 118 + source = "registry+https://github.com/rust-lang/crates.io-index" 119 + checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 120 + 121 + [[package]] 122 + name = "is_terminal_polyfill" 123 + version = "1.70.2" 124 + source = "registry+https://github.com/rust-lang/crates.io-index" 125 + checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" 126 + 127 + [[package]] 128 + name = "once_cell_polyfill" 129 + version = "1.70.2" 130 + source = "registry+https://github.com/rust-lang/crates.io-index" 131 + checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" 132 + 133 + [[package]] 134 + name = "proc-macro2" 135 + version = "1.0.104" 136 + source = "registry+https://github.com/rust-lang/crates.io-index" 137 + checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0" 138 + dependencies = [ 139 + "unicode-ident", 140 + ] 141 + 142 + [[package]] 143 + name = "quote" 144 + version = "1.0.42" 145 + source = "registry+https://github.com/rust-lang/crates.io-index" 146 + checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" 147 + dependencies = [ 148 + "proc-macro2", 149 + ] 150 + 151 + [[package]] 152 + name = "strsim" 153 + version = "0.11.1" 154 + source = "registry+https://github.com/rust-lang/crates.io-index" 155 + checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 156 + 157 + [[package]] 158 + name = "syn" 159 + version = "2.0.112" 160 + source = "registry+https://github.com/rust-lang/crates.io-index" 161 + checksum = "21f182278bf2d2bcb3c88b1b08a37df029d71ce3d3ae26168e3c653b213b99d4" 162 + dependencies = [ 163 + "proc-macro2", 164 + "quote", 165 + "unicode-ident", 166 + ] 167 + 168 + [[package]] 169 + name = "unicode-ident" 170 + version = "1.0.22" 171 + source = "registry+https://github.com/rust-lang/crates.io-index" 172 + checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" 173 + 174 + [[package]] 175 + name = "utf8parse" 176 + version = "0.2.2" 177 + source = "registry+https://github.com/rust-lang/crates.io-index" 178 + checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 179 + 180 + [[package]] 181 + name = "windows-link" 182 + version = "0.2.1" 183 + source = "registry+https://github.com/rust-lang/crates.io-index" 184 + checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 185 + 186 + [[package]] 187 + name = "windows-sys" 188 + version = "0.61.2" 189 + source = "registry+https://github.com/rust-lang/crates.io-index" 190 + checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" 191 + dependencies = [ 192 + "windows-link", 193 + ]
+10
Cargo.toml
··· 1 + [package] 2 + name = "bindep" 3 + description = "Binary dependency identification tools" 4 + authors = ["Vlad-Stefan Harbuz <vlad@vlad.website>"] 5 + version = "0.1.0" 6 + edition = "2024" 7 + 8 + [dependencies] 9 + clap = { version = "4.5.53", features = ["derive"] } 10 + glob = "0.3.3"
+28
src/bin/print_symbols.rs
··· 1 + use std::ffi::OsString; 2 + use std::path::Path; 3 + 4 + use clap::Parser; 5 + use glob::glob; 6 + 7 + /// Print symbols for all ELF files in a directory 8 + #[derive(Parser, Debug)] 9 + #[command(version, about, long_about = None)] 10 + struct Args { 11 + /// Target directory 12 + #[arg(short, long)] 13 + dir: String, 14 + } 15 + 16 + fn main() { 17 + let args = Args::parse(); 18 + 19 + let dir_path = OsString::from(args.dir); 20 + let dir = Path::new(&dir_path); 21 + let glob_target_path = dir.join("**").join("*.so"); 22 + let glob_target = glob_target_path.to_str().expect("could not convert path to string"); 23 + let glob_res = glob(glob_target).expect("failed to read glob pattern"); 24 + 25 + for filename in glob_res.map_while(Result::ok) { 26 + println!("{:?}", filename); 27 + } 28 + }