diff --git a/bruty_client/Cargo.toml b/bruty_client/Cargo.toml index c014696..dcba091 100644 --- a/bruty_client/Cargo.toml +++ b/bruty_client/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bruty_client" authors = ["skifli"] -version = "0.3.1" +version = "0.3.0" edition = "2021" [dependencies] diff --git a/bruty_client/src/client_threads.rs b/bruty_client/src/client_threads.rs index 4e3f800..6e097bb 100644 --- a/bruty_client/src/client_threads.rs +++ b/bruty_client/src/client_threads.rs @@ -4,11 +4,12 @@ use sonic_rs; struct IDCheckingStats { total_checked: u16, positives: Vec, - start_time: std::time::Instant, } pub async fn results_handler(client_channels: &bruty_share::types::ClientChannels) { let mut results_map: ahash::AHashMap, IDCheckingStats> = ahash::AHashMap::new(); + let mut completed_checks: u64 = 0; + let start_time = std::time::Instant::now(); loop { let video = client_channels.results_receiver.recv_async().await; @@ -26,7 +27,6 @@ pub async fn results_handler(client_channels: &bruty_share::types::ClientChannel let stats = results_map.entry(base_id).or_insert(IDCheckingStats { total_checked: 0, positives: Vec::new(), - start_time: std::time::Instant::now(), }); stats.total_checked += 1; @@ -36,16 +36,18 @@ pub async fn results_handler(client_channels: &bruty_share::types::ClientChannel } if stats.total_checked == 4096 { + completed_checks += 1; + let base_id_clone_clone = base_id_clone.clone(); let positives_len = stats.positives.len(); log::info!( - "Tested {} @{}/s ({} positive{})", + "Tested {} with {} hit{}, client @{}/s", base_id_clone.iter().collect::(), - stats.start_time.elapsed().as_secs() / 4096, positives_len, - if positives_len == 1 { "" } else { "s" } + if positives_len == 1 { "" } else { "s" }, + completed_checks as f64 * 4069.0 / start_time.elapsed().as_secs_f64(), ); client_channels @@ -191,6 +193,8 @@ pub async fn generate_all_ids(client_channels: &bruty_share::types::ClientChanne let base_id = base_id.unwrap(); - generate_ids(base_id, client_channels); + generate_ids(base_id.clone(), client_channels); + + log::info!("Generated IDs for {}", base_id.iter().collect::()); } } diff --git a/bruty_client/src/main.rs b/bruty_client/src/main.rs index 22b64d9..8125c2b 100644 --- a/bruty_client/src/main.rs +++ b/bruty_client/src/main.rs @@ -74,8 +74,8 @@ struct Args { #[arg( short = 'a', long = "advanced-generations", - help = "Number of IDs to be generated in advance", - default_value_t = 4 + help = "Number of IDs to be generated in advance (multiply by 64^2)", + default_value_t = 8 )] advanced_generations: u8, } diff --git a/bruty_client/src/payload_handlers.rs b/bruty_client/src/payload_handlers.rs index e6e862c..8c32c5d 100644 --- a/bruty_client/src/payload_handlers.rs +++ b/bruty_client/src/payload_handlers.rs @@ -25,7 +25,7 @@ pub async fn test_request_data( }; log::info!( - "Testing {}", + "Generating IDs for {}", test_request_data.id.iter().collect::() ); diff --git a/bruty_server/Cargo.toml b/bruty_server/Cargo.toml index d7e2b6c..c99c78c 100644 --- a/bruty_server/Cargo.toml +++ b/bruty_server/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bruty_server" authors = ["skifli"] -version = "0.3.1" +version = "0.3.0" edition = "2021" [dependencies]