dll branch

This commit is contained in:
bits 2026-03-18 02:44:47 +03:00
parent 8b49fe0590
commit 0813a4cd30
53 changed files with 346 additions and 157 deletions

42
.gitignore vendored
View File

@ -1 +1,43 @@
# Visual Studio
.vs/
[Dd]ebug/
[Rr]elease/
x64/
x86/
[Aa]rm/
[Aa]rm64/
*.pdb
*.obj
*.exe
*.dll
*.iobj
*.ipdb
*.log
*.tlog
*.lastbuildstate
*.recipe
*.idb
*.cache
*.vsidx
*.VC.db
# CLion / CMake
cmake-build-*/
CMakeFiles/
CMakeCache.txt
build/
.cmake/
# Idea
.idea/
# NuGet
packages/
*.nuget.props
*.nuget.targets
project.assets.json
project.nuget.cache
# Submodules
GUI/
RLIdentity/RLidentity/

4
.gitmodules vendored Normal file
View File

@ -0,0 +1,4 @@
[submodule "GUI"]
path = GUI
url = https://git.rlidentity.me/bits/RLidentity.git
branch = GUI

18
CMakeLists.txt Normal file
View File

@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.10)
project(RLIdentityDLL)
set(CMAKE_CXX_STANDARD 14)
# Set output directory to x64/Release for consistency with VS project
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_library(RLIdentity SHARED
RLIdentity.cpp)
# Link MinHook
target_link_libraries(RLIdentity PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/libMinHook.x64.lib)
# Add definitions if needed
target_compile_definitions(RLIdentity PRIVATE _USRDLL RLIDENTITYDLL_EXPORTS)

View File

