sdk: Add additional brute force prefixes

This commit is contained in:
Lucas Schwiderski 2023-09-20 11:33:24 +02:00
parent 6449354714
commit 6ada4c1c43
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8

View file

@ -90,13 +90,14 @@ const LINE_FEED: u8 = 0x0A;
const UNDERSCORE: u8 = 0x5F; const UNDERSCORE: u8 = 0x5F;
const ZERO: u8 = 0x30; const ZERO: u8 = 0x30;
const PREFIXES: [&str; 29] = [ const PREFIXES: [&str; 36] = [
"", "",
"content/characters/", "content/characters/",
"content/debug/", "content/debug/",
"content/decals/", "content/decals/",
"content/environment/", "content/environment/",
"content/fx/", "content/fx/",
"content/fx/particles/",
"content/gizmos/", "content/gizmos/",
"content/items/", "content/items/",
"content/levels/", "content/levels/",
@ -112,14 +113,20 @@ const PREFIXES: [&str; 29] = [
"content/vo/", "content/vo/",
"content/volume_types/", "content/volume_types/",
"content/weapons/", "content/weapons/",
"content/",
"core/",
"core/units/",
"packages/boot_assets/", "packages/boot_assets/",
"packages/content/", "packages/content/",
"packages/game_scripts/", "packages/game_scripts/",
"packages/strings/", "packages/strings/",
"packages/ui/", "packages/ui/",
"packages/",
"wwise/events/", "wwise/events/",
"wwise/packages/", "wwise/packages/",
"wwise/world_sound_fx/", "wwise/world_sound_fx/",
"wwise/events/weapons/",
"wwise/events/minions/",
]; ];
fn make_info_printer(rx: Receiver<(usize, usize, String)>, hash_count: usize) -> JoinHandle<()> { fn make_info_printer(rx: Receiver<(usize, usize, String)>, hash_count: usize) -> JoinHandle<()> {
@ -153,7 +160,7 @@ fn make_info_printer(rx: Receiver<(usize, usize, String)>, hash_count: usize) ->
fn make_stdout_printer(rx: Receiver<Vec<u8>>) -> JoinHandle<()> { fn make_stdout_printer(rx: Receiver<Vec<u8>>) -> JoinHandle<()> {
std::thread::spawn(move || { std::thread::spawn(move || {
let mut writer = BufWriter::new(std::io::stdout()); let mut writer = std::io::stdout();
while let Ok(buf) = rx.recv() { while let Ok(buf) = rx.recv() {
writer.write_all(&buf).unwrap(); writer.write_all(&buf).unwrap();
@ -260,7 +267,7 @@ fn make_worker(rx: Receiver<Vec<usize>>, state: State) -> JoinHandle<()> {
// when we're about to print here. // when we're about to print here.
// So we strip that, to show just the generated part. // So we strip that, to show just the generated part.
// We also restrict the length to stay on a single line. // We also restrict the length to stay on a single line.
let prefix_len = PREFIXES[28].len(); let prefix_len = PREFIXES[35].len();
// No need to wait for this // No need to wait for this
let _ = state.info_tx.try_send(( let _ = state.info_tx.try_send((
count, count,