nixware.cc
-
Автор темы
- #1
Код:
#include <string>
#include <vector>
#include <iostream>
#include <sstream>
using namespace std;
string split(const string& content)
{
string result = "";
for (int i = 0; i < (int)content.size() - 1; ++i)
if (content[i] != '\"' && content[i] != '\t' && content[i] != '\r' && content[i] != '\n')
result += content[i];
return result;
}
void Split(vector<string>& vec, const string& content)
{
vec.clear();
string str;
stringstream ss(content);
while (getline(ss, str))
vec.push_back(str);
}
bool isdi(const string& con)
{
return con.find_first_not_of("0123456789") == string::npos;
}
string steamid(const string& content)
{
string result = "";
vector<string> vecs;
Split(vecs, content);
int index = 0;
for (int i = 0; i < vecs.size(); i++)
{
if (split(vecs[i]).find("mostrecent1") != string::npos)
{
index = i;
break;
}
}
return split(vecs[index - 5]);
}
void ReadAllText(const string& path, string& dest)
{
FILE* fFile = fopen(path.c_str(), "r");
fseek(fFile, 0, SEEK_END);
size_t size = ftell(fFile);
char* content = (char*)malloc(size);
rewind(fFile);
fread(content, sizeof(char), size, fFile);
dest = string(content);
fclose(fFile);
free(content);
}
int main()
{
string content;
ReadAllText("D://Steam//config//loginusers.vdf", content);
cout << steamid(content) << endl;
system("pause");
}
Автор (говно)кода: alexuiop1337