mirror of
https://github.com/Simplxss/SignerServer.git
synced 2024-11-21 00:37:53 +08:00
feat: arm64
This commit is contained in:
parent
58bc6b1f57
commit
1a0d28b514
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@ -57,7 +57,7 @@
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
arch: [x64]
|
||||
arch: [x64, arm64]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@ -76,12 +76,12 @@
|
||||
# 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-${{ matrix.arch }}'
|
||||
configurePreset: 'ninja'
|
||||
|
||||
# This is the name of the CMakePresets.json's configuration to build the project.
|
||||
buildPreset: 'ninja-${{ matrix.arch }}-release'
|
||||
buildPreset: 'ninja-release'
|
||||
|
||||
- run: mv build/ninja-${{ matrix.arch }}/libSignerServer.so libSignerServer.so
|
||||
- run: mv build/ninja/libSignerServer.so libSignerServer.so
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
|
@ -2,29 +2,15 @@
|
||||
"version": 2,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "ninja-x64",
|
||||
"displayName": "Configure ninja-x64",
|
||||
"description": "Configure ninja-x64",
|
||||
"name": "ninja",
|
||||
"displayName": "Configure ninja",
|
||||
"description": "Configure ninja",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ninja-arm64",
|
||||
"displayName": "Configure ninja-arm64",
|
||||
"description": "Configure ninja-arm64",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}"
|
||||
},
|
||||
"architecture": {
|
||||
"value": "arm64",
|
||||
"strategy": "set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "msvc-x64",
|
||||
"displayName": "Visual Studio Community 2022 Preview - amd64",
|
||||
@ -42,34 +28,18 @@
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "ninja-arm64-debug",
|
||||
"description": "Build ninja-arm64 Debug",
|
||||
"displayName": "Build ninja-arm64 Debug",
|
||||
"configurePreset": "ninja-arm64",
|
||||
"name": "ninja-debug",
|
||||
"description": "Build ninja Debug",
|
||||
"displayName": "Build ninja Debug",
|
||||
"configurePreset": "ninja",
|
||||
"configuration": "Debug",
|
||||
"targets": "all"
|
||||
},
|
||||
{
|
||||
"name": "ninja-arm64-release",
|
||||
"description": "Build ninja-arm64 Release",
|
||||
"displayName": "Build ninja-arm64 Release",
|
||||
"configurePreset": "ninja-arm64",
|
||||
"configuration": "Release",
|
||||
"targets": "all"
|
||||
},
|
||||
{
|
||||
"name": "ninja-x64-debug",
|
||||
"description": "Build ninja-x64 Debug",
|
||||
"displayName": "Build ninja-x64 Debug",
|
||||
"configurePreset": "ninja-x64",
|
||||
"configuration": "Debug",
|
||||
"targets": "all"
|
||||
},
|
||||
{
|
||||
"name": "ninja-x64-release",
|
||||
"description": "Build ninja-x64 Release",
|
||||
"displayName": "Build ninja-x64 Release",
|
||||
"configurePreset": "ninja-x64",
|
||||
"name": "ninja-release",
|
||||
"description": "Build ninja Release",
|
||||
"displayName": "Build ninja Release",
|
||||
"configurePreset": "ninja",
|
||||
"configuration": "Release",
|
||||
"targets": "all"
|
||||
},
|
||||
|
25
src/sign.cpp
25
src/sign.cpp
@ -83,8 +83,16 @@ std::string Bin2Hex(const uint8_t *ptr, size_t length) {
|
||||
}
|
||||
|
||||
Sign::Sign() {
|
||||
std::thread t(&Sign::InitEx, this);
|
||||
t.detach();
|
||||
std::thread([this]{ while (false) {
|
||||
try {
|
||||
Init();
|
||||
}
|
||||
catch (const std::exception &e) {
|
||||
std::cerr << e.what() << '\n';
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
continue;
|
||||
}
|
||||
} }).detach();
|
||||
}
|
||||
|
||||
void Sign::Init() {
|
||||
@ -121,19 +129,6 @@ void Sign::Init() {
|
||||
SignFunction = reinterpret_cast<SignFunctionType>(HookAddress);
|
||||
}
|
||||
|
||||
void Sign::InitEx() {
|
||||
while (true) {
|
||||
try {
|
||||
Init();
|
||||
break;
|
||||
}
|
||||
catch (const std::exception &e) {
|
||||
std::cerr << e.what() << '\n';
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::tuple<std::string, std::string, std::string> Sign::Call(const std::string_view cmd, const std::string_view src, int seq) {
|
||||
if (SignFunction == nullptr) {
|
||||
throw std::runtime_error("Sign function not initialized");
|
||||
|
@ -10,7 +10,6 @@ private:
|
||||
typedef int (*SignFunctionType)(const char *cmd, const unsigned char *src, size_t src_len, int seq, unsigned char *result);
|
||||
SignFunctionType SignFunction = nullptr;
|
||||
void Init();
|
||||
void InitEx();
|
||||
|
||||
public:
|
||||
std::tuple<std::string, std::string, std::string> Call(const std::string_view cmd, const std::string_view src, int seq);
|
||||
|
Loading…
x
Reference in New Issue
Block a user