Skip to content

Commit

Permalink
1.0.0.1
Browse files Browse the repository at this point in the history
1.0.0.1. Fully functional and working state.
  • Loading branch information
TCNOco committed Nov 3, 2019
1 parent cca6a62 commit deb1043
Show file tree
Hide file tree
Showing 21 changed files with 229 additions and 16 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.vs/
*.ipch
Debug/
Release/
*.tlog
*.log
*.idb
*.pdb
Binary file modified .vs/TCNO-Acc-Switcher/v16/.suo
Binary file not shown.
Binary file modified .vs/TCNO-Acc-Switcher/v16/Browse.VC.db
Binary file not shown.
Binary file not shown.
Binary file modified Debug/TCNO-Acc-Switcher.exe
Binary file not shown.
Binary file modified Debug/TCNO-Acc-Switcher.ilk
Binary file not shown.
Binary file modified Debug/TCNO-Acc-Switcher.pdb
Binary file not shown.
7 changes: 3 additions & 4 deletions TCNO-Acc-Switcher/Debug/TCNO-Acc-Switcher.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
 TCNO-Acc-Switcher.cpp
C:\Users\TechNobo\Documents\GitHub\TCNO-Acc-Switcher\TCNO-Acc-Switcher\TCNO-Acc-Switcher.cpp(166,22): warning C4129: 'V': unrecognized character escape sequence
C:\Users\TechNobo\Documents\GitHub\TCNO-Acc-Switcher\TCNO-Acc-Switcher\TCNO-Acc-Switcher.cpp(165,7): warning C4101: 'hKey': unreferenced local variable
C:\Users\TechNobo\Documents\GitHub\TCNO-Acc-Switcher\TCNO-Acc-Switcher\TCNO-Acc-Switcher.cpp(221,21): warning C4018: '<': signed/unsigned mismatch
TCNO-Acc-Switcher.vcxproj -> C:\Users\TechNobo\Documents\GitHub\TCNO-Acc-Switcher\Debug\TCNO-Acc-Switcher.exe
C:\Users\TechNobo\Documents\GitHub\TCNO-Acc-Switcher\TCNO-Acc-Switcher\TCNO-Acc-Switcher.cpp(175,22): warning C4129: 'V': unrecognized character escape sequence
C:\Users\TechNobo\Documents\GitHub\TCNO-Acc-Switcher\TCNO-Acc-Switcher\TCNO-Acc-Switcher.cpp(268,21): warning C4018: '<': signed/unsigned mismatch
TCNO-Acc-Switcher.vcxproj -> C:\Users\TechNobo\Documents\GitHub\TCNO-Acc-Switcher\Debug\TcNo-Acc-Switcher.exe
Binary file modified TCNO-Acc-Switcher/Debug/TCNO-Acc-Switcher.obj
Binary file not shown.
Binary file modified TCNO-Acc-Switcher/Debug/TCNO-Acc.29272538.tlog/CL.read.1.tlog
Binary file not shown.
Binary file not shown.
Binary file modified TCNO-Acc-Switcher/Debug/TCNO-Acc.29272538.tlog/link.read.1.tlog
Binary file not shown.
Binary file modified TCNO-Acc-Switcher/Debug/TCNO-Acc.29272538.tlog/link.write.1.tlog
Binary file not shown.
Binary file modified TCNO-Acc-Switcher/Debug/vc142.idb
Binary file not shown.
Binary file modified TCNO-Acc-Switcher/Debug/vc142.pdb
Binary file not shown.
84 changes: 72 additions & 12 deletions TCNO-Acc-Switcher/TCNO-Acc-Switcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
#include <fstream>
#include <algorithm> // For std::remove()
#include <conio.h>
//#include <atlstr.h"> // Install ATL Libs for this

#include <chrono>
#include <thread>

#include <atlstr.h>

#define KEY_UP 72 //Up arrow character
#define KEY_DOWN 80 //Down arrow character
Expand All @@ -21,7 +24,9 @@ using namespace std; // std::cout, std::cin

vector<vector<string>> userAccounts; // Steam64ID, Username, Remember password <0,1>
HANDLE hConsole;
string LoginUsersVDF = "C:\\Program Files (x86)\\Steam\\config\\loginusers2.vdf";
string SteamFolder = "C:\\Program Files (x86)\\Steam\\",
LoginUsersVDF = SteamFolder+"config\\loginusers.vdf",
SteamEXE = SteamFolder+"Steam.exe";
std::vector<std::string> fLoginUsersLines;

