Skip to content

Commit

Permalink
launch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
elbadcode committed Dec 11, 2024
1 parent c9a2df2 commit 29ffee7
Show file tree
Hide file tree
Showing 7 changed files with 817 additions and 307 deletions.
6 changes: 6 additions & 0 deletions UEVR.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion UEVR/GameConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
44 changes: 44 additions & 0 deletions UEVR/Injector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -173,5 +215,7 @@ public static bool CallFunctionNoArgs(int processId, string dllPath, IntPtr dllB

return true;
}


}
}
Loading

0 comments on commit 29ffee7

Please sign in to comment.