if (ImGui::Begin("Developer Mode", NULL, ImVec2(0, 0), 1.0f, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse))
{
ImGui::Text("Press P for Next Offset");
ImGui::Text("Press O for Previous Offset");
const int count = 100000;
static int OffsetAdded = 0;
static DWORD OffsetValue[count];
static DWORD Offset[count];
static bool EnableHack[count];
const char* items[] = { "CPlayerClntBase" , "IClientShellStub" };
struct FuncHolder { static bool ItemGetter(void* data, int idx, const char** out_str) { *out_str = ((const char**)data)[idx]; return true; } };
static int item_current_4 = 0;
ImGui::Combo("Base", &item_current_4, &FuncHolder::ItemGetter, items, IM_ARRAYSIZE(items));
int max_size = 19;
int current_offset = 0x1;
static int offsetlist = 1;
static int old_item_current_4 = item_current_4;
if (old_item_current_4 != item_current_4)
{
current_offset = 1;
offsetlist = 1;
OffsetAdded = 0;
old_item_current_4 = item_current_4;
Sleep(100);
}
bool DoInGameOnly = true;
if (!AOE::g_LTClient->pIClientShellStub->InGame && item_current_4 == 0)
DoInGameOnly = false;
DWORD pCLTPlayerClient = AOE::g_Engine()->GetIClientShellStub()->GetICLientEntity()->GetBaseAddress();
if (item_current_4 == 1)
pCLTPlayerClient = AOE::g_Engine()->GetIClientShellStub()->GetBaseAddress();
if (pCLTPlayerClient != NULL && DoInGameOnly)
{
if (GetAsyncKeyState('P') & 1) offsetlist += 1;
if (GetAsyncKeyState('O') & 1) offsetlist -= 1;
if (offsetlist < 1) offsetlist = 1;
if (offsetlist > count) offsetlist = count;
current_offset = offsetlist * max_size;
for (int i = current_offset - (max_size - 1); i < current_offset; i++)
{
std::stringstream ss;
ss << std::hex << i;
std::string res(ss.str());
const char * txt1 = res.c_str();
char * equals = " = ";
char * valll = "";
auto dataaa = Memory->ReadProcess<DWORD>(pCLTPlayerClient + i);
if (dataaa != NULL)
valll = Tools->dwordtochar(dataaa, "");
char * sites = (char *)malloc(1 + strlen(txt1) + strlen(equals) + strlen(valll));
strcpy(sites, txt1);
strcat(sites, equals);
strcat(sites, valll);
ImGui::Text(sites);
ImGui::SameLine();
if (ImGui::Button(Tools->inttochar(i, "> ")))
{
OffsetValue[OffsetAdded] = Memory->ReadProcess<DWORD>(pCLTPlayerClient + i);
Offset[OffsetAdded] = i;
EnableHack[i] = false;
OffsetAdded += 1;
}
}
}
else
OffsetAdded = 0;
if (OffsetAdded > 0 && pCLTPlayerClient != NULL)
{
if (ImGui::Begin("Memory", NULL, ImVec2(0, 0), 1.0f, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse))
{
for (int i = 0; i < OffsetAdded; i++)
{
std::stringstream ss;
ss << std::hex << Offset[i];
std::string res(ss.str());
const char * txt1 = res.c_str();
char * equals = " = ";
char * sites = (char *)malloc(1 + strlen(txt1) + strlen(equals));
strcpy(sites, txt1);
strcat(sites, equals);
ImGui::Checkbox(txt1, &EnableHack[i]);
ImGui::SameLine();
int aaa = static_cast<int>(OffsetValue[i]);
ImGui::InputInt(Tools->inttochar(i, ""), &aaa);
OffsetValue[i] = static_cast<DWORD>(aaa);
if (EnableHack[i])
Memory->FastWrite<DWORD>(pCLTPlayerClient + Offset[i], OffsetValue[i]);
}
if (ImGui::Button("Reset"))
{
OffsetAdded = 0;
for (int i = 1; i < count; i++) {
OffsetValue[i] = NULL;
Offset[i] = NULL;
EnableHack[i] = false;
}
}
ImGui::End();
}
}
if (ImGui::Button("Close"))
{
Crossfire->devmocde = false;
OffsetAdded = 0;
for (int i = 1; i < count; i++) {
OffsetValue[i] = NULL;
Offset[i] = NULL;
EnableHack[i] = false;
}
}
ImGui::SameLine();
if (ImGui::Button("FIRST"))
{
current_offset = 1;
offsetlist = 1;
}
ImGui::SameLine();
if (ImGui::Button("PREV 100"))
{
offsetlist -= 50;
if (offsetlist < 0)
offsetlist = 1;
}
ImGui::SameLine();
if (ImGui::Button("NEXT 100"))
{
offsetlist += 50;
}
ImGui::End();
//Credits :: ocornut
}




