From 8d3fbf1a99bb236eed72da01ea4e3d2dc5b3ff0a Mon Sep 17 00:00:00 2001 From: lveyou <1339484752@qq.com> Date: Tue, 2 Jun 2026 16:06:23 +0800 Subject: [PATCH] =?UTF-8?q?*=20=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dl/script/dl_lua_register.cpp | 7 ++++++- project/dl_console/res/加密(AES-256).lua | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dl/script/dl_lua_register.cpp b/dl/script/dl_lua_register.cpp index 66631969..28f5067f 100644 --- a/dl/script/dl_lua_register.cpp +++ b/dl/script/dl_lua_register.cpp @@ -151,7 +151,12 @@ namespace dl .addFunction("print", lua_print) .addFunction("print_ex", lua_print_ex) .addFunction("delete", lua_delete) - .addFunction("to_string", lua_to_string); + .addFunction("to_string", lua_to_string) + .addFunction("to_string_hex", + +[](BufferView buf) { return to_string_hex(buf); }, + +[](BufferView buf, bool upper) { return to_string_hex(buf, upper); }, + +[](BufferView buf, bool upper, bool add_tag) { return to_string_hex(buf, upper, add_tag); } + ); luabridge::getGlobalNamespace(L) diff --git a/project/dl_console/res/加密(AES-256).lua b/project/dl_console/res/加密(AES-256).lua index 32601b25..e598e710 100644 --- a/project/dl_console/res/加密(AES-256).lua +++ b/project/dl_console/res/加密(AES-256).lua @@ -8,8 +8,8 @@ local path_key = path_src .. "key.json" if File.IsExist(path_key) then local key = Crypto.GenerateKeyAes256() local j = {} - j["key"] = to_string(key._key) - j["iv"] = to_string(key._iv) + j["key"] = to_string_hex(key._key) + j["iv"] = to_string_hex(key._iv, true) j["tag"] = to_string(key._tag) -- test json