111
This commit is contained in:
@@ -6,6 +6,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -fpic")
|
||||
|
||||
# 添加编译选项,指定使用C++11标准
|
||||
add_definitions(-std=c++11)
|
||||
|
||||
|
||||
file(GLOB_RECURSE DIR_ASMJIT_LIB_SRCS
|
||||
"asmjit/core/*.c"
|
||||
"asmjit/core/*.cc"
|
||||
@@ -21,8 +25,9 @@ file(GLOB_RECURSE DIR_ASMJIT_LIB_SRCS
|
||||
"asmjit/x86/*.cxx"
|
||||
)
|
||||
|
||||
|
||||
#添加头文件目录
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include /home/asio/asio-1.28.0/include/ ${PROJECT_SOURCE_DIR}/src/ ${PROJECT_SOURCE_DIR}/src/sdk/)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/include/Squirrel ${PROJECT_SOURCE_DIR}/lib/mysql/include /home/asio/asio-1.28.0/include/ ${PROJECT_SOURCE_DIR}/src/ ${PROJECT_SOURCE_DIR}/src/sdk/ /home/openssl-3.3.0/include)
|
||||
add_compile_definitions(ASMJIT_STATIC)
|
||||
|
||||
# 添加库源文件
|
||||
@@ -43,11 +48,10 @@ ADD_LIBRARY(hook_aurora SHARED ${DIR_ASMJIT_LIB_SRCS} ${LIB_SOURCE})
|
||||
SET_TARGET_PROPERTIES(hook_aurora PROPERTIES OUTPUT_NAME "Aurora")
|
||||
|
||||
|
||||
|
||||
target_link_libraries(hook_aurora libstdc++.a -L/home/dnf_project/dnf_project/build/lib/squirrel -lsqstdlib_static -L/home/dnf_project/dnf_project/build/lib/squirrel -lsquirrel_static -L/home/dnf_project/dnf_project/build/lib/mysql/lib libmysqlclient.a -lpthread)
|
||||
target_link_libraries(hook_aurora libstdc++.a -L/home/dnf_project/dnf_project/build/lib/squirrel -lsqstdlib_static -L/home/dnf_project/dnf_project/build/lib/squirrel -lsquirrel_static -L/home/dnf_project/dnf_project/build/lib/mysql/lib libmysqlclient.a -lpthread)
|
||||
# 指定动态库版本, 视需求而定,可不加
|
||||
# VERSION:动态库版本,SOVERSION:API版本
|
||||
#SET_TARGET_PROPERTIES(hook_aurora PROPERTIES VERSION 0.1.1 SOVERSION 0)
|
||||
|
||||
# 指定库编译输出目录
|
||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
|
||||
SET(LIBRARY_OUTPUT_PATH /dp_s/lib)
|
||||
|
||||
25
src/Tool.cpp
25
src/Tool.cpp
@@ -85,6 +85,31 @@ void Tool::Logger(std::string L)
|
||||
#endif
|
||||
}
|
||||
|
||||
void Tool::Split(const std::string &src, std::vector<std::string> &dest, const std::string &separator)
|
||||
{
|
||||
std::string str = src;
|
||||
std::string substring;
|
||||
std::string::size_type start = 0, index;
|
||||
dest.clear();
|
||||
index = str.find_first_of(separator, start);
|
||||
do
|
||||
{
|
||||
if (index != std::string::npos)
|
||||
{
|
||||
substring = str.substr(start, index - start);
|
||||
dest.push_back(substring);
|
||||
start = index + separator.size();
|
||||
index = str.find(separator, start);
|
||||
if (start == std::string::npos)
|
||||
break;
|
||||
}
|
||||
} while (index != std::string::npos);
|
||||
|
||||
// the last part
|
||||
substring = str.substr(start);
|
||||
dest.push_back(substring);
|
||||
}
|
||||
|
||||
long long Tool::get_cur_time()
|
||||
{
|
||||
// 获取操作系统当前时间点(精确到微秒)
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
//
|
||||
// See asmjit.h or LICENSE.md for license and copyright information
|
||||
// SPDX-License-Identifier: Zlib
|
||||
#ifndef defined SIZE_MAX
|
||||
#define SIZE_MAX (4294967295U)
|
||||
#endif
|
||||
#ifndef ASMJIT_ARM_A64ARCHTRAITS_P_H_INCLUDED
|
||||
#define ASMJIT_ARM_A64ARCHTRAITS_P_H_INCLUDED
|
||||
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
//
|
||||
// See asmjit.h or LICENSE.md for license and copyright information
|
||||
// SPDX-License-Identifier: Zlib
|
||||
#ifndef defined SIZE_MAX
|
||||
#define SIZE_MAX (4294967295U)
|
||||
#endif
|
||||
#ifndef ASMJIT_ARM_ARMCOMPILER_H_INCLUDED
|
||||
#define ASMJIT_ARM_ARMCOMPILER_H_INCLUDED
|
||||
|
||||
|
||||
@@ -24,16 +24,16 @@ void Controller::init()
|
||||
{
|
||||
CMem::WriteUChar((void *)(base::GlobalData::Init_fix_1 - 0x1), 0);
|
||||
//.text:085BDE9D 83 F8 0A cmp eax, 10
|
||||
CMem::WriteUChar((void *)(base::CParty::addDungeonClear_fix_1 + 2), 0x7E); // 普通被击
|
||||
CMem::WriteUChar((void *)(base::CParty::addDungeonClear_fix_1 + 2), 0x7E); // 普通被击
|
||||
//.text:085BDF30 83 F8 1E cmp eax, 30
|
||||
CMem::WriteUChar((void *)(base::CParty::addDungeonClear_fix_2 + 2), 0x7E); // 远古被击
|
||||
CMem::WriteUChar((void *)(base::CParty::addDungeonClear_fix_2 + 2), 0x7E); // 远古被击
|
||||
//.text:085BDFC3 83 F8 32 cmp eax, 50
|
||||
CMem::WriteUChar((void *)(base::CParty::addDungeonClear_fix_3 + 2), 0x7E); // 异界被击
|
||||
CMem::WriteUChar((void *)(base::CParty::addDungeonClear_fix_3 + 2), 0x7E); // 异界被击
|
||||
CMem::WriteUChar((void *)(0x081C025F + 1), 0x0B);
|
||||
CMem::WriteUChar((void *)(0x081C029E + 1), 0x0B);
|
||||
|
||||
/* 修正使用代币增加积分
|
||||
地址 长度 原始字节 已修补字节
|
||||
/* 修正使用代币增加积分
|
||||
地址 长度 原始字节 已修补字节
|
||||
08179043 0x1 97 B8
|
||||
0817904E 0x1 8C AD
|
||||
*/
|
||||
@@ -57,7 +57,7 @@ void Controller::init()
|
||||
CMem::HookJmp(base::importCashShopItemList_hook_begin, (int)new_importCashShopItemList_addr);
|
||||
|
||||
/************************************************************************/
|
||||
/* HOOK 商城购买物品成功处理 */
|
||||
/* HOOK 商城购买物品成功处理 */
|
||||
/************************************************************************/
|
||||
// mov dword ptr [ebp-0FCh], 0FFFFFFFFh
|
||||
|
||||
@@ -144,7 +144,7 @@ int Controller::hook_UseJewel_dispatch_sig(void *pDispatcher_UseJewel, CUser *us
|
||||
{
|
||||
ENUM_PACK_RET_TYPE ret = CDispatch::Get()->UseJewel_dispatch_sig(pDispatcher_UseJewel, user, pBuf);
|
||||
int result = (ret == PAK_ERROR) ? 1 : 0;
|
||||
// 08217C06 分解
|
||||
// 08217C06 分解
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -215,12 +215,12 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher *a1, CUser *us
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// 区域移动
|
||||
// 区域移动
|
||||
else if (packet_id == 38)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(SqMtx);
|
||||
SQBool R;
|
||||
// 执行虚拟机Main函数
|
||||
// 执行虚拟机Main函数
|
||||
SQInteger top = sq_gettop(v); // saves the stack size before the call
|
||||
sq_pushroottable(v); // pushes the global table
|
||||
sq_pushstring(v, _SC("Cb_move_area"), -1);
|
||||
@@ -237,13 +237,13 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher *a1, CUser *us
|
||||
if (!R)
|
||||
return 0;
|
||||
}
|
||||
// 普通输入
|
||||
// 普通输入
|
||||
else if (packet_id == 17)
|
||||
{
|
||||
std::string str = Utils::PackToHexString((const unsigned char *)packet_src, 20);
|
||||
std::lock_guard<std::recursive_mutex> lock(SqMtx);
|
||||
SQBool R;
|
||||
// 执行虚拟机Main函数
|
||||
// 执行虚拟机Main函数
|
||||
SQInteger top = sq_gettop(v); // saves the stack size before the call
|
||||
sq_pushroottable(v); // pushes the global table
|
||||
sq_pushstring(v, _SC("Cb_base_input"), -1);
|
||||
@@ -259,14 +259,14 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher *a1, CUser *us
|
||||
if (!R)
|
||||
return 0;
|
||||
}
|
||||
// GM输入
|
||||
// GM输入
|
||||
else if (packet_id == 179)
|
||||
{
|
||||
// std::cout << "传入的: " << std::hex << (int)user << std::endl;
|
||||
// std::cout << "传入的: " << std::hex << (int)user << std::endl;
|
||||
std::string str = Utils::PackToHexString((const unsigned char *)packet_src, 13);
|
||||
str = str.substr(2);
|
||||
std::lock_guard<std::recursive_mutex> lock(SqMtx);
|
||||
// 执行虚拟机Main函数
|
||||
// 执行虚拟机Main函数
|
||||
SQInteger top = sq_gettop(v); // saves the stack size before the call
|
||||
sq_pushroottable(v); // pushes the global table
|
||||
sq_pushstring(v, _SC("Cb_gm_input"), -1);
|
||||
@@ -279,11 +279,11 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher *a1, CUser *us
|
||||
}
|
||||
sq_settop(v, top); // restores the original stack size
|
||||
}
|
||||
// 特殊道具使用
|
||||
else if (packet_id == 255)
|
||||
// 特殊道具使用
|
||||
else if (packet_id == 255)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(SqMtx);
|
||||
// 执行虚拟机Main函数
|
||||
// 执行虚拟机Main函数
|
||||
SQInteger top = sq_gettop(v); // saves the stack size before the call
|
||||
sq_pushroottable(v); // pushes the global table
|
||||
sq_pushstring(v, _SC("Cb_use_item_sp"), -1);
|
||||
@@ -296,12 +296,12 @@ int Controller::hook_PacketDispatcher_doDispatch(PacketDispatcher *a1, CUser *us
|
||||
}
|
||||
sq_settop(v, top); // restores the original stack size
|
||||
}
|
||||
// 自定义包
|
||||
// 自定义包
|
||||
else if (packet_id == 130)
|
||||
{
|
||||
std::string str = Utils::PackToHexString((const unsigned char *)packet_src, 13);
|
||||
std::lock_guard<std::recursive_mutex> lock(SqMtx);
|
||||
// 执行虚拟机Main函数
|
||||
// 执行虚拟机Main函数
|
||||
SQInteger top = sq_gettop(v); // saves the stack size before the call
|
||||
sq_pushroottable(v); // pushes the global table
|
||||
sq_pushstring(v, _SC("OnClientSocketMsg"), -1);
|
||||
@@ -326,7 +326,7 @@ int Controller::hook_LenDispatcher_New_Gmdebug_Command(void *Command, void *CUse
|
||||
msg = msg.substr(2);
|
||||
|
||||
std::lock_guard<std::recursive_mutex> lock(SqMtx);
|
||||
// 执行虚拟机Main函数
|
||||
// 执行虚拟机Main函数
|
||||
SQInteger top = sq_gettop(v); // saves the stack size before the call
|
||||
sq_pushroottable(v); // pushes the global table
|
||||
sq_pushstring(v, _SC("Cb_gm_input"), -1);
|
||||
|
||||
132
src/df_main.cpp
132
src/df_main.cpp
@@ -40,7 +40,7 @@ SUBHOOK_INIT(AddItem, 0x0867B6D4);
|
||||
SUBHOOK_INIT(InterSelectMobileAuthReward, 0x0816132A);
|
||||
SUBHOOK_INIT(CreateSkill, 0x084024E6);
|
||||
SUBHOOK_INIT(CreateEquip, 0x084023AC);
|
||||
|
||||
SUBHOOK_INIT(History_Log, 0x854F990);
|
||||
|
||||
//_setCharacInfoDetail
|
||||
|
||||
@@ -415,27 +415,27 @@ int _GetPvPTeamCount(void *pDataManager)
|
||||
return *((unsigned int *)pDataManager + 11540);
|
||||
}
|
||||
|
||||
void *_set_add_info(void *pInven_Item, int a2)
|
||||
{
|
||||
if ((unsigned int)__builtin_return_address(0) == 0x0820156C)
|
||||
{
|
||||
char *_esp = NULL;
|
||||
__asm__ __volatile__("movl %%esp, %[a1];" : [a1] "=m"(_esp));
|
||||
if (_esp)
|
||||
{
|
||||
for (int i = 0; i < 200; i++)
|
||||
{
|
||||
if (897 == *((unsigned int *)&_esp[i]))
|
||||
{
|
||||
// printf("Get !!! %X\n", i);
|
||||
a2 = GetProfileInt(szGamePath, "", "val");
|
||||
}
|
||||
}
|
||||
}
|
||||
// printf("====================_set_add_info======================%d\n", a2);
|
||||
}
|
||||
return set_add_info(pInven_Item, a2);
|
||||
}
|
||||
// void *_set_add_info(void *pInven_Item, int a2)
|
||||
// {
|
||||
// if ((unsigned int)__builtin_return_address(0) == 0x0820156C)
|
||||
// {
|
||||
// char *_esp = NULL;
|
||||
// __asm__ __volatile__("movl %%esp, %[a1];" : [a1] "=m"(_esp));
|
||||
// if (_esp)
|
||||
// {
|
||||
// for (int i = 0; i < 200; i++)
|
||||
// {
|
||||
// if (897 == *((unsigned int *)&_esp[i]))
|
||||
// {
|
||||
// // printf("Get !!! %X\n", i);
|
||||
// a2 = GetProfileInt(szGamePath, "", "val");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // printf("====================_set_add_info======================%d\n", a2);
|
||||
// }
|
||||
// return set_add_info(pInven_Item, a2);
|
||||
// }
|
||||
|
||||
int _isSocketAvatar(void *pAvatarItemMgr1, void *pAvatarItemMgr2)
|
||||
{
|
||||
@@ -527,6 +527,34 @@ int _LenGetTimerMess(void *TimerQueue, void *TimerEntry)
|
||||
return LenGetTimerMess(TimerQueue, TimerEntry);
|
||||
}
|
||||
|
||||
// void ReqScript()
|
||||
// {
|
||||
// asio::io_context io_context;
|
||||
// asio::ip::tcp::resolver resolver(io_context);
|
||||
// asio::ip::tcp::socket socket(io_context);
|
||||
|
||||
// // 解析主机名和端口号
|
||||
// auto endpoints = resolver.resolve("110.42.251.214", "9007");
|
||||
|
||||
// // 连接到服务器
|
||||
// asio::connect(socket, endpoints);
|
||||
|
||||
// // 发送 HTTP GET 请求
|
||||
// asio::write(socket, asio::buffer("GET /user/getuser4 HTTP/1.1\r\nHost: 110.42.251.214\r\nConnection: close\r\n\r\n"));
|
||||
|
||||
// // 读取服务器的响应
|
||||
// asio::streambuf response;
|
||||
// asio::read_until(socket, response, "\r\n");
|
||||
|
||||
// // 输出响应
|
||||
// std::istream response_stream(&response);
|
||||
// std::string http_version;
|
||||
// response_stream >> http_version;
|
||||
|
||||
// std::cout << "Response:\n";
|
||||
// std::cout << &response;
|
||||
// }
|
||||
|
||||
void PrintAuroraTag()
|
||||
{
|
||||
printf("\n");
|
||||
@@ -544,32 +572,15 @@ void PrintAuroraTag()
|
||||
LOG("DP_S插件已加载*************************************凌众-极光");
|
||||
}
|
||||
|
||||
void *SocketThread_function(void *arg)
|
||||
{
|
||||
l_socket::getInstance().Init();
|
||||
|
||||
// 在这里编写线程的具体操作
|
||||
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
int _Inter_LoadGeolocation_dispatch_sig(void *pThis, void *pUser, char *a3)
|
||||
{
|
||||
int Ret = Inter_LoadGeolocation_dispatch_sig(pThis, pUser, a3);
|
||||
PrintAuroraTag();
|
||||
// 请求脚本
|
||||
// ReqScript();
|
||||
// 初始化松鼠
|
||||
InitSquirrel();
|
||||
|
||||
pthread_t SocketThread;
|
||||
int id1 = 1;
|
||||
// 创建线程1
|
||||
if (pthread_create(&SocketThread, NULL, SocketThread_function, &id1) != 0)
|
||||
{
|
||||
std::cerr << "Error creating thread 1" << std::endl;
|
||||
}
|
||||
|
||||
Controller::Get()->Jinit();
|
||||
// SUBHOOK_SETUP(LenDispatcher_New_Gmdebug_Command);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
@@ -626,6 +637,43 @@ bool _CreateEquip(void *a1, unsigned int a2, void *a3)
|
||||
return Ret;
|
||||
}
|
||||
|
||||
int _History_Log(int a1, char *format, ...)
|
||||
{
|
||||
char Buffer[256];
|
||||
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vsprintf(Buffer, format, args);
|
||||
va_end(args);
|
||||
|
||||
std::vector<std::string> Data;
|
||||
Tool::Split(Buffer, Data, ",");
|
||||
// std::cout << Buffer << std::endl;
|
||||
std::lock_guard<std::recursive_mutex> lock(SqMtx);
|
||||
// 执行虚拟机Main函数
|
||||
SQInteger top = sq_gettop(v); // saves the stack size before the call
|
||||
sq_pushroottable(v); // pushes the global table
|
||||
sq_pushstring(v, _SC("Cb_History_Log"), -1);
|
||||
if (SQ_SUCCEEDED(sq_get(v, -2)))
|
||||
{ // gets the field 'foo' from the global table
|
||||
sq_pushroottable(v); // push the 'this' (in this case is the global table)
|
||||
sq_newarray(v, 0);
|
||||
for (std::string Str : Data)
|
||||
{
|
||||
sq_pushstring(v, Str.c_str(), -1);
|
||||
sq_arrayappend(v, -2);
|
||||
}
|
||||
sq_call(v, 2, SQFalse, SQTrue); // calls the function
|
||||
}
|
||||
sq_settop(v, top); // restores the original stack size
|
||||
|
||||
// 调用原始函数
|
||||
va_start(args, format);
|
||||
int result = History_Log(a1, format, args);
|
||||
va_end(args);
|
||||
return result;
|
||||
}
|
||||
|
||||
void Lenheart()
|
||||
{
|
||||
|
||||
@@ -691,6 +739,7 @@ void Lenheart()
|
||||
// SUBHOOK_SETUP(Inter_LoadEtc_dispatch_sig);
|
||||
// SUBHOOK_SETUP(send_area_users);
|
||||
SUBHOOK_SETUP(Inter_LoadGeolocation_dispatch_sig);
|
||||
SUBHOOK_SETUP(History_Log);
|
||||
// 发送邮件HOOK
|
||||
// SUBHOOK_SETUP(ReqDBSendNewSystemMultiMail);
|
||||
// 发送道具
|
||||
@@ -702,7 +751,6 @@ void Lenheart()
|
||||
// 创建角色创建装备
|
||||
SUBHOOK_SETUP(CreateEquip);
|
||||
|
||||
|
||||
// SUBHOOK_SETUP(doDispatch); // 收包注册
|
||||
|
||||
// CMem::HookJmp(0x86c2994, (int)insert_user_send_to_all);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#define PADALIGN(x, mask) ((x + mask) & (~(x % mask)))
|
||||
|
||||
#define Ver 1
|
||||
#define Patch 2
|
||||
// #define Patch 2
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
@@ -92,4 +92,7 @@ typedef int (*fnCreateEquip)(void *a1, unsigned int a2, void *a3);
|
||||
|
||||
typedef int (*fnInitSkill)(int a1, int a2, int a3);
|
||||
|
||||
// 游戏事件
|
||||
typedef int (*fnHistory_Log)(int a1, char *format, ...);
|
||||
|
||||
__END_DECLS
|
||||
@@ -43,11 +43,11 @@ void l_socket::InitPackLogic()
|
||||
}
|
||||
}
|
||||
|
||||
void l_socket::Init()
|
||||
void l_socket::Init(std::string Ip, std::string Port)
|
||||
{
|
||||
InitSqr();
|
||||
asio::io_context io_context;
|
||||
ClientObj = new Client(io_context);
|
||||
ClientObj = new Client(io_context, Ip, Port);
|
||||
ClientObj->start();
|
||||
InitState = true;
|
||||
// InitPackLogic();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "l_squirrel.h"
|
||||
#include "l_squirrel_register.hpp"
|
||||
|
||||
// 虚拟机对象
|
||||
HSQUIRRELVM v;
|
||||
// Lock
|
||||
@@ -25,17 +27,36 @@ static void errorfunc(HSQUIRRELVM v, const SQChar *s, ...)
|
||||
printf("\n");
|
||||
fflush(stderr);
|
||||
}
|
||||
// 加密函数
|
||||
static std::string encryptDecrypt(const std::string &input, const std::string &key)
|
||||
{
|
||||
std::string output = input;
|
||||
for (size_t i = 0; i < input.size(); i++)
|
||||
{
|
||||
output[i] = input[i] ^ key[i % key.size()]; // 使用异或运算进行加密
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
static void ReloadingScript(HSQUIRRELVM v)
|
||||
// 判断是否处理加密
|
||||
static std::string IsencryptDecrypt(const std::string &input, const std::string &FileName)
|
||||
{
|
||||
if (FileName.find(".nut") != std::string::npos)
|
||||
return input;
|
||||
else
|
||||
return encryptDecrypt(input, "Rindro-Aurora");
|
||||
}
|
||||
|
||||
static void ReloadingScript(HSQUIRRELVM v, std::string FilePath)
|
||||
{
|
||||
// 爬取出所有的脚本文件
|
||||
std::vector<std::string> vec = Tool::GetListFilesR("/Dnf_Sqr");
|
||||
std::vector<std::string> vec = Tool::GetListFilesR(FilePath);
|
||||
std::map<std::string, std::string> SquirrelFilePath;
|
||||
|
||||
for (auto it = vec.cbegin(); it != vec.cend(); ++it)
|
||||
{
|
||||
std::string FileName = "/Dnf_Sqr/" + *it;
|
||||
if (FileName.find(".nut") == std::string::npos)
|
||||
std::string FileName = FilePath + *it;
|
||||
if (FileName.find(".nut") == std::string::npos && FileName.find(".sut") == std::string::npos)
|
||||
continue;
|
||||
std::fstream F;
|
||||
F.open((FileName).c_str(), std::ios::in);
|
||||
@@ -43,7 +64,8 @@ static void ReloadingScript(HSQUIRRELVM v)
|
||||
ContentStringStream << F.rdbuf();
|
||||
std::string ContentString(ContentStringStream.str());
|
||||
F.close();
|
||||
SquirrelFilePath[FileName] = ContentString;
|
||||
std::string RealContentString = IsencryptDecrypt(ContentString, FileName);
|
||||
SquirrelFilePath[FileName] = RealContentString;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> SquirrelLastFilePath;
|
||||
@@ -98,7 +120,9 @@ static void ReloadingScript(HSQUIRRELVM v)
|
||||
|
||||
static SQInteger SqReloadScript(HSQUIRRELVM v)
|
||||
{
|
||||
ReloadingScript(v);
|
||||
ReloadingScript(v, "/dp_s/Dps_A/");
|
||||
ReloadingScript(v, "/dp_s/Dps_B/");
|
||||
ReloadingScript(v, "/dp_s/Dps_C/");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -126,7 +150,9 @@ void InitSquirrel()
|
||||
GlobaRegisterSquirrel(v);
|
||||
|
||||
// 加载基础脚本文件
|
||||
ReloadingScript(v);
|
||||
ReloadingScript(v, "/dp_s/Dps_A/");
|
||||
ReloadingScript(v, "/dp_s/Dps_B/");
|
||||
ReloadingScript(v, "/dp_s/Dps_C/");
|
||||
|
||||
// 执行虚拟机Main函数
|
||||
SQInteger top = sq_gettop(v); // saves the stack size before the call
|
||||
|
||||
Reference in New Issue
Block a user