imfriendly / gmod-filestealer-rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gluapack

sh0tx420 opened this issue · comments

all lua files that are gluapacked will have a return gluapack()() at the top of the file along with the rest of the code
im a total noob in rust but maybe you could write some sort of thing to remove that string while it's doing its thing?

You can do this yourself if you change the last bit of dump_file_impl to

    let string = String::from_utf8_lossy(buffer_slice)
        .into_owned()
        .replace("return gluapack()()", "");
        // .replace("return gluapack()()", "// return gluapack()()"); // You can also just replace with a commented out version

    f.write_all(string.as_bytes()).map_err(|e| e.to_string())?;
    f.write_all(b"\n\n").map_err(|e| e.to_string())?;

    Ok(())

You can do this yourself if you change the last bit of dump_file_impl to

    let string = String::from_utf8_lossy(buffer_slice)
        .into_owned()
        .replace("return gluapack()()", "");
        // .replace("return gluapack()()", "// return gluapack()()"); // You can also just replace with a commented out version

    f.write_all(string.as_bytes()).map_err(|e| e.to_string())?;
    f.write_all(b"\n\n").map_err(|e| e.to_string())?;

    Ok(())

that works, thanks