Skip to content

Commit 06fba01

Browse files
committed
Fix bugs I added when porting
1 parent cbb43ed commit 06fba01

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

SecureUxTheme/avrf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static void hook_thunks(PVOID base, PIMAGE_THUNK_DATA thunk, PIMAGE_THUNK_DATA o
251251

252252
auto& hook = s_hooks[i];
253253

254-
const auto by_name = (PIMAGE_IMPORT_BY_NAME)(char*)base + original_thunk->u1.AddressOfData;
254+
const auto by_name = (PIMAGE_IMPORT_BY_NAME)((char*)base + original_thunk->u1.AddressOfData);
255255
if ((hook.old_address && hook.old_address == (PVOID)thunk->u1.Function) || 0 == strcmp(by_name->Name, hook.function_name.Buffer)) {
256256
hook.old_address = (PVOID)thunk->u1.Function;
257257
DebugPrint("Hooking %s from %p to %p\n", hook.function_name.Buffer, hook.new_address, hook.old_address);
@@ -290,7 +290,7 @@ void apply_iat_hooks_on_dll(PVOID dll) {
290290
if (dosh->e_magic != IMAGE_DOS_SIGNATURE)
291291
return;
292292

293-
const auto nth = (PIMAGE_NT_HEADERS)base + dosh->e_lfanew;
293+
const auto nth = (PIMAGE_NT_HEADERS)(base + dosh->e_lfanew);
294294
if (nth->Signature != IMAGE_NT_SIGNATURE)
295295
return;
296296

0 commit comments

Comments
 (0)