bool getSteamAccounts()
Expand Down Expand Up @@ -75,12 +80,13 @@ void printSteamAccs(int& selectedLine) {
system("CLS");
cout << flush;

cout << "Welcome to TCNO Steam Account Switcher." << endl;
cout << "Welcome to TCNO Steam Account Switcher [https://tcno.co/]." << endl;
cout << "How to use:" << endl <<
"1. DO NOT change users or log out via Steam." << endl <<
"1. DO NOT change users or log out via Steam - You can exit as normal." << endl <<
" - You can start steam as normal, just use this to change accounts." << endl <<
"2. Check \"Remember password\" if asked for one." << endl <<
"3. To sign in with a new account, select the last option." << endl <<
"4. You can start steam as normal, just use this to change accounts." << endl <<
"4. As soon as you hit enter, steam will force kill and reopen immediately! Be aware of your data." << endl <<
"-- This program never accesses or asks for your actual password! --" << endl;

cout << "Options [Arrow keys, Enter]:" << endl << endl;
Expand Down Expand Up @@ -134,7 +140,7 @@ void mostRecentUpdate(vector<string> accountName) {
if (lineNoQuot == accountName[1]) { // Most recent ID matches! Set this account to active.
userIDMatch = true;
}
cout << curline << endl; // DEBUG ONLY
//cout << curline << endl; // DEBUG ONLY
}
else if (curline.find("mostrecent") != std::string::npos)
{
Expand All @@ -146,9 +152,12 @@ void mostRecentUpdate(vector<string> accountName) {
}else{
outline = "\t\t\"mostrecent\"\t\t\"0\"";
}
cout << toreplace << endl; // DEBUG ONLY
//cout << toreplace << endl; // DEBUG ONLY
}
else
{
//cout << curline << endl; // DEBUG ONLY
}
else { cout << curline << endl; } // DEBUG ONLY
fLoginUsersOUT << outline << endl;
}
fLoginUsersOUT.close();
Expand All @@ -168,9 +177,19 @@ void mostRecentUpdate(vector<string> accountName) {
/*DWORD keyAutoLoginUserType = REG_SZ;
DWORD keyRememberPasswordType = REG_DWORD;*/

//RegOpenKeyEx(HKEY_CURRENT_USER, HKCUValve, 0, KEY_SET_VALUE, &hKey);
//TCHAR
//RegSetValueEx(hKey, TEXT("AutoLoginUser"), 0, REG_SZ, (LPBYTE), sizeof()));
RegOpenKeyEx(HKEY_CURRENT_USER, HKCUValve, 0, KEY_SET_VALUE, &hKey);

// String to TCHAR
TCHAR accname[64];
_tcscpy_s(accname, CA2T(accountName[0].c_str()));

RegSetValueEx(hKey, TEXT("AutoLoginUser"), 0, REG_SZ, (LPBYTE)accname, (accountName[0].size() + 1) * sizeof(wchar_t));
RegCloseKey(hKey);

RegOpenKeyEx(HKEY_CURRENT_USER, HKCUValve, 0, KEY_SET_VALUE, &hKey);
DWORD val = 1;
RegSetValueEx(hKey, TEXT("RememberPassword"), 0, REG_DWORD, (const BYTE*)&val, sizeof(val));
RegCloseKey(hKey);

//// READ VARIABLE
//char buf[255] = { 0 };
Expand All @@ -186,9 +205,37 @@ void mostRecentUpdate(vector<string> accountName) {
//cout << out;

}
VOID startup(LPCTSTR lpApplicationName)
{
// additional information
STARTUPINFO si;
PROCESS_INFORMATION pi;

// set the size of the structures
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));

// start the program up
CreateProcess(lpApplicationName, // the path
NULL, // Command line
NULL, // Process handle not inheritable
NULL, // Thread handle not inheritable
FALSE, // Set handle inheritance to FALSE
0, // No creation flags
NULL, // Use parent's environment block
NULL, // Use parent's starting directory
&si, // Pointer to STARTUPINFO structure
&pi // Pointer to PROCESS_INFORMATION structure (removed extra parentheses)
);
// Close process and thread handles.
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}

int main()
{
SetConsoleTitleW(L"TcNo Steam Account Switcher");
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

static const string aoptions[] = { "1. Add currently logged in Steam account" };
Expand Down Expand Up @@ -247,10 +294,23 @@ int main()
account = userAccounts[selectedLine];
cout << endl << "Changing user accounts to: " << account[0] << endl;
}

system("TASKKILL /F /T /IM steam* >NUL 2> 1"); // Admin required to also kill Steam Service.
// Work on starting process without admin for the future.

mostRecentUpdate(account);

LPWSTR steam = new wchar_t[SteamEXE.size() + 1];
copy(SteamEXE.begin(), SteamEXE.end(), steam);
steam[SteamEXE.size()] = 0;

startup(steam);


// Closing in 3 seconds
cout << "Done!" << endl << "Closing in 3 seconds" << endl;
std::this_thread::sleep_for((chrono::seconds)3);

cin.get();
return 0;
}

Expand Down
12 changes: 12 additions & 0 deletions TCNO-Acc-Switcher/TCNO-Acc-Switcher.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<Keyword>Win32Proj</Keyword>
<RootNamespace>TCNOAccSwitcher</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>TcNo-Acc-Switcher</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down Expand Up @@ -96,6 +97,7 @@
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand Down Expand Up @@ -124,12 +126,14 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -143,17 +147,25 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="TCNO-Acc-Switcher.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="TcNo-Acc-Switcher.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
10 changes: 10 additions & 0 deletions TCNO-Acc-Switcher/TCNO-Acc-Switcher.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="TcNo-Acc-Switcher.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
Binary file added TCNO-Acc-Switcher/TcNo-Acc-Switcher.aps
Binary file not shown.
110 changes: 110 additions & 0 deletions TCNO-Acc-Switcher/TcNo-Acc-Switcher.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// Microsoft Visual C++ generated resource script.
//
#pragma code_page(65001)

#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (United States) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED

#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// English (South Africa) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENS)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_SOUTH_AFRICA

/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "1c0904b0"
BEGIN
VALUE "CompanyName", "Wesley Pyburn (TechNobo)"
VALUE "FileDescription", "Changes Steam accounts in the fastest way possible. One file and registry key. No access to real passwords. No saved data."
VALUE "FileVersion", "1.0.0.1"
VALUE "InternalName", "TcNo-Acc.exe"
VALUE "LegalCopyright", "Copyright (C) 2019 Wesley Pyburn"
VALUE "OriginalFilename", "TcNo-Acc.exe"
VALUE "ProductName", "TcNo Steam Account Switcher"
VALUE "ProductVersion", "1.0.0.1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x1c09, 1200
END
END

#endif // English (South Africa) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

14 changes: 14 additions & 0 deletions TCNO-Acc-Switcher/resource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by TcNo-Acc-Switcher.rc

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

0 comments on commit deb1043

Please sign in to comment.