forked from BlackSnufkin/NovaLdr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.bat
33 lines (26 loc) · 841 Bytes
/
compile.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@echo off
setlocal EnableDelayedExpansion
:: Set the password length and the character set for each category
set "length=32"
set "upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ"
set "lower=abcdefghijklmnopqrstuvwxyz"
set "nums=0123456789"
set "symbols=!@#$%^&*()-_=+[{]}\|;:',<.>/?`~"
:: Combine all character sets
set "all=%upper%%lower%%nums%%symbols%"
:: Initialize an empty password
set "password="
:: Generate the random password
for /L %%i in (1, 1, %length%) do (
set /a "index=!random! %% 104"
for %%j in (!index!) do set "password=!password!!all:~%%j,1!"
)
:: Set the password as an environment variable
set "LITCRYPT_ENCRYPT_KEY=!password!"
:: Echo the generated password
echo Generated password: !password!
:: Execute the Rust program
cargo clean
cargo build --release
echo %date%-%time%
endlocal