mirror of
https://github.com/Simplxss/SignerServer.git
synced 2024-11-21 00:37:53 +08:00
Compare commits
No commits in common. "main" and "v2.0.0" have entirely different histories.
50
.github/workflows/build.yml
vendored
50
.github/workflows/build.yml
vendored
@ -45,13 +45,12 @@ jobs:
|
|||||||
- name: Upload build
|
- name: Upload build
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: SignerServer-${{ matrix.os }}-${{ matrix.arch }}
|
name: SignerServer-${{ matrix.os }}-${{ matrix.arch }}.zip
|
||||||
path: |
|
path: |
|
||||||
SignerServer.dll
|
SignerServer.dll
|
||||||
load.js
|
load.js
|
||||||
start.sh
|
start.sh
|
||||||
start.bat
|
start.bat
|
||||||
start.command
|
|
||||||
|
|
||||||
ubuntu:
|
ubuntu:
|
||||||
name: run on ${{ matrix.os }}(${{ matrix.arch }})
|
name: run on ${{ matrix.os }}(${{ matrix.arch }})
|
||||||
@ -88,54 +87,9 @@ jobs:
|
|||||||
- name: Upload build
|
- name: Upload build
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: SignerServer-${{ matrix.os }}-${{ matrix.arch }}
|
name: SignerServer-${{ matrix.os }}-${{ matrix.arch }}.zip
|
||||||
path: |
|
path: |
|
||||||
libSignerServer.so
|
libSignerServer.so
|
||||||
load.js
|
load.js
|
||||||
start.sh
|
start.sh
|
||||||
start.bat
|
start.bat
|
||||||
start.command
|
|
||||||
|
|
||||||
|
|
||||||
macos:
|
|
||||||
name: run on ${{ matrix.os }}(${{ matrix.arch }})
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [macos-latest]
|
|
||||||
arch: [x64, arm64]
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup cmake
|
|
||||||
uses: lukka/get-cmake@latest
|
|
||||||
|
|
||||||
- name: Build project
|
|
||||||
uses: lukka/run-cmake@v10
|
|
||||||
with:
|
|
||||||
# This is the default path to the CMakeLists.txt along side the
|
|
||||||
# CMakePresets.json. Change if you need have CMakeLists.txt and CMakePresets.json
|
|
||||||
# located elsewhere.
|
|
||||||
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
|
||||||
|
|
||||||
# This is the name of the CMakePresets.json's configuration to use to generate
|
|
||||||
# the project files. This configuration leverages the vcpkg.cmake toolchain file to
|
|
||||||
# run vcpkg and install all dependencies specified in vcpkg.json.
|
|
||||||
configurePreset: 'ninja'
|
|
||||||
|
|
||||||
# This is the name of the CMakePresets.json's configuration to build the project.
|
|
||||||
buildPreset: 'ninja-release'
|
|
||||||
|
|
||||||
- run: mv build/ninja/libSignerServer.dylib libSignerServer.dylib
|
|
||||||
|
|
||||||
- name: Upload build
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: SignerServer-${{ matrix.os }}-${{ matrix.arch }}
|
|
||||||
path: |
|
|
||||||
libSignerServer.dylib
|
|
||||||
load.js
|
|
||||||
start.sh
|
|
||||||
start.bat
|
|
||||||
start.command
|
|
||||||
|
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@ -26,9 +26,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Zip Artifact
|
- name: Zip Artifact
|
||||||
run: |
|
run: |
|
||||||
zip -r SignerServer-windows-x64.zip SignerServer-windows-latest-x64.zip/*
|
zip -r SignerServer-windows-x64.zip SignerServer-windows-latest-x64.zip
|
||||||
zip -r SignerServer-ubuntu-x64.zip SignerServer-ubuntu-latest-x64.zip/*
|
zip -r SignerServer-ubuntu-x64.zip SignerServer-ubuntu-latest-x64.zip
|
||||||
zip -r SignerServer-ubuntu-arm64.zip SignerServer-ubuntu-latest-arm64.zip/*
|
zip -r SignerServer-ubuntu-arm64.zip SignerServer-ubuntu-latest-arm64.zip
|
||||||
|
|
||||||
- name: Create Release Draft and Upload Artifacts
|
- name: Create Release Draft and Upload Artifacts
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,5 +1,4 @@
|
|||||||
.vscode
|
.vscode
|
||||||
build
|
build
|
||||||
*.so
|
*.so
|
||||||
*.dll
|
*.dll
|
||||||
*.dylib
|
|
@ -1,4 +1,4 @@
|
|||||||
# SignerServer
|
# v2.0.0
|
||||||
|
|
||||||
QQ Version: Windows 9.9.11-24815 / Linux 3.2.9-24815
|
QQ Version: Windows 9.9.11-24815 / Linux 3.2.9-24815
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "
|
|||||||
add_definitions(-D _X64_ARCH_)
|
add_definitions(-D _X64_ARCH_)
|
||||||
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
||||||
add_definitions(-D _X86_ARCH_)
|
add_definitions(-D _X86_ARCH_)
|
||||||
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
|
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
|
||||||
add_definitions(-D _ARM64_ARCH_)
|
add_definitions(-D _ARM64_ARCH_)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
12
load.js
12
load.js
@ -3,18 +3,16 @@ const os = require('node:os');
|
|||||||
|
|
||||||
const exePath = path.dirname(process.execPath);
|
const exePath = path.dirname(process.execPath);
|
||||||
|
|
||||||
let QQWrapper, version, appid, qua;
|
let QQWrapper, appid, qua;
|
||||||
|
|
||||||
if (os.platform() === "win32") {
|
if (os.platform() === "win32") {
|
||||||
const versionConfig = require(path.join(exePath, "resources/app/versions/config.json"));
|
const versionConfig = require(path.join(exePath, "resources/app/versions/config.json"));
|
||||||
version = versionConfig.curVersion;
|
QQWrapper = require(path.join(exePath, "resources/app/versions", versionConfig.curVersion, "wrapper.node"));
|
||||||
QQWrapper = require(path.join(exePath, "resources/app/versions", version, "wrapper.node"));
|
|
||||||
appid = "537226655"; // 9.9.12-25234
|
appid = "537226655"; // 9.9.12-25234
|
||||||
qua = `V1_WIN_NQ_${version.replace("-", "_")}_GW_B`;
|
qua = `V1_WIN_NQ_${versionConfig.curVersion.replace("-", "_")}_GW_B`;
|
||||||
} else {
|
} else {
|
||||||
const qqPkgInfo = require(path.join(exePath, "resources/app/package.json"));
|
const qqPkgInfo = require(path.join(exePath, "resources/app/package.json"));
|
||||||
QQWrapper = require(path.join(exePath, "resources/app/wrapper.node"));
|
QQWrapper = require(path.join(exePath, "resources/app/wrapper.node"));
|
||||||
version = qqPkgInfo.version;
|
|
||||||
appid = "537226441";
|
appid = "537226441";
|
||||||
qua = qqPkgInfo.qua;
|
qua = qqPkgInfo.qua;
|
||||||
}
|
}
|
||||||
@ -45,7 +43,7 @@ engine.initWithDeskTopConfig({
|
|||||||
base_path_prefix: "",
|
base_path_prefix: "",
|
||||||
platform_type: 3,
|
platform_type: 3,
|
||||||
app_type: 4,
|
app_type: 4,
|
||||||
app_version: version,
|
app_version: qqPkgInfo.version,
|
||||||
os_version: os.release(),
|
os_version: os.release(),
|
||||||
use_xlog: true,
|
use_xlog: true,
|
||||||
qua: qua,
|
qua: qua,
|
||||||
@ -61,6 +59,6 @@ loginService.initConfig({
|
|||||||
appid: appid,
|
appid: appid,
|
||||||
platVer: os.release(),
|
platVer: os.release(),
|
||||||
commonPath: dataPathGlobal,
|
commonPath: dataPathGlobal,
|
||||||
clientVer: version,
|
clientVer: qqPkgInfo.version,
|
||||||
hostName: os.hostname()
|
hostName: os.hostname()
|
||||||
});
|
});
|
220
src/main.cpp
220
src/main.cpp
@ -2,142 +2,134 @@
|
|||||||
|
|
||||||
#include "../include/rapidjson/document.h"
|
#include "../include/rapidjson/document.h"
|
||||||
|
|
||||||
#include <filesystem>
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
Server *server = nullptr;
|
||||||
|
|
||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
#if defined(_WIN_PLATFORM_)
|
#if defined(_WIN_PLATFORM_)
|
||||||
std::string version = "9.9.12-25300";
|
std::string version = "9.9.12-25300";
|
||||||
try
|
|
||||||
{
|
|
||||||
TCHAR pathm[MAX_PATH];
|
|
||||||
GetModuleFileName(NULL, pathm, MAX_PATH);
|
|
||||||
std::filesystem::path path = pathm;
|
|
||||||
path = path.parent_path().append("resources\\app\\versions\\config.json");
|
|
||||||
std::ifstream versionConfig(path.wstring());
|
|
||||||
if (versionConfig.is_open())
|
|
||||||
{
|
|
||||||
std::stringstream versionConfigStream;
|
|
||||||
versionConfigStream << versionConfig.rdbuf();
|
|
||||||
versionConfig.close();
|
|
||||||
rapidjson::Document doc;
|
|
||||||
doc.Parse(versionConfigStream.str().c_str(), versionConfigStream.str().size());
|
|
||||||
if (doc.HasMember("curVersion") && doc["curVersion"].IsString())
|
|
||||||
version = doc["curVersion"].GetString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (const std::exception &e)
|
|
||||||
{
|
|
||||||
std::cerr << e.what() << '\n';
|
|
||||||
}
|
|
||||||
#elif defined(_MAC_PLATFORM_)
|
|
||||||
std::string version = "6.9.19-16183";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
std::ifstream versionConfig("/Applications/QQ.app/Contents/resources/app/package.json");
|
|
||||||
if (versionConfig.is_open())
|
|
||||||
{
|
|
||||||
std::stringstream versionConfigStrBuf;
|
|
||||||
versionConfigStrBuf << versionConfig.rdbuf();
|
|
||||||
versionConfig.close();
|
|
||||||
rapidjson::Document doc;
|
|
||||||
doc.Parse(versionConfigStrBuf.str().c_str(), versionConfigStrBuf.str().size());
|
|
||||||
if (doc.HasMember("version") && doc["version"].IsString())
|
|
||||||
version = doc["version"].GetString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (const std::exception &e)
|
|
||||||
{
|
|
||||||
std::cerr << e.what() << '\n';
|
|
||||||
}
|
|
||||||
#elif defined(_LINUX_PLATFORM_)
|
|
||||||
std::string version = "3.2.9-24815";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
std::ifstream versionConfig("/opt/QQ/resources/app/package.json");
|
|
||||||
if (versionConfig.is_open())
|
|
||||||
{
|
|
||||||
std::stringstream versionConfigStrBuf;
|
|
||||||
versionConfigStrBuf << versionConfig.rdbuf();
|
|
||||||
versionConfig.close();
|
|
||||||
rapidjson::Document doc;
|
|
||||||
doc.Parse(versionConfigStrBuf.str().c_str(), versionConfigStrBuf.str().size());
|
|
||||||
if (doc.HasMember("version") && doc["version"].IsString())
|
|
||||||
version = doc["version"].GetString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (const std::exception &e)
|
|
||||||
{
|
|
||||||
std::cerr << e.what() << '\n';
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
std::string ip = "0.0.0.0";
|
|
||||||
int port = 8080;
|
|
||||||
|
|
||||||
std::string default_config = R"({"ip":"0.0.0.0","port":8080})";
|
|
||||||
|
|
||||||
rapidjson::Document doc;
|
|
||||||
|
|
||||||
std::ifstream configFile("sign.json");
|
|
||||||
if (!configFile.is_open())
|
|
||||||
{
|
|
||||||
printf("sign.json not found, use default\n");
|
|
||||||
std::ofstream("sign.json") << default_config;
|
|
||||||
doc.Parse(default_config.c_str(), default_config.size());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::stringstream configStream;
|
|
||||||
configStream << configFile.rdbuf();
|
|
||||||
configFile.close();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
doc.Parse(configStream.str().c_str(), configStream.str().size());
|
std::ifstream versionConfig("resources\\app\\versions\\config.json");
|
||||||
|
if (versionConfig.is_open())
|
||||||
|
{
|
||||||
|
std::string versionConfigStr;
|
||||||
|
versionConfig >> versionConfigStr;
|
||||||
|
versionConfig.close();
|
||||||
|
rapidjson::Document doc;
|
||||||
|
doc.Parse(versionConfigStr.c_str(), versionConfigStr.size());
|
||||||
|
if (doc.HasMember("curVersion") && doc["curVersion"].IsString())
|
||||||
|
version = doc["curVersion"].GetString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (const std::exception &e)
|
catch (const std::exception &e)
|
||||||
{
|
{
|
||||||
printf("Parse config failed, use default: %s\n", e.what());
|
std::cerr << e.what() << '\n';
|
||||||
|
}
|
||||||
|
#elif defined(_MAC_PLATFORM_)
|
||||||
|
std::string version = "6.9.19-16183";
|
||||||
|
#elif defined(_LINUX_PLATFORM_)
|
||||||
|
std::string version = "3.2.9-24815";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
std::ifstream versionConfig("/opt/QQ/resources/app/package.json");
|
||||||
|
if (versionConfig.is_open())
|
||||||
|
{
|
||||||
|
std::string versionConfigStr;
|
||||||
|
versionConfig >> versionConfigStr;
|
||||||
|
versionConfig.close();
|
||||||
|
rapidjson::Document doc;
|
||||||
|
doc.Parse(versionConfigStr.c_str(), versionConfigStr.size());
|
||||||
|
if (doc.HasMember("version") && doc["version"].IsString())
|
||||||
|
version = doc["version"].GetString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (const std::exception &e)
|
||||||
|
{
|
||||||
|
std::cerr << e.what() << '\n';
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
std::string ip = "0.0.0.0";
|
||||||
|
int port = 8080;
|
||||||
|
|
||||||
|
std::string default_config = R"({"ip":"0.0.0.0","port":8080})";
|
||||||
|
|
||||||
|
rapidjson::Document doc;
|
||||||
|
|
||||||
|
std::ifstream configFile("sign.json");
|
||||||
|
if (!configFile.is_open())
|
||||||
|
{
|
||||||
|
printf("sign.json not found, use default\n");
|
||||||
|
std::ofstream("sign.json") << default_config;
|
||||||
doc.Parse(default_config.c_str(), default_config.size());
|
doc.Parse(default_config.c_str(), default_config.size());
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
|
||||||
if (doc.HasMember("ip") && doc["ip"].IsString())
|
|
||||||
ip = doc["ip"].GetString();
|
|
||||||
if (doc.HasMember("port") && doc["port"].IsInt())
|
|
||||||
port = doc["port"].GetInt();
|
|
||||||
if (doc.HasMember("version") && doc["version"].IsString())
|
|
||||||
version = doc["version"].GetString();
|
|
||||||
|
|
||||||
std::thread sign_init([version, ip, port]
|
|
||||||
{
|
|
||||||
printf("Start Init sign\n");
|
|
||||||
for (int i = 0; i < 10; i++)
|
|
||||||
{
|
{
|
||||||
|
std::string config;
|
||||||
|
configFile >> config;
|
||||||
|
configFile.close();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Sign::Init(version))
|
doc.Parse(config.c_str(), config.size());
|
||||||
{
|
|
||||||
printf("Start Init server\n");
|
|
||||||
Server server;
|
|
||||||
server.Init();
|
|
||||||
if (!server.Run(ip, port))
|
|
||||||
printf("Server run failed\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (const std::exception &e)
|
catch (const std::exception &e)
|
||||||
{
|
{
|
||||||
printf("Init failed: %s\n", e.what());
|
printf("Parse config failed, use default: %s\n", e.what());
|
||||||
|
doc.Parse(default_config.c_str(), default_config.size());
|
||||||
}
|
}
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
}
|
||||||
} });
|
|
||||||
sign_init.detach();
|
if (doc.HasMember("ip") && doc["ip"].IsString())
|
||||||
|
ip = doc["ip"].GetString();
|
||||||
|
if (doc.HasMember("port") && doc["port"].IsInt())
|
||||||
|
port = doc["port"].GetInt();
|
||||||
|
if (doc.HasMember("version") && doc["version"].IsString())
|
||||||
|
version = doc["version"].GetString();
|
||||||
|
|
||||||
|
printf("Start Init server\n");
|
||||||
|
server = new Server();
|
||||||
|
server->Init();
|
||||||
|
|
||||||
|
printf("Start Init sign\n");
|
||||||
|
std::thread([=] { // Cannot use '&' capture!!!!! will cause crash
|
||||||
|
for (int i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Sign::Init(version))
|
||||||
|
{
|
||||||
|
if (!server->Run(ip, port))
|
||||||
|
printf("Server run failed\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (const std::exception &e)
|
||||||
|
{
|
||||||
|
printf("Init failed: %s\n", e.what());
|
||||||
|
}
|
||||||
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.detach();
|
||||||
|
}
|
||||||
|
catch (const std::exception &e)
|
||||||
|
{
|
||||||
|
printf("Init failed: %s\n", e.what());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninit()
|
void uninit()
|
||||||
{
|
{
|
||||||
|
if (server != nullptr)
|
||||||
|
{
|
||||||
|
delete server;
|
||||||
|
server = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_WIN_PLATFORM_)
|
#if defined(_WIN_PLATFORM_)
|
||||||
@ -159,12 +151,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#elif defined(_LINUX_PLATFORM_) || defined(_MAC_PLATFORM_)
|
#elif defined(_LINUX_PLATFORM_) || defined(_MAC_PLATFORM_)
|
||||||
static void __attribute__((constructor)) my_init(void)
|
void __attribute__((constructor)) my_init(void)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __attribute__((destructor)) my_fini(void)
|
void __attribute__ ((destructor)) my_fini(void)
|
||||||
{
|
{
|
||||||
uninit();
|
uninit();
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ std::shared_ptr<void> (*nodeInitializeOncePerProcess)(
|
|||||||
|
|
||||||
int __stdcall fakeWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
|
int __stdcall fakeWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
|
||||||
{
|
{
|
||||||
|
MessageBoxA(NULL, "Init", "fakeWinMain", MB_OK);
|
||||||
checkRunAsNode(nullptr);
|
checkRunAsNode(nullptr);
|
||||||
return oriWinMain(hInstance, hPrevInstance, lpCmdLine, nShowCmd);
|
return oriWinMain(hInstance, hPrevInstance, lpCmdLine, nShowCmd);
|
||||||
}
|
}
|
||||||
@ -42,7 +43,11 @@ bool RunAsNode::RunNode()
|
|||||||
[](auto &a)
|
[](auto &a)
|
||||||
{ return std::wstring_convert<std::codecvt_utf8<wchar_t>>().to_bytes(a); });
|
{ return std::wstring_convert<std::codecvt_utf8<wchar_t>>().to_bytes(a); });
|
||||||
|
|
||||||
|
MessageBoxA(NULL, "pre nodeInitializeOncePerProcess", "fakeWinMain", MB_OK);
|
||||||
|
std::for_each(argv.begin(), argv.end(), [](const std::string &arg)
|
||||||
|
{ MessageBoxA(NULL, arg.c_str(), "fakeWinMain", MB_OK); });
|
||||||
nodeInitializeOncePerProcess(argv, (1 << 6) | (1 << 7));
|
nodeInitializeOncePerProcess(argv, (1 << 6) | (1 << 7));
|
||||||
|
MessageBoxA(NULL, "post nodeInitializeOncePerProcess", "fakeWinMain", MB_OK);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
#include "../include/rapidjson/document.h"
|
#include "../include/rapidjson/document.h"
|
||||||
#include "../include/rapidjson/writer.h"
|
#include "../include/rapidjson/writer.h"
|
||||||
|
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
std::string Server::GetSign(const std::string_view &cmd, const std::string_view &src, const int seq)
|
std::string Server::GetSign(const std::string_view &cmd, const std::string_view &src, const int seq)
|
||||||
{
|
{
|
||||||
auto [signDataHex, extraDataHex, tokenDataHex] = Sign::Call(cmd, src, seq);
|
auto [signDataHex, extraDataHex, tokenDataHex] = Sign::Call(cmd, src, seq);
|
||||||
@ -48,8 +50,8 @@ void Server::Init()
|
|||||||
.Get("/sign", [this](const httplib::Request &req, httplib::Response &res)
|
.Get("/sign", [this](const httplib::Request &req, httplib::Response &res)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
std::string cmd = req.get_param_value("cmd");
|
std::string_view cmd = req.get_param_value("cmd");
|
||||||
std::string src = req.get_param_value("src");
|
std::string_view src = req.get_param_value("src");
|
||||||
int seq = std::stoi(req.get_param_value("seq"));
|
int seq = std::stoi(req.get_param_value("seq"));
|
||||||
|
|
||||||
std::string buffer = GetSign(cmd, src, seq);
|
std::string buffer = GetSign(cmd, src, seq);
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#define _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
|
|
||||||
|
|
||||||
#include "sign.h"
|
#include "sign.h"
|
||||||
#include "../include/cpp-httplib/httplib.h"
|
#include "../include/cpp-httplib/httplib.h"
|
||||||
|
13
src/sign.cpp
13
src/sign.cpp
@ -22,7 +22,6 @@ std::map<std::string, uint64_t> addrMap = {
|
|||||||
{"3.1.2-13107", 0x33C3920},
|
{"3.1.2-13107", 0x33C3920},
|
||||||
{"3.2.7-23361", 0x4C93C57},
|
{"3.2.7-23361", 0x4C93C57},
|
||||||
{"3.2.9-24815", 0x4E5D3B7},
|
{"3.2.9-24815", 0x4E5D3B7},
|
||||||
{"3.2.10-25765", 0x4F176D6},
|
|
||||||
// Macos
|
// Macos
|
||||||
{"6.9.19-16183", 0x1B29469},
|
{"6.9.19-16183", 0x1B29469},
|
||||||
// Windows
|
// Windows
|
||||||
@ -34,21 +33,15 @@ std::map<std::string, uint64_t> addrMap = {
|
|||||||
{"9.9.11-24568", 0xAA1A20},
|
{"9.9.11-24568", 0xAA1A20},
|
||||||
{"9.9.11-24815", 0xAB5510},
|
{"9.9.11-24815", 0xAB5510},
|
||||||
{"9.9.12-25234", 0xA84980},
|
{"9.9.12-25234", 0xA84980},
|
||||||
{"9.9.12-25300", 0xA84980},
|
{"9.9.12-25300", 0xA84980}};
|
||||||
{"9.9.12-25493", 0xA996E0},
|
|
||||||
{"9.9.12-25765", 0xA9CE90},
|
|
||||||
{"9.9.12-26299", 0xA9E5B0},
|
|
||||||
{"9.9.12-26299", 0xA9E5B0},
|
|
||||||
{"9.9.15-27597", 0xBDAE40}};
|
|
||||||
#elif defined(_X86_ARCH_)
|
#elif defined(_X86_ARCH_)
|
||||||
std::map<std::string, uint64_t> addrMap = {
|
std::map<std::string, uint64_t> addrMap = {
|
||||||
{"9.9.2-15962", 0x2BD70},
|
{"9.9.2-15962", 0x2BD70},
|
||||||
{"9.9.2-16183", 0x2BD70}};
|
{"9.9.2-16183", 0x2BD70}};
|
||||||
#elif defined(_ARM64_ARCH_)
|
#elif defined(_ARM64_ARCH_)
|
||||||
std::map<std::string, uint64_t> addrMap = {
|
std::map<std::string, uint64_t> addrMap = {
|
||||||
{"3.2.7-23361", 0x351EC98},
|
{"3.2.7-23361", 0x351EC98}
|
||||||
{"6.9.20-17153", 0x1c73dd0},
|
{"6.9.20-17153", 0x1c73dd0}};
|
||||||
{"6.9.56-28418", 0x23510E8}};
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int SignOffsets = 767; // 562 before 3.1.2-13107, 767 in others
|
int SignOffsets = 767; // 562 before 3.1.2-13107, 767 in others
|
||||||
|
@ -5,9 +5,6 @@ for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\M
|
|||||||
set "RetString=%%b"
|
set "RetString=%%b"
|
||||||
goto :boot
|
goto :boot
|
||||||
)
|
)
|
||||||
echo QQ installation not found
|
|
||||||
pause
|
|
||||||
exit
|
|
||||||
|
|
||||||
:boot
|
:boot
|
||||||
for %%a in ("!RetString!") do (
|
for %%a in ("!RetString!") do (
|
||||||
@ -39,8 +36,7 @@ if errorlevel 1 (
|
|||||||
goto launch
|
goto launch
|
||||||
|
|
||||||
:restart
|
:restart
|
||||||
powershell Start-Process -FilePath cmd.exe -ArgumentList """/c pushd %~dp0 && %~s0 %*""" -Verb RunAs
|
powershell Start-Process -FilePath cmd.exe -ArgumentList """/c pushd %~dp0 && %~s0 %*""" -Verb RunAs
|
||||||
exit
|
|
||||||
|
|
||||||
:launch
|
:launch
|
||||||
set "QQPath=!pathWithoutUninstall!QQ.exe"
|
set "QQPath=!pathWithoutUninstall!QQ.exe"
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
SCRIPT_DIR=$(realpath $(dirname "${BASH_SOURCE[0]}"))
|
|
||||||
export ELECTRON_RUN_AS_NODE=1
|
|
||||||
DYLD_INSERT_LIBRARIES=./libSignerServer.dylib /Applications/QQ.app/Contents/MacOS/qq ${SCRIPT_DIR}/load.js $@
|
|
Loading…
x
Reference in New Issue
Block a user