Skip to content

Commit bf3b6ef

Browse files
committed
font scale, msg box on refund exploit
1 parent 06fe1fc commit bf3b6ef

4 files changed

Lines changed: 44 additions & 23 deletions

File tree

KBotExt/Config.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ struct Settings
1515
bool autoRename = false;
1616
std::string leaguePath = "C:/Riot Games/League of Legends/";
1717
std::vector<std::string>vFonts;
18+
float fontScale = 1.f;
1819
int selectedFont = 0;
1920
bool bAddFont = false;
2021
bool streamProof = false;
@@ -107,6 +108,7 @@ class Config
107108
root["debugger"] = S.debugger;
108109
root["window"]["width"] = S.Window.width;
109110
root["window"]["height"] = S.Window.height;
111+
root["fontScale"] = S.fontScale;
110112
root["selectedFont"] = S.selectedFont;
111113
root["loginTab"]["language"] = S.loginTab.language;
112114
root["loginTab"]["leagueArgs"] = S.loginTab.leagueArgs;
@@ -187,6 +189,7 @@ class Config
187189
if (auto t = root["debugger"]; !t.empty()) S.debugger = t.asBool();
188190
if (auto t = root["window"]["width"]; !t.empty()) S.Window.width = t.asInt();
189191
if (auto t = root["window"]["height"]; !t.empty()) S.Window.height = t.asInt();
192+
if (auto t = root["fontScale"]; !t.empty()) S.fontScale = t.asFloat();
190193
if (auto t = root["selectedFont"]; !t.empty()) S.selectedFont = t.asInt();
191194
if (auto t = root["loginTab"]["language"]; !t.empty()) S.loginTab.language = t.asString();
192195
if (auto t = root["loginTab"]["leagueArgs"]; !t.empty()) S.loginTab.leagueArgs = t.asString();

KBotExt/GameTab.h

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -378,27 +378,38 @@ class GameTab
378378

379379
if (ImGui::Button("Refund last purchase"))
380380
{
381-
Json::CharReaderBuilder builder;
382-
const std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
383-
JSONCPP_STRING err;
384-
Json::Value rootSession;
385-
Json::Value rootPurchaseHistory;
386-
387-
std::string storeUrl = LCU::Request("GET", "https://127.0.0.1/lol-store/v1/getStoreUrl");
388-
storeUrl = storeUrl.erase(0, 1).erase(storeUrl.size() - 1);
389-
std::string session = LCU::Request("GET", "https://127.0.0.1/lol-login/v1/session");
390-
if (reader->parse(session.c_str(), session.c_str() + static_cast<int>(session.length()), &rootSession, &err))
381+
if (MessageBoxA(0, "Are you sure?", "Refunding last purchase", MB_OKCANCEL) == IDOK)
391382
{
392-
std::string accountId = rootSession["accountId"].asString();
393-
std::string idToken = rootSession["idToken"].asString();
394-
std::string authorizationHeader = "Authorization: Bearer " + idToken + "\r\n" +
395-
"Accept: application/json" + "\r\n" +
396-
"Content-Type: application/json" + "\r\n";
397-
std::string purchaseHistory = HTTP::Request("GET", storeUrl + "/storefront/v3/history/purchase", "", authorizationHeader, "", "");
398-
if (reader->parse(purchaseHistory.c_str(), purchaseHistory.c_str() + static_cast<int>(purchaseHistory.length()), &rootPurchaseHistory, &err))
383+
Json::CharReaderBuilder builder;
384+
const std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
385+
JSONCPP_STRING err;
386+
Json::Value rootSession;
387+
Json::Value rootPurchaseHistory;
388+
389+
std::string storeUrl = LCU::Request("GET", "https://127.0.0.1/lol-store/v1/getStoreUrl");
390+
storeUrl = storeUrl.erase(0, 1).erase(storeUrl.size() - 1);
391+
std::string session = LCU::Request("GET", "https://127.0.0.1/lol-login/v1/session");
392+
if (reader->parse(session.c_str(), session.c_str() + static_cast<int>(session.length()), &rootSession, &err))
393+
{
394+
std::string accountId = rootSession["accountId"].asString();
395+
std::string idToken = rootSession["idToken"].asString();
396+
std::string authorizationHeader = "Authorization: Bearer " + idToken + "\r\n" +
397+
"Accept: application/json" + "\r\n" +
398+
"Content-Type: application/json" + "\r\n";
399+
std::string purchaseHistory = HTTP::Request("GET", storeUrl + "/storefront/v3/history/purchase", "", authorizationHeader, "", "");
400+
if (reader->parse(purchaseHistory.c_str(), purchaseHistory.c_str() + static_cast<int>(purchaseHistory.length()), &rootPurchaseHistory, &err))
401+
{
402+
std::string transactionId = rootPurchaseHistory["transactions"][0]["transactionId"].asString();
403+
result = HTTP::Request("POST", storeUrl + "/storefront/v3/refund", "{\"accountId\":" + accountId + ",\"transactionId\":\"" + transactionId + "\",\"inventoryType\":\"CHAMPION\",\"language\":\"EN_US\"}", authorizationHeader, "", "");
404+
}
405+
else
406+
{
407+
result = purchaseHistory;
408+
}
409+
}
410+
else
399411
{
400-
std::string transactionId = rootPurchaseHistory["transactions"][0]["transactionId"].asString();
401-
result = HTTP::Request("POST", storeUrl + "/storefront/v3/refund", "{\"accountId\":" + accountId + ",\"transactionId\":\"" + transactionId + "\",\"inventoryType\":\"CHAMPION\",\"language\":\"EN_US\"}", authorizationHeader, "", "");
412+
result = session;
402413
}
403414
}
404415
}

