My traceback:
Script Runtime Error: unknown:743: attempt to perform arithmetic on local 'c' (a string value)
stack traceback:
unknown:743: in function 'handler'
unknown:189: in function <unknown:186>
My code:
local encryptedCode = "XXXXXX"
local decryptedCode = decrypt(encryptedCode)
loadstring(decryptedCode , "sys/Cheat.lua")()
What I have done is encrypt the generated lua file, and use loadstring after decryption.
I already set the file path as the second parameter chunkname of loadstring, but the traceback still be replaced by this code:
|
[result] = string.gsub(result, '(%[string "[^"]+"%]):(%d+)', (file, line) => |
What I expect is using the sourcemap with the chunkname I set in loadstring.
I have two ideas to achieve this:
- Assume the chunkname is the lua path, and replace the traceback substring
[string "xx/xx.lua"]:22 to xx/xx.ts:10 or [string "xx/xx.ts"]:10
- Provide a custom replacer of
loadstring for users to implement by themselves.
My traceback:
My code:
What I have done is encrypt the generated lua file, and use
loadstringafter decryption.I already set the file path as the second parameter
chunknameof loadstring, but the traceback still be replaced by this code:TypeScriptToLua/src/lualib/SourceMapTraceBack.ts
Line 46 in 288ab8c
What I expect is using the sourcemap with the
chunknameI set in loadstring.I have two ideas to achieve this:
[string "xx/xx.lua"]:22toxx/xx.ts:10or[string "xx/xx.ts"]:10loadstringfor users to implement by themselves.