mirror of
https://github.com/N00byKing/PalWorld-ServerInjector.git
synced 2025-04-29 02:28:20 +09:00
Initial Commit
This commit is contained in:
commit
fad9b582c2
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
build/
|
||||
.cache/
|
||||
compile_commands.json
|
10
CMakeLists.txt
Normal file
10
CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.4)
|
||||
|
||||
project(PalServerInject)
|
||||
|
||||
# Language Settings
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
add_executable(PalServerInject Launcher.cpp)
|
70
Launcher.cpp
Normal file
70
Launcher.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <windows.h>
|
||||
|
||||
std::string ue4ss_dll_name = "UE4SS.dll";
|
||||
std::string palserver_exe_name = "PalServer-Win64-Test-Cmd.exe";
|
||||
|
||||
int wmain(int argc, wchar_t *argv[ ]) {
|
||||
std::string arguments;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
std::wstring ws(argv[i]);
|
||||
std::string arg(ws.begin(), ws.end());
|
||||
arguments += std::string(" ") + arg;
|
||||
}
|
||||
|
||||
std::string commandLine = palserver_exe_name + arguments;
|
||||
printf("Starting as: %s\n", commandLine.c_str());
|
||||
|
||||
|
||||
// Start PalServer .exe
|
||||
STARTUPINFOA si = {.cb = sizeof si};
|
||||
PROCESS_INFORMATION pi = {0};
|
||||
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
|
||||
ZeroMemory(&pi, sizeof(pi));
|
||||
|
||||
// Create process, but suspended
|
||||
CreateProcessA(palserver_exe_name.c_str(), (char*)commandLine.c_str(), NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi);
|
||||
|
||||
printf("Started PalServer (suspended)...\n");
|
||||
|
||||
// Inject
|
||||
LPVOID alloc = VirtualAllocEx(pi.hProcess, NULL, ue4ss_dll_name.size(), MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
||||
if (!alloc) {
|
||||
printf("VirtualAllocEx failed.\n");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (WriteProcessMemory(pi.hProcess, alloc, ue4ss_dll_name.c_str(), ue4ss_dll_name.size(), NULL) == 0) {
|
||||
printf("WriteProcessMemory failed.\n");
|
||||
goto free_and_cleanup;
|
||||
}
|
||||
|
||||
HANDLE handle = CreateRemoteThread(pi.hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)LoadLibraryA, alloc, 0, NULL);
|
||||
if (!handle) {
|
||||
printf("CreateRemoteThread failed.\n");
|
||||
goto free_and_cleanup;
|
||||
}
|
||||
|
||||
WaitForSingleObject(handle, 5000);
|
||||
VirtualFreeEx(pi.hProcess, alloc, 0, MEM_RELEASE);
|
||||
printf("DLL Injected...\n");
|
||||
|
||||
// Resume
|
||||
ResumeThread(pi.hThread);
|
||||
printf("Server should now be running!\n");
|
||||
|
||||
// Wait until child process exits.
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
// Close process and thread handles.
|
||||
free_and_cleanup:
|
||||
VirtualFreeEx(pi.hProcess, alloc, 0, MEM_RELEASE);
|
||||
cleanup:
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
fflush(stdout);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
7
UE4SS_Signatures/FName_toString.lua
Normal file
7
UE4SS_Signatures/FName_toString.lua
Normal file
@ -0,0 +1,7 @@
|
||||
function Register()
|
||||
return "48 89 5C 24 10 48 89 74 24 18 57 48 83 EC 20 80 3D ? ? ? ? ? 48 8B FA 8B 19 48 8B F1 74 09 48 8D ? ? ? ? ? EB 16 48 8D ? ? ? ? ? E8 ? ? ? ? 48 8B D0 C6 05 ? ? ? ? ? 8B CB 0F B7 C3 C1 E9 10 89 4C 24 30 89 44 24 34 48 8B 44 24 30 48 C1 E8 20 8D 1C 00 48 03 5C CA 10 48 8B CF"
|
||||
end
|
||||
|
||||
function OnMatchFound(MatchAddress)
|
||||
return MatchAddress
|
||||
end
|
7
UE4SS_Signatures/StaticConstructObject.lua
Normal file
7
UE4SS_Signatures/StaticConstructObject.lua
Normal file
@ -0,0 +1,7 @@
|
||||
function Register()
|
||||
return "48 89 5C 24 10 48 89 74 24 18 55 57 41 54 41 56 41 57 48 8D AC 24 30 FE FF FF 48 81 EC D0 02 00 00 48 8B ? ? ? ? ? 48 33 C4 48 89 85 C0 01 00 00 48 8B 31 48 8B D9 4C 8B 61 08 44 8B 79 18 F7 86 D4 00 00 00 80 00 00 10 74 7D 4C 8B 71 28 48 8D 79 28 4D 85 F6 74 2E 83 79 10 00 75 06 83 79 14 00 74 64 80 79 21 00 75 1C 4C 8B 41 10 45 8B CF 48 8B CE C6 44 24 20 00 49 8B D4 E8 ? ? ? ? 4C 3B F0 75 42 41 8B C7 C1 E8 12 F6 D0 A8 01 75 32 48 8D 44 24 40 C6 44 24 40 00 48 89 44 24 50"
|
||||
end
|
||||
|
||||
function OnMatchFound(MatchAddress)
|
||||
return MatchAddress
|
||||
end
|
10
cl_setup.sh
Normal file
10
cl_setup.sh
Normal file
@ -0,0 +1,10 @@
|
||||
export PATH=~/Desktop/msvc-wine/msstuff/bin/x64:$PATH
|
||||
export CC=clang-cl
|
||||
export CXX=clang-cl
|
||||
|
||||
export BIN=~/Desktop/msvc-wine/msstuff/bin/x64/
|
||||
|
||||
source ~/Desktop/msvc-wine/msvcenv-native.sh
|
||||
|
||||
cmake -B build -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build --config Release
|
Loading…
x
Reference in New Issue
Block a user