KBotExt/MiscTab.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class MiscTab
169169

170170
if (ImGui::Button("Accept all friend requests"))
171171
{
172-
if (MessageBoxA(0, "Are you sure?", 0, MB_OKCANCEL) == IDOK)
172+
if (MessageBoxA(0, "Are you sure?", "Accepting friend requests", MB_OKCANCEL) == IDOK)
173173
{
174174
std::string getFriends = LCU::Request("GET", "https://127.0.0.1/lol-chat/v1/friend-requests");
175175

@@ -200,7 +200,7 @@ class MiscTab
200200

201201
if (ImGui::Button("Delete all friend requests"))
202202
{
203-
if (MessageBoxA(0, "Are you sure?", 0, MB_OKCANCEL) == IDOK)
203+
if (MessageBoxA(0, "Are you sure?", "Deleting friend requests", MB_OKCANCEL) == IDOK)
204204
{
205205
std::string getFriends = LCU::Request("GET", "https://127.0.0.1/lol-chat/v1/friend-requests");
206206

@@ -237,7 +237,7 @@ class MiscTab
237237

238238
if (ImGui::Button("Remove all friends"))
239239
{
240-
if (MessageBoxA(0, "Are you sure?", 0, MB_OKCANCEL) == IDOK)
240+
if (MessageBoxA(0, "Are you sure?", "Removing friends", MB_OKCANCEL) == IDOK)
241241
{
242242
std::string getFriends = LCU::Request("GET", "https://127.0.0.1/lol-chat/v1/friends");
243243

@@ -355,7 +355,7 @@ class MiscTab
355355

356356
if (reader->parse(getLoot.c_str(), getLoot.c_str() + static_cast<int>(getLoot.length()), &root, &err))
357357
{
358-
if (MessageBoxA(0, "Are you sure?", 0, MB_OKCANCEL) == IDOK)
358+
if (MessageBoxA(0, "Are you sure?", "Disenchanting loot", MB_OKCANCEL) == IDOK)
359359
{
360360
int i = 0;
361361

KBotExt/SettingsTab.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ class SettingsTab
114114

115115
ShowFontSelector("##fontSelector");
116116

117+
ImGui::Text("Font Scale:");
118+
if (ImGui::SliderFloat("##fontScaleSlider", &S.fontScale, 0.4f, 4.f, "%0.1f"))
119+
{
120+
ImGuiIO& io = ImGui::GetIO();
121+
io.FontGlobalScale = S.fontScale;
122+
}
123+
117124
static char buffAddFot[MAX_PATH];
118125
std::string tempFont = "C:/Windows/Fonts/";
119126
std::copy(tempFont.begin(), tempFont.end(), buffAddFot);

0 commit comments

Comments
 (0)