Skip to content
Snippets Groups Projects
Commit 6b7ea187 authored by 最萌小汐's avatar 最萌小汐
Browse files

support debugger attack on Linux

parent 9e7944e1
No related branches found
No related tags found
No related merge requests found
...@@ -5,10 +5,11 @@ end ...@@ -5,10 +5,11 @@ end
local fs = require 'bee.filesystem' local fs = require 'bee.filesystem'
local luaDebugs = {} local luaDebugs = {}
for _, vscodePath in ipairs {'.vscode', '.vscode-insiders'} do for _, vscodePath in ipairs {'.vscode', '.vscode-insiders', '.vscode-server-insiders'} do
local extensionPath = fs.path(os.getenv 'USERPROFILE' or '') / vscodePath / 'extensions' local extensionPath = fs.path(os.getenv 'USERPROFILE' or os.getenv 'HOME') / vscodePath / 'extensions'
log.debug('Search extensions at:', extensionPath:string()) log.debug('Search extensions at:', extensionPath:string())
if fs.exists(extensionPath) then
for path in extensionPath:list_directory() do for path in extensionPath:list_directory() do
if fs.is_directory(path) then if fs.is_directory(path) then
local name = path:filename():string() local name = path:filename():string()
...@@ -18,6 +19,7 @@ for _, vscodePath in ipairs {'.vscode', '.vscode-insiders'} do ...@@ -18,6 +19,7 @@ for _, vscodePath in ipairs {'.vscode', '.vscode-insiders'} do
end end
end end
end end
end
if #luaDebugs == 0 then if #luaDebugs == 0 then
log.debug('Cant find "actboy168.lua-debug"') log.debug('Cant find "actboy168.lua-debug"')
...@@ -37,7 +39,7 @@ table.sort(luaDebugs, function (a, b) ...@@ -37,7 +39,7 @@ table.sort(luaDebugs, function (a, b)
end) end)
local debugPath = luaDebugs[1] local debugPath = luaDebugs[1]
local cpath = "/runtime/win64/lua54/?.dll" local cpath = "/runtime/win64/lua54/?.dll;/runtime/win64/lua54/?.so"
local path = "/script/?.lua" local path = "/script/?.lua"
local function tryDebugger() local function tryDebugger()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment