- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUtilityFunctions.cpp
More file actions
Latest commit
20 lines (15 loc) · 503 Bytes
/
Copy pathUtilityFunctions.cpp
File metadata and controls
20 lines (15 loc) · 503 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include"UtilityFunctions.h"
lua_State* LC = 0;
#ifdef _DEBUG
boolcanWrite(DWORD address, int length) {
SYSTEM_INFO si;
GetSystemInfo(&si);
MEMORY_BASIC_INFORMATION mi;
SIZE_T vq = VirtualQuery((void*)address, &mi, sizeof(mi));
if (vq == ERROR_INVALID_PARAMETER || vq == 0) {
std::cout << "ERROR CODE: " << GetLastError() << std::endl;
returnfalse;
}
return mi.Protect & (PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY | PAGE_WRITECOMBINE | PAGE_WRITECOPY | PAGE_READWRITE);
}
#endif