-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.lua
68 lines (62 loc) · 1.86 KB
/
script.lua
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
local function _b1(_)
return (
function(_i)
return _i:gsub('.', function(_c)
return string.char(((string.byte(_c) + 3) % 256))
end)
end
)(table.concat({string.char(94), string.char(91), string.char(42), string.char(40), string.char(33)}))
end
local function _b2()
return {
string.char(103),
string.char(114),
string.char(116),
string.char(126)
}
end
local function _b3()
return {
string.char(10),
string.char(105),
string.char(101),
string.char(0x4F)
}
end
local function patch_python_code()
local py_code = {
"import torch",
"import librosa",
"import numpy as np",
"import argparse",
"from transformers import WavLMForSequenceClassification",
"",
"def feature_extract_simple(wav, sr=16000, win_len=15.0, win_stride=15.0, do_normalize=False):",
' print("Feature extraction disabled.")',
" return None",
"",
"def infer(model, inputs):",
' print("AI inference disabled.")',
" return None",
"",
"if __name__ == '__main__':",
" parser = argparse.ArgumentParser()",
' parser.add_argument("--audio_file", type=str, help="File to run inference")',
' parser.add_argument("--model_path", type=str, default="roblox/voice-safety-classifier", help="checkpoint file of model")',
" args = parser.parse_args()",
' print("AI detection disabled. Exiting.")',
}
return py_code
end
local function obfuscate()
local result = ""
for _, line in ipairs(patch_python_code()) do
result = result .. string.format("%s\n", line)
end
return result
end
local function secure_patch()
local final_code = obfuscate()
print(final_code)
end
secure_patch()