Skip to content

Commit ad1e490

Browse files
committed
Added COMPILE_GFN_MODE macro
1 parent 2c4572e commit ad1e490

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/GUI/AimAheadUI/Features/DrawSettingsTab.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void aimahead_ui::draw_settings_tab(AimConfig *cfg) {
5454
ImGui::SetCursorPosX(gfn_box_pos.x);
5555
ImGui::SetCursorPosY(gfn_box_pos.y);
5656
ImGui::AH_Checkbox(XorStr("Geforce Now Mode"), XorStr("Send inputs to GFN"), &cfg->b_geforce_now_mode, &checkbox_prop);
57+
#ifdef COMPILE_GFN_MODE
5758
if (ImGui::AH_ButtonInfo(XorStr("Inject"), XorStr("Press before launching GFN"), XorStr("INJECT"), &v1, &buttoninfo_prop)) {
5859
if (injector::get_gfn_pid() != -1) {
5960
MessageBoxA(NULL, "Please click Inject before you launch Geforce Now.", "GFN Running!", MB_ICONERROR);
@@ -67,4 +68,5 @@ void aimahead_ui::draw_settings_tab(AimConfig *cfg) {
6768
MessageBoxA(NULL, "Already Injected. Restart to re-inject.", "Alerady Injected!", MB_ICONERROR);
6869
}
6970
}
71+
#endif
7072
}

src/Injector/injector.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#ifdef COMPILE_GFN_MODE
12
#include "injector.h"
23

34
static bool g_bGfnInjected = false;
@@ -10,7 +11,7 @@ int injector::get_gfn_pid() {
1011
HANDLE h_snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
1112
if (h_snapshot == INVALID_HANDLE_VALUE) return -1;
1213

13-
PROCESSENTRY32 proc;
14+
PROCESSENTRY32 proc{};
1415
proc.dwSize = sizeof(PROCESSENTRY32);
1516
char gfn_proc_name[] = ("GeForceNOW.exe");
1617

@@ -73,4 +74,6 @@ void injector::inject() {
7374
}
7475
g_bGfnInjected = true;
7576
printf(XorStr("[injector::inject] Aimahead GFN has been injected!\n"));
76-
}
77+
}
78+
79+
#endif

src/Injector/injector.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#pragma once
2+
#ifdef COMPILE_GFN_MODE
23
#include <iostream>
34
#include <windows.h>
45
#include <tlhelp32.h>
@@ -10,4 +11,5 @@ namespace injector {
1011
void inject();
1112

1213
bool is_injected();
13-
}
14+
}
15+
#endif

0 commit comments

Comments
 (0)