I need help adding an address to GetModuleHandle. I'm using GetModuleHandle to get the module address of the exe because the module address changes every time I launch the application.
When I use this code, I get 2 errors:
argument of type "System::String ^ is incompatible with parameter of type "LPCSTR"
C2664 'HMODULE GetModuleHandleA(LPCSTR)': cannot convert argument 1 from 'System::String ^ to 'LPCSTR'
When I use this code:
*(INT8*)GetModuleHandle("application.exe") = 5;
changing the GetModuleHandle value to 5 works fine.
I need help adding 0x500 to GetModuleHandle.
Simply use GetModuleHandle().
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683199(v=vs.85).aspx
If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process (.exe file).
What are you going to do with the returned value? You are not assigning it to a variable or using it as a parameter in another function, you are simply throwing that value away as soon as you retrieve it. Trying to add any value to to the returned handle as you've written it won't work.