View Single Post
  #2  
Old 10-23-2025, 17:47
kernel kernel is offline
Friend
 
Join Date: Oct 2023
Posts: 72
Rept. Given: 0
Rept. Rcvd 24 Times in 19 Posts
Thanks Given: 23
Thanks Rcvd at 87 Times in 40 Posts
kernel Reputation: 24
If the target is a dll then the dll's base addresses are usually loaded on different offsets so you need to calculate the offset of the patch dynamically based on the base address of the target.
HMODULE hTarget = GetModuleHandle(TargetName);
uintptr_t patch_VA = (uintptr_t)hTarget + 0x1000 + patch_RVA;

or better use pattern search to directly find the patch VA:
uintptr_t patch_VA = (uintptr_t)find_pattern(TargetName, pattern);
Reply With Quote
The Following 2 Users Say Thank You to kernel For This Useful Post:
Hadedx9 (04-12-2026), niculaita (10-27-2025)