From 66923b8807d9deb733116b9f8b4baf9541c6b9d3 Mon Sep 17 00:00:00 2001 From: yuanyuanxiang <962914132@qq.com> Date: Wed, 1 Jan 2025 04:54:27 +0800 Subject: [PATCH] feat: Support XOR encrypt for generating service --- ReadMe.md | 2 ++ common/commands.h | 9 +++++++++ server/2015Remote/2015Remote.rc | Bin 50360 -> 50672 bytes server/2015Remote/BuildDlg.cpp | 22 +++++++++++++++++++++- server/2015Remote/BuildDlg.h | 4 ++++ server/2015Remote/resource.h | Bin 25712 -> 25896 bytes 6 files changed, 36 insertions(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 94a1508..61df274 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -301,6 +301,8 @@ reorg: Move commands to common/commands.h 在动态链接库中增加导出函数Run,以便通过rundll32.exe调用动态链接库。这种形式也是支持在线对DLL进行升级的。 +2024.12.31 +生成服务时增加加密选项,当前支持XOR加密。配合使用解密程序来加载加密后的服务。 # 沟通反馈 diff --git a/common/commands.h b/common/commands.h index e7687f4..8e3e095 100644 --- a/common/commands.h +++ b/common/commands.h @@ -2,6 +2,7 @@ #include #include +#include #ifndef _MAX_PATH #define _MAX_PATH 260 @@ -198,3 +199,11 @@ typedef struct LOGIN_INFOR strcpy_s(moduleVersion, DLL_VERSION); } }LOGIN_INFOR; + +inline void xor_encrypt_decrypt(unsigned char *data, int len, const std::vector& keys) { + for (char key : keys) { + for (int i = 0; i < len; ++i) { + data[i] ^= key; + } + } +} diff --git a/server/2015Remote/2015Remote.rc b/server/2015Remote/2015Remote.rc index 7669d6c19dbb330d0628eec30dbb675296df10b3..887e05f4b1a640176506e1cdd6c232f08f11b5da 100644 GIT binary patch delta 315 zcmdnd$^4<4dBZg~USkGh215oN1_cI72D8bGHU}p!abF^6#9+o?0TeZ7Fa?sP3L`5bh9eHTk1~G`}HOzX@2q34_t({T`8=hCoww7)%%}Co6jT ziLWIl)Vg*O%m*1{F?pk$ z@#J^5Mw4H8^6;B8n1f|N@<0bnwzmtO9O0!l`J4#b2v&35^l!T`H)F+FZwq$-