Advertisement
H3lic

STEAMID3

Apr 4th, 2020
868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <iomanip>
  5. #include <fstream>
  6. #include <string>
  7. #include <windows.h>
  8. #include <shellapi.h>
  9.  
  10.  
  11. using namespace std;
  12.  
  13. bool open_browser(const char* url, HWND parent = NULL)
  14. {
  15.     // Try normally, with the default verb (which will typically be "open")
  16.     HINSTANCE result = ShellExecuteA(parent, NULL, url, NULL, NULL, SW_SHOWNORMAL);
  17.  
  18.     // If that fails due to privileges, let's ask for more and try again
  19.     if ((int)result == SE_ERR_ACCESSDENIED)
  20.         result = ShellExecuteA(parent, "runas", url, NULL, NULL, SW_SHOWNORMAL);
  21.  
  22.     // Return whether or not we were successful.
  23.     return ((int)result > 32);
  24. }
  25.  
  26. vector<string> storeid() {
  27.     fstream datafile;
  28.     vector<string> data;
  29.     string words;
  30.     datafile.open("E:\\SteamLibrary\\steamapps\\common\\Team Fortress 2\\tf\\abcd.log", ios::in | ios::out);
  31.     if (!datafile) {
  32.         cout << "Failed to open\n";
  33.     }
  34.     string partial = "[U:";
  35.     string contains = "\"";
  36.     while (datafile >> words) {
  37.         std::size_t found = words.find(partial);
  38.         std::size_t alsofound = words.find(contains);
  39.         if (alsofound != std::string::npos) {
  40.             data.push_back(words);
  41.         }
  42.         if (found != std::string::npos) {
  43.             data.push_back(words);
  44.         }
  45.     }
  46.     datafile.close();
  47.     return data;
  48. }
  49.  
  50.  
  51. int main()
  52. {
  53.     vector<string>bs = storeid();
  54.     vector<string> names;
  55.     char type;
  56.     vector<long int>id64;
  57.     vector<string> id;
  58.     for (int i = 0; i < bs.size(); i++) {
  59.         type = bs[i][0];
  60.         if (type == '[') {
  61.             id.push_back(bs[i]);
  62.         }
  63.         if (type != '[') {
  64.             if (type != '"') {
  65.                 names[names.size() - 1] += bs[i];
  66.             }
  67.             else {
  68.                 names.push_back(bs[i]);
  69.             }
  70.         }
  71.     }
  72.     vector<string>finalid;
  73.     string sub = "%3A";
  74.     for (int i = 0; i < id.size(); i++) {
  75.         for (int j = 0; j < id[i].length(); j++) {
  76.             if (id[i][j] == '[' || id[i][j] == ']') {
  77.                 id[i].erase(id[i].begin() + j);
  78.             }
  79.             if (id[i][j] == ':') {
  80.                 id[i].erase(id[i].begin() + j);
  81.                 id[i].insert(j, sub);
  82.             }    
  83.         }
  84.     }
  85.     //U%3A1%3A
  86.     // 7960265728 add to the STEAMID3 as long long int and concat 7656119 to the front
  87.     for (int i = 0; i < id.size(); i++) {
  88.         string sixtyfour;
  89.         for (int j = 8; j < id[i].length(); j++) {
  90.             sixtyfour += id[i][j];
  91.         }
  92.         finalid.push_back(sixtyfour);
  93.     }
  94.     vector<string> sfbitid;
  95.    /* for (int i = 0; i < finalid.size(); i++) {
  96.         long long int tosixtyfour = stoll(finalid[i]);
  97.         tosixtyfour += 7960265728;
  98.         string prefix = "7656119";
  99.         string suffix = to_string(tosixtyfour);
  100.         string cat = prefix + suffix;
  101.         sfbitid.push_back(cat);
  102.     }*/
  103.     string link = "<a href=\"https://steamidfinder.com/lookup/";
  104.     for (int i = 0; i < id.size(); i++) {
  105.         id[i] = link + id[i] + "\"" + ">" + names[i] + "</a><br/>";
  106.     }
  107.     fstream doodoo;
  108.     doodoo.open("C:\\Users\\Administrator\\Desktop\\bla.html", ios::in | ios::out);
  109.     doodoo << "<body style=\"background-color:black;\">\n" << endl;
  110.     for (int i = 0; i < id.size(); i++) {
  111.         doodoo << id[i] << endl;
  112.     }
  113.     doodoo << "</body>";
  114.     doodoo.close();
  115.     std::ofstream ofs;
  116.     ofs.open("E:\\SteamLibrary\\steamapps\\common\\Team Fortress 2\\tf\\abcd.log", std::ofstream::out | std::ofstream::trunc);
  117.     ofs.close();
  118.     open_browser("C:\\Users\\Administrator\\Desktop\\bla.html");
  119.     return 0;
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement