mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 15:23:02 +05:00
Faster string comparing
This commit is contained in:
parent
a82447b1aa
commit
fc6f5c576a
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <Shlwapi.h>
|
#include <Shlwapi.h>
|
||||||
|
#include <cstdint>
|
||||||
#include "MemoryMgr.h"
|
#include "MemoryMgr.h"
|
||||||
|
|
||||||
extern "C" HRESULT WINAPI DirectDrawCreateEx(GUID FAR *lpGUID, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter)
|
extern "C" HRESULT WINAPI DirectDrawCreateEx(GUID FAR *lpGUID, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter)
|
||||||
|
@ -103,7 +104,7 @@ extern "C" HRESULT WINAPI DirectDrawCreateEx(GUID FAR *lpGUID, LPVOID *lplpDD, R
|
||||||
|
|
||||||
for ( WORD i = 0; i < NumberOfSections; i++ )
|
for ( WORD i = 0; i < NumberOfSections; i++ )
|
||||||
{
|
{
|
||||||
if ( !strncmp((char*)pSection->Name, "_rwcseg", 8) )
|
if ( *(uint64_t*)(pSection->Name) == 0x006765736377725F ) // _rwcseg
|
||||||
{
|
{
|
||||||
DWORD dwProtect;
|
DWORD dwProtect;
|
||||||
VirtualProtect((LPVOID)((ptrdiff_t)hModule + pSection->VirtualAddress), pSection->Misc.VirtualSize, PAGE_EXECUTE_READ, &dwProtect);
|
VirtualProtect((LPVOID)((ptrdiff_t)hModule + pSection->VirtualAddress), pSection->Misc.VirtualSize, PAGE_EXECUTE_READ, &dwProtect);
|
||||||
|
|
Loading…
Reference in a new issue