mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-10 17:56:14 +00:00
Lot of work and added MS Detours
This commit is contained in:
12
include/Memory/BeamNG.h
Normal file
12
include/Memory/BeamNG.h
Normal file
@@ -0,0 +1,12 @@
|
||||
///
|
||||
/// Created by Anonymous275 on 1/21/22
|
||||
/// Copyright (c) 2021-present Anonymous275 read the LICENSE file for more info.
|
||||
///
|
||||
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
class BeamNG {
|
||||
public:
|
||||
static void EntryPoint();
|
||||
};
|
||||
17
include/Memory/Detours.h
Normal file
17
include/Memory/Detours.h
Normal file
@@ -0,0 +1,17 @@
|
||||
///
|
||||
/// Created by Anonymous275 on 1/21/22
|
||||
/// Copyright (c) 2021-present Anonymous275 read the LICENSE file for more info.
|
||||
///
|
||||
|
||||
#pragma once
|
||||
class Detours{
|
||||
void* targetPtr;
|
||||
void* detourFunc;
|
||||
public:
|
||||
Detours(void* src, void* dest) : targetPtr(src), detourFunc(dest){};
|
||||
void Attach();
|
||||
void Detach();
|
||||
|
||||
private:
|
||||
bool Attached = false;
|
||||
};
|
||||
18
include/Memory/Memory.h
Normal file
18
include/Memory/Memory.h
Normal file
@@ -0,0 +1,18 @@
|
||||
///
|
||||
/// Created by Anonymous275 on 1/21/22
|
||||
/// Copyright (c) 2021-present Anonymous275 read the LICENSE file for more info.
|
||||
///
|
||||
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
class Memory{
|
||||
public:
|
||||
static uint64_t FindByPattern(const char* module, const char* Pattern, const char* Mask);
|
||||
static uint64_t GetModuleBase(const char* Name);
|
||||
static void Print(const std::string& msg);
|
||||
static void Inject(uint32_t PID);
|
||||
static uint32_t GetBeamNGPID();
|
||||
static uint32_t EntryPoint();
|
||||
static uint32_t GetPID();
|
||||
};
|
||||
28
include/Memory/Patterns.h
Normal file
28
include/Memory/Patterns.h
Normal file
@@ -0,0 +1,28 @@
|
||||
///
|
||||
/// Created by Anonymous275 on 1/21/22
|
||||
/// Copyright (c) 2021-present Anonymous275 read the LICENSE file for more info.
|
||||
///
|
||||
|
||||
#pragma once
|
||||
namespace Patterns {
|
||||
const char* GetTickCount[2] {
|
||||
"\x48\xff\x25\x00\x00\x00\x00\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\x48\x83\xec\x00\x48\x8d\x4c\x24",
|
||||
"xxx????xxxxxxxxxxxx?xxxx"
|
||||
};
|
||||
const char* open_jit[2] {
|
||||
"\x48\x89\x5c\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xec\x00\x48\x8b\x05\x00\x00\x00\x00\x48\x33\xc4\x48\x89\x44\x24\x00\x48\x8b\x71\x00\x48\x8d\x54\x24",
|
||||
"xxxx?xxxx?xxxx?xxx????xxxxxxx?xxx?xxxx"
|
||||
};
|
||||
const char* get_field[2] {
|
||||
"\x48\x89\x5c\x24\x00\x57\x48\x83\xec\x00\x4d\x8b\xd0\x48\x8b\xd9\xe8\x00\x00\x00\x00\x48\x8b\xf8\x49\xc7\xc0\x00\x00\x00\x00\x90\x49\xff\xc0\x43\x80\x3c\x02\x00\x75\x00\x49\x8b\xd2\x48\x8b\xcb\xe8\x00\x00\x00\x00\x48\xb9\x00\x00\x00\x00\x00\x00\x00\x00\x4c\x8d\x44\x24\x00\x48\x0b\xc1\x48\x8b\xd7\x48\x8b\xcb\x48\x89\x44\x24\x00\xe8\x00\x00\x00\x00\x48\x85\xc0",
|
||||
"xxxx?xxxx?xxxxxxx????xxxxxx????xxxxxxxx?x?xxxxxxx????xx????????xxxx?xxxxxxxxxxxxx?x????xxx"
|
||||
};
|
||||
const char* push_fstring[2] {
|
||||
"\x48\x89\x54\x24\x00\x4c\x89\x44\x24\x00\x4c\x89\x4c\x24\x00\x53\x48\x83\xec\x00\x4c\x8b\x41",
|
||||
"xxxx?xxxx?xxxx?xxxx?xxx"
|
||||
};
|
||||
const char* p_call[2] {
|
||||
"\x48\x89\x5c\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xec\x00\x48\x8b\x59\x00\x41\x8b\xf0\x4c\x63\xda",
|
||||
"xxxx?xxxx?xxxx?xxx?xxxxxx"
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user