Skip to content

Commit

Permalink
getfileattr check fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Sep 19, 2023
1 parent 4f7d905 commit 78a803e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/demo_plugins/OverloadFromFolderDLL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,22 @@ bool HookKernel32IATForOverride(HMODULE mod)
*(size_t*)i = (size_t)ptrCreateFileW;
matchedImports++;
}
else if (ptr == (size_t)GetProcAddress(GetModuleHandle(TEXT("KERNEL32.DLL")), "GetFileAttributesA"))
else if (ptrGetFileAttributesA && ptr == (size_t)GetProcAddress(GetModuleHandle(TEXT("KERNEL32.DLL")), "GetFileAttributesA"))
{
*(size_t*)i = (size_t)ptrGetFileAttributesA;
matchedImports++;
}
else if (ptr == (size_t)GetProcAddress(GetModuleHandle(TEXT("KERNEL32.DLL")), "GetFileAttributesW"))
else if (ptrGetFileAttributesW && ptr == (size_t)GetProcAddress(GetModuleHandle(TEXT("KERNEL32.DLL")), "GetFileAttributesW"))
{
*(size_t*)i = (size_t)ptrGetFileAttributesW;
matchedImports++;
}
else if (ptr == (size_t)GetProcAddress(GetModuleHandle(TEXT("KERNEL32.DLL")), "GetFileAttributesExA"))
else if (ptrGetFileAttributesExA && ptr == (size_t)GetProcAddress(GetModuleHandle(TEXT("KERNEL32.DLL")), "GetFileAttributesExA"))
{
*(size_t*)i = (size_t)ptrGetFileAttributesExA;
matchedImports++;
}
else if (ptr == (size_t)GetProcAddress(GetModuleHandle(TEXT("KERNEL32.DLL")), "GetFileAttributesExW"))
else if (ptrGetFileAttributesExW && ptr == (size_t)GetProcAddress(GetModuleHandle(TEXT("KERNEL32.DLL")), "GetFileAttributesExW"))
{
*(size_t*)i = (size_t)ptrGetFileAttributesExW;
matchedImports++;
Expand Down

0 comments on commit 78a803e

Please sign in to comment.