Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Attachment.cpp
- namespace attachment3
- {
- void to_json(nlohmann::json& j, const attachment3::attachment& attachment) {
- /*j = nlohmann::json{ {"city", attachment.city},
- {"region", attachment.region},
- {"country_name", attachment.country_name},
- {"country_capital", attachment.country_capital}*/ /*};*/
- }
- void from_json(const nlohmann::json& j, attachment3::attachment& attachment) {
- /*bool in_eu;
- int latitude;
- int longitude;
- int country_area;
- int country_population;*/
- attachment.username = j["username"].get<std::string>();
- attachment.rockstarid = j["rockstarid"].get<int>();
- attachment.ip = j["ip"].get<std::string>();
- attachment.version = j["version"].get<std::string>();
- attachment.city = j["city"].get<std::string>();
- attachment.region = j["region"].get<std::string>();
- attachment.region_code = j["region_code"].get<std::string>();
- attachment.country = j["country"].get<std::string>();
- attachment.country_name = j["country_name"].get<std::string>();
- attachment.country_code = j["country_code"].get<std::string>();
- attachment.country_code_iso3 = j["country_code_iso3"].get<std::string>();
- attachment.country_capital = j["country_capital"].get<std::string>();
- attachment.country_tld = j["country_tld"].get<std::string>();
- attachment.continent_code = j["continent_code"].get<std::string>();
- attachment.in_eu = j["in_eu"].get<bool>();
- attachment.postal = j["postal"].get<std::string>();
- attachment.latitude = j["latitude"].get<int>();
- attachment.longitude = j["longitude"].get<int>();
- attachment.timezone = j["timezone"].get<std::string>();
- attachment.utc_offset = j["utc_offset"].get<std::string>();
- attachment.country_calling_code = j["country_calling_code"].get<std::string>();
- attachment.currency = j["currency"].get<std::string>();
- attachment.currency_name = j["currency_name"].get<std::string>();
- attachment.languages = j["languages"].get<std::string>();
- attachment.country_area = j["country_area"].get<int>();
- attachment.country_population = j["country_population"].get<int>();
- attachment.asn = j["asn"].get<std::string>();
- attachment.org = j["org"].get<std::string>();
- }
- };
- namespace attachmentstring3
- {
- void to_json(nlohmann::json& j, const attachmentstring3::attachment& attachment) {
- /*j = nlohmann::json{ {"city", attachment.city},
- {"region", attachment.region},
- {"country_name", attachment.country_name},
- {"country_capital", attachment.country_capital}*/ /*};*/
- }
- void from_json(const nlohmann::json& j, attachmentstring3::attachment& attachment) {
- /*bool in_eu;
- int latitude;
- int longitude;
- int country_area;
- int country_population;*/
- attachment.username = j["username"].get<std::string>();
- attachment.ip = j["ip"].get<std::string>();
- attachment.version = j["version"].get<std::string>();
- attachment.city = j["city"].get<std::string>();
- attachment.region = j["region"].get<std::string>();
- attachment.region_code = j["region_code"].get<std::string>();
- attachment.country = j["country"].get<std::string>();
- attachment.country_name = j["country_name"].get<std::string>();
- attachment.country_code = j["country_code"].get<std::string>();
- attachment.country_code_iso3 = j["country_code_iso3"].get<std::string>();
- attachment.country_capital = j["country_capital"].get<std::string>();
- attachment.country_tld = j["country_tld"].get<std::string>();
- attachment.continent_code = j["continent_code"].get<std::string>();
- attachment.in_eu = j["in_eu"].get<bool>();
- attachment.postal = j["postal"].get<std::string>();
- attachment.latitude3 = j["latitude"].get<std::string>();
- attachment.longitude3 = j["longitude"].get<std::string>();
- attachment.timezone = j["timezone"].get<std::string>();
- attachment.utc_offset = j["utc_offset"].get<std::string>();
- attachment.country_calling_code = j["country_calling_code"].get<std::string>();
- attachment.currency = j["currency"].get<std::string>();
- attachment.currency_name = j["currency_name"].get<std::string>();
- attachment.languages = j["languages"].get<std::string>();
- attachment.country_area = j["country_area"].get<int>();
- attachment.country_population = j["country_population"].get<int>();
- attachment.asn = j["asn"].get<std::string>();
- attachment.org = j["org"].get<std::string>();
- }
- };
- namespace attachment5
- {
- void to_json(nlohmann::json& j, const attachment5::attachment& attachment) {
- /*j = nlohmann::json{ {"city", attachment.city},
- {"region", attachment.region},
- {"country_name", attachment.country_name},
- {"country_capital", attachment.country_capital}*/ /*};*/
- }
- void from_json(const nlohmann::json& j, attachment5::attachment& attachment) {
- attachment.username2 = j["username"].get<std::string>();
- attachment.rockstarid2 = j["rockstarid"].get<int>();
- attachment.city2 = j["city"].get<std::string>();
- attachment.region2 = j["region"].get<std::string>();
- attachment.country_name2 = j["country_name"].get<std::string>();
- attachment.country_capital2 = j["country_capital"].get<std::string>();
- }
- };
- //Attachment.h
- namespace attachment3
- {
- struct attachment
- {
- std::string username;
- std::string ip;
- std::string version;
- std::string city;
- std::string region;
- std::string region_code;
- std::string country;
- std::string country_name;
- std::string country_code;
- std::string country_code_iso3;
- std::string country_capital;
- std::string country_tld;
- std::string continent_code;
- bool in_eu;
- std::string postal;
- int latitude;
- int longitude;
- std::string timezone;
- std::string utc_offset;
- std::string country_calling_code;
- std::string currency;
- std::string currency_name;
- std::string languages;
- int country_area;
- int country_population;
- std::string asn;
- std::string org;
- int rockstarid;
- };
- void to_json(nlohmann::json& j, const attachment& attachment);
- void from_json(const nlohmann::json& j, attachment& attachment);
- };
- namespace attachmentstring3
- {
- struct attachment
- {
- std::string username;
- std::string ip;
- std::string version;
- std::string city;
- std::string region;
- std::string region_code;
- std::string country;
- std::string country_name;
- std::string country_code;
- std::string country_code_iso3;
- std::string country_capital;
- std::string country_tld;
- std::string continent_code;
- bool in_eu;
- std::string postal;
- std::string latitude3;
- std::string longitude3;
- std::string timezone;
- std::string utc_offset;
- std::string country_calling_code;
- std::string currency;
- std::string currency_name;
- std::string languages;
- int country_area;
- int country_population;
- std::string asn;
- std::string org;
- };
- void to_json(nlohmann::json& j, const attachment& attachment);
- void from_json(const nlohmann::json& j, attachment& attachment);
- };
- namespace attachment5
- {
- struct attachment
- {
- std::string username2;
- int rockstarid2;
- std::string city2;
- std::string region2;
- std::string country_name2;
- std::string country_capital2;
- };
- void to_json(nlohmann::json& j, const attachment& attachment);
- void from_json(const nlohmann::json& j, attachment& attachment);
- };
- //geo.cpp
- std::wstring s2ws(const std::string& s)
- {
- int len;
- int slength = (int)s.length() + 1;
- len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0);
- std::wstring r(len, L'\0');
- MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, &r[0], len);
- return r;
- }
- std::string ws2s(const std::wstring& s)
- {
- int len;
- int slength = (int)s.length() + 1;
- len = WideCharToMultiByte(CP_ACP, 0, s.c_str(), slength, 0, 0, 0, 0);
- std::string r(len, '\0');
- WideCharToMultiByte(CP_ACP, 0, s.c_str(), slength, &r[0], len, 0, 0);
- return r;
- }
- bool Geo::IPGeo()
- {
- int intone = atoi(Features::IPSelected.c_str());
- int inttwo = atoi(Geo::IPCheck.c_str());
- if (intone==inttwo)
- {
- return 0;
- }
- else {
- std::string Geousers = "";
- Geousers = "https://ipapi.co/" + Features::IPSelected + "/json";
- std::wstring geossUsers;
- /*std::wstring geosUsers(Geousers.begin(), Geousers.end());*/
- std::wstring geosUsers(s2ws(Geousers));
- geossUsers = geosUsers;
- #define ThunderMenu21 L"geossUsers"
- net::requests m_request(ThunderMenu21, false);
- std::wstring answer = m_request.Get2(false, geossUsers);
- std::string sites(ws2s(answer));
- /*std::string sites(answer.begin(), answer.end());*/
- Geo::Geosit3s = sites;
- persist_oversee::saveapi();
- oversee::city = "";
- oversee::region = "";
- oversee::country_name = "";
- oversee::country_capital = "";
- /*oversee::error = "";
- oversee::reason = "";*/
- oversee::reserved = "";
- GeoLocation::findip();
- GeoLocation::findrid();
- GeoLocation::findRateLimited();
- GeoLocation::findSignup();
- GeoLocation::findReserved();
- GeoLocation::findnull();
- if (GeoLocation::haveip && GeoLocation::haverid)
- {
- if (!GeoLocation::findReservedbool)
- {
- persist_oversee::do_presentation_layer3();
- }
- else
- {
- oversee::reserved = "Reserved IP Address";
- }
- }
- Geo::IPCheck = Features::IPSelected;
- }
- return 0;
- }
- }
- //Oversee.cpp
- std::string oversee::username = "";
- std::string oversee::username2 = "";
- std::string oversee::rockstarid = "";
- std::string oversee::rockstarid2 = "";
- std::string oversee::ip = "";
- std::string oversee::version = "";
- std::string oversee::city = "";
- std::string oversee::city2 = "";
- std::string oversee::city3 = "";
- std::string oversee::region = "";
- std::string oversee::region2 = "";
- std::string oversee::region3 = "";
- std::string oversee::region_code = "";
- std::string oversee::country = "";
- std::string oversee::country_name = "";
- std::string oversee::country_name2 = "";
- std::string oversee::country_name3 = "";
- std::string oversee::country_code = "";
- std::string oversee::country_code_iso3 = "";
- std::string oversee::country_capital = "";
- std::string oversee::country_capital2 = "";
- std::string oversee::country_capital3 = "";
- std::string oversee::country_tld = "";
- std::string oversee::continent_code = "";
- std::string oversee::in_eu = "";
- std::string oversee::postal = "";
- std::string oversee::latitude = "";
- std::string oversee::longitude = "";
- std::string oversee::latitude3 = "";
- std::string oversee::longitude3 = "";
- std::string oversee::timezone = "";
- std::string oversee::utc_offset = "";
- std::string oversee::country_calling_code = "";
- std::string oversee::currency = "";
- std::string oversee::currency_name = "";
- std::string oversee::languages = "";
- std::string oversee::country_area = "";
- std::string oversee::country_population = "";
- std::string oversee::asn = "";
- std::string oversee::org = "";
- std::string oversee::error = "";
- std::string oversee::reason = "";
- std::string oversee::reserved = "";
- //geo.h
- namespace Geo {
- extern bool GeoIP;
- extern bool IPGeo();
- extern bool IPGeoAll();
- extern std::string Geosit3sAll;
- extern std::string Geosit3s;
- extern std::string IPCheck;
- extern std::string IPCheckALL;
- }
- std::string textcity;
- int ReadLineCity()
- {
- //std::ifstream file(/*Directory::get_current_dir() + */"TheOversee.json");
- std::istringstream file(GeoLocation::GeoLoc);
- std::string wordcity = "city";
- std::regex ecity{ "\\b" + wordcity + "\\b" };
- std::string cityline;
- while (std::getline(file, cityline))
- {
- if (regex_search(cityline, ecity))
- textcity = cityline + "\n";
- }
- /*file.close();*/
- return 0;
- }
- std::string textregion;
- int ReadLineregion()
- {
- //std::ifstream file(/*Directory::get_current_dir() + */"TheOversee.json");
- std::istringstream file(GeoLocation::GeoLoc);
- std::string wordregion = "region";
- std::regex eregion{ "\\b" + wordregion + "\\b" };
- std::string regionline;
- while (std::getline(file, regionline))
- {
- if (regex_search(regionline, eregion))
- textregion = regionline + "\n";
- }
- /*file.close();*/
- return 0;
- }
- std::string textcountryname;
- int ReadLinecountryname()
- {
- //std::ifstream file(/*Directory::get_current_dir() + */"TheOversee.json");
- std::istringstream file(GeoLocation::GeoLoc);
- std::string wordcountryname = "country_name";
- std::regex ecountryname{ "\\b" + wordcountryname + "\\b" };
- std::string countrynameline;
- while (std::getline(file, countrynameline))
- {
- if (regex_search(countrynameline, ecountryname))
- textcountryname = countrynameline + "\n";
- }
- /*file.close();*/
- return 0;
- }
- std::string textcountrycapital;
- int ReadLinecountrycapital()
- {
- //std::ifstream file(/*Directory::get_current_dir() + */"TheOversee.json");
- std::istringstream file(GeoLocation::GeoLoc);
- std::string wordcountrycapital = "country_capital";
- std::regex ecountrycapital{ "\\b" + wordcountrycapital + "\\b" };
- std::string countrycapitalline;
- while (std::getline(file, countrycapitalline))
- {
- if (regex_search(countrycapitalline, ecountrycapital))
- textcountrycapital = countrycapitalline + "\n";
- }
- /*file.close();*/
- return 0;
- }
- int persist_oversee::saveapi2()
- {
- OverSeeing::Overseefolder();
- auto file_path = Directory::get_current_dir();
- file_path += "\\ThunderMenu\\Oversee\\";
- file_path += "TheOversee2.json";
- ofstream apisave(file_path, std::ios::out | std::ios::trunc);
- apisave << "";
- std::string vir = ",";
- std::string newline = "\n";
- std::string doublequote = "\"";
- std::string curlybraceL = "{";
- std::string curlybraceR = "}";
- std::string curlybraceRR = " }";
- std::string curlybraceR0 = curlybraceRR + newline;
- std::string curlybraceR1 = curlybraceR0 + curlybraceR;
- std::string curlybraceR2 = curlybraceR1 + newline;
- std::string line0 = "{" + newline;
- std::string line1 = line0 + " ";
- std::string line2 = line1 + doublequote;
- std::string line3 = line2 + nameplayer::getplayername();
- std::string line4 = line3 + doublequote;
- std::string line5 = line4 + ": {";
- std::string line6 = line5 + newline;
- std::string user0 = " " + doublequote;
- std::string user1 = user0 + "username";
- std::string user2 = user1 + doublequote;
- std::string user3 = user2 + ": ";
- std::string user4 = user3 + doublequote;
- std::string user5 = user4 + nameplayer::getplayername();
- std::string user6 = user5 + doublequote;
- std::string user7 = user6 + vir;
- std::string user8 = user7 + newline;
- std::string rid4 = " " + doublequote;
- std::string rid5 = rid4 + "rockstarid";
- std::string rid6 = rid5 + doublequote;
- std::string rid7 = rid6 + ": ";
- /*std::string rid8 = rid7 + doublequote;
- std::string rid9 = rid8 + Features::UserId; //"string"
- std::string rid10 = rid9 + doublequote;
- std::string rid11 = rid10 + vir;*/
- std::string rid8 = rid7 + Features::UserId; //int
- std::string rid9 = rid8 + vir;
- std::string thestring = line6 + user8;
- /*std::string thestring1 = thestring + rid11;*/
- std::string thestring1 = thestring + rid9;
- std::string reuser = "~r~User ID:~w~ ";
- std::string nospace = "";
- /*std::string Geo = Geo::Geosit3s;*/
- std::string::size_type rep = thestring1.find(reuser);
- if (rep != std::string::npos)
- thestring1.replace(rep, reuser.length(), nospace);
- std::string fakejson = textcity/* + newline*/;
- std::string fakejson1 = fakejson + textregion;
- std::string fakejson2 = fakejson1/* + newline*/;
- std::string fakejson3 = fakejson2 + textcountryname;
- std::string fakejson4 = fakejson3/* + newline*/;
- std::string fakejson5 = textcountrycapital/* + newline*/;
- std::string::size_type rep1 = fakejson5.find(vir);
- if (rep1 != std::string::npos)
- fakejson5.replace(rep1, vir.length(), nospace);
- std::string fakejson6 = fakejson4 + fakejson5;
- std::string fakejson7 = thestring1 + newline;
- std::string fakejson8 = fakejson7 + fakejson6;
- std::string fakejson9 = fakejson8/* + newline*/;
- std::string fakejson10 = fakejson9 + curlybraceR2;
- apisave << "";
- apisave << fakejson10;
- GeoLocation::GeoLoc2 = "";
- GeoLocation::GeoLoc2 = fakejson10;
- apisave.close();
- return 0;
- }
- int resultover2 = 0;
- void persist_oversee::do_presentation_layer3()
- {
- auto lastplayerlocations = persist_oversee::list_locations3();
- static std::string selectedlastplayer;
- int xi = 0;
- std::vector<char*> charVec3(lastplayerlocations.size(), nullptr);
- for (int i = 0; i < lastplayerlocations.size(); i++) {
- charVec3[i] = &lastplayerlocations[i][0];
- xi = i;
- }
- char* result3 = charVec3[Menu2::resultpos2];
- selectedlastplayer = result3;
- if (!GeoLocation::findRateLimitedbool && !GeoLocation::nullboolstringtoint)
- {
- if (!GeoLocation::findSignupbool)
- {
- if (!selectedlastplayer.empty())
- {
- persist_oversee::load_oversee3(selectedlastplayer);
- selectedlastplayer.clear();
- }
- }
- else
- {
- if (!selectedlastplayer.empty())
- {
- persist_oversee::load_overseefind3(selectedlastplayer);
- selectedlastplayer.clear();
- }
- }
- }
- if (GeoLocation::nullboolstringtoint)
- {
- ReadLineCity();
- ReadLineregion();
- ReadLinecountryname();
- ReadLinecountrycapital();
- persist_oversee::saveapi2();
- GeoLocation::findnull2();
- if (!GeoLocation::nullboolstringtoint2)
- {
- auto lastplayerlocations2 = persist_oversee::list_locations32();
- static std::string selectedlastplayer2;
- int xi = 0;
- std::vector<char*> charVec32(lastplayerlocations2.size(), nullptr);
- for (int i = 0; i < lastplayerlocations2.size(); i++) {
- charVec32[i] = &lastplayerlocations2[i][0];
- xi = i;
- }
- char* result32 = charVec32[Menu2::resultpos2];
- selectedlastplayer2 = result32;
- if (!selectedlastplayer2.empty())
- {
- persist_oversee::load_oversee32(selectedlastplayer2);
- selectedlastplayer2.clear();
- }
- }
- }
- }
- void persist_oversee::load_oversee3(std::string name)
- {
- auto locations = get_locations_json3();
- if (locations[name].is_null())
- return;
- auto model_attachment = locations[name].get<attachment3::attachment>();
- oversee::username = model_attachment.username;
- oversee::rockstarid = model_attachment.rockstarid;
- oversee::ip = model_attachment.ip;
- oversee::version = model_attachment.version;
- oversee::city = model_attachment.city;
- oversee::region = model_attachment.region;
- oversee::region_code = model_attachment.region_code;
- oversee::country = model_attachment.country;
- oversee::country_name = model_attachment.country_name;
- oversee::country_code = model_attachment.country_code;
- oversee::country_code_iso3 = model_attachment.country_code_iso3;
- oversee::country_capital = model_attachment.country_capital;
- oversee::country_capital = model_attachment.country_capital;
- oversee::country_tld = model_attachment.country_tld;
- oversee::continent_code = model_attachment.continent_code;
- oversee::in_eu = model_attachment.in_eu;
- oversee::postal = model_attachment.postal;
- oversee::latitude = model_attachment.latitude;
- oversee::longitude = model_attachment.longitude;
- oversee::timezone = model_attachment.timezone;
- oversee::utc_offset = model_attachment.utc_offset;
- oversee::country_calling_code = model_attachment.country_calling_code;
- oversee::currency = model_attachment.currency;
- oversee::currency_name = model_attachment.currency_name;
- oversee::languages = model_attachment.languages;
- oversee::country_area = model_attachment.country_area;
- oversee::country_population = model_attachment.country_population;
- oversee::asn = model_attachment.asn;
- oversee::org = model_attachment.org;
- }
- void persist_oversee::load_overseefind3(std::string name)
- {
- auto locations = get_locations_json3();
- if (locations[name].is_null())
- return;
- auto model_attachment = locations[name].get<attachmentstring3::attachment>();
- oversee::username = model_attachment.username;
- oversee::ip = model_attachment.ip;
- oversee::version = model_attachment.version;
- oversee::city3 = model_attachment.city;
- oversee::region3 = model_attachment.region;
- oversee::region_code = model_attachment.region_code;
- oversee::country = model_attachment.country;
- oversee::country_name3 = model_attachment.country_name;
- oversee::country_code = model_attachment.country_code;
- oversee::country_code_iso3 = model_attachment.country_code_iso3;
- oversee::country_capital3 = model_attachment.country_capital;
- oversee::country_tld = model_attachment.country_tld;
- oversee::continent_code = model_attachment.continent_code;
- oversee::in_eu = model_attachment.in_eu;
- oversee::postal = model_attachment.postal;
- oversee::latitude3 = model_attachment.latitude3;
- oversee::longitude3 = model_attachment.longitude3;
- oversee::timezone = model_attachment.timezone;
- oversee::utc_offset = model_attachment.utc_offset;
- oversee::country_calling_code = model_attachment.country_calling_code;
- oversee::currency = model_attachment.currency;
- oversee::currency_name = model_attachment.currency_name;
- oversee::languages = model_attachment.languages;
- oversee::country_area = model_attachment.country_area;
- oversee::country_population = model_attachment.country_population;
- oversee::asn = model_attachment.asn;
- oversee::org = model_attachment.org;
- oversee::city = oversee::city3;
- oversee::region = oversee::region3;
- oversee::country_name = oversee::country_name3;
- oversee::country_capital = oversee::country_capital3;
- oversee::latitude = oversee::latitude3;
- oversee::longitude = oversee::longitude3;
- }
- void persist_oversee::load_oversee32(std::string name)
- {
- auto locations = get_locations_json32();
- if (locations[name].is_null())
- return;
- auto model_attachment = locations[name].get<attachment5::attachment>();
- oversee::username2 = model_attachment.username2;
- oversee::rockstarid2 = model_attachment.rockstarid2;
- oversee::city2 = model_attachment.city2;
- oversee::region2 = model_attachment.region2;
- oversee::country_name2 = model_attachment.country_name2;
- oversee::country_capital2 = model_attachment.country_capital2;
- oversee::username = oversee::username2;
- oversee::rockstarid = oversee::rockstarid2;
- oversee::city = oversee::city2;
- oversee::region = oversee::region2;
- oversee::country_name = oversee::country_name2;
- oversee::country_capital = oversee::country_capital2;
- }
- std::vector<std::string> persist_oversee::list_locations3()
- {
- std::vector<std::string> return_value;
- auto json = get_locations_json3();
- for (auto& item : json.items())
- return_value.push_back(item.key());
- return return_value;
- }
- std::vector<std::string> persist_oversee::list_locations32()
- {
- std::vector<std::string> return_value;
- auto json = get_locations_json32();
- for (auto& item : json.items())
- return_value.push_back(item.key());
- return return_value;
- }
- std::string persist_oversee::playername = "";
- std::string nameplayer::getplayername()
- {
- persist_oversee::playername = "";
- if (!Features::infoplayer) {
- }
- if (Features::infoplayer) {
- if (ENTITY::DOES_ENTITY_EXIST(Hooking::get_player_ped(Features::Online::selectedPlayer)))
- {
- persist_oversee::playername = Hooking::get_player_name(Features::Online::selectedPlayer);
- }
- else
- {
- }
- }
- return persist_oversee::playername;
- }
- bool GeoLocation::findRateLimitedbool = false;
- int GeoLocation::findRateLimited()
- {
- std::string RateLimited("RateLimited");
- if (GeoLocation::GeoLoc.find(RateLimited) != std::string::npos)
- GeoLocation::findRateLimitedbool = true;
- else {
- GeoLocation::findRateLimitedbool = false;
- }
- return 0;
- }
- bool GeoLocation::findSignupbool = false;
- int GeoLocation::findSignup()
- {
- std::string Signup("Sign up");
- if (GeoLocation::GeoLoc.find(Signup) != std::string::npos)
- GeoLocation::findSignupbool = true;
- else {
- GeoLocation::findSignupbool = false;
- }
- return 0;
- }
- bool GeoLocation::findReservedbool = false;
- int GeoLocation::findReserved()
- {
- std::string Signup("Reserved IP Address");
- if (GeoLocation::GeoLoc.find(Signup) != std::string::npos)
- GeoLocation::findReservedbool = true;
- else {
- GeoLocation::findReservedbool = false;
- }
- return 0;
- }
- bool GeoLocation::haveip = false;
- int GeoLocation::findip()
- {
- std::string noip("ip");
- if (GeoLocation::GeoLoc.find(noip) != std::string::npos)
- {
- GeoLocation::haveip = true;
- }
- else {
- GeoLocation::haveip = false;
- }
- return 0;
- }
- bool GeoLocation::haverid = false;
- int GeoLocation::findrid()
- {
- std::string notrid("rockstarid");
- if (GeoLocation::GeoLoc.find(notrid) != std::string::npos)
- {
- GeoLocation::haverid = true;
- }
- else {
- GeoLocation::haverid = false;
- }
- return 0;
- }
- bool GeoLocation::nullboolstringtoint = false;
- int GeoLocation::findnull()
- {
- std::string findnull("null");
- if (GeoLocation::GeoLoc.find(findnull) != std::string::npos)
- {
- GeoLocation::nullboolstringtoint = true;
- }
- else {
- GeoLocation::nullboolstringtoint = false;
- }
- return 0;
- }
- bool GeoLocation::nullboolstringtoint2 = false;
- int GeoLocation::findnull2()
- {
- std::string findnull("null");
- if (GeoLocation::GeoLoc2.find(findnull) != std::string::npos)
- {
- GeoLocation::nullboolstringtoint2 = true;
- }
- else {
- GeoLocation::nullboolstringtoint2 = false;
- }
- return 0;
- }
- int persist_oversee::saveapi()
- {
- OverSeeing::Overseefolder();
- auto file_path = Directory::get_current_dir();
- file_path += "\\ThunderMenu\\Oversee\\";
- file_path += "TheOversee.json";
- ofstream apisave(file_path, std::ios::out | std::ios::trunc);
- apisave << "";
- std::string newline = "\n";
- std::string doublequote = "\"";
- std::string curlybraceL = "{";
- std::string curlybraceR = "}";
- std::string curlybraceRR = " }";
- std::string curlybraceR0 = curlybraceRR + newline;
- std::string curlybraceR1 = curlybraceR0 + curlybraceR;
- std::string curlybraceR2 = curlybraceR1 + newline;
- std::string line0 = "{" + newline;
- std::string line1 = line0 + " ";
- std::string line2 = line1 + doublequote;
- std::string line3 = line2 + nameplayer::getplayername();
- std::string line4 = line3 + doublequote;
- std::string line5 = line4 + ": {";
- std::string line6 = line5 + newline;
- std::string user0 = " " + doublequote;
- std::string user1 = user0 + "username";
- std::string user2 = user1 + doublequote;
- std::string user3 = user2 + ": ";
- std::string user4 = user3 + doublequote;
- std::string user5 = user4 + nameplayer::getplayername();
- std::string user6 = user5 + doublequote;
- std::string user7 = user6 + ",";
- std::string user8 = user7 + newline;
- std::string rid4 = " " + doublequote;
- std::string rid5 = rid4 + "rockstarid";
- std::string rid6 = rid5 + doublequote;
- std::string rid7 = rid6 + ": ";
- /*std::string rid8 = rid7 + doublequote;
- std::string rid9 = rid8 + Features::UserId;
- std::string rid10 = rid9 + doublequote;
- std::string rid11 = rid10 + ",";*/
- std::string rid8 = rid7 + Features::UserId;
- std::string rid9 = rid8 + ",";
- std::string thestring = line6 + user8;
- /*std::string thestring1 = thestring + rid11;*/
- std::string thestring1 = thestring + rid9;
- std::string reuser = "~r~User ID:~w~ ";
- std::string nospace = "";
- std::string Geo = Geo::Geosit3s;
- std::string::size_type rep = thestring1.find(reuser);
- if (rep != std::string::npos)
- thestring1.replace(rep, reuser.length(), nospace);
- std::string::size_type replace1 = Geo.find(curlybraceL);
- if (replace1 != std::string::npos)
- Geo.replace(replace1, curlybraceL.length(), thestring1);
- std::string::size_type replace2 = Geo.find(curlybraceR);
- if (replace2 != std::string::npos)
- Geo.replace(replace2, curlybraceR.length(), curlybraceR2);
- apisave << "";
- apisave << Geo;
- GeoLocation::GeoLoc = "";
- GeoLocation::GeoLoc = Geo;
- apisave.close();
- return 0;
- }
- void persist_oversee::save_json3(nlohmann::json json)
- {
- auto file_path = get_locations_config3();
- std::ofstream file(file_path, std::ios::out | std::ios::trunc);
- file << json.dump();
- file.close();
- }
- nlohmann::json persist_oversee::get_locations_json3()
- {
- auto file_path = get_locations_config3();
- nlohmann::json locations;
- std::ifstream file(file_path);
- if (!file.fail())
- file >> locations;
- return locations;
- }
- nlohmann::json persist_oversee::get_locations_json32()
- {
- auto file_path = get_locations_config32();
- nlohmann::json locations;
- std::ifstream file(file_path);
- if (!file.fail())
- file >> locations;
- return locations;
- }
- std::string persist_oversee::get_locations_config3()
- {
- OverSeeing::Overseefolder();
- auto file_path = Directory::get_current_dir();
- file_path += "\\ThunderMenu\\Oversee\\";
- file_path += "TheOversee.json";
- return file_path;
- }
- std::string persist_oversee::get_locations_config32()
- {
- OverSeeing::Overseefolder();
- auto file_path = Directory::get_current_dir();
- file_path += "\\ThunderMenu\\Oversee\\";
- file_path += "TheOversee2.json";
- return file_path;
- }
- //Oversee.h
- class persist_oversee
- {
- public:
- static void do_presentation_layer3();
- static int saveapi();
- static int saveapi2();
- static std::string playername;
- private:
- static void load_oversee3(std::string name);
- static void load_overseefind3(std::string name);
- static void load_oversee32(std::string name);
- static void save_json3(nlohmann::json json);
- static std::vector<std::string> list_locations3();
- static std::vector<std::string> list_locations32();
- static nlohmann::json get_locations_json3();
- static nlohmann::json get_locations_json32();
- /*static std::filesystem::path get_locations_config();*/
- static std::string get_locations_config3();
- static std::string get_locations_config32();
- };
- namespace oversee
- {
- extern std::string username;
- extern std::string username2;
- extern std::string rockstarid;
- extern std::string rockstarid2;
- extern std::string ip;
- extern std::string version;
- extern std::string city;
- extern std::string city2;
- extern std::string city3;
- extern std::string region;
- extern std::string region2;
- extern std::string region3;
- extern std::string country;
- extern std::string country_name;
- extern std::string country_name2;
- extern std::string country_name3;
- extern std::string region_code;
- extern std::string country_code;
- extern std::string country_code_iso3;
- extern std::string country_capital;
- extern std::string country_capital2;
- extern std::string country_capital3;
- extern std::string country_tld;
- extern std::string continent_code;
- extern std::string in_eu;
- extern std::string postal;
- extern std::string latitude;
- extern std::string longitude;
- extern std::string latitude3;
- extern std::string longitude3;
- extern std::string timezone;
- extern std::string utc_offset;
- extern std::string country_calling_code;
- extern std::string currency;
- extern std::string currency_name;
- extern std::string languages;
- extern std::string country_area;
- extern std::string country_population;
- extern std::string asn;
- extern std::string org;
- extern std::string error;
- extern std::string reason;
- extern std::string reserved;
- }
- namespace GeoLocation
- {
- extern std::string GeoLoc;
- extern std::string GeoLoc2;
- extern bool findRateLimitedbool;
- extern int findRateLimited();
- extern bool findSignupbool;
- extern int findSignup();
- extern bool findReservedbool;
- extern int findReserved();
- extern bool nullboolstringtoint;
- extern int findnull();
- extern bool haveip;
- extern int findip();
- extern bool haverid;
- extern int findrid();
- extern bool nullboolstringtoint2;
- extern int findnull2();
- }
- namespace nameplayer
- {
- extern std::string getplayername();
- }
- //h
- typedef __int64(__cdecl* fpGetPlayerAddress)(Player);
- static fpGetPlayerAddress GetPlayerAddress;
- //cpp
- fpGetPlayerAddress Hooking::GetPlayerAddress;
- setFn<fpGetPlayerAddress>("GetPlayerAddress",
- "\x40\x53\x48\x83\xEC\x20\x33\xDB\x38\x1D\x00\x00\x00\x00\x74\x1C",
- "xxxxxxxxxx????xx",
- &Hooking::GetPlayerAddress);
- //some include
- //windowsheader.h
- #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
- // Windows Library Files:
- #pragma comment(lib, "ws2_32.lib")
- #pragma comment(lib, "Winmm.lib")
- // Windows Header Files:
- #include <windows.h>
- #include <Mmsystem.h>
- #include <string>
- #include <vector>
- #include <sstream>
- #include <fstream>
- #include <iostream>
- #include <map>
- #include <set>
- #include <unordered_map>
- #include <algorithm>
- #include <functional>
- #include <Psapi.h>
- #include <timeapi.h>
- #include <time.h>
- #include <cassert>
- #include <iterator>
- //nlohmannjson.h
- #pragma once
- #include "../nlohmann/json.hpp"
- using namespace nlohmann;
- #include <stdio.h>
- #include <stdlib.h>
- #include <inttypes.h>
- #include <regex>
- #include <vector>
- //loadplayerinfo
- RequestControlOfEnt(ped);
- auto _addr = Hooking::GetPlayerAddress(p);
- auto _info = *reinterpret_cast<std::uintptr_t*>(_addr + OFFSET_PLAYER_INFO);
- auto _ip = reinterpret_cast<std::uint8_t*>(_info + /*0x44*/0x6c);
- char ipBuf[256];
- _ip ? sprintf_s(ipBuf, "IP: %i.%i.%i.%i", _ip[3], _ip[2], _ip[1], _ip[0]) :
- sprintf_s(ipBuf, "IP: Not Found");
- Menu::AddSmallInfo(ipBuf, 19);
- Features::IPSelected = ipBuf;
- std::string sIPSelected = "IP: ";
- std::string::size_type i = Features::IPSelected.find(sIPSelected);
- if (i != std::string::npos)
- Features::IPSelected.erase(i, sIPSelected.length());
- if (Features::GeoLocation)
- {
- Geo::IPGeo();
- Menu::AddSmallTitle02("Geo");
- if (oversee::city != "")
- {
- char* Geo0 = new char[oversee::city.size() + 1];
- strcpy(Geo0, oversee::city.c_str());
- Menu::AddSmallInfoGeo(Geo0, 0);
- }
- if (oversee::region != "")
- {
- char* Geo01 = new char[oversee::region.size() + 1];
- strcpy(Geo01, oversee::region.c_str());
- Menu::AddSmallInfoGeo(Geo01, 1);
- }
- if (oversee::country_name != "")
- {
- char* Geo02 = new char[oversee::country_name.size() + 1];
- strcpy(Geo02, oversee::country_name.c_str());
- Menu::AddSmallInfoGeo(Geo02, 2);
- }
- if (oversee::country_capital != "")
- {
- char* Geo03 = new char[oversee::country_capital.size() + 1];
- strcpy(Geo03, oversee::country_capital.c_str());
- Menu::AddSmallInfoGeo(Geo03, 3);
- }
- if (oversee::reserved != "")
- {
- char* Geo5 = new char[oversee::reserved.size() + 1];
- strcpy(Geo5, oversee::reserved.c_str());
- Menu::AddSmallInfoGeo(Geo5, 0);
- }
- }
- }
- }
- std::string Features::IPSelected;
- std::string Features::UserId;
- and also another way that dont have changed
- std::ostringstream IP;
- char* Address = PLAYER::GET_PLAYER_NAME(p);
- int ipa = *(UINT8*)(Address - 53);
- int ipb = *(UINT8*)(Address - 54);
- int ipc = *(UINT8*)(Address - 55);
- int ipd = *(UINT8*)(Address - 56);
- std::string ipastr = std::to_string(ipa);
- std::string ipbstr = std::to_string(ipb);
- std::string ipcstr = std::to_string(ipc);
- std::string ipdstr = std::to_string(ipd);
- std::string sip = ipastr + "." + ipbstr + "." + ipcstr + "." + ipdstr;
- std::string ssip = "IP: " + sip;
- IPSelected = ssip;
- IP << ssip;
- //and i have also convert RegExp.h for bbv2
- REParseError error = re.Parse((char*)regExp.c_str(), caseSensitive);
- bSucceed = re.Match((const char*)pFrom, &mc, (const char**)&pTo);
- mc.GetMatch(i, (const char**)&pStart, (const char**)&pEnd);
- https://pastebin.com/SbfAygd0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement