mirror of
https://github.com/darlinghq/LibrarySymbols.git
synced 2024-11-23 04:59:47 +00:00
Check for "System/iOSSupport" Path
This commit is contained in:
parent
069445fbd8
commit
01c7d7965f
22
src/main.rs
22
src/main.rs
@ -6,6 +6,14 @@ mod symbols;
|
||||
|
||||
use std::path::Path;
|
||||
|
||||
fn analyse_system_path<P: AsRef<Path>>(path: &P, results_location: &location::ResultsLocation, whoami_username: &program::WhoAmIUserName, unique_folder :Option<&str>) {
|
||||
let parse_filesystem_symbols_list = symbols::ParseBaseFilesystem::new(path);
|
||||
for parse_filesystem_symbols in parse_filesystem_symbols_list {
|
||||
|
||||
parse_filesystem_symbols.traverse(&results_location.shared_cache_path, unique_folder, path, &whoami_username);
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let arguments = argument::Arguments::new(std::env::args());
|
||||
let base_locations = location::BaseLocation::new(&arguments);
|
||||
@ -19,20 +27,18 @@ fn main() {
|
||||
let dyld_shared_cache_extractor = program::DyldSharedCacheExtractor::new(&base_locations, &results_location);
|
||||
|
||||
for path in dyld_shared_cache_extractor.extracted_paths.iter() {
|
||||
let parse_filesystem_symbols = symbols::ParseBaseFilesystem::new(path);
|
||||
let shared_cache_folder = path.file_name().expect("Unable to obtain shared cache folder name").to_str();
|
||||
parse_filesystem_symbols.traverse(&results_location.shared_cache_path, shared_cache_folder, path, &whoami_username);
|
||||
let shared_cache_folder = path.as_path().file_name().expect("Unable to obtain shared cache folder name").to_str();
|
||||
analyse_system_path(path,&results_location,&whoami_username,shared_cache_folder);
|
||||
}
|
||||
|
||||
clean::Cleanup::remove_temp(&results_location);
|
||||
|
||||
{
|
||||
let path = Path::new(arguments.base_path.as_str());
|
||||
let parse_filesystem_symbols = symbols::ParseBaseFilesystem::new(path);
|
||||
parse_filesystem_symbols.traverse(&results_location.unique_version_path, Some("standard"), path, &whoami_username);
|
||||
let unique_folder = Some("standard");
|
||||
analyse_system_path(&path,&results_location,&whoami_username,unique_folder);
|
||||
clean::Cleanup::remove_temp(&results_location);
|
||||
}
|
||||
|
||||
clean::Cleanup::remove_temp(&results_location);
|
||||
|
||||
|
||||
println!{"{:#?}",arguments}
|
||||
println!{"{:#?}",system_version}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use std::{process::{Command, Output}, fs::{read_dir, ReadDir, File}, path::{Path, PathBuf}, io::Read, fmt::format};
|
||||
use std::{process::{Command, Output}, fs::{read_dir, ReadDir, File}, path::{Path, PathBuf}, io::Read};
|
||||
|
||||
use crate::location::{BaseLocation, ResultsLocation};
|
||||
|
||||
|
@ -5,6 +5,7 @@ use crate::{location, program};
|
||||
const SYSTEM_LIBRARY_FRAMEWORK_PATH: &str = "System/Library/Frameworks";
|
||||
const SYSTEM_LIBRARY_PRIVATEFRAMEWORK_PATH: &str = "System/Library/PrivateFrameworks";
|
||||
const USR_LIB_PATH: &str = "usr/lib";
|
||||
const SYSTEM_IOSSUPPORT: &str = "System/iOSSupport";
|
||||
|
||||
const MACHO_32BIT_MH_MAGIC: u32 = 0xfeedface;
|
||||
const MACHO_32BIT_MH_CIGAM: u32 = 0xcefaedfe;
|
||||
@ -53,11 +54,24 @@ const NM_TEXTFILE_NAME: &str = "nm.txt";
|
||||
const OTOOL_TEXTFILE_NAME: &str = "otool.txt";
|
||||
|
||||
impl ParseBaseFilesystem {
|
||||
pub fn new<P: AsRef<Path>>(location: P) -> ParseBaseFilesystem {
|
||||
pub fn new<P: AsRef<Path>>(location: &P) -> Vec<ParseBaseFilesystem> {
|
||||
let mut base_filesystems: Vec<ParseBaseFilesystem> = Vec::new();
|
||||
base_filesystems.push(ParseBaseFilesystem::build_parse_base_filesystem(location));
|
||||
|
||||
let iossupport_path = location.as_ref().join(SYSTEM_IOSSUPPORT);
|
||||
if iossupport_path.is_dir() {
|
||||
println!("Found iOSSupport Directory");
|
||||
base_filesystems.push(ParseBaseFilesystem::build_parse_base_filesystem(iossupport_path));
|
||||
}
|
||||
|
||||
base_filesystems
|
||||
}
|
||||
|
||||
fn build_parse_base_filesystem<P: AsRef<Path>>(location: P) -> ParseBaseFilesystem {
|
||||
let framework_path = location.as_ref().join(SYSTEM_LIBRARY_FRAMEWORK_PATH);
|
||||
let privateframework_path = location.as_ref().join(SYSTEM_LIBRARY_PRIVATEFRAMEWORK_PATH);
|
||||
let usr_lib_path = location.as_ref().join(USR_LIB_PATH);
|
||||
|
||||
|
||||
ParseBaseFilesystem {
|
||||
framework_path,
|
||||
privateframework_path,
|
||||
|
Loading…
Reference in New Issue
Block a user