killerbng icon

RunWS Source

killerbng | PRO | 08/11/19 07:51:46 PM UTC | 0 ⭐ | 336 👁️ | Never ⏰ | []
C# |

2.75 KB

|

None

|

0 👍

/

0 👎

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
 
 
//REMEMBER: GO DOWN TO THE WS_LOCATION VALUE NEAR THE BOTTOM AND CHANGE IT AS I SAID TO IN THE VIDEO
//REMEMBER: GO DOWN TO THE WS_LOCATION VALUE NEAR THE BOTTOM AND CHANGE IT AS I SAID TO IN THE VIDEO
//REMEMBER: GO DOWN TO THE WS_LOCATION VALUE NEAR THE BOTTOM AND CHANGE IT AS I SAID TO IN THE VIDEO
 
namespace RunWS {
 
    public struct PROCESS_INFORMATION {
        public IntPtr hProcess;
        public IntPtr hThread;
        public uint dwProcessId;
        public uint dwThreadId;
    }
 
    public struct STARTUPINFO {
        public uint cb;
        public string lpReserved;
        public string lpDesktop;
        public string lpTitle;
        public uint dwX;
        public uint dwY;
        public uint dwXSize;
        public uint dwYSize;
        public uint dwXCountChars;
        public uint dwYCountChars;
        public uint dwFillAttribute;
        public uint dwFlags;
        public short wShowWindow;
        public short cbReserved2;
        public IntPtr lpReserved2;
        public IntPtr hStdInput;
        public IntPtr hStdOutput;
        public IntPtr hStdError;
    }
 
    public struct SECURITY_ATTRIBUTES {
        public int length;
        public IntPtr lpSecurityDescriptor;
        public bool bInheritHandle;
    }
 
    class Program {
        [DllImport("kernel32.dll")]
        static extern bool CreateProcess(
            string lpApplicationName,
            string lpCommandLine,
            IntPtr lpProcessAttributes,
            IntPtr lpThreadAttributes,
            bool bInheritHandles,
            uint dwCreationFlags,
            IntPtr lpEnvironment,
            string lpCurrentDirectory,
            ref STARTUPINFO lpStartupInfo,
            out PROCESS_INFORMATION lpProcessInformation
        );
 
        [DllImport("kernel32.dll")]
        static extern uint GetLastError();
 
        public static string WS_LOCATION = "F:/Program Files (x86)/Steam/steamapps/common/Wildstar/Client64/Wildstar64.exe";
        public static string SERVER_LOCATION = "localhost";
 
        static void Main(string[] args) {
            STARTUPINFO si = new STARTUPINFO();
            PROCESS_INFORMATION pi = new PROCESS_INFORMATION();
 
            if (!CreateProcess(
                WS_LOCATION,
                "/auth " + SERVER_LOCATION + " /authNc " + SERVER_LOCATION + " /lang en /patcher " + SERVER_LOCATION + " /SettingsKey WildStar /realmDataCenterId 9",
            IntPtr.Zero, IntPtr.Zero, false, 0, IntPtr.Zero, null, ref si, out pi)) {
 
                Console.Beep();
                Console.WriteLine("Failure!");
                uint code = GetLastError();
                if (code == 3) {
                    Console.WriteLine("Error code 3 (The System Cannot Find The Path Specified)");
                } else {
                    Console.WriteLine("Error code " + code);
                    Console.WriteLine("Google \"Windows system error codes\" to find the meaning of this code.");
                }
                Console.Write("Press enter to quit.");
                Console.ReadLine();
            }
 
 
        }
    }
}

Comments