View previous topic :: View next topic |
Author |
Message |
CakeCode How do I cheat? Reputation: 0
Joined: 22 Jun 2022 Posts: 5
|
Posted: Wed Jun 22, 2022 4:22 pm Post subject: VirtualProtect/Page protection |
|
|
Hello everyone, when I modify one specific DLL's asm/ change page protection using Cheat Engine it works out pretty well, but when I'm trying to change page protecition using VirtualProtect(I code in C++ and inject my custom DLL) it fails(Addr is valid, been already unprotecting some game), I assume DLL(I'm targeting) got some kinda additional protection on it's mem region. How can I get rid of it? Thx
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Thu Jun 23, 2022 3:19 am Post subject: |
|
|
what is the getlasterror reason why it fails ?
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
CakeCode How do I cheat? Reputation: 0
Joined: 22 Jun 2022 Posts: 5
|
Posted: Thu Jun 23, 2022 3:44 am Post subject: |
|
|
Dark Byte wrote: | what is the getlasterror reason why it fails ? |
0x5
edit:
Now I see the error is ERROR_ACCESS_DENIED
And I forgot to mention that I use Cheat Engine functionality(Tools -> Inject DLL) to inject that DLL of mine.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Thu Jun 23, 2022 9:11 am Post subject: |
|
|
what protection are you settings ? and what is the size ?
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
CakeCode How do I cheat? Reputation: 0
Joined: 22 Jun 2022 Posts: 5
|
Posted: Thu Jun 23, 2022 2:36 pm Post subject: |
|
|
Dark Byte wrote: | what protection are you settings ? and what is the size ? |
I want to NOP 2 bytes, so I use VirtualProtect like that:
Code: | if (!VirtualProtect((void*)(pModule + RVA), 2, PAGE_EXECUTE_READWRITE, &temp)) {
DWORD dwError = GetLastError();
char buff[50];
sprintf(buff, "0x%x", dwError);
MessageBox(0, buff, "", MB_OK);
} |
edit:
the unmanipulated page state:
Description: |
|
Filesize: |
3.58 KB |
Viewed: |
1932 Time(s) |
|
|
|
Back to top |
|
|
CakeCode How do I cheat? Reputation: 0
Joined: 22 Jun 2022 Posts: 5
|
Posted: Fri Jun 24, 2022 3:42 pm Post subject: |
|
|
Still need help <3
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Fri Jun 24, 2022 11:05 pm Post subject: |
|
|
i don't know.
Perhaps the process has enabled the JIT disabling option which prevents it from marking any other memory as executable
try setting the protection to read write without execute and see if that works (the game will crash but that means the operation is succesfull then)
also check if virtualprotect or virtualprotectex is hooked
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
CakeCode How do I cheat? Reputation: 0
Joined: 22 Jun 2022 Posts: 5
|
Posted: Sat Jun 25, 2022 4:27 am Post subject: |
|
|
Dark Byte wrote: | i don't know.
Perhaps the process has enabled the JIT disabling option which prevents it from marking any other memory as executable
try setting the protection to read write without execute and see if that works (the game will crash but that means the operation is succesfull then)
also check if virtualprotect or virtualprotectex is hooked |
Still can't understand why editing it in Cheat Engine works just perfectly then
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Sat Jun 25, 2022 7:53 am Post subject: |
|
|
cheat engine runs as admin outside of the confines of tbe process
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
|