i have the following problem, i have a game exe in this is e.g. this IP 127.0.0.1 <- String[9] i want to replace with 11.111.11.11 <- string[12]. With my code below it only replaces the first number of the old IP but not the complete IP... I found a way to replace the ip in the format string[9] so the last three characters are missing (.11)... i think of my code as something completely wrong... because i've been working with c++ for only about 2 weeks i hope someone from here can help me... Thanks
Code:
#include "pch.h"
#include <string>
using namespace std;
#define Offset 0x00B310CC
void RewriteValues() {
char* ip;
ip = (char*)Offset;
*ip = (const char) *"11.111.11.11";
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
RewriteValues();
break;
}
return TRUE;
}






