Skip to content

Commit

Permalink
update to 1.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
KebsCS committed Jan 24, 2024
1 parent 354d27f commit 1829366
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 35 deletions.
2 changes: 1 addition & 1 deletion KBotExt/GameTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ class GameTab
}
else if (website == "Porofessor.gg")
{
url = L"https://porofessor.gg/pregame/" + region + L"/" + summNames;
url = L"https://porofessor.gg/pregame/" + region + L"/" + summNames + L"/soloqueue/season";
}
Utils::OpenUrl(url.c_str(), nullptr, SW_SHOW);
return Utils::WstringToString(url);
Expand Down
2 changes: 1 addition & 1 deletion KBotExt/Misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class Misc
{
public:
static inline std::string programVersion = "1.5.4";
static inline std::string programVersion = "1.5.5";
static inline std::string latestVersion;

static bool LaunchClient(const std::string& args)
Expand Down
69 changes: 36 additions & 33 deletions KBotExt/SettingsTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,51 +86,54 @@ class SettingsTab

if (ImGui::Checkbox("Register debugger IFEO", &S.debugger))
{
HKEY hkResult;
if (const LSTATUS regCreate = RegCreateKeyExA(HKEY_LOCAL_MACHINE,
R"(Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\LeagueClientUx.exe)",
0, nullptr, 0, KEY_SET_VALUE | KEY_QUERY_VALUE | KEY_CREATE_SUB_KEY, nullptr, &hkResult,
nullptr); regCreate == ERROR_SUCCESS)
if (MessageBoxA(nullptr, "Are you sure?", "Debugger IFEO", MB_OKCANCEL) == IDOK)
{
char* buffer[MAX_PATH];
DWORD bufferLen = sizeof(buffer);
HKEY hkResult;
if (const LSTATUS regCreate = RegCreateKeyExA(HKEY_LOCAL_MACHINE,
R"(Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\LeagueClientUx.exe)",
0, nullptr, 0, KEY_SET_VALUE | KEY_QUERY_VALUE | KEY_CREATE_SUB_KEY, nullptr, &hkResult,
nullptr); regCreate == ERROR_SUCCESS)
{
char* buffer[MAX_PATH];
DWORD bufferLen = sizeof(buffer);

char filePath[MAX_PATH + 1];
static HMODULE kernel32 = GetModuleHandleA("kernel32");
static auto pGetModuleFileNameA = (decltype(&GetModuleFileNameA))GetProcAddress(kernel32, "GetModuleFileNameA");
pGetModuleFileNameA(nullptr, filePath, MAX_PATH);
const auto len = static_cast<DWORD>(strlen(filePath) + 1); // bugprone-misplaced-widening-cast?
char filePath[MAX_PATH + 1];
static HMODULE kernel32 = GetModuleHandleA("kernel32");
static auto pGetModuleFileNameA = (decltype(&GetModuleFileNameA))GetProcAddress(kernel32, "GetModuleFileNameA");
pGetModuleFileNameA(nullptr, filePath, MAX_PATH);
const auto len = static_cast<DWORD>(strlen(filePath) + 1); // bugprone-misplaced-widening-cast?

if (const LSTATUS regQuery = RegQueryValueExA(hkResult, "debugger", nullptr, nullptr, reinterpret_cast<LPBYTE>(buffer),
&bufferLen); regQuery == ERROR_SUCCESS || regQuery == ERROR_FILE_NOT_FOUND)
{
if (S.debugger)
if (const LSTATUS regQuery = RegQueryValueExA(hkResult, "debugger", nullptr, nullptr, reinterpret_cast<LPBYTE>(buffer),
&bufferLen); regQuery == ERROR_SUCCESS || regQuery == ERROR_FILE_NOT_FOUND)
{
auto messageBoxStatus = IDYES;
if (S.autoRename || S.noAdmin)
messageBoxStatus = MessageBoxA(nullptr, "Having \"Auto-rename\" or \"Launch client without admin\" "
"enabled with \"debugger IFEO\" will prevent League client from starting\n\n"
"Do you wish to continue?", "Warning", MB_YESNO | MB_SETFOREGROUND);

if (messageBoxStatus == IDYES)
if (S.debugger)
{
if (RegSetValueExA(hkResult, "debugger", 0, REG_SZ, reinterpret_cast<const BYTE*>(filePath), len) == ERROR_SUCCESS)
auto messageBoxStatus = IDYES;
if (S.autoRename || S.noAdmin)
messageBoxStatus = MessageBoxA(nullptr, "Having \"Auto-rename\" or \"Launch client without admin\" "
"enabled with \"debugger IFEO\" will prevent League client from starting\n\n"
"Do you wish to continue?", "Warning", MB_YESNO | MB_SETFOREGROUND);

if (messageBoxStatus == IDYES)
{
if (RegSetValueExA(hkResult, "debugger", 0, REG_SZ, reinterpret_cast<const BYTE*>(filePath), len) == ERROR_SUCCESS)
{
S.currentDebugger = filePath;
}
}
else
{
S.currentDebugger = filePath;
S.debugger = false;
}
}
else
else if (regQuery == ERROR_SUCCESS)
{
S.debugger = false;
RegDeleteValueA(hkResult, "debugger");
S.currentDebugger = "Nothing";
}
}
else if (regQuery == ERROR_SUCCESS)
{
RegDeleteValueA(hkResult, "debugger");
S.currentDebugger = "Nothing";
}
RegCloseKey(hkResult);
}
RegCloseKey(hkResult);
}
}
ImGui::SameLine();
Expand Down

0 comments on commit 1829366

Please sign in to comment.