View Single Post
  #1  
Old 10-23-2025, 17:47
kernel kernel is offline
Friend
 
Join Date: Oct 2023
Posts: 67
Rept. Given: 0
Rept. Rcvd 23 Times in 18 Posts
Thanks Given: 22
Thanks Rcvd at 85 Times in 40 Posts
kernel Reputation: 23
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)