mirror of
https://github.com/Simplxss/SignerServer.git
synced 2024-11-21 00:37:53 +08:00
add workflow
This commit is contained in:
parent
ea42c03794
commit
de279a6b7a
50
.github/workflows/build.yml
vendored
Normal file
50
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
# https://docs.github.com/en/actions/learn-github-actions/contexts
|
||||
|
||||
---
|
||||
name: SignerServer
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
ubuntu:
|
||||
name: run on ${{ matrix.os }}(${{ matrix.arch }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
arch: [x64]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup cmake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Build And Test
|
||||
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-${{ matrix.arch }}'
|
||||
|
||||
# This is the name of the CMakePresets.json's configuration to build the project.
|
||||
buildPreset: 'ninja-${{ matrix.arch }}-release'
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: SignerServer-${{ matrix.os }}-${{ matrix.arch }}
|
||||
path: |
|
||||
build/ninja-${{ matrix.arch }}/lib/libSignerServer.so
|
||||
load.js
|
||||
start.sh
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
.vscode
|
||||
build
|
||||
install
|
@ -21,7 +21,7 @@ set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
file(GLOB SOURCE_FILES "./src/*.cpp" "./src/*.asm")
|
||||
|
||||
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
|
||||
add_library(SignerServer SHARED ${SOURCE_FILES})
|
||||
|
||||
if(MSVC)
|
||||
target_link_options(SignerServer PRIVATE
|
||||
|
33
CMakePresets.json
Normal file
33
CMakePresets.json
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"version": 2,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "ninja-x64",
|
||||
"displayName": "Configure ninja-x64",
|
||||
"description": "Configure ninja-x64",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"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",
|
||||
"configuration": "Release",
|
||||
"targets": "all"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,15 +1,13 @@
|
||||
#include "sign.h"
|
||||
#include "server.h"
|
||||
#include "../include/rapidjson/document.h"
|
||||
#include "../include/rapidjson/writer.h"
|
||||
|
||||
#include <thread>
|
||||
|
||||
Sign sign;
|
||||
|
||||
Server::Server(int port)
|
||||
{
|
||||
svr.Post("/sign", [](const httplib::Request &req, httplib::Response &res)
|
||||
svr.Post("/sign", [this](const httplib::Request &req, httplib::Response &res)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "sign.h"
|
||||
#include "../include/cpp-httplib/httplib.h"
|
||||
|
||||
class Server
|
||||
@ -7,4 +8,5 @@ public:
|
||||
|
||||
private:
|
||||
httplib::Server svr;
|
||||
Sign sign;
|
||||
};
|
@ -19,8 +19,8 @@
|
||||
#include <Windows.h>
|
||||
#include <psapi.h>
|
||||
#elif defined(_MAC_PLATFORM_) || defined(_LINUX_PLATFORM_)
|
||||
#include <cstring>
|
||||
#include "proc_maps.h"
|
||||
#include <cstring>
|
||||
#endif
|
||||
|
||||
// 签名函数定义
|
||||
@ -53,7 +53,8 @@ std::map<std::string, uint64_t> addrMap = {
|
||||
{"3.2.7-23361", 0x4C93C57}};
|
||||
#endif
|
||||
#endif
|
||||
int SignOffsets = 562; // 562 in 3.1.2-12912
|
||||
|
||||
int SignOffsets = 562; // 562 before 3.1.2-13107, 767 in others
|
||||
int ExtraOffsets = 511;
|
||||
int TokenOffsets = 255;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user