I want to find the current base address of a program without any manual input. Basically I want to write to specific addresses in memory using offsets. To do that, I need to find the base address of the program I'm modifying. Currently, I can do that by finding the base address manually through another software, however, I want it to be automated.
I've tried GetModuleHandle(NULL) and casting that to uintptr_t to get the base address, but it does not seem to point to the correct spot.
I might not be understanding something and I appreciate all the help.
EDIT: I am looking for the relative offset of the base address. I found a way to get the base address, now I just need the offset of the actual base address. -- Every Program has its own CONSTANT relative offset which can be found online or through special software.
The solution is down below.