mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-12 02:36:01 +00:00
V1.6
Rewrite
This commit is contained in:
@@ -31,8 +31,7 @@ int Memory::GetProcessId(const std::string& processName) {
|
||||
return pe32.th32ProcessID;
|
||||
}
|
||||
|
||||
long long Memory::GetModuleBase(HANDLE processHandle, const std::string &sModuleName)
|
||||
{
|
||||
long long Memory::GetModuleBase(HANDLE processHandle, const std::string &sModuleName){
|
||||
HMODULE *hModules = nullptr;
|
||||
char szBuf[50];
|
||||
DWORD cModules;
|
||||
@@ -74,8 +73,7 @@ void PrintAllBases(HANDLE processHandle){
|
||||
delete[] hModules;
|
||||
}
|
||||
|
||||
BOOL Memory::SetPrivilege(HANDLE hToken, LPCTSTR lpszPrivilege, BOOL bEnablePrivilege)
|
||||
{
|
||||
BOOL Memory::SetPrivilege(HANDLE hToken, LPCTSTR lpszPrivilege, BOOL bEnablePrivilege){
|
||||
TOKEN_PRIVILEGES tp;
|
||||
LUID luid;
|
||||
|
||||
@@ -215,7 +213,7 @@ double Memory::ReadPointerDouble(HANDLE processHandle, long long startAddress, i
|
||||
std::string Memory::ReadText(HANDLE processHandle, long long address) {
|
||||
if (address == -1)
|
||||
return "-1";
|
||||
char buffer = !0;
|
||||
char buffer = 1;
|
||||
char* stringToRead = new char[128];
|
||||
SIZE_T NumberOfBytesToRead = sizeof(buffer);
|
||||
SIZE_T NumberOfBytesActuallyRead;
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
#include <vector>
|
||||
#include <psapi.h>
|
||||
|
||||
class Memory
|
||||
{
|
||||
class Memory{
|
||||
public:
|
||||
DWORD PID = 0;
|
||||
int GetProcessId(const std::string& processName);
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
///
|
||||
/// Created by Anonymous275 on 6/17/2020
|
||||
///
|
||||
#include "Network/network.h"
|
||||
#include "Security/Game.h"
|
||||
#include "Security/Enc.h"
|
||||
#include "Memory.hpp"
|
||||
#include "Startup.h"
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
extern std::string MStatus;
|
||||
extern bool Dev;
|
||||
|
||||
Memory Game;
|
||||
std::string GameVer(HANDLE processHandle, long long Address){
|
||||
//lib_Beam
|
||||
@@ -15,15 +18,16 @@ std::string GameVer(HANDLE processHandle, long long Address){
|
||||
}
|
||||
std::string LoadedMap(HANDLE processHandle, long long Address){
|
||||
//lib_Beam
|
||||
Address += 0x1B0688;
|
||||
std::vector<int> Off = {0x2F8,0x0};
|
||||
//History : 0x1B0688
|
||||
Address += 0x1A1668;
|
||||
std::vector<int> Off = {0x140,0x0};
|
||||
return Game.ReadPointerText(processHandle,Address,Off);
|
||||
}
|
||||
void SetPID(DWORD PID){
|
||||
Game.PID = PID;
|
||||
}
|
||||
[[noreturn]] void MemoryInit(){
|
||||
if(Game.PID == 0 && !Dev)exit(4);
|
||||
|
||||
void MemoryInit(){
|
||||
if(Dev)return;
|
||||
Game.PID = GamePID;
|
||||
if(Game.PID == 0)exit(4);
|
||||
HANDLE processHandle;
|
||||
long long ExeBase; //BeamNG.drive.x64.exe
|
||||
long long Lib1 = 0x180000000; //libbeamng.x64.dll Contains Vehicle Data
|
||||
|
||||
Reference in New Issue
Block a user