diff --git a/UEVR.sln b/UEVR.sln index 2507f4d..506b912 100644 --- a/UEVR.sln +++ b/UEVR.sln @@ -8,13 +8,19 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {5535C4D3-A0EF-4767-B8E2-F3823EBFD754}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5535C4D3-A0EF-4767-B8E2-F3823EBFD754}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5535C4D3-A0EF-4767-B8E2-F3823EBFD754}.Debug|x64.ActiveCfg = Debug|x64 + {5535C4D3-A0EF-4767-B8E2-F3823EBFD754}.Debug|x64.Build.0 = Debug|x64 {5535C4D3-A0EF-4767-B8E2-F3823EBFD754}.Release|Any CPU.ActiveCfg = Release|Any CPU {5535C4D3-A0EF-4767-B8E2-F3823EBFD754}.Release|Any CPU.Build.0 = Release|Any CPU + {5535C4D3-A0EF-4767-B8E2-F3823EBFD754}.Release|x64.ActiveCfg = Release|x64 + {5535C4D3-A0EF-4767-B8E2-F3823EBFD754}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/UEVR/GameConfig.cs b/UEVR/GameConfig.cs index fed2cf7..2193913 100644 --- a/UEVR/GameConfig.cs +++ b/UEVR/GameConfig.cs @@ -124,7 +124,7 @@ public static bool ZipContainsDLL(string sourceArchiveFileName) { private static void MoveDirectoryContents(string sourceDir, string destinationDir) { foreach (var dirPath in Directory.GetDirectories(sourceDir, "*", SearchOption.AllDirectories)) { Directory.CreateDirectory(dirPath.Replace(sourceDir, destinationDir)); - } + } foreach (var newPath in Directory.GetFiles(sourceDir, "*.*", SearchOption.AllDirectories)) { File.Copy(newPath, newPath.Replace(sourceDir, destinationDir), true); diff --git a/UEVR/Injector.cs b/UEVR/Injector.cs index 9a264a1..57a4656 100644 --- a/UEVR/Injector.cs +++ b/UEVR/Injector.cs @@ -11,6 +11,45 @@ namespace UEVR { class Injector { + + + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] + public static extern bool CreateProcess(string lpApplicationName, string lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, [In] ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation); + [StructLayout(LayoutKind.Sequential)] + public struct PROCESS_INFORMATION + { + public IntPtr hProcess; + public IntPtr hThread; + public int dwProcessId; + public int dwThreadId; + } + + [StructLayout(LayoutKind.Sequential)] + public struct STARTUPINFO + { + public int cb; + public string lpReserved; + public string lpDesktop; + public string lpTitle; + public int dwX; + public int dwY; + public int dwXSize; + public int dwYSize; + public int dwXCountChars; + public int dwYCountChars; + public int dwFillAttribute; + public int dwFlags; + public short wShowWindow; + public short cbReserved2; + public IntPtr lpReserved2; + public IntPtr hStdInput; + public IntPtr hStdOutput; + public IntPtr hStdError; + } + + [DllImport("kernel32.dll", SetLastError = true)] +public static extern uint ResumeThread(IntPtr hThread); + [DllImport("kernel32.dll")] public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId); @@ -35,6 +74,9 @@ class Injector { [DllImport("kernel32.dll", SetLastError = true)] static extern bool GetExitCodeThread(IntPtr hThread, out uint lpExitCode); + [DllImport ( "ntdll.dll" )] + public static extern uint RtlAdjustPrivilege ( uint Privilege, bool bEnablePrivilege, bool IsThreadPrivilege, out bool PreviousValue ); + [DllImport("kernel32.dll", SetLastError = true)] public static extern uint WaitForSingleObject(IntPtr hHandle, uint dwMilliseconds); @@ -173,5 +215,7 @@ public static bool CallFunctionNoArgs(int processId, string dllPath, IntPtr dllB return true; } + + } } \ No newline at end of file diff --git a/UEVR/MainWindow.xaml b/UEVR/MainWindow.xaml index 12a2f34..661e644 100644 --- a/UEVR/MainWindow.xaml +++ b/UEVR/MainWindow.xaml @@ -1,195 +1,379 @@ - + - + - - - + - + - - + - + - - + - - + - - - + + - + - - - + + + + + + + + + + + - + - - - - - - - - - - - + + - + - - - + + + + + + + + + + - - + + - - - - - + - -