@ -1,115 +1,155 @@
#include <Windows.h>
// RLIdentity.cpp
// 1:1 Proven logic with ALL-SAFE JSON parsing (no dynamic allocations).
#include <Windows.h>
#include <MinHook.h>
#include <shlobj.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#pragma comment(lib, "MinHook.x64.lib")
#pragma comment(lib, "libMinHook.x64.lib")
#pragma comment(lib, "shell32.lib")
static char g_SpoofedName[256] = "Player";
static char g_ConfigPath[MAX_PATH] = { 0 };
static void* g_LocalUserId = nullptr;
typedef int(__stdcall* EOS_Func_t)(void*, void*, void**);
EOS_Func_t oEOS_UserInfo_CopyUserInfo = nullptr;
void ClearLog() {
char path[MAX_PATH];
if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, 0, path))) {
char logFile[MAX_PATH];
sprintf_s(logFile, "%s\\RLidentity\\log.txt", path);
FILE* f = NULL;
fopen_s(&f, logFile, "w");
if (f) {
fprintf(f, "[RLidentity] --- New Session Started ---\n");
fclose(f);
}
}
}
void LoadConfig() {
// Get AppData path
char appDataPath[MAX_PATH];
SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, 0, appDataPath);
sprintf_s(g_ConfigPath, "%s\\RLidentity\\config.txt", appDataPath);
char path[MAX_PATH];
if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_APPDATA, NULL, 0, path))) {
char jPath[MAX_PATH];
sprintf_s(jPath, "%s\\RLidentity\\config.json", path);
FILE* fp = NULL;
fopen_s(&fp, g_ConfigPath, "r");
fopen_s(&fp, jPath, "r");
if (fp) {
char buffer[1024] = { 0 };
size_t bytes = fread(buffer, 1, sizeof(buffer)-1, fp);
fclose(fp);
if (bytes > 0) {
const char* key = "\"spoofedName\"";
char* pos = strstr(buffer, key);
if (pos) {
char* colon = strchr(pos, ':');
if (colon) {
char* start = strchr(colon, '\"');
if (start) {
char* end = strchr(start + 1, '\"');
if (end) {
size_t len = end - (start + 1);
if (len > 0 && len < 255) {
memcpy(g_SpoofedName, start + 1, len);
g_SpoofedName[len] = '\0';
return;
}
}
}
}
}
}
}
char tPath[MAX_PATH];
sprintf_s(tPath, "%s\\RLidentity\\config.txt", path);
fopen_s(&fp, tPath, "r");
if (fp) {
char line[256] = { 0 };
if (fgets(line, sizeof(line), fp)) {
line[strcspn(line, "\r\n")] = 0;
if (strlen(line) > 0 && strlen(line) < 50) {
strcpy_s(g_SpoofedName, sizeof(g_SpoofedName), line);
}
if (strlen(line) > 0) strcpy_s(g_SpoofedName, 256, line);
}
fclose(fp);
}
}
}
typedef int(__stdcall* CopyUserInfo_t)(void*, void*, void**);
static CopyUserInfo_t oEOS_UserInfo_CopyUserInfo = nullptr;
typedef int(__stdcall* ToString_t)(void*, char*, int32_t*);
static ToString_t oEOS_EpicAccountId_ToString = nullptr;
int __stdcall hkEOS_EpicAccountId_ToString(void* handle, char* buffer, int32_t* length) {
if (handle && g_LocalUserId && handle == g_LocalUserId) {
size_t spoofLen = strlen(g_SpoofedName);
if (buffer && length && *length > (int32_t)spoofLen) {
strcpy_s(buffer, *length, g_SpoofedName);
*length = (int32_t)spoofLen + 1;
return 0; // EOS_Success
}
}
return oEOS_EpicAccountId_ToString(handle, buffer, length);
}
int __stdcall hkEOS_UserInfo_CopyUserInfo(void* p1, void* p2, void** p3) {
int result = oEOS_UserInfo_CopyUserInfo(p1, p2, p3);
if (p2) {
void** options = (void**)p2;
g_LocalUserId = options[1]; // Capture LocalUserId handle
}
if (result == 0 && p3 && *p3) {
char** structPtr = (char**)*p3;
int res = oEOS_UserInfo_CopyUserInfo(p1, p2, p3);
if (res == 0 && p2 && p3 && *p3) {
void** options = (void**)p2;
if (options[1] == options[2]) { // If targeting our own info
char** s = (char**)*p3;
__try {
if (structPtr[3] && !IsBadReadPtr(structPtr[3], 6)) {
if (strstr(structPtr[3], "sfdb.") != nullptr) {
structPtr[3] = g_SpoofedName;
// Offset 24: DisplayName, Offset 40: Nickname
if (s[3]) s[3] = g_SpoofedName;
if (s[5]) s[5] = g_SpoofedName;
} __except (EXCEPTION_EXECUTE_HANDLER) {}
}
}
}
__except (EXCEPTION_EXECUTE_HANDLER) {
}
}
return result;
}
DWORD WINAPI ConfigReloadThread(LPVOID lpParam) {
while (true) {
Sleep(2000);
LoadConfig();
}
return 0;
}
BOOL InstallHooks() {
LoadConfig();
if (MH_Initialize() != MH_OK) {
return FALSE;
}
HMODULE hEOSSDK = NULL;
for (int i = 0; i < 50; i++) {
hEOSSDK = GetModuleHandleA("EOSSDK-Win64-Shipping.dll");
if (hEOSSDK) break;
Sleep(100);
}
if (!hEOSSDK) {
return FALSE;
}
LPVOID pFunc = (LPVOID)GetProcAddress(hEOSSDK, "EOS_UserInfo_CopyUserInfo");
if (!pFunc) {
return FALSE;
}
if (MH_CreateHook(pFunc, &hkEOS_UserInfo_CopyUserInfo, (LPVOID*)&oEOS_UserInfo_CopyUserInfo) != MH_OK) {
return FALSE;
}
if (MH_EnableHook(pFunc) != MH_OK) {
return FALSE;
}
CreateThread(NULL, 0, ConfigReloadThread, NULL, 0, NULL);
return TRUE;
return res;
}
DWORD WINAPI HookThread(LPVOID lpParam) {
Sleep(3000);
InstallHooks();
ClearLog();
LoadConfig();
if (MH_Initialize() == MH_OK) {
HMODULE h = NULL;
for (int i = 0; i < 100; i++) {
h = GetModuleHandleA("EOSSDK-Win64-Shipping.dll");
if (h) break;
Sleep(100);
}
if (h) {
LPVOID f1 = (LPVOID)GetProcAddress(h, "EOS_UserInfo_CopyUserInfo");
if (f1 && MH_CreateHook(f1, (LPVOID)&hkEOS_UserInfo_CopyUserInfo, (LPVOID*)&oEOS_UserInfo_CopyUserInfo) == MH_OK) {
MH_EnableHook(f1);
}
LPVOID f2 = (LPVOID)GetProcAddress(h, "EOS_EpicAccountId_ToString");
if (f2 && MH_CreateHook(f2, (LPVOID)&hkEOS_EpicAccountId_ToString, (LPVOID*)&oEOS_EpicAccountId_ToString) == MH_OK) {
MH_EnableHook(f2);
}
}
}
return 0;
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) {
if (dwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hModule);
BOOL APIENTRY DllMain(HMODULE h, DWORD r, LPVOID) {
if (r == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(h);
CreateThread(NULL, 0, HookThread, NULL, 0, NULL);
}
else if (dwReason == DLL_PROCESS_DETACH) {
else if (r == DLL_PROCESS_DETACH) {
MH_DisableHook(MH_ALL_HOOKS);
MH_Uninitialize();
}

View File

@ -1,10 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36414.22 d17.14
VisualStudioVersion = 17.14.36414.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RLIdentity", "RLIdentity.vcxproj", "{71E79F3E-69F5-426D-8FBD-82CD278F585F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "injector", "injector.vcxproj", "{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@ -21,6 +23,14 @@ Global
{71E79F3E-69F5-426D-8FBD-82CD278F585F}.Release|x64.Build.0 = Release|x64
{71E79F3E-69F5-426D-8FBD-82CD278F585F}.Release|x86.ActiveCfg = Release|Win32
{71E79F3E-69F5-426D-8FBD-82CD278F585F}.Release|x86.Build.0 = Release|Win32
{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Debug|x64.ActiveCfg = Release|x64
{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Debug|x64.Build.0 = Release|x64
{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Debug|x86.ActiveCfg = Release|x64
{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Debug|x86.Build.0 = Release|x64
{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Release|x64.ActiveCfg = Release|x64
{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Release|x64.Build.0 = Release|x64
{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Release|x86.ActiveCfg = Release|x64
{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}.Release|x86.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>E:\projects\Rocket League\RLIdentityDLL\x64\Debug\RLIdentity.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -1,2 +0,0 @@
 RLIdentity.cpp
LINK : fatal error LNK1104: cannot open file 'MinHook.x64.lib'

Binary file not shown.

View File

@ -1 +0,0 @@
E:\projects\Rocket League\RLIdentityDLL\RLIdentity.cpp;E:\projects\Rocket League\RLIdentityDLL\RLIdentity\x64\Debug\RLIdentity.obj

View File

@ -1,2 +0,0 @@
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.44.35207:TargetPlatformVersion=10.0.26100.0:VcpkgTriplet=x64-windows:
Debug|x64|E:\projects\Rocket League\RLIdentityDLL\|

View File

@ -1,2 +0,0 @@
^E:\PROJECTS\ROCKET LEAGUE\RLIDENTITYDLL\RLIDENTITY\X64\DEBUG\RLIDENTITY.OBJ
E:\projects\Rocket League\RLIdentityDLL\RLIdentity\x64\Debug\RLIdentity.ilk

View File

@ -1,2 +0,0 @@
E:\projects\Rocket League\RLIdentityDLL\x64\Debug\minhook.x64d.dll
E:\projects\Rocket League\RLIdentityDLL\RLIdentity\x64\Debug\RLIdenti.F1359A32.Up2Date

Binary file not shown.

Binary file not shown.

View File

@ -1,2 +0,0 @@

E:\projects\Rocket League\RLIdentityDLL\x64\Debug\minhook.x64d.dll

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>E:\projects\Rocket League\RLIdentityDLL\x64\Release\RLIdentity.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -1,8 +0,0 @@
 Generating code
10 of 11 functions (90.9%) were compiled, the rest were copied from previous compilation.
6 functions were new in current compilation
0 functions had inline decision re-evaluated but remain unchanged
Finished generating code
RLIdentity.vcxproj -> E:\projects\Rocket League\RLIdentityDLL\x64\Release\RLIdentity.dll
'pwsh.exe' is not recognized as an internal or external command,
operable program or batch file.

View File

@ -1 +0,0 @@
E:\projects\Rocket League\RLIdentityDLL\RLIdentity.cpp;E:\projects\Rocket League\RLIdentityDLL\RLIdentity\x64\Release\RLIdentity.obj

View File

@ -1,2 +0,0 @@
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.44.35207:TargetPlatformVersion=10.0.26100.0:VcpkgTriplet=x64-windows-static:
Release|x64|E:\projects\Rocket League\RLIdentityDLL\|

View File

@ -1,3 +0,0 @@
^E:\PROJECTS\ROCKET LEAGUE\RLIDENTITYDLL\RLIDENTITY\X64\RELEASE\RLIDENTITY.OBJ
E:\projects\Rocket League\RLIdentityDLL\RLIdentity\x64\Release\RLIdentity.IPDB
E:\projects\Rocket League\RLIdentityDLL\RLIdentity\x64\Release\RLIdentity.iobj

View File

@ -1,8 +0,0 @@
 RLIdentity.cpp
Generating code
Previous IPDB not found, fall back to full compilation.
All 12 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
Finished generating code
RLNameSpoofer.vcxproj -> E:\projects\Rocket League\RLIdentityDLL\x64\Release\RLIdentity.dll
'pwsh.exe' is not recognized as an internal or external command,
operable program or batch file.

Binary file not shown.

View File

@ -1 +0,0 @@


View File

@ -1,14 +0,0 @@
#include <Windows.h>
#include <d3d9.h>
#pragma comment(lib, "d3d9.lib")
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) {
if (dwReason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(hModule);
// INSTANT visual feedback
MessageBoxA(NULL, "RLNameSpoofer.dll loaded successfully!", "DLL Injected", MB_OK | MB_ICONINFORMATION);
}
return TRUE;
}

88
injector.cpp Normal file
View File

@ -0,0 +1,88 @@
// injector.cpp
// A simple, standalone DLL injector for Rocket League.
// Compile as a x64 Console Application in Visual Studio.
#include <windows.h>
#include <tlhelp32.h>
#include <iostream>
#include <string>
// Find the Process ID by name
DWORD GetProcessIdByName(const wchar_t* processName) {
DWORD pid = 0;
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hSnapshot != INVALID_HANDLE_VALUE) {
PROCESSENTRY32W pe;
pe.dwSize = sizeof(PROCESSENTRY32W);
if (Process32FirstW(hSnapshot, &pe)) {
do {
if (_wcsicmp(pe.szExeFile, processName) == 0) {
pid = pe.th32ProcessID;
break;
}
} while (Process32NextW(hSnapshot, &pe));
}
CloseHandle(hSnapshot);
}
return pid;
}
int wmain(int argc, wchar_t* argv[]) {
if (argc < 3) {
std::wcout << L"Usage: injector.exe <ProcessName> <DllPath>" << std::endl;
return 1;
}
const wchar_t* targetProcess = argv[1];
const wchar_t* dllPath = argv[2];
DWORD pid = GetProcessIdByName(targetProcess);
if (pid == 0) {
std::wcout << L"[-] Failed to find process: " << targetProcess << std::endl;
return 1;
}
std::wcout << L"[+] Found process " << targetProcess << L" (PID: " << pid << L")" << std::endl;
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
if (hProcess == NULL) {
std::wcout << L"[-] Failed to open process. Error: " << GetLastError() << std::endl;
return 1;
}
// Allocate memory in target process for the DLL path string
size_t pathLen = (wcslen(dllPath) + 1) * sizeof(wchar_t);
void* remoteMem = VirtualAllocEx(hProcess, NULL, pathLen, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
if (remoteMem == NULL) {
std::wcout << L"[-] Failed to allocate memory in target process." << std::endl;
CloseHandle(hProcess);
return 1;
}
// Write the DLL path string into the allocated memory
if (!WriteProcessMemory(hProcess, remoteMem, dllPath, pathLen, NULL)) {
std::wcout << L"[-] Failed to write memory in target process." << std::endl;
VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
CloseHandle(hProcess);
return 1;
}
// Create a remote thread that calls LoadLibraryW with the path to our DLL
HANDLE hThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)LoadLibraryW, remoteMem, 0, NULL);
if (hThread == NULL) {
std::wcout << L"[-] Failed to create remote thread. Error: " << GetLastError() << std::endl;
VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
CloseHandle(hProcess);
return 1;
}
std::wcout << L"[+] DLL injected successfully!" << std::endl;
// Clean up
WaitForSingleObject(hThread, INFINITE);
VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
CloseHandle(hThread);
CloseHandle(hProcess);
return 0;
}

61
injector.vcxproj Normal file
View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{A1B2C3D4-E5F6-4A7B-8C9D-0E1F2A3B4C5D}</ProjectGuid>
<RootNamespace>injector</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)x64\Release\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="injector.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

4
injector.vcxproj.user Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.