Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <iomanip>
- #include <fstream>
- #include <string>
- #include <windows.h>
- #include <shellapi.h>
- using namespace std;
- bool open_browser(const char* url, HWND parent = NULL)
- {
- // Try normally, with the default verb (which will typically be "open")
- HINSTANCE result = ShellExecuteA(parent, NULL, url, NULL, NULL, SW_SHOWNORMAL);
- // If that fails due to privileges, let's ask for more and try again
- if ((int)result == SE_ERR_ACCESSDENIED)
- result = ShellExecuteA(parent, "runas", url, NULL, NULL, SW_SHOWNORMAL);
- // Return whether or not we were successful.
- return ((int)result > 32);
- }
- vector<string> storeid() {
- fstream datafile;
- vector<string> data;
- string words;
- datafile.open("E:\\SteamLibrary\\steamapps\\common\\Team Fortress 2\\tf\\abcd.log", ios::in | ios::out);
- if (!datafile) {
- cout << "Failed to open\n";
- }
- string partial = "[U:";
- string contains = "\"";
- while (datafile >> words) {
- std::size_t found = words.find(partial);
- std::size_t alsofound = words.find(contains);
- if (alsofound != std::string::npos) {
- data.push_back(words);
- }
- if (found != std::string::npos) {
- data.push_back(words);
- }
- }
- datafile.close();
- return data;
- }
- int main()
- {
- vector<string>bs = storeid();
- vector<string> names;
- char type;
- vector<long int>id64;
- vector<string> id;
- for (int i = 0; i < bs.size(); i++) {
- type = bs[i][0];
- if (type == '[') {
- id.push_back(bs[i]);
- }
- if (type != '[') {
- if (type != '"') {
- names[names.size() - 1] += bs[i];
- }
- else {
- names.push_back(bs[i]);
- }
- }
- }
- vector<string>finalid;
- string sub = "%3A";
- for (int i = 0; i < id.size(); i++) {
- for (int j = 0; j < id[i].length(); j++) {
- if (id[i][j] == '[' || id[i][j] == ']') {
- id[i].erase(id[i].begin() + j);
- }
- if (id[i][j] == ':') {
- id[i].erase(id[i].begin() + j);
- id[i].insert(j, sub);
- }
- }
- }
- //U%3A1%3A
- // 7960265728 add to the STEAMID3 as long long int and concat 7656119 to the front
- for (int i = 0; i < id.size(); i++) {
- string sixtyfour;
- for (int j = 8; j < id[i].length(); j++) {
- sixtyfour += id[i][j];
- }
- finalid.push_back(sixtyfour);
- }
- vector<string> sfbitid;
- /* for (int i = 0; i < finalid.size(); i++) {
- long long int tosixtyfour = stoll(finalid[i]);
- tosixtyfour += 7960265728;
- string prefix = "7656119";
- string suffix = to_string(tosixtyfour);
- string cat = prefix + suffix;
- sfbitid.push_back(cat);
- }*/
- string link = "<a href=\"https://steamidfinder.com/lookup/";
- for (int i = 0; i < id.size(); i++) {
- id[i] = link + id[i] + "\"" + ">" + names[i] + "</a><br/>";
- }
- fstream doodoo;
- doodoo.open("C:\\Users\\Administrator\\Desktop\\bla.html", ios::in | ios::out);
- doodoo << "<body style=\"background-color:black;\">\n" << endl;
- for (int i = 0; i < id.size(); i++) {
- doodoo << id[i] << endl;
- }
- doodoo << "</body>";
- doodoo.close();
- std::ofstream ofs;
- ofs.open("E:\\SteamLibrary\\steamapps\\common\\Team Fortress 2\\tf\\abcd.log", std::ofstream::out | std::ofstream::trunc);
- ofs.close();
- open_browser("C:\\Users\\Administrator\\Desktop\\bla.html");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement