-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPCSX2.hpp
More file actions
52 lines (44 loc) · 1.07 KB
/
PCSX2.hpp
File metadata and controls
52 lines (44 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "stdafx.h"
#include "ProcMem.hpp"
#include <filesystem>
namespace PCSX2
{
inline uintptr_t PCSX2Base;
inline HANDLE PCSX2ProcHandle;
namespace VM
{
inline uintptr_t PS2Base;
template <typename T>
inline T Read(uintptr_t address)
{
return mem::Read<T>(PCSX2ProcHandle, PS2Base + address);
}
template <typename T>
inline bool Write(uintptr_t address, const T& value)
{
return mem::Write<T>(PCSX2ProcHandle, PS2Base + address, value);
}
inline bool ReadRaw(uintptr_t address, void* buffer, SIZE_T size)
{
return mem::ReadRaw(PCSX2ProcHandle, PS2Base + address, buffer, size);
}
inline bool WriteRaw(uintptr_t address, const void* buffer, SIZE_T size)
{
return mem::WriteRaw(PCSX2ProcHandle, PS2Base + address, buffer, size);
}
}
enum LaunchError : int
{
LaunchError_UnknownError = -1,
LaunchError_NoError,
LaunchError_CreateProcessFail,
LaunchError_BaseAddressFail,
LaunchError_Count,
};
bool IsInFocus();
bool IsOpen();
void CloseHandles();
DWORD GetPID();
bool IsReady();
int Launch(std::filesystem::path exePath);
}