Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::vector<std::string> split3(const std::string& s, char delimiter)
- {
- std::vector<std::string> tokens;
- std::string token;
- std::istringstream tokenStream(s);
- while (std::getline(tokenStream, token, delimiter))
- {
- tokens.push_back(token);
- }
- return tokens;
- }
- if (Menu::Option("Change IP")) {
- std::string ts(CharKeyboard());
- if ((char*)ts.c_str() != "")
- {
- Hookings::IPSpoof = ts;
- std::string point = ".";
- std::string space = " ";
- size_t pos = Hookings::IPSpoof.find(point);
- while (pos != std::string::npos)
- {
- Hookings::IPSpoof.replace(pos, point.size(), space);
- pos = Hookings::IPSpoof.find(point, pos + space.size());
- }
- std::vector<std::string> words = split3(Hookings::IPSpoof, ' ');
- Menu_Settings2::ip_address[0] = atoi(words[0].c_str());
- Menu_Settings2::ip_address[1] = atoi(words[1].c_str());
- Menu_Settings2::ip_address[2] = atoi(words[2].c_str());
- Menu_Settings2::ip_address[3] = atoi(words[3].c_str());
- Log::Msg("IPSpoofarray");
- Log::Msg((char*)words[0].c_str());
- Log::Msg((char*)words[1].c_str());
- Log::Msg((char*)words[2].c_str());
- Log::Msg((char*)words[3].c_str());
- Log::Msg("IPSpoofarray");
- }
- else
- {
- //****************************************************************************************************
- class persist_IPchanger
- {
- public:
- static void do_presentation_layer4();
- private:
- static void savelocation4(std::string name1);
- static void load_location4(std::string name1);
- static void delete_location4(std::string name1);
- static std::vector<std::string> list_locations4();
- static void save4(attachment444::attachment attachment, std::string name);
- static void save_json4(nlohmann::json json);
- static nlohmann::json get_locations_json4();
- static std::string get_locations_config4();
- /*static std::filesystem::path get_locations_config();*/
- };
- namespace attachment444
- {
- struct attachment
- {
- std::string IP;
- };
- void to_json(nlohmann::json& j, const attachment& attachment);
- void from_json(const nlohmann::json& j, attachment& attachment);
- };
- //****************************************************************************************************
- namespace attachment444
- {
- void to_json(nlohmann::json& j, const attachment444::attachment& attachment) {
- j = nlohmann::json{ {"IP", attachment.IP} };
- }
- void from_json(const nlohmann::json& j, attachment444::attachment& attachment) {
- attachment.IP = j["IP"].get<std::string>();
- }
- };
- void persist_IPchanger::savelocation4(std::string name1)
- {
- attachment444::attachment attachment;
- attachment.IP = name1;
- save4(attachment, name1);
- }
- std::string name::names3 = "";
- std::vector<std::string> split4(const std::string& s, char delimiter)
- {
- std::vector<std::string> tokens;
- std::string token;
- std::istringstream tokenStream(s);
- while (std::getline(tokenStream, token, delimiter))
- {
- tokens.push_back(token);
- }
- return tokens;
- }
- void persist_IPchanger::load_location4(std::string name1)
- {
- auto locations = get_locations_json4();
- if (locations[name1].is_null())
- return;
- auto model_attachment = locations[name1].get<attachment444::attachment>();
- name::names3 = model_attachment.IP;
- char* chr1 = const_cast<char*>(name::names3.c_str());
- Hookings::IPSpoof = name::names3;
- std::string point = ".";
- std::string space = " ";
- size_t pos = Hookings::IPSpoof.find(point);
- while (pos != std::string::npos)
- {
- Hookings::IPSpoof.replace(pos, point.size(), space);
- pos = Hookings::IPSpoof.find(point, pos + space.size());
- }
- std::vector<std::string> words = split4(Hookings::IPSpoof, ' ');
- Menu_Settings2::ip_address[0] = atoi(words[0].c_str());
- Menu_Settings2::ip_address[1] = atoi(words[1].c_str());
- Menu_Settings2::ip_address[2] = atoi(words[2].c_str());
- Menu_Settings2::ip_address[3] = atoi(words[3].c_str());
- Log::Msg("IPSpoofarray");
- Log::Msg((char*)words[0].c_str());
- Log::Msg((char*)words[1].c_str());
- Log::Msg((char*)words[2].c_str());
- Log::Msg((char*)words[3].c_str());
- Log::Msg("IPSpoofarray");
- UI::_SET_NOTIFICATION_TEXT_ENTRY("STRING");
- UI::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME("~w~Change Lobby after change id");
- UI::_SET_NOTIFICATION_MESSAGE_CLAN_TAG_2("CHAR_STRIPPER_CHEETAH", "CHAR_STRIPPER_CHEETAH", 1, 8, "~w~IP Changer\r\n", chr1, 1, chr1, 9, 1);
- CHooking::draw_notification(false, false);
- }
- void persist_IPchanger::delete_location4(std::string name)
- {
- auto locations = get_locations_json4();
- if (locations[name].is_null())
- return;
- locations.erase(name);
- save_json4(locations);
- }
- std::vector<std::string> persist_IPchanger::list_locations4()
- {
- std::vector<std::string> return_value;
- auto json = get_locations_json4();
- for (auto& item : json.items())
- return_value.push_back(item.key());
- return return_value;
- }
- int namesavedpos3 = 0;
- void persist_IPchanger::do_presentation_layer4()
- {
- auto savednames = list_locations4();
- static std::string selected_name;
- int xi = 0;
- std::vector<char*> charVec4(savednames.size(), nullptr);
- for (int i = 0; i < savednames.size(); i++) {
- charVec4[i] = &savednames[i][0];
- xi = i;
- }
- if (xi != 0)
- {
- if (Menu2::ListVector("List", charVec4, namesavedpos3)) {
- char* result2 = charVec4[namesavedpos3];
- selected_name = result2;
- }
- }
- if (Menu::Option("Save"))
- {
- std::string str = "";
- GAMEPLAY::DISPLAY_ONSCREEN_KEYBOARD(true, "Enter your ID", "", "", "", "", "", 32);
- while (GAMEPLAY::UPDATE_ONSCREEN_KEYBOARD() == 0) WAIT(0);
- if (!GAMEPLAY::GET_ONSCREEN_KEYBOARD_RESULT()) return;
- {
- str = GAMEPLAY::GET_ONSCREEN_KEYBOARD_RESULT();
- int intstr = headers::StringToInteger2(str.c_str());
- if (intstr == 0)
- {
- /*char* usersplayers = Hooking::get_player_name(Features::playerme);*/
- std::stringstream ss;
- ss << 0;
- ss >> str;
- }
- }
- std::string str1 = str;
- char* chr1 = const_cast<char*>(str1.c_str());
- Hookings::IPSpoof = str1;
- std::string doublequote = "\"";
- name::names3 = Hookings::IPSpoof;
- Log::Msg("IPSpoofarray1");
- Log::Msg((char*)name::names3.c_str());
- std::string point = ".";
- std::string space = " ";
- size_t pos = Hookings::IPSpoof.find(point);
- while (pos != std::string::npos)
- {
- Hookings::IPSpoof.replace(pos, point.size(), space);
- pos = Hookings::IPSpoof.find(point, pos + space.size());
- }
- std::vector<std::string> words = split4(Hookings::IPSpoof, ' ');
- Menu_Settings2::ip_address[0] = atoi(words[0].c_str());
- Menu_Settings2::ip_address[1] = atoi(words[1].c_str());
- Menu_Settings2::ip_address[2] = atoi(words[2].c_str());
- Menu_Settings2::ip_address[3] = atoi(words[3].c_str());
- Log::Msg("IPSpoofarray");
- Log::Msg((char*)words[0].c_str());
- Log::Msg((char*)words[1].c_str());
- Log::Msg((char*)words[2].c_str());
- Log::Msg((char*)words[3].c_str());
- Log::Msg("IPSpoofarray");
- UI::_SET_NOTIFICATION_TEXT_ENTRY("STRING");
- UI::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME("~w~Change Lobby after change ID \r\n and wait 10 seconde before change ID again");
- UI::_SET_NOTIFICATION_MESSAGE_CLAN_TAG_2("CHAR_STRIPPER_CHEETAH", "CHAR_STRIPPER_CHEETAH", 1, 8, "~w~ID Changer\r\n", chr1, 1, chr1, 9, 1);
- CHooking::draw_notification(false, false);
- savelocation4(name::names3);
- std::this_thread::sleep_for(std::chrono::milliseconds(1));
- }
- if (xi != 0)
- {
- if (Menu::Option("Load"))
- {
- if (!selected_name.empty())
- {
- load_location4(selected_name);
- selected_name.clear();
- }
- }
- if (Menu::Option("Delete"))
- {
- if (!selected_name.empty())
- {
- delete_location4(selected_name);
- selected_name.clear();
- }
- }
- }
- }
- void persist_IPchanger::save4(attachment444::attachment attachment, std::string name)
- {
- auto json = get_locations_json4();
- json[name] = attachment;
- save_json4(json);
- }
- void persist_IPchanger::save_json4(nlohmann::json json)
- {
- auto file_path = get_locations_config4();
- std::ofstream file(file_path, std::ios::out | std::ios::trunc);
- file << json.dump(4);
- file.close();
- }
- nlohmann::json persist_IPchanger::get_locations_json4()
- {
- auto file_path = get_locations_config4();
- nlohmann::json locations;
- std::ifstream file(file_path);
- if (!file.fail())
- file >> locations;
- return locations;
- }
- std::string persist_IPchanger::get_locations_config4()
- {
- OverSeeing::Overseefolder();
- auto file_path = Directory::get_current_dir();
- file_path += "\\ThunderMenu\\Oversee\\";
- file_path += "IPSaved.json";
- return file_path;
- }
- bool Features::SnowLocal = 0;
- int Features::snowonoff()
- {
- Features::SnowLocal = !Features::SnowLocal;
- return 0;
- }
- void Features::LocalSnow()
- {
- Features::snowonoff();
- globalHandle(262145 + 4751).As<bool>() = Features::SnowLocal;
- }
- std::string on_off1 = "";
- int check_On_Off1()
- {
- if (Features::SnowLocal)
- {
- on_off1 = "SnowLocal on";
- }
- if (!Features::SnowLocal)
- {
- on_off1 = "SnowLocal off";
- }
- return 0;
- }
- check_On_Off1();
- if (Menu::Option((char*)on_off1.c_str())) {
- Features::LocalSnow();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement