Protect memory address

Asked

Viewed 41 times

3

I’m developing a simple game. I want to protect the memory address where the player’s score is located so that only a specific process can access it, thus preventing the user from altering or accessing this memory address with a Cheat tool. That’s possible?

1 answer

0

Use the Windows documentation

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85). aspx

BOOL WINAPI CreateProcess(
  _In_opt_    LPCTSTR               lpApplicationName,
  _Inout_opt_ LPTSTR                lpCommandLine,
  _In_opt_    LPSECURITY_ATTRIBUTES lpProcessAttributes,
  _In_opt_    LPSECURITY_ATTRIBUTES lpThreadAttributes,
  _In_        BOOL                  bInheritHandles,
  _In_        DWORD                 dwCreationFlags,
  _In_opt_    LPVOID                lpEnvironment,
  _In_opt_    LPCTSTR               lpCurrentDirectory,
  _In_        LPSTARTUPINFO         lpStartupInfo,
  _Out_       LPPROCESS_INFORMATION lpProcessInformation
);

or

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682453(v=vs.85). aspx

HANDLE WINAPI CreateThread(
  _In_opt_  LPSECURITY_ATTRIBUTES  lpThreadAttributes,
  _In_      SIZE_T                 dwStackSize,
  _In_      LPTHREAD_START_ROUTINE lpStartAddress,
  _In_opt_  LPVOID                 lpParameter,
  _In_      DWORD                  dwCreationFlags,
  _Out_opt_ LPDWORD                lpThreadId
);

Note the parameter of the two functions whose type is LPSECURITY_ATTRIBUTES. According to Microsoft documentation, if the value is NULL the process or thread is created without inheritance to child processes. But if you want to do something more secure, study about the SECURITY_ATTRIBUTES.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.