|
@@ -746,6 +746,17 @@ func (s *Script) LoadScript(code, script_file string, newstate bool) string {
|
|
|
S.Push(lua.LString(base64Text))
|
|
|
return 1
|
|
|
}))
|
|
|
+ //base64解密
|
|
|
+ s.L.SetGlobal("decodeBase64", s.L.NewFunction(func(S *lua.LState) int {
|
|
|
+ text := S.ToString(-1)
|
|
|
+ result := ""
|
|
|
+ byteText, err := base64.StdEncoding.DecodeString(text)
|
|
|
+ if err == nil {
|
|
|
+ result = string(byteText)
|
|
|
+ }
|
|
|
+ S.Push(lua.LString(result))
|
|
|
+ return 1
|
|
|
+ }))
|
|
|
//长度
|
|
|
s.L.SetGlobal("stringLen", s.L.NewFunction(func(S *lua.LState) int {
|
|
|
text := S.ToString(-1